diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 0000000000..60318f794c --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,13 @@ +## System information + - node version: + - npm or yarn version: + - OS/version/architecture: + - Applicable nodegit version: + +``` +node -v +npm -v # (or yarn -v) +node -e "console.log(process.platform)" +node -e "console.log(require('os').release())" +node -e "console.log(process.arch)" +``` diff --git a/.github/workflows/build-openssl-packages.yml b/.github/workflows/build-openssl-packages.yml new file mode 100644 index 0000000000..7b7a5dea3e --- /dev/null +++ b/.github/workflows/build-openssl-packages.yml @@ -0,0 +1,48 @@ +name: Build and Publish OpenSSL Packages + +on: + workflow_dispatch: + +jobs: + build-openssl: + name: Build OpenSSL package for (${{ matrix.os }} ${{ matrix.arch }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: windows-latest + arch: arm64 + - os: windows-latest + arch: x64 + - os: macos-15 + arch: arm64 + - os: macos-15-intel + arch: x64 + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install dependencies + run: npm install + + - name: Build OpenSSL packages + env: + npm_config_arch: ${{ matrix.arch }} + NODEGIT_OPENSSL_BUILD_PACKAGE: 1 + OPENSSL_MACOS_DEPLOYMENT_TARGET: "11.0" + run: node utils/acquireOpenSSL.mjs + + - name: Push OpenSSL package to S3 + env: + npm_config_arch: ${{ matrix.arch }} + node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }} + AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }} + run: node utils/uploadOpenSSL.mjs diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000000..3cd6aae10c --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,196 @@ +on: + push: + branches: + - master + - backport/* + tags: + - v*.*.* + pull_request: + +name: Testing + +jobs: + linux-tests: + name: "Linux Tests" + strategy: + matrix: + node: [20, 22, 24] + fail-fast: false + runs-on: ubuntu-22.04 + steps: + - name: Install Dependencies for Ubuntu + run: sudo apt-get update && sudo apt-get install -y software-properties-common git build-essential clang libssl-dev libkrb5-dev libc++-dev wget zlib1g-dev + + - uses: actions/checkout@v4 + + - name: Setup Environment + run: | + set -e + mkdir ~/.ssh_tests + chmod 700 ~/.ssh_tests + printf "%b" "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh_tests/config + cat test/id_rsa.pub > ~/.ssh_tests/id_rsa.pub + cat test/id_rsa.enc | base64 -d > ~/.ssh_tests/id_rsa + chmod 600 ~/.ssh_tests/id_rsa* + git config --global user.name "John Doe" + git config --global user.email johndoe@example.com + + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + check-latest: true + + - name: Install + run: npm install + + - name: Test + run: | + set -e + eval `ssh-agent -s` + ssh-add ~/.ssh_tests/id_rsa + node utils/retry npm test + + - name: Deploy + if: startsWith(github.ref, 'refs/tags/v') + env: + node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }} + AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }} + run: | + npm install -g @mapbox/node-pre-gyp aws-sdk + node lifecycleScripts/clean + node-pre-gyp package + node-pre-gyp publish + + macos-tests: + name: "macOS Tests" + strategy: + matrix: + node: [20, 22, 24] + arch: [x64, arm64] + fail-fast: false + runs-on: ${{ matrix.arch == 'x64' && 'macos-15-intel' || 'macos-15' }} + steps: + - uses: actions/checkout@v4 + + - name: Setup Environment + run: | + mkdir ~/.ssh_tests + chmod 700 ~/.ssh_tests + printf "%b" "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh_tests/config + cat test/id_rsa.pub > ~/.ssh_tests/id_rsa.pub + cat test/id_rsa.enc | base64 -d > ~/.ssh_tests/id_rsa + chmod 600 ~/.ssh_tests/id_rsa* + git config --global user.name "John Doe" + git config --global user.email johndoe@example.com + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + check-latest: true + + - name: Install + run: npm install + + - name: Test + run: | + set -e + eval `ssh-agent -s` + ssh-add ~/.ssh_tests/id_rsa + node utils/retry npm test + + - name: Deploy + if: startsWith(github.ref, 'refs/tags/v') + env: + node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }} + AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }} + run: | + npm install -g @mapbox/node-pre-gyp aws-sdk + node lifecycleScripts/clean + node-pre-gyp package + node-pre-gyp publish + + windows-tests: + name: Windows Tests + strategy: + matrix: + node: [20, 22, 24] + arch: [x86, x64, arm64] + exclude: + - node: 24 + arch: x86 + fail-fast: false + runs-on: windows-2022 + steps: + - name: Setup Environment + run: | + git config --file C:\ProgramData\Git\config core.autocrlf input + git config --system core.autocrlf input + git config --global core.autocrlf input + git config --global user.name "John Doe" + git config --global user.email johndoe@example.com + + - uses: actions/checkout@v4 + + - name: Use Node.js + if: matrix.arch == 'x86' + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + check-latest: true + architecture: x86 + + - name: Use Node.js + uses: actions/setup-node@v4 + if: matrix.arch != 'x86' + with: + node-version: ${{ matrix.node }} + check-latest: true + + - name: Install + env: + npm_config_arch: ${{ matrix.arch == 'x86' && 'ia32' || matrix.arch }} + run: npm install + + - name: Test + # need arm64 runners or an emulator to run tests + if: matrix.arch != 'arm64' + env: + GIT_SSH: ${{ github.workspace }}\vendor\plink.exe + run: | + $encodedKey = Get-Content -Path test\private.ppk.enc + $finalPath = Join-Path -Path $HOME -ChildPath .ssh_tests\private.ppk + mkdir ~\.ssh_tests + Set-Content -Value $([System.Convert]::FromBase64String($encodedKey)) -Path $finalPath -AsByteStream + powershell -command "Start-Process .\vendor\pageant\pageant_${{ matrix.arch }}.exe $finalPath" + node utils/retry npm test + + # You're probably wondering why this isn't a single `run: |` step, it certainly is for *nix, + # but it's not, because the CI runner for windows doesn't wait for each step as listed here + # and it treats each additional step past the first as an orphaned process. + - name: Deploy (Dependencies) + if: startsWith(github.ref, 'refs/tags/v') + run: npm install -g @mapbox/node-pre-gyp aws-sdk + + - name: Deploy (Clean) + if: startsWith(github.ref, 'refs/tags/v') + run: node lifecycleScripts\clean + + - name: Deploy (Package) + if: startsWith(github.ref, 'refs/tags/v') + run: node-pre-gyp package --target_arch=${{ matrix.arch }} + + - name: Deploy (Publish) + if: startsWith(github.ref, 'refs/tags/v') + env: + node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }} + AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }} + run: node-pre-gyp publish --target_arch=${{ matrix.arch }} diff --git a/.gitignore b/.gitignore index 5529ab114f..7d1f15f049 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ /build/ /coverage/ -/dist/ /include/ /lib/enums.js /lib/nodegit.js @@ -18,10 +17,35 @@ /generate/missing-tests.json /binding.gyp +# Generated vendor files +/vendor/openssl/ +/vendor/libssh2/Makefile +/vendor/libssh2/config.status +/vendor/libssh2/docs/Makefile +/vendor/libssh2/example/.deps/ +/vendor/libssh2/example/Makefile +/vendor/libssh2/example/libssh2_config.h +/vendor/libssh2/example/stamp-h2 +/vendor/libssh2/libssh2.pc +/vendor/libssh2/libtool +/vendor/libssh2/src/.deps/ +/vendor/libssh2/src/Makefile +/vendor/libssh2/src/libssh2_config.h +/vendor/libssh2/src/stamp-h1 +/vendor/libssh2/tests/.deps/ +/vendor/libssh2/tests/Makefile +/vendor/libssh2/tests/ossfuzz/.deps +/vendor/libssh2/tests/ossfuzz/Makefile *.log .DS_STORE .idea +.clangd +.nyc_output/ .vscode jsconfig.json + +test/id_rsa +test/nodegit-test-rsa +test/private.ppk diff --git a/.gitmodules b/.gitmodules index 1e39a72bfe..11538c1e2b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,6 @@ [submodule "vendor/libgit2"] path = vendor/libgit2 -[submodule "vendor/libgit2"] url = https://github.com/nodegit/libgit2.git +[submodule "vendor/http_parser"] + path = vendor/http_parser + url = https://github.com/nodejs/http-parser diff --git a/.jshintrc b/.jshintrc index 0fd02f29b6..437878c8ce 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,8 +1,8 @@ { + "esversion": 9, "boss": true, "curly": true, "eqnull": true, - "esnext": true, "evil": true, "futurehostile": true, "globals": { @@ -16,7 +16,7 @@ "it": true }, "immed": false, - "maxlen": 80, + "maxlen": 120, "node": true, "predef": [ "Promise", diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8d159873a2..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,111 +0,0 @@ -branches: - only: - - master - - /^v\d+\.\d+\.\d+$/ - -compiler: clang - -os: - - linux - - osx - -sudo: false - -env: - matrix: - - export NODE_VERSION="8.3.0" TARGET_ARCH="x64" - - export NODE_VERSION="7.4" TARGET_ARCH="x64" - - export NODE_VERSION="6.5" TARGET_ARCH="x64" - -matrix: - fast_finish: true - include: - - os: linux - env: export NODE_VERSION="8.3.0" TARGET_ARCH="ia32" - - os: linux - env: export NODE_VERSION="7.4" TARGET_ARCH="ia32" - - os: linux - env: export NODE_VERSION="6.5" TARGET_ARCH="ia32" - -git: - depth: 1 - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - build-essential - - libssl-dev - - gcc-4.9-multilib - - g++-4.9-multilib - - lcov - -before_install: - - export CC=clang - - export CXX=clang++ - - export npm_config_clang=1 - - export JOBS=4 - - - if [ $TRAVIS_OS_NAME != "linux" ]; then - git clone https://github.com/creationix/nvm.git ./.nvm; - source ./.nvm/nvm.sh; - fi - - - nvm install $NODE_VERSION - - - if [ -z "$TRAVIS_TAG" ] && [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "6" ]; then - export GYP_DEFINES="coverage=1 use_obsolete_asm=true"; - export CC=/usr/bin/gcc-4.9; - export CXX=/usr/bin/g++-4.9; - export npm_config_clang=0; - wget http://downloads.sourceforge.net/ltp/lcov-1.10.tar.gz; - tar xvfz lcov-1.10.tar.gz; - else - export GYP_DEFINES="use_obsolete_asm=true"; - fi - -install: - - travis_retry npm install; - -# This is a random private key used purely for testing. -before_script: - - echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config - - echo -e "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkTcgXnHuqR0gbwegnr9Zxz4hTkjjV/SpgJNPJz7mo/HKNbx0rqjj1P0yGR053R9GSFFim2ut4NK9DPPUkQdyucw+DoLkYRHJmlJ4BNa9NTCD0sl+eSXO2969kZojCYSOgbmkCJx8mdgTwhzdgE/jhBrsY0hPE6pRTlU+H68/zeNdJUAIJf0LLXOm3hpTKLA19VICltl/j9VvBJpgRHdBylXEyL8HokYpjkQQk1ZXj3m7Nlo8yDdg4VcljOJWC+Xh8kxRMfK5x/VRVsYKCQXN5QlzKeqf7USRDUS/7mFoPUBW+d4kwKtGxRsWuIL2yeqzifZUTOgsh9+ZWAWxWffQZ your_email@example.com" > ~/.ssh/id_rsa.pub - - echo -e "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEA5E3IF5x7qkdIG8HoJ6/Wcc+IU5I41f0qYCTTyc+5qPxyjW8d\nK6o49T9MhkdOd0fRkhRYptrreDSvQzz1JEHcrnMPg6C5GERyZpSeATWvTUwg9LJf\nnklztvevZGaIwmEjoG5pAicfJnYE8Ic3YBP44Qa7GNITxOqUU5VPh+vP83jXSVAC\nCX9Cy1zpt4aUyiwNfVSApbZf4/VbwSaYER3QcpVxMi/B6JGKY5EEJNWV495uzZaP\nMg3YOFXJYziVgvl4fJMUTHyucf1UVbGCgkFzeUJcynqn+1EkQ1Ev+5haD1AVvneJ\nMCrRsUbFriC9snqs4n2VEzoLIffmVgFsVn30GQIDAQABAoIBAQDPQm2sQbti0mN8\nD4Uawl8D40v30n8WhUa7EbPTOmlqKAQ2sfDhex9KRbTLEmEBmImA/Eee8o9iCTIy\n8Fv8Fm6pUHt9G6Pti/XvemwW3Q3QNpSUkHqN0FDkgecQVqVBEb6uHo3mDm4RFINX\neOmkp30BjIK9/blEw1D0sFALLOEUPaDdPMwiXtFgqfrFSgpDET3TvQIwZ2LxxTm0\ncNmP3sCSlZHJNkZI4hBEWaaXR+V5/+C1qblDCo5blAWTcX3UzqrwUUJgFi6VnBuh\n7S9Q6+CEIU+4JRyWQNmY8YgZFaAp6IOr/kyfPxTP1+UEVVgcLn3WDYwfG9og0tmz\nfzlruAgBAoGBAPfz73Pey86tNZEanhJhbX8gVjzy2hvyhT0paHg0q/H6c1VWOtUH\nOwZ3Ns2xAZqJhlDqCHnQYSCZDly042U/theP4N8zo1APb4Yg4qdmXF9QE1+2M03r\nkS6138gU/CSCLf8pCYa6pA/GmsaXxloeJGLvT4fzOZRsVav80/92XHRhAoGBAOu2\nmKh4Gr1EjgN9QNbk9cQTSFDtlBEqO/0pTepvL73UvNp/BAn4iYZFU4WnklFVBSWc\nL84Sc732xU12TAbTTUsa6E7W29pS8u7zVTxlIdQIIU5pzDyU1pNNk2kpxzte5p3Y\nPDtniPFsoYLWoH0LpsKL93t2pLAj+IOkE6f3XBq5AoGAIKaYo5N1FxQr952frx/x\nQUpK0N/R5Ng8v18SiLG26rhmM5iVSrQXC7TrHI7wfR8a9tC6qP/NqnM9NuwC/bQ0\nEEo7/GhaWxKNRwZRkmWiSFLNGk9t1hbtGU+N1lUdFtmloPIQdRNiw0kN3JTj474Q\nYI7O1EItFORnK6yxZfR6HEECgYEA1CT7MGUoa8APsMRCXyaiq15Pb8bjxK8mXquW\nHLEFXuzhLCW1FORDoj0y9s/iuKC0iS0ROX8R/J7k5NrbgikbH8WP36UxKkYNr1IC\nHOFImPTYRSKjVsL+fIUNb1DSp3S6SsYbL7v3XJJQqtlQiDq8U8x1aQFXJ9C4EoLR\nzhKrKsECgYBtU/TSF/TATZY5XtrN9O+HX1Fbz70Ci8XgvioheVI2fezOcXPRzDcC\nOYPaCMNKA5E8gHdg4s0TN7uDvKTJ+KhSg2V7gZ39A28dHrJaRX7Nz4k6t2uEBjX9\na1JidpAIbJ+3w7+hj6L299tVZvS+Y/6Dz/uuEQGXfJg/l/5CCvQPsA==\n-----END RSA PRIVATE KEY-----" > ~/.ssh/id_rsa - - chmod 600 ~/.ssh/id_rsa* - - eval `ssh-agent -s` - - ssh-add ~/.ssh/id_rsa - - git config --global user.name "John Doe" - - git config --global user.email johndoe@example.com - -script: - if [ -z "$TRAVIS_TAG" ] && [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "6" ]; then - travis_retry npm test && npm run cov && npm run coveralls; - else - travis_retry npm test; - fi - -after_success: - - if [ -n "$TRAVIS_TAG" ]; then - npm install -g node-pre-gyp; - npm install -g aws-sdk; - node lifecycleScripts/clean; - node-pre-gyp package --target_arch=$TARGET_ARCH; - node-pre-gyp publish --target_arch=$TARGET_ARCH; - fi - - - if [ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_PULL_REQUEST == "false" ] && [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "6" ] && [ $TARGET_ARCH == "x64" ]; then - .travis/deploy-docs.sh; - fi - -notifications: - slack: - secure: KglNSqZiid9YudCwkPFDh+sZfW5BwFlM70y67E4peHwwlbbV1sSBPHcs74ZHP/lqgEZ4hMv4N2NI58oYFD5/1a+tKIQP1TkdIMuq4j2LXheuirA2HDcydOVrsC8kRx5XFGKdVRg/uyX2dlRHcOWFhxrS6yc6IxtxYWlRTD2SmEc= - - webhooks: - urls: - - https://webhooks.gitter.im/e/cbafdb27ad32ba746a73 - on_success: always # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: false # default: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bc26bc09b..d7c020aac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,2310 @@ # Change Log -## v0.20.3 [(2017-10-18)](https://github.com/nodegit/nodegit/releases/tag/v0.20.3) +## v0.28.0-alpha.36 [(2025-11-21)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.36) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.35...v0.28.0-alpha.36) + +#### Summary of Changes + - Use openssl unconditionally for linux electron builds + - Fix cross-compiling libssh2 + - Fix Windows SSH keys, tests, documentation + - Add CI tests and Prebuilts for MacOS arm64 + - Bump tar-fsa to fix security vulnerabilities + +#### Merged PRs into NodeGit +- [Bump tar-fs from 3.0.9 to 3.1.1](https://github.com/nodegit/nodegit/pull/2034) +- [Use custom electron for non-static builds on linux and fix cross-compilation](https://github.com/nodegit/nodegit/pull/2033) +- [add macos arm64 tests and prebuilts](https://github.com/nodegit/nodegit/pull/2030) + +## v0.28.0-alpha.35 [(2025-11-14)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.35) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.34...v0.28.0-alpha.35) + +#### Summary of Changes + - Bump libgit2 to 1.9.1 + - Bump OpenSSL to 3.0 + - Move OpenSSL Packaging to Github Actions + - Add arm64 build Support + +#### Merged PRs into NodeGit +- [Bump libgit2 to 1.9.1](https://github.com/nodegit/nodegit/pull/2025) +- [Bump OpenSSL to 3.0, Move OpenSSL package generation to Github Actions](https://github.com/nodegit/nodegit/pull/2026) +- [fix: correct macos arch labels](github.com/nodegit/nodegit/pull/2027) +- [Add Ability to compile for arm64](https://github.com/nodegit/nodegit/pull/2028) + +## v0.28.0-alpha.34 [(2025-07-23)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.34) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.33...v0.28.0-alpha.34) + +#### Summary of Changes + - Empty release to fix downstream issues + +#### Merged PRs into NodeGit +- None + +## v0.28.0-alpha.33 [(2025-06-03)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.33) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.32...v0.28.0-alpha.33) + +#### Summary of Changes + - fix non-standard import assertion + - update tar-fs + +#### Merged PRs into NodeGit +- [Fix Invalid Import Assertion, Bump tar-fs](https://github.com/nodegit/nodegit/pull/2022) + +## v0.28.0-alpha.32 [(2025-05-28)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.32) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.31...v0.28.0-alpha.32) + +#### Summary of Changes + - fix windows build on electron + +#### Merged PRs into NodeGit +- [fix electron dependencies again](https://github.com/nodegit/nodegit/pull/2020) + +## v0.28.0-alpha.31 [(2025-05-27)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.31) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.30...v0.28.0-alpha.31) + +#### Summary of Changes +- bump libgit2 from v1.7.2 to v1.8.4 +- update several npm dependencies for deprecations and vulnerabilities + +#### Merged PRs into NodeGit +- [Dependency/Process Updates](https://github.com/nodegit/nodegit/pull/2019) +- [Bump libgit2 to 1.8.4, CI Updates](https://github.com/nodegit/nodegit/pull/2018) + +## v0.28.0-alpha.30 [(2025-02-13)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.30) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.29...v0.28.0-alpha.30) + +#### Summary of Changes +- Fix windows build + +#### Merged PRs into NodeGit +- [define NOMINMAX on windows](https://github.com/nodegit/nodegit/pull/2016) + +## v0.28.0-alpha.29 [(2025-02-11)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.29) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.28...v0.28.0-alpha.29) + +#### Summary of Changes +- Build on Electron 34+ +- fix use-after-free in Repository::statistics() + +#### Merged PRs into NodeGit +- [Bump @axosoft/nan and add ability to compile for c++20](https://github.com/nodegit/nodegit/pull/2012) +- [Fix Github Action workflow](https://github.com/nodegit/nodegit/pull/2014) + + +## v0.28.0-alpha.28 [(2024-07-01)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.28) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.27...v0.28.0-alpha.28) + +#### Summary of changes +- Build on Electron 31+ + +#### Merged PRs into NodeGit +- [Bump nan again for electron 31](https://github.com/nodegit/nodegit/pull/2000) + +## v0.28.0-alpha.27 [(2024-06-06)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.27) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.26...v0.28.0-alpha.27) + +#### Summary of changes +- Build on Electron 29+ + +#### Merged PRs into NodeGit +- [Fix build failure on electron 29+](https://github.com/nodegit/nodegit/pull/1998) + +## v0.28.0-alpha.26 [(2024-04-19)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.26) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.25...v0.28.0-alpha.26) + +#### Summary of changes +- Fix use-after-free in getRemotes + +#### Merged PRs into NodeGit +- [Fix double-free introduced trying to fix other double-free](https://github.com/nodegit/nodegit/pull/1996) + +## v0.28.0-alpha.25 [(2024-04-15)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.25) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.24...v0.28.0-alpha.25) + +#### Summary of changes +- Fix use-after-free in getReferences + +#### Merged PRs into NodeGit +- [Don't free the given repo on error in getReferences and getRemotes](https://github.com/nodegit/nodegit/pull/1995) + +## v0.28.0-alpha.24 [(2024-02-20)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.24) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.23...v0.28.0-alpha.24) + +#### Summary of changes +- Use Collision Detection SHA1 implementation +- Fix win32 Electron build due to incorrect OpenSSL include path + +#### Merged PRs into NodeGit +- [Use builtin SHA1 for libgit compilation](https://github.com/nodegit/nodegit/pull/1992) +- [Ensure OpenSSL root included in win32 Electron builds](https://github.com/nodegit/nodegit/pull/1991) + +## v0.28.0-alpha.23 [(2024-02-14)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.23) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.22...v0.28.0-alpha.23) + +#### Summary of changes +- Bump libgit2 to 1.7.2 + +#### Merged PRs into NodeGit +- [Bump libgit2 to 1.7.2](https://github.com/nodegit/nodegit/pull/1990) + +## v0.28.0-alpha.22 [(2024-02-05)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.22) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.21...v0.28.0-alpha.22) + +#### Summary of changes +- Compatibility with Electron 28 +- NodeGit now requires Node 16+ + +#### Merged PRs into NodeGit +- [Fix electron 28 build failure](https://github.com/nodegit/nodegit/pull/1988) +- [Bump node-gyp to 10.0.1](https://github.com/nodegit/nodegit/pull/1989) + +## v0.28.0-alpha.21 [(2023-02-10)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.21) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.20...v0.28.0-alpha.21) + +#### Summary of changes +- Update OpenSSL to 1.1.1t +- Update got + other packages with security vulnerabilities +- Fix tag.createWithSignature function definition + +#### Merged PRs into NodeGit +- [Bump OpenSSL to 1.1.1t](https://github.com/nodegit/nodegit/pull/1971) +- [Update got + other locked package versions](https://github.com/nodegit/nodegit/pull/1969) +- [Fix tag createWithSignature function](https://github.com/nodegit/nodegit/pull/1945) + +## v0.28.0-alpha.20 [(2022-11-11)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.20) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.19...v0.28.0-alpha.20) + +#### Summary of changes +- Fix electron build issues + +#### Merged PRs into NodeGit +- [Fix electron build issues](https://github.com/nodegit/nodegit/pull/1955) + +## v0.28.0-alpha.19 [(2022-11-08)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.19) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.18...v0.28.0-alpha.19) + +#### Summary of changes +- OpenSSL bump +- OpenSSL binaries will be automatically downloaded when building for Electron on Windows and macOS +- Crash fix on Electron 18+ due to Nan bug +- Partial stash support + +#### Merged PRs into NodeGit +- [Allow overriding C++ standard](https://github.com/nodegit/nodegit/pull/1953) +- [Bump OpenSSL to 1.1.1s](https://github.com/nodegit/nodegit/pull/1952) +- [Fix intermittent crash on Electron 18+](https://github.com/nodegit/nodegit/pull/1951) +- [type is a call](https://github.com/nodegit/nodegit/pull/1942) +- [Fix leak in agent](https://github.com/nodegit/nodegit/pull/1947) +- [Default to using precompiled OpenSSL for Electron](https://github.com/nodegit/nodegit/pull/1949) +- [Partial stash support](https://github.com/nodegit/nodegit/pull/1948) +- [Switch CI to macOS-11](https://github.com/nodegit/nodegit/pull/1950) +- [Preemptively Patch OpenSSL 1.1.1q](https://github.com/nodegit/nodegit/pull/1928) +- [Add getAllFilepaths function in tree object](https://github.com/nodegit/nodegit/pull/1919) + +## v0.28.0-alpha.18 [(2022-05-27)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.18) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.17...v0.28.0-alpha.18) + +#### Summary of changes +- Allow fetching partial patches from diff +- Fix nanosecond comparison typo + +#### Merged PRs into NodeGit +- [Improve Diff.patches to allow an index array](https://github.com/nodegit/nodegit/pull/1916) +- [Bring in GIT_USE_NSEC fix](https://github.com/nodegit/nodegit/pull/1917) + +## v0.28.0-alpha.17 [(2022-05-24)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.17) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.16...v0.28.0-alpha.17) + +#### Summary of changes +- Enable nanosecond precision for file operations + +#### Merged PRs into NodeGit +- [Enable GIT_USE_NSEC](https://github.com/nodegit/nodegit/pull/1912) + +## v0.28.0-alpha.16 [(2022-05-09)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.16) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.15...v0.28.0-alpha.16) + +#### Summary of changes +- Allow disabling specific filters during checkout + +#### Merged PRs into NodeGit +- [Allow disabling specific filters during checkout](https://github.com/nodegit/nodegit/pull/1911) + +## v0.28.0-alpha.15 [(2022-05-05)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.15) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.14...v0.28.0-alpha.15) + +#### Summary of changes +- Expose `GIT_OPT_GET_OWNER_VALIDATION` and `GIT_OPT_SET_OWNER_VALIDATION` + +#### Merged PRs into NodeGit +- [Expose get/set owner validation opts](https://github.com/nodegit/nodegit/pull/1910) + +## v0.28.0-alpha.14 [(2022-05-02)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.14) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.13...v0.28.0-alpha.14) + +#### Summary of changes +- Allow statically linking OpenSSL on Linux +- Update libgit2 to 1.3.1 + +#### Merged PRs into NodeGit +- [Statically compile OpenSSL on linux for electron](https://github.com/nodegit/nodegit/pull/1905) +- [Upgrade libgit2 to 1.3.1](https://github.com/nodegit/nodegit/pull/1894) + +## v0.28.0-alpha.13 [(2022-03-22)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.13) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.12...v0.28.0-alpha.13) + +#### Summary of changes +- Partially fix issue with building for Electron + +#### Merged PRs into NodeGit +- [Fix electron build](https://github.com/nodegit/nodegit/pull/1901) + +## v0.28.0-alpha.12 [(2022-03-18)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.12) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.11...v0.28.0-alpha.12) + +#### Summary of changes +- Updated CI because of GitHub deprecations +- Added workaround for LFS performance regression + +#### Merged PRs into NodeGit +- [Update windows 2016 CI to 2019](https://github.com/nodegit/nodegit/pull/1897) +- [Skip "can clone with git" test, unauthenticated git protocol is no longer supported in Github](https://github.com/nodegit/nodegit/pull/1899) +- [UNSAFE Temporary workaround for LFS checkout performance regression](https://github.com/nodegit/nodegit/pull/1883) +- [Update Github Actions for node 16](https://github.com/nodegit/nodegit/pull/1896) + +## v0.28.0-alpha.11 [(2022-02-08)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.11) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.10...v0.28.0-alpha.11) + +#### Summary of changes +- Updated libssh2 to add RSA SHA2 256/512 SSH key support + +#### Merged PRs into NodeGit +- [RSA SHA2 256/512 key upgrade support RFC 8332 #536 (#626)](https://github.com/nodegit/nodegit/pull/1888) +- [Fix typos in examples](https://github.com/nodegit/nodegit/pull/1884) +- [Don't build shared OpenSSL libs](https://github.com/nodegit/nodegit/pull/1877) + +## v0.28.0-alpha.10 [(2021-11-11)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.10) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.9...v0.28.0-alpha.10) + +#### Summary of changes +- Reworked CI due to GitHub dropping Ubuntu 16.04 support +- When building for Electron on Windows/macOS and prebuilts are unavailable: NodeGit will attempt to build OpenSSL locally by default. This is due to Conan changing their API/provided OpenSSL binaries. There are options for pointing to an installed OpenSSL location or URL for downloading prebuilt binaries, see [Building from source](http://www.nodegit.org/guides/install/from-source/). +- Updated OpenSSL to 1.1.1l +- Updated libssh2 to 1.10.0 +- Added `Repo.prototype.statistics` method for calculating repository statistics +- More progress towards becoming context-aware + +#### Merged PRs into NodeGit +- [Allow download of prebuilt OpenSSL](https://github.com/nodegit/nodegit/pull/1875) +- [Update libssh2 to 1.10.0](https://github.com/nodegit/nodegit/pull/1874) +- [Statistics with same output as "git-sizer -j"](https://github.com/nodegit/nodegit/pull/1846) +- [Fix memory leak on context shutdown](https://github.com/nodegit/nodegit/pull/1856) +- [Build OpenSSL locally for Electron](https://github.com/nodegit/nodegit/pull/1870) +- [Fix a reference error when compiling with VC2019](https://github.com/nodegit/nodegit/pull/1859) +- [Use containers for Linux CI](https://github.com/nodegit/nodegit/pull/1860) + + +## v0.28.0-alpha.9 [(2021-06-04)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.9) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.8...v0.28.0-alpha.9) + +#### Summary of changes +- Fixes an issue where rebase.init and rebase.open were ignoring callbacks in some situations + +#### Merged PRs into NodeGit +- [Shallow clone rebase options before modifying #1845](https://github.com/nodegit/nodegit/pull/1845) + + +## v0.28.0-alpha.8 [(2021-05-10)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.8) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.7...v0.28.0-alpha.8) + +#### Summary of changes +- Fixes another issue where Kerberos proxy authentication causes network failures + +#### Merged PRs into NodeGit +- [Bump libgit2 to include libgit2#5852 #1844](https://github.com/nodegit/nodegit/pull/1844) + +#### Merged PRs into Libgit2 +- [Fix issues with Proxy Authentication after httpclient refactor #5852](https://github.com/libgit2/libgit2/pull/5852) + + +## v0.28.0-alpha.7 [(2021-04-30)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.7) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.6...v0.28.0-alpha.7) + +#### Summary of changes +- Fixes issue with where proxy authentication fails on linux/osx with assertion error. + +#### Merged PRs into NodeGit +- [Bump Libgit2 to fix proxy auth on linux / osx #1841](https://github.com/nodegit/nodegit/pull/1841) + +#### Merged PRs into Libgit2 +- [https://github.com/libgit2/libgit2/pull/5852](https://github.com/libgit2/libgit2/pull/5852) + + +## v0.28.0-alpha.6 [(2021-04-23)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.6) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.5...v0.28.0-alpha.6) + +#### Summary of changes +- Rewrote options normalization such that it is done in C++. Provided deprecated classes for backwards compatibility. These will be removed in a later version of Nodegit. +- Deprecated construction of these objects, in the future, please pass plain objects with just the fields you wish to override to NodeGit, and the library will take care of the rest. + - NodeGit.ApplyOptions + - NodeGit.BlameOptions + - NodeGit.BlobFilterOptions + - NodeGit.CheckoutOptions + - NodeGit.CherrypickOptions + - NodeGit.CloneOptions + - NodeGit.DescribeFormatOptions + - NodeGit.DiffFindOptions + - NodeGit.FetchOptions + - NodeGit.MergeFileInput + - NodeGit.MergeFileOptions + - NodeGit.MergeOptions + - NodeGit.ProxyOptions + - NodeGit.PushOptions + - NodeGit.RebaseOptions + - NodeGit.RemoteCreatOptions + - NodeGit.RepositoryInitOptions + - NodeGit.RevertOptions + - NodeGit.StashApplyOptions + - NodeGit.StatusOptions + - NodeGit.SubmoduleUpdateOptions +- Ensured the following functions have their optional arguments labeled/working as optional: + - NodeGit.Apply + - NodeGit.Checkout.index + - NodeGit.Cherrypick + - NodeGit.Cherrypick.commit + - NodeGit.Merge + - NodeGit.PatchBlobs + - NodeGit.Rebase.open + - NodeGit.Remote.prototype.connect + - NodeGit.Remote.prototype.download + - NodeGit.Remote.prototype.fetch + - NodeGit.Remote.prototype.prune + - NodeGit.Remote.prototype.push + - NodeGit.Remote.prototype.upload + - NodeGit.Stash.apply + - NodeGit.Stash.pop + - NodeGit.Worktree.isPrunable + - NodeGit.Worktree.prune +- Updated the following functions to be async: + - NodeGit.Apply + - NodeGit.Remote.prototype.prune + - NodeGit.Worktree.isPrunable + - NodeGit.Worktree.prune +- Addressed issue where GitWorktreePruneOptions and GitWorktreeAddOptions were impossible to instantiate, thus making working with worktress possible now. +- Addressed issue where GitIndexTime was not configurable +- Addressed issue where the following functions did not return errors from libgit2: + - NodeGit.Merge.analysis + - NodeGit.Note.commitRemove + +#### Merged PRs into NodeGit +- [Eliminate need for normalize options #1837](https://github.com/nodegit/nodegit/pull/1837) +- [Define optional arguments for Patch.fromBlobs() #1835](https://github.com/nodegit/nodegit/pull/1835) + + +## v0.28.0-alpha.5 [(2021-04-09)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.5) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.4...v0.28.0-alpha.5) + +#### Summary of changes +- Fixes crash in multithreaded checkout in fork of libgit2 + +#### Merged PRs into NodeGit +- [Update multithreaded checkout in libgit2 #1834](https://github.com/nodegit/nodegit/pull/1834) + +#### Merged PRs into Libgit2 +- [Default to GIT_BRANCH_DEFAULT if init.defaultBranch is empty string](https://github.com/libgit2/libgit2/pull/5832) +- [Remove duplicate line, in example code](https://github.com/libgit2/libgit2/pull/5821) + + +## v0.28.0-alpha.4 [(2021-04-07)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.4) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.3...v0.28.0-alpha.4) + +#### Summary of changes +- Introduces harder safeguards on persistent references to prevent garbage collection during async work + +#### Merged PRs into NodeGit +- [Workaround: Prevent objectwrap from being cleaned up during async work #1833](https://github.com/nodegit/nodegit/pull/1833) + + +## v0.28.0-alpha.3 [(2021-04-02)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.3) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.2...v0.28.0-alpha.3) + +#### Summary of changes +- Addresses failure to open repo with empty default branch name + +#### Merged PRs into NodeGit +- [Bring in changes from libgit2 #5832 #1832](https://github.com/nodegit/nodegit/pull/1832) + +#### Cherrypicked PRs into Libgit2 +- [Default to GIT_BRANCH_DEFAULT if init.defaultBranch is empty string #5832](https://github.com/libgit2/libgit2/pull/5832) + + +## v0.28.0-alpha.2 [(2021-03-31)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.1...v0.28.0-alpha.2) + +#### Summary of changes +- Addresses crash in mwindow from libgit2 +- Bumps libgit2 to bring in bug fixes + +#### Merged PRs into NodeGit +- [Bump Libgit2 to 1.1.0 (on current head of libgit2) #1831](https://github.com/nodegit/nodegit/pull/1831) + +#### Merged PRs into Libgit2 +- [tree: deprecate `git_treebuilder_write_with_buffer`](https://github.com/libgit2/libgit2/pull/5815) +- [winhttp: skip certificate check if unable to send request](https://github.com/libgit2/libgit2/pull/5814) +- [commit-graph: Introduce `git_commit_graph_needs_refresh()`](https://github.com/libgit2/libgit2/pull/5764) +- [commit-graph: Support lookups of entries in a commit-graph](https://github.com/libgit2/libgit2/pull/5763) +- [merge: Check insert_head_ids error in create_virtual_base](https://github.com/libgit2/libgit2/pull/5818) +- [Check git_signature_dup failure](https://github.com/libgit2/libgit2/pull/5817) +- [Fix some typos](https://github.com/libgit2/libgit2/pull/5797) +- [include: fix typos in comments](https://github.com/libgit2/libgit2/pull/5805) +- [Fix documentation formating on repository.h](https://github.com/libgit2/libgit2/pull/5806) +- [index: Check git_vector_dup error in write_entries](https://github.com/libgit2/libgit2/pull/5801) +- [refdb_fs: Check git_sortedcache wlock/rlock errors](https://github.com/libgit2/libgit2/pull/5800) +- [Add new bindings for the R language](https://github.com/libgit2/libgit2/pull/5795) +- [Update .gitignore](https://github.com/libgit2/libgit2/pull/5787) +- [patch: add owner accessor](https://github.com/libgit2/libgit2/pull/5731) +- [commit-graph: Introduce a parser for commit-graph files](https://github.com/libgit2/libgit2/pull/5762) +- [revspec: rename git_revparse_mode_t to git_revspec_t](https://github.com/libgit2/libgit2/pull/5786) +- [mwindow: Fix a bug in the LRU window finding code](https://github.com/libgit2/libgit2/pull/5783) +- [ci: don't use ninja on macOS](https://github.com/libgit2/libgit2/pull/5780) +- [midx: Fix a bug in `git_midx_needs_refresh()`](https://github.com/libgit2/libgit2/pull/5768) +- [clone: set refs/remotes/origin/HEAD when branch is specified](https://github.com/libgit2/libgit2/pull/5775) +- [Use `p_pwrite`/`p_pread` consistently throughout the codebase](https://github.com/libgit2/libgit2/pull/5769) +- [README: instructions for using libgit2 without compiling](https://github.com/libgit2/libgit2/pull/5772) +- [Cope with empty default branch](https://github.com/libgit2/libgit2/pull/5770) +- [github-actions: Also rename the main branch here](https://github.com/libgit2/libgit2/pull/5771) +- [blob: fix name of `GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD`](https://github.com/libgit2/libgit2/pull/5760) +- [Add documentation for git_blob_filter_options.version](https://github.com/libgit2/libgit2/pull/5759) +- [Build with NO_MMAP](https://github.com/libgit2/libgit2/pull/5583) +- [zlib: Add support for building with Chromium's zlib implementation](https://github.com/libgit2/libgit2/pull/5748) +- [Handle ipv6 addresses](https://github.com/libgit2/libgit2/pull/5741) +- [Add support for additional SSH hostkey types.](https://github.com/libgit2/libgit2/pull/5750) +- [Fix the `-DENABLE_WERROR=ON` build for gcc 10.2](https://github.com/libgit2/libgit2/pull/5749) +- [repository: use intptr_t's in the config map cache](https://github.com/libgit2/libgit2/pull/5746) +- [Add tests for `git__multiply_int64_overflow`](https://github.com/libgit2/libgit2/pull/5744) +- [Third attempt to fix the 32-bit version of `git__multiply_int64_overf…](https://github.com/libgit2/libgit2/pull/5743) +- [Avoid using `__builtin_mul_overflow` with the clang+32-bit combo](https://github.com/libgit2/libgit2/pull/5742) +- [ci: run codeql](https://github.com/libgit2/libgit2/pull/5709) +- [pack: continue zlib while we can make progress](https://github.com/libgit2/libgit2/pull/5740) +- [Re-enable the RC4 test](https://github.com/libgit2/libgit2/pull/4418) +- [Cache the parsed submodule config when diffing](https://github.com/libgit2/libgit2/pull/5727) +- [Make git__strntol64() ~70%* faster](https://github.com/libgit2/libgit2/pull/5735) +- [winhttp: support optional client cert](https://github.com/libgit2/libgit2/pull/5384) +- [git.git-authors: Replacing his/her with their](https://github.com/libgit2/libgit2/pull/5724) +- [Friendlier getting started in the lack of git_libgit2_init](https://github.com/libgit2/libgit2/pull/5578) +- [Thread-local storage: a generic internal library (with no allocations)](https://github.com/libgit2/libgit2/pull/5720) +- [Thread-free implementation](https://github.com/libgit2/libgit2/pull/5719) +- [Make the pack and mwindow implementations data-race-free](https://github.com/libgit2/libgit2/pull/5593) +- [Make the odb race-free](https://github.com/libgit2/libgit2/pull/5595) +- [Also add the raw hostkey to `git_cert_hostkey`](https://github.com/libgit2/libgit2/pull/5704) +- [Fix the `ENABLE_WERROR=ON` build in Groovy Gorilla (gcc 10.2)](https://github.com/libgit2/libgit2/pull/5715) +- [odb: Add git_odb_options](https://github.com/libgit2/libgit2/pull/5447) +- [Introduce GIT_ASSERT macros](https://github.com/libgit2/libgit2/pull/5327) +- [ci: only report main branch in README status](https://github.com/libgit2/libgit2/pull/5708) +- [ci: run coverity in the nightly builds](https://github.com/libgit2/libgit2/pull/5707) +- [ci: more GitHub Actions](https://github.com/libgit2/libgit2/pull/5706) +- [Add a ThreadSanitizer build](https://github.com/libgit2/libgit2/pull/5597) +- [msvc crtdbg -> win32 leakcheck](https://github.com/libgit2/libgit2/pull/5580) +- [Add missing worktree_dir check and test case](https://github.com/libgit2/libgit2/pull/5692) +- [Fix the `-DTHREADSAFE=OFF` build](https://github.com/libgit2/libgit2/pull/5690) +- [ci: propagate environment variables](https://github.com/libgit2/libgit2/pull/5703) +- [ci: supply a token for self-hosted runners](https://github.com/libgit2/libgit2/pull/5702) +- [ci: supply a token for self-hosted runners](https://github.com/libgit2/libgit2/pull/5701) +- [ci: GitHub Actions for arm64](https://github.com/libgit2/libgit2/pull/5700) +- [ci: stop using deprecated set-env in GitHub Actions](https://github.com/libgit2/libgit2/pull/5697) +- [Deprecate `is_valid_name` functions; replace with `name_is_valid` functions](https://github.com/libgit2/libgit2/pull/5659) +- [Include `${MBEDTLS_INCLUDE_DIR}` when compiling `crypt_mbedtls.c`](https://github.com/libgit2/libgit2/pull/5685) +- [threadstate: rename tlsdata when building w/o threads](https://github.com/libgit2/libgit2/pull/5668) +- [Refactor "global" state](https://github.com/libgit2/libgit2/pull/5546) +- [Make the Windows leak detection more robust](https://github.com/libgit2/libgit2/pull/5661) +- [Define `git___load` when building with `-DTHREADSAFE=OFF`](https://github.com/libgit2/libgit2/pull/5664) +- [ntlm: update ntlm dependency for htonll](https://github.com/libgit2/libgit2/pull/5658) +- [libgit2 v1.1.0](https://github.com/libgit2/libgit2/pull/5660) +- [Update PCRE to 8.44](https://github.com/libgit2/libgit2/pull/5649) +- [clone: update origin's HEAD](https://github.com/libgit2/libgit2/pull/5651) +- [Improve the support of atomics](https://github.com/libgit2/libgit2/pull/5594) +- [Fix error return for invalid extensions.](https://github.com/libgit2/libgit2/pull/5656) +- [Change bare free to allocator free (fixes #5653)](https://github.com/libgit2/libgit2/pull/5654) +- [midx: Introduce a parser for multi-pack-index files](https://github.com/libgit2/libgit2/pull/5401) +- [Fixed typo in comment](https://github.com/libgit2/libgit2/pull/5648) +- [Fix binary diff showing /dev/null](https://github.com/libgit2/libgit2/pull/5494) +- [httpclient: only free challenges for current_server type](https://github.com/libgit2/libgit2/pull/5576) +- [Respect `init.defaultBranch` setting](https://github.com/libgit2/libgit2/pull/5581) +- [patch_parse: handle absence of "index" header for new/deleted cases](https://github.com/libgit2/libgit2/pull/5620) +- [boolean config parsing fails in some cases with mapped values](https://github.com/libgit2/libgit2/pull/5626) +- [Fix config file parsing with multi line values containing quoted parts](https://github.com/libgit2/libgit2/pull/5629) +- [Fix release build warnings](https://github.com/libgit2/libgit2/pull/5636) +- [Fix deprecation links inside of documentation not working](https://github.com/libgit2/libgit2/pull/5631) +- [Fix typo: Make ifndef macroname the same as the define name](https://github.com/libgit2/libgit2/pull/5632) +- [diff stats: fix segfaults with new files](https://github.com/libgit2/libgit2/pull/5619) +- [WinHTTP: Try to use TLS1.3](https://github.com/libgit2/libgit2/pull/5633) +- [Fixed includes for FreeBSD](https://github.com/libgit2/libgit2/pull/5628) +- [Don't fail if a HTTP server announces he supports a protocol upgrade](https://github.com/libgit2/libgit2/pull/5624) +- [Return false instead of segfaulting when checking for default port](https://github.com/libgit2/libgit2/pull/5621) +- [deps: ntlmclient: fix htonll for Haiku](https://github.com/libgit2/libgit2/pull/5612) +- [azure: Remove job generating documentation](https://github.com/libgit2/libgit2/pull/5615) +- [Fix crash in git_describe_commit when opts are NULL.](https://github.com/libgit2/libgit2/pull/5617) +- [Fix `git_mwindow_scan_recently_used` spuriously returning true](https://github.com/libgit2/libgit2/pull/5600) +- [zstream: handle Z_BUF_ERROR appropriately in get_output_chunk](https://github.com/libgit2/libgit2/pull/5599) +- [docs: fix typo](https://github.com/libgit2/libgit2/pull/5610) + + +## v0.28.0-alpha.1 [(2021-03-12)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.27.0...v0.28.0-alpha.1) + +#### Summary of changes +- *Notice* We planned to fix / address Electron 11 compatibility, but ran into some roadblocks. Fix is coming soon, follow [#114](https://github.com/nodegit/nodegit/issues/1774) for details +- Drops support for Node 10.x.y, < 12.19.x, < 14.10.0 +- Brings in LibGit2 1.0.0 +- NodeGit.Config.prototype.setBool handles truthiness, and NodeGit.Config.prototype.getBool returns true or false +- Fix GC ownership memory issue +- Exposes sidebandProgress callback in GitRemoteCallbacks +- Fixes issue with winhttp and optional client certificates +- Addresses proxy issue with certification validation in Windows +- Fix crash in NodeGit.Repository.prototype.refreshReferences +- Deprecations + - NodeGit.Cred is deprecated in favor of NodeGit.Credential + +#### Merged PRs into NodeGit +- [Include libgit2 winhttp proxy fix #1824](https://github.com/nodegit/nodegit/pull/1824) +- [Return/accept boolean for Config#get/setBool #1827](https://github.com/nodegit/nodegit/pull/1827) +- [First stab at #1800 (async/await in examples) #1802](https://github.com/nodegit/nodegit/pull/1802) +- [returns_info: fix ownedByIndices #1823](https://github.com/nodegit/nodegit/pull/1823) +- [Remove block for sideband_progress in remote_callbacks #1801](https://github.com/nodegit/nodegit/pull/1801) +- [Use key to grab credential type #1828](https://github.com/nodegit/nodegit/pull/1828) +- [Don't strdup nullptr from git_tag_message #1822](https://github.com/nodegit/nodegit/pull/1822) +- [Refactor for context-awareness #1795](https://github.com/nodegit/nodegit/pull/1795) +- [Update longpath enums to match libgit2 #1797](https://github.com/nodegit/nodegit/pull/1797) +- [Bump libgit2 to fork of v1.0.0 #1788](https://github.com/nodegit/nodegit/pull/1788) + +#### Merged PRs into Libgit2 +- [winhttp: skip certificate check if unable to send request #5814](https://github.com/libgit2/libgit2/pull/5814) +- [sanitizer ci: skip negotiate tests](https://github.com/libgit2/libgit2/pull/5596) +- [Add CI support for Memory and UndefinedBehavior Sanitizers](https://github.com/libgit2/libgit2/pull/5569) +- [Access HEAD via the refdb backends](https://github.com/libgit2/libgit2/pull/5563) +- [config_entries: Avoid excessive map operations](https://github.com/libgit2/libgit2/pull/5582) +- [mwindow: set limit on number of open files](https://github.com/libgit2/libgit2/pull/5396) +- [refdb: a set of preliminary refactorings for the reftable backend](https://github.com/libgit2/libgit2/pull/5570) +- [CMake modernization pt2](https://github.com/libgit2/libgit2/pull/5547) +- [Make the tests run cleanly under UndefinedBehaviorSanitizer](https://github.com/libgit2/libgit2/pull/5568) +- [Make the tests pass cleanly with MemorySanitizer](https://github.com/libgit2/libgit2/pull/5567) +- [Enable building git2.rc resource script with GCC](https://github.com/libgit2/libgit2/pull/5561) +- [Make NTLMClient Memory and UndefinedBehavior Sanitizer-clean](https://github.com/libgit2/libgit2/pull/5571) +- [Random fixes for diff-printing](https://github.com/libgit2/libgit2/pull/5559) +- [index: Update the documentation for git_index_add_from_buffer()](https://github.com/libgit2/libgit2/pull/5419) +- [Introduce CI with GitHub Actions](https://github.com/libgit2/libgit2/pull/5550) +- [Random code cleanups and fixes](https://github.com/libgit2/libgit2/pull/5552) +- [examples: log: fix documentation generation](https://github.com/libgit2/libgit2/pull/5553) +- [Missing declarations](https://github.com/libgit2/libgit2/pull/5551) +- [clar: add tap output option](https://github.com/libgit2/libgit2/pull/5541) +- [diff::parse: don't include `diff.h`](https://github.com/libgit2/libgit2/pull/5545) +- [release script: fix typo](https://github.com/libgit2/libgit2/pull/5543) +- [tests: offer exact name matching with a `$` suffix](https://github.com/libgit2/libgit2/pull/5537) +- [httpclient: support googlesource](https://github.com/libgit2/libgit2/pull/5536) +- [git_packbuilder_write: Allow setting path to NULL to use the default path](https://github.com/libgit2/libgit2/pull/5532) +- [mempack: Use threads when building the pack](https://github.com/libgit2/libgit2/pull/5531) +- [clar: use internal functions instead of /bin/cp and /bin/rm](https://github.com/libgit2/libgit2/pull/5528) +- [strarray refactoring](https://github.com/libgit2/libgit2/pull/5535) +- [CMake cleanups](https://github.com/libgit2/libgit2/pull/5481) +- [git_pool_init: allow the function to fail](https://github.com/libgit2/libgit2/pull/5526) +- [diff::workdir: actually test the buffers](https://github.com/libgit2/libgit2/pull/5529) +- [Handle unreadable configuration files](https://github.com/libgit2/libgit2/pull/5527) +- [Make git_index_write() generate valid v4 index](https://github.com/libgit2/libgit2/pull/5533) +- [OpenSSL certificate memory leak](https://github.com/libgit2/libgit2/pull/5522) +- [tests: checkout: fix flaky test due to mtime race](https://github.com/libgit2/libgit2/pull/5515) +- [cmake: Sort source files for reproducible builds](https://github.com/libgit2/libgit2/pull/5523) +- [futils: fix order of declared parameters for `git_futils_fake_symlink`](https://github.com/libgit2/libgit2/pull/5517) +- [Check the version in package.json](https://github.com/libgit2/libgit2/pull/5516) +- [tests: merge: fix printf formatter on 32 bit arches](https://github.com/libgit2/libgit2/pull/5513) +- [Update package.json](https://github.com/libgit2/libgit2/pull/5511) +- [Introduce GIT_ASSERT macros](https://github.com/libgit2/libgit2/pull/5509) +- [README.md: Add instructions for building in MinGW environment](https://github.com/libgit2/libgit2/pull/5512) +- [Fix uninitialized stack memory and NULL ptr dereference in stash_to_index](https://github.com/libgit2/libgit2/pull/5510) +- [Honor GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH for all checkout types ](https://github.com/libgit2/libgit2/pull/5378) +- [docs: add documentation for our coding style](https://github.com/libgit2/libgit2/pull/5482) +- [MSVC: Enable Control Flow Guard (CFG)](https://github.com/libgit2/libgit2/pull/5500) +- [git__hexdump: better mimic `hexdump -C`](https://github.com/libgit2/libgit2/pull/5431) +- [Feature: Allow blame to ignore whitespace change](https://github.com/libgit2/libgit2/pull/5383) +- [deps: ntlmclient: use htobe64 on NetBSD too](https://github.com/libgit2/libgit2/pull/5487) +- [sysdir: remove unused git_sysdir_get_str](https://github.com/libgit2/libgit2/pull/5485) +- [Fix typo causing removal of symbol 'git_worktree_prune_init_options'](https://github.com/libgit2/libgit2/pull/5483) +- [pack: Improve error handling for get_delta_base()](https://github.com/libgit2/libgit2/pull/5425) +- [repo::open: ensure we can open the repository](https://github.com/libgit2/libgit2/pull/5480) +- [examples: additions and fixes](https://github.com/libgit2/libgit2/pull/5421) +- [merge: cache negative cache results for similarity metrics](https://github.com/libgit2/libgit2/pull/5477) +- [Handle repository format v1](https://github.com/libgit2/libgit2/pull/5388) +- [CMake: backend selection streamlining](https://github.com/libgit2/libgit2/pull/5440) +- [refdb_fs: remove unused header file](https://github.com/libgit2/libgit2/pull/5461) +- [patch: correctly handle mode changes for renames](https://github.com/libgit2/libgit2/pull/5466) +- [gitignore: clean up patterns from old times](https://github.com/libgit2/libgit2/pull/5474) +- [README.md: update build matrix to reflect our latest releases](https://github.com/libgit2/libgit2/pull/5478) +- [Release v1.0](https://github.com/libgit2/libgit2/pull/5471) +- [refdb_backend: improve callback documentation](https://github.com/libgit2/libgit2/pull/5464) +- [credentials: provide backcompat for opaque structs](https://github.com/libgit2/libgit2/pull/5465) +- [Fix segfault when calling git_blame_buffer()](https://github.com/libgit2/libgit2/pull/5445) +- [Fix spelling error](https://github.com/libgit2/libgit2/pull/5463) +- [refdb_fs: initialize backend version](https://github.com/libgit2/libgit2/pull/5456) +- [repository: improve commondir docs](https://github.com/libgit2/libgit2/pull/5444) +- [cmake: use install directories provided via GNUInstallDirs](https://github.com/libgit2/libgit2/pull/5455) +- [azure: fix errors due to curl and removal of old VM images](https://github.com/libgit2/libgit2/pull/5451) +- [win32: don't canonicalize relative paths](https://github.com/libgit2/libgit2/pull/5435) +- [CMake booleans](https://github.com/libgit2/libgit2/pull/5422) +- [Set proper pkg-config dependency for pcre2](https://github.com/libgit2/libgit2/pull/5439) +- [httpclient: use a 16kb read buffer for macOS](https://github.com/libgit2/libgit2/pull/5432) +- [ci: provide globalsign certs for bionic](https://github.com/libgit2/libgit2/pull/5437) +- [deps: ntlmclient: fix htonll on big endian FreeBSD](https://github.com/libgit2/libgit2/pull/5426) +- [azure-pipelines: download GlobalSign's certificate manually](https://github.com/libgit2/libgit2/pull/5433) +- [deps: ntlmclient: fix missing htonll symbols on FreeBSD and SunOS](https://github.com/libgit2/libgit2/pull/5417) +- [README: add language binding link to wasm-git](https://github.com/libgit2/libgit2/pull/5420) +- [Fix #5410: fix installing libgit2.pc in wrong location](https://github.com/libgit2/libgit2/pull/5412) +- [Fix typo on GIT_USE_NEC](https://github.com/libgit2/libgit2/pull/5413) +- [tests: diff: verify that we are able to diff with empty subtrees](https://github.com/libgit2/libgit2/pull/5374) +- [README: update our build matrix to reflect current releases](https://github.com/libgit2/libgit2/pull/5408) +- [azure: docker: set up HOME variable to fix Coverity builds](https://github.com/libgit2/libgit2/pull/5409) +- [sha1_lookup: inline its only function into "pack.c"](https://github.com/libgit2/libgit2/pull/5390) +- [Coverity fixes](https://github.com/libgit2/libgit2/pull/5391) +- [Release 0.99](https://github.com/libgit2/libgit2/pull/5291) +- [Release script](https://github.com/libgit2/libgit2/pull/5372) +- [azure: fix ARM32 builds by replacing gosu(1)](https://github.com/libgit2/libgit2/pull/5406) +- [openssl: fix Valgrind issues in nightly builds](https://github.com/libgit2/libgit2/pull/5398) +- [fuzzers: Fix the documentation](https://github.com/libgit2/libgit2/pull/5400) +- [azure: fix misleading messages printed to stderr being](https://github.com/libgit2/libgit2/pull/5392) +- [tests: iterator: fix iterator expecting too few items](https://github.com/libgit2/libgit2/pull/5393) +- [transports: http: fix custom headers not being applied](https://github.com/libgit2/libgit2/pull/5387) +- [azure: fix Coverity pipeline](https://github.com/libgit2/libgit2/pull/5382) +- [azure: tests: re-run flaky proxy tests](https://github.com/libgit2/libgit2/pull/5381) +- [fetchhead: strip credentials from remote URL](https://github.com/libgit2/libgit2/pull/5373) +- [azure-pipelines: properly expand negotiate passwords](https://github.com/libgit2/libgit2/pull/5375) +- [cred: change enum to git_credential_t and GIT_CREDENTIAL_*](https://github.com/libgit2/libgit2/pull/5336) +- [Update link to libgit2 Julia language binding](https://github.com/libgit2/libgit2/pull/5371) +- [Return int from non-free functions](https://github.com/libgit2/libgit2/pull/5365) +- [HTTP: Support Apache-based servers with Negotiate](https://github.com/libgit2/libgit2/pull/5286) +- [internal types: change enums from `type_t` to `_t`](https://github.com/libgit2/libgit2/pull/5364) +- [merge: Return non-const git_repository from accessor method](https://github.com/libgit2/libgit2/pull/5358) +- [Do not return free'd git_repository object on error](https://github.com/libgit2/libgit2/pull/5361) +- [refs: refuse to delete HEAD](https://github.com/libgit2/libgit2/pull/5360) +- [index: replace map macros with inline functions](https://github.com/libgit2/libgit2/pull/5351) +- [Make type mismatch errors consistent](https://github.com/libgit2/libgit2/pull/5359) +- [win32: fix relative symlinks pointing into dirs](https://github.com/libgit2/libgit2/pull/5355) +- [ntlm: prevent (spurious) compiler warnings](https://github.com/libgit2/libgit2/pull/5354) +- [Adds support for multiple SSH auth mechanisms being used sequentially](https://github.com/libgit2/libgit2/pull/5305) +- [netops: handle intact query parameters in service_suffix removal](https://github.com/libgit2/libgit2/pull/5339) +- [Refactor packfile code to use zstream abstraction](https://github.com/libgit2/libgit2/pull/5340) +- [Fix git_submodule_sync with relative url](https://github.com/libgit2/libgit2/pull/5322) +- [http: avoid generating double slashes in url](https://github.com/libgit2/libgit2/pull/5325) +- [Correct typo in name of referenced parameter](https://github.com/libgit2/libgit2/pull/5348) +- [patch_parse: fix undefined behaviour due to arithmetic on NULL pointers](https://github.com/libgit2/libgit2/pull/5338) +- [smart_pkt: fix overflow resulting in OOB read/write of one byte](https://github.com/libgit2/libgit2/pull/5337) +- [branch: clarify documentation around branches](https://github.com/libgit2/libgit2/pull/5300) +- [examples: checkout: implement guess heuristic for remote branches](https://github.com/libgit2/libgit2/pull/5283) +- [Minor doc improvements](https://github.com/libgit2/libgit2/pull/5320) +- [attr: Update definition of binary macro](https://github.com/libgit2/libgit2/pull/5333) +- [Security fixes for master](https://github.com/libgit2/libgit2/pull/5331) +- [release.md: note that we do two security releases](https://github.com/libgit2/libgit2/pull/5318) +- [MSVC: Fix warning C4133 on x64: "function": Incompatible types - from "unsigned long *" to "size_t *"](https://github.com/libgit2/libgit2/pull/5317) +- [ci: only push docs from the libgit2/libgit2 repo](https://github.com/libgit2/libgit2/pull/5316) +- [global: convert to fiber-local storage to fix exit races](https://github.com/libgit2/libgit2/pull/5314) +- [Fix copy&paste in git_cherrypick_commit docstring](https://github.com/libgit2/libgit2/pull/5315) +- [patch_parse: fix out-of-bounds reads caused by integer underflow](https://github.com/libgit2/libgit2/pull/5312) +- [tests: fix compiler warning if tracing is disabled](https://github.com/libgit2/libgit2/pull/5311) +- [tests: config: only test parsing huge file with GITTEST_INVASIVE_SPEED](https://github.com/libgit2/libgit2/pull/5313) +- [diff: complete support for git patchid](https://github.com/libgit2/libgit2/pull/5306) +- [Memory optimizations for config entries](https://github.com/libgit2/libgit2/pull/5243) +- [ssh: include sha256 host key hash when supported](https://github.com/libgit2/libgit2/pull/5307) +- [Various examples shape-ups](https://github.com/libgit2/libgit2/pull/5272) +- [Improve trace support in tests](https://github.com/libgit2/libgit2/pull/5309) +- [Move `git_off_t` to `git_object_size_t`](https://github.com/libgit2/libgit2/pull/5123) +- [Add compat typdef for git_attr_t](https://github.com/libgit2/libgit2/pull/5310) +- [CI Build Updates](https://github.com/libgit2/libgit2/pull/5308) +- [patch_parse: use paths from "---"/"+++" lines for binary patches](https://github.com/libgit2/libgit2/pull/5303) +- [Follow 308 redirect in WinHTTP transport](https://github.com/libgit2/libgit2/pull/5285) +- [fileops: correct error return on p_lstat failures when mkdir](https://github.com/libgit2/libgit2/pull/5302) +- [config_mem: implement support for snapshots](https://github.com/libgit2/libgit2/pull/5299) +- [patch_parse: fix segfault when header path contains whitespace only](https://github.com/libgit2/libgit2/pull/5298) +- [config_file: fix race when creating an iterator](https://github.com/libgit2/libgit2/pull/5282) +- [Fix crash if snapshotting a config_snapshot](https://github.com/libgit2/libgit2/pull/5293) +- [fix a bug introduced in 8a23597b](https://github.com/libgit2/libgit2/pull/5295) +- [reflogs: fix behaviour around reflogs with newlines](https://github.com/libgit2/libgit2/pull/5275) +- [commit: verify objects exist in git_commit_with_signature](https://github.com/libgit2/libgit2/pull/5289) +- [patch_parse: fixes for fuzzing errors](https://github.com/libgit2/libgit2/pull/5276) +- [apply: add GIT_APPLY_CHECK](https://github.com/libgit2/libgit2/pull/5227) +- [refs: unlock unmodified refs on transaction commit](https://github.com/libgit2/libgit2/pull/5264) +- [fuzzers: add a new fuzzer for patch parsing](https://github.com/libgit2/libgit2/pull/5269) +- [patch_parse: handle patches without extended headers](https://github.com/libgit2/libgit2/pull/5273) +- [Provide a wrapper for simple submodule clone steps](https://github.com/libgit2/libgit2/pull/4637) +- [macOS GSS Support](https://github.com/libgit2/libgit2/pull/5238) +- [cmake: correct the link stanza for CoreFoundation](https://github.com/libgit2/libgit2/pull/5265) +- [Fix file locking on POSIX OS](https://github.com/libgit2/libgit2/pull/5257) +- [cmake: update minimum CMake version to v3.5.1](https://github.com/libgit2/libgit2/pull/5260) +- [patch_parse: handle patches with new empty files](https://github.com/libgit2/libgit2/pull/5248) +- [DRY commit parsing](https://github.com/libgit2/libgit2/pull/4445) +- [azure: avoid building and testing in Docker as root](https://github.com/libgit2/libgit2/pull/5239) +- [regexp: implement a new regular expression API](https://github.com/libgit2/libgit2/pull/5226) +- [git_refdb API fixes](https://github.com/libgit2/libgit2/pull/5106) +- [Don't use enum for flags](https://github.com/libgit2/libgit2/pull/5242) +- [valgrind: suppress memory leaks in libssh2_session_handshake](https://github.com/libgit2/libgit2/pull/5240) +- [buffer: fix writes into out-of-memory buffers](https://github.com/libgit2/libgit2/pull/5232) +- [cred: add missing private header in GSSAPI block](https://github.com/libgit2/libgit2/pull/5237) +- [CMake pkg-config modulification](https://github.com/libgit2/libgit2/pull/5206) +- [Update chat resources in README.md](https://github.com/libgit2/libgit2/pull/5229) +- [Circular header splitting](https://github.com/libgit2/libgit2/pull/5223) + +## v0.27.0 [(2020-07-28)](https://github.com/nodegit/nodegit/releases/tag/v0.27.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.26.5...v0.27.0) + +#### Summary of changes +- Expose git_remote_rename +- Bump OpenSSL from 1.1.0i -> 1.1.1c in Windows/Mac OS Electron builds +- Replace unmaintained request library with got +- Remove promisify-node and use vanilla promises for all NodeGit promises +- Prebuilds for Node 14, deprecate Node 8 +- Persist RemoteCallbacks and ProxyOptions on the remote if using Remote.prototype.connect. This fixes a segfault when using any routines on a connected remote. + +####Merged PRs into NodeGit +- [Upgrade build environments #1785](https://github.com/nodegit/nodegit/pull/1785) +- [Remote needs to persist the callback/proxyOpts/headers #1784](https://github.com/nodegit/nodegit/pull/1784) +- [Remove promisify-node and remove old callback api remnants](https://github.com/nodegit/nodegit/pull/1772) +- [Replace deprecated package request with got](https://github.com/nodegit/nodegit/pull/1771) +- [Bump OpenSSL prebuilt to 1.1.1c](https://github.com/nodegit/nodegit/pull/1770) +- [Expose git_remote_rename](https://github.com/nodegit/nodegit/pull/1767) +- [Dedupe Remote.prototype.fetch](https://github.com/nodegit/nodegit/pull/1766) + +## v0.27.0-alpha.1 [(2020-03-26)](https://github.com/nodegit/nodegit/releases/tag/v0.27.0-alpha.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.26.5...v0.27.0-alpha.1) + +#### Summary of changes +- Expose git_remote_rename +- Bump OpenSSL from 1.1.0i -> 1.1.1c in Windows/Mac OS Electron builds +- Replace unmaintained request library with got +- Remove promisify-node and use vanilla promises for all NodeGit promises + +#### Merged PRs into NodeGit +- [Remove promisify-node and remove old callback api remnants](https://github.com/nodegit/nodegit/pull/1772) +- [Replace deprecated package request with got](https://github.com/nodegit/nodegit/pull/1771) +- [Bump OpenSSL prebuilt to 1.1.1c](https://github.com/nodegit/nodegit/pull/1770) +- [Expose git_remote_rename](https://github.com/nodegit/nodegit/pull/1767) +- [Dedupe Remote.prototype.fetch](https://github.com/nodegit/nodegit/pull/1766) + + +## v0.26.5 [(2020-02-27)](https://github.com/nodegit/nodegit/releases/tag/v0.26.5) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.26.4...v0.26.5) + +#### Summary of changes +- Bring in improvement to client certificate handling on Windows from [winhttp: support optional client cert #5384](https://github.com/libgit2/libgit2/pull/5384) +- `Commit.prototype.parent()` now correctly assigns the repo property on the retrieved commit. This should solve certain bugs when working with a commit retrieved from `parent`. + +#### Merged PRs into NodeGit +- [Bring in Libgit2 #5384 to NodeGit](https://github.com/nodegit/nodegit/pull/1758) +- [Fix behavior of Commit#parent](https://github.com/nodegit/nodegit/pull/1509) +- [Remove DiffList](https://github.com/nodegit/nodegit/pull/1733) +- [Remove unnecessary assignment of Commit#repo](https://github.com/nodegit/nodegit/pull/1508) + +#### Merged PRs into LibGit2 +- [winhttp: support optional client cert #5384](https://github.com/libgit2/libgit2/pull/5384) +- [Support `core.longpaths` on Windows #5347](https://github.com/libgit2/libgit2/pull/5347) +- [Parallelize checkout_create_the_new for perf #4205](https://github.com/libgit2/libgit2/pull/4205) + + +## v0.26.4 [(2020-01-14)](https://github.com/nodegit/nodegit/releases/tag/v0.26.4) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.26.3...v0.26.4) + +#### Summary of changes +- Bumped LibGit2 + - Now can be configured to support longpaths on Windows. Does not respect the config value, but is configured through `NodeGit.Libgit2.opts`. See [#1748](https://github.com/nodegit/nodegit/pull/1748) for details. + - Support for complex SSH auth creds handshakes +- Pulled in patch for Libssh2 that covers an integer overflow, see [Libssh2#402](https://github.com/libssh2/libssh2/pull/402) + +#### Merged PRs into NodeGit +- [Fix some issues from the libgit2 bump](https://github.com/nodegit/nodegit/pull/1751) +- [Add option to support longpaths on Windows](https://github.com/nodegit/nodegit/pull/1748) +- [Bring in libssh2#402](https://github.com/nodegit/nodegit/pull/1749) +- [Wait for copy and remove promises to finish](https://github.com/nodegit/nodegit/pull/1730) + +#### Merged PRs into LibGit2 +- [Support `core.longpaths` on Windows #5347](https://github.com/libgit2/libgit2/pull/5347) +- [Parallelize checkout_create_the_new for perf #4205](https://github.com/libgit2/libgit2/pull/4205) +- [win32: fix relative symlinks pointing into dirs](https://github.com/libgit2/libgit2/pull/5355) +- [ntlm: prevent (spurious) compiler warnings](https://github.com/libgit2/libgit2/pull/5354) +- [Adds support for multiple SSH auth mechanisms being used sequentially](https://github.com/libgit2/libgit2/pull/5305) +- [netops: handle intact query parameters in service_suffix removal](https://github.com/libgit2/libgit2/pull/5339) +- [Refactor packfile code to use zstream abstraction](https://github.com/libgit2/libgit2/pull/5340) +- [Fix git_submodule_sync with relative url](https://github.com/libgit2/libgit2/pull/5322) +- [http: avoid generating double slashes in url](https://github.com/libgit2/libgit2/pull/5325) +- [Correct typo in name of referenced parameter](https://github.com/libgit2/libgit2/pull/5348) +- [patch_parse: fix undefined behaviour due to arithmetic on NULL pointers](https://github.com/libgit2/libgit2/pull/5338) +- [smart_pkt: fix overflow resulting in OOB read/write of one byte](https://github.com/libgit2/libgit2/pull/5337) +- [branch: clarify documentation around branches](https://github.com/libgit2/libgit2/pull/5300) +- [examples: checkout: implement guess heuristic for remote branches](https://github.com/libgit2/libgit2/pull/5283) +- [Minor doc improvements](https://github.com/libgit2/libgit2/pull/5320) +- [attr: Update definition of binary macro](https://github.com/libgit2/libgit2/pull/5333) +- [Security fixes for master](https://github.com/libgit2/libgit2/pull/5331) +- [release.md: note that we do two security releases](https://github.com/libgit2/libgit2/pull/5318) +- [MSVC: Fix warning C4133 on x64: "function": Incompatible types - from "unsigned long *" to "size_t *"](https://github.com/libgit2/libgit2/pull/5317) +- [ci: only push docs from the libgit2/libgit2 repo](https://github.com/libgit2/libgit2/pull/5316) +- [global: convert to fiber-local storage to fix exit races](https://github.com/libgit2/libgit2/pull/5314) +- [Fix copy&paste in git_cherrypick_commit docstring](https://github.com/libgit2/libgit2/pull/5315) +- [patch_parse: fix out-of-bounds reads caused by integer underflow](https://github.com/libgit2/libgit2/pull/5312) +- [tests: fix compiler warning if tracing is disabled](https://github.com/libgit2/libgit2/pull/5311) +- [tests: config: only test parsing huge file with GITTEST_INVASIVE_SPEED](https://github.com/libgit2/libgit2/pull/5313) +- [diff: complete support for git patchid](https://github.com/libgit2/libgit2/pull/5306) +- [Memory optimizations for config entries](https://github.com/libgit2/libgit2/pull/5243) +- [ssh: include sha256 host key hash when supported](https://github.com/libgit2/libgit2/pull/5307) +- [Various examples shape-ups](https://github.com/libgit2/libgit2/pull/5272) +- [Improve trace support in tests](https://github.com/libgit2/libgit2/pull/5309) +- [Move `git_off_t` to `git_object_size_t`](https://github.com/libgit2/libgit2/pull/5123) +- [Add compat typdef for git_attr_t](https://github.com/libgit2/libgit2/pull/5310) +- [CI Build Updates](https://github.com/libgit2/libgit2/pull/5308) +- [patch_parse: use paths from "---"/"+++" lines for binary patches](https://github.com/libgit2/libgit2/pull/5303) +- [Follow 308 redirect in WinHTTP transport](https://github.com/libgit2/libgit2/pull/5285) +- [fileops: correct error return on p_lstat failures when mkdir](https://github.com/libgit2/libgit2/pull/5302) +- [config_mem: implement support for snapshots](https://github.com/libgit2/libgit2/pull/5299) +- [patch_parse: fix segfault when header path contains whitespace only](https://github.com/libgit2/libgit2/pull/5298) +- [config_file: fix race when creating an iterator](https://github.com/libgit2/libgit2/pull/5282) +- [Fix crash if snapshotting a config_snapshot](https://github.com/libgit2/libgit2/pull/5293) +- [fix a bug introduced in 8a23597b](https://github.com/libgit2/libgit2/pull/5295) +- [reflogs: fix behaviour around reflogs with newlines](https://github.com/libgit2/libgit2/pull/5275) +- [commit: verify objects exist in git_commit_with_signature](https://github.com/libgit2/libgit2/pull/5289) +- [patch_parse: fixes for fuzzing errors](https://github.com/libgit2/libgit2/pull/5276) +- [apply: add GIT_APPLY_CHECK](https://github.com/libgit2/libgit2/pull/5227) +- [refs: unlock unmodified refs on transaction commit](https://github.com/libgit2/libgit2/pull/5264) +- [fuzzers: add a new fuzzer for patch parsing](https://github.com/libgit2/libgit2/pull/5269) +- [patch_parse: handle patches without extended headers](https://github.com/libgit2/libgit2/pull/5273) +- [Provide a wrapper for simple submodule clone steps](https://github.com/libgit2/libgit2/pull/4637) +- [macOS GSS Support](https://github.com/libgit2/libgit2/pull/5238) +- [cmake: correct the link stanza for CoreFoundation](https://github.com/libgit2/libgit2/pull/5265) +- [Fix file locking on POSIX OS](https://github.com/libgit2/libgit2/pull/5257) +- [cmake: update minimum CMake version to v3.5.1](https://github.com/libgit2/libgit2/pull/5260) +- [patch_parse: handle patches with new empty files](https://github.com/libgit2/libgit2/pull/5248) +- [DRY commit parsing](https://github.com/libgit2/libgit2/pull/4445) +- [azure: avoid building and testing in Docker as root](https://github.com/libgit2/libgit2/pull/5239) +- [regexp: implement a new regular expression API](https://github.com/libgit2/libgit2/pull/5226) +- [git_refdb API fixes](https://github.com/libgit2/libgit2/pull/5106) +- [Don't use enum for flags](https://github.com/libgit2/libgit2/pull/5242) +- [valgrind: suppress memory leaks in libssh2_session_handshake](https://github.com/libgit2/libgit2/pull/5240) +- [buffer: fix writes into out-of-memory buffers](https://github.com/libgit2/libgit2/pull/5232) +- [cred: add missing private header in GSSAPI block](https://github.com/libgit2/libgit2/pull/5237) +- [CMake pkg-config modulification](https://github.com/libgit2/libgit2/pull/5206) +- [Update chat resources in README.md](https://github.com/libgit2/libgit2/pull/5229) +- [Circular header splitting](https://github.com/libgit2/libgit2/pull/5223) + + +## v0.26.3 [(2019-12-10)](https://github.com/nodegit/nodegit/releases/tag/v0.26.3) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.26.2...v0.26.3) + +#### Summary of changes +- Include LibGit2 security patch: https://github.com/libgit2/libgit2/releases/tag/v0.28.4 + +#### Merged PRs into NodeGit +- [Bring in security patches from libgit2 #1743](https://github.com/nodegit/nodegit/pull/1743) + + +## v0.26.2 [(2019-09-26)](https://github.com/nodegit/nodegit/releases/tag/v0.26.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.26.1...v0.26.2) + +#### Summary of changes +- Added options to fetch additional data (gpg signature) from LibGit2 in revWalk.prototype.commitWalk and return plain objects + - _revWalk.prototype.commitWalk(numCommits: number, { returnPlainObjects: boolean })_ + +#### Merged PRs into NodeGit +- [Optionally retrieve more data on commit walk #1728](https://github.com/nodegit/nodegit/pull/1728) + + +## v0.26.1 [(2019-09-16)](https://github.com/nodegit/nodegit/releases/tag/v0.26.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.26.0...v0.26.1) + +#### Summary of changes +- Bumped LibGit2 + - Additional git ignore fixes + - Allow credentials callback to return any credential type from list of supported types + - Memory leak and allocation fixes +- updateTips has optional parameters and should convert plain objects into options structs correctly now +- Added Nodegit.Blob.prototype.filter, this should be used instead of NodeGit.Blob.filteredContent as it is not deprecated. + +#### Merged PRs into NodeGit +- [Bump libgit2 to latest fork of master #1723](https://github.com/nodegit/nodegit/pull/1723) +- [updateTips: optional param and normalizeOptions #1722](https://github.com/nodegit/nodegit/pull/1722) + +#### Merged PRs into LibGit2 +- [Parallelize checkout_create_the_new for perf #4205](https://github.com/libgit2/libgit2/pull/4205) +- [azure: build Docker images as part of the pipeline](https://github.com/libgit2/libgit2/pull/5198) +- [smart: use push_glob instead of manual filtering](https://github.com/libgit2/libgit2/pull/5195) +- [ntlm: fix failure to find openssl headers](https://github.com/libgit2/libgit2/pull/5216) +- [cmake: remove extraneous logging](https://github.com/libgit2/libgit2/pull/5222) +- [open:fix memory leak when passing NULL to git_repository_open_ext](https://github.com/libgit2/libgit2/pull/5224) +- [apply: Fix a patch corruption related to EOFNL handling](https://github.com/libgit2/libgit2/pull/5209) +- [ignore: correct handling of nested rules overriding wild card unignore](https://github.com/libgit2/libgit2/pull/5210) +- [Memory allocation fixes for diff generator](https://github.com/libgit2/libgit2/pull/5214) +- [Use an HTTP scheme that supports the given credentials](https://github.com/libgit2/libgit2/pull/5212) +- [apply: git_apply_to_tree fails to apply patches that add new files](https://github.com/libgit2/libgit2/pull/5208) +- [Optionally read `.gitattributes` from HEAD](https://github.com/libgit2/libgit2/pull/5189) +- [config: implement "onbranch" conditional](https://github.com/libgit2/libgit2/pull/5196) +- [Fix include casing for case-sensitive filesystems.](https://github.com/libgit2/libgit2/pull/5213) +- [util: use 64 bit timer on Windows](https://github.com/libgit2/libgit2/pull/5054) +- [Memory allocation audit](https://github.com/libgit2/libgit2/pull/5200) +- [clone: don't decode URL percent encodings](https://github.com/libgit2/libgit2/pull/5187) +- [Security updates from 0.28.3](https://github.com/libgit2/libgit2/pull/5202) + + +## v0.26.0 [(2019-09-09)](https://github.com/nodegit/nodegit/releases/tag/v0.26.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.1...v0.26.0) + +#### Summary of changes +- Bumped libssh2 to 1.9 for security patch +- Remote.prototype.upload and Remote.prototype.updateTips should be async now + +#### Merged PRs into NodeGit +- [GitRemote upload and updateTips are async #1720](https://github.com/nodegit/nodegit/pull/1720) +- [Update libssh2 to 1.9 #1719](https://github.com/nodegit/nodegit/pull/1719) + + +## v0.25.1 [(2019-08-13)](https://github.com/nodegit/nodegit/releases/tag/v0.25.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0...v0.25.1) + +#### Summary of changes +Security patch for LibGit2: +- A carefully constructed commit object with a very large number + of parents may lead to potential out-of-bounds writes or + potential denial of service. + +- The ProgramData configuration file is always read for compatibility + with Git for Windows and Portable Git installations. The ProgramData + location is not necessarily writable only by administrators, so we + now ensure that the configuration file is owned by the administrator + or the current user. + +Additionally: +- Stash should run much faster now. + +#### Merged PRs into LibGit2 +- [Parallelize checkout_create_the_new for perf #4205](https://github.com/libgit2/libgit2/pull/4205) +- [stash: avoid recomputing tree when committing worktree](https://github.com/libgit2/libgit2/pull/5113) +- [Variadic macros](https://github.com/libgit2/libgit2/pull/5121) +- [Add sign capability to git_rebase_commit](https://github.com/libgit2/libgit2/pull/4913) +- [remote: remove unused block of code](https://github.com/libgit2/libgit2/pull/5197) +- [Adjust printf specifiers in examples code](https://github.com/libgit2/libgit2/pull/5146) +- [config: check if we are running in a sandboxed environment](https://github.com/libgit2/libgit2/pull/5191) +- [Fix example checkout to forbid rather than require --](https://github.com/libgit2/libgit2/pull/5184) +- [editorconfig: update to match our coding style](https://github.com/libgit2/libgit2/pull/5183) +- [Compare buffers in diff example](https://github.com/libgit2/libgit2/pull/5125) +- [Include ahead_behind in the test suite](https://github.com/libgit2/libgit2/pull/5135) +- [config: separate file and snapshot backends](https://github.com/libgit2/libgit2/pull/5186) +- [object: deprecate git_object__size for removal](https://github.com/libgit2/libgit2/pull/5192) + + +## v0.25.0 [(2019-08-09)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.24.3...v0.25.0) + +#### Summary of changes +##### BREAKING +- `getRemotes` no longer returns remote names, it now returns remote objects directly. Use `getRemoteNames` to get a list of remote names. +- Converted Buf.prototype.set and Buf.prototype.grow from async to sync +- `Repository.prototype.continueRebase` will now throw on any error except for EAPPLIED on the first call to `Rebase.prototype.next` +- Drops support for Ubuntu 14 after EOL +- Removed access to the `diff_so_far` param in `git_diff_notify_cb` and `git_diff_progress_cb` +- Changed `FilterSource.prototype.repo` to async to prevent segfaults on filters that run during `Submodule.status` +- Changed `NodeGit.Signature.default` to async, because it actually ends up reading the config. +- Fixed bug where templates were not reporting errors for synchronous methods. It's a bit of a wide net, but in general, + it is now possible certain sync methods in NodeGit will begin failing that did not fail before. This is the correct + behavior. + +##### Deprecations +- Support signing commits in `Repository.prototype.mergeBranches`. The last parameter `processMergeMessageCallback` is now deprecated, but will continue to work. Use the options object instead, which will contain the `processMergeMessageCallback`, as well as the `signingCb`. + +##### New +- Support for Node 12 +- Add signing support for commits and annotated tags + - Enforced consistent use of signing callbacks within the application. Any object that implements the signingCallback + pattern for signing commits or tags should use the exact same callback type and with the same meaning. + `type SigningCallback = (content: string) => {| code: number, field?: string, signedData?: string |};` + If the code is `NodeGit.Error.CODE.OK` or 0, the operation will succeed and _at least_ signedData is expected to be filled out. + If the code is a negative number, except for `NodeGit.Error.CODE.PASSTHROUGH`, the signing operation will fail. + If the code is `NodeGit.Error.CODE.PASSTHROUGH`, the operation will continue without signing the object. +- Exposed `AnnotatedCommit` methods: + - `AnnotatedCommit.prototype.ref` +- Exposed `Apply` methods: + - `Apply.apply` applies a diff to the repository + - `Apply.toTree` applies a diff to a tree +- Exposed `Config` methods: + - `Config.prototype.deleteEntry` + - `Config.prototype.deleteMultivar` + - `Config.prototype.getBool` + - `Config.prototype.getInt32` + - `Config.prototype.getInt64` + - `Config.prototype.setMultivar` + - `Config.prototype.snapshot` +- Exposed `ConfigIterator` with methods: + - `ConfigIterator.create` + - `ConfigIterator.createGlob` + - `ConfigIterator.createMultivar` + - `ConfigIterator.prototype.next` +- Exposed `IndexNameEntry`: + - `IndexNameEntry.add` + - `IndexNameEntry.clear` + - `IndexNameEntry.entryCount` + - `IndexNameEntry.getByIndex` + - `IndexNameEntry.prototype.ancestor` + - `IndexNameEntry.prototype.ours` + - `IndexNameEntry.prototype.theirs` +- Exposed `IndexReucEntry`: + - `IndexReucEntry.add` + - `IndexReucEntry.clear` + - `IndexReucEntry.entryCount` + - `IndexReucEntry.find` + - `IndexReucEntry.getByIndex` + - `IndexReucEntry.getByPath` + - `IndexReucEntry.remove` + - `IndexReucEntry.prototype.mode` + - `IndexReucEntry.prototype.oid` + - `IndexReucEntry.prototype.path` +- Exposed `Mailmap`: + - `Mailmap.prototype.addEntry` + - `Mailmap.fromBuffer` + - `Mailmap.fromRepository` + - `Mailmap.create` + - `Mailmap.prototype.resolve` + - `Mailmap.prototype.resolveSignature` +- Exposed `Merge` methods: + - `Merge.analysis` + - `Merge.analysisForRef` +- Exposed `Path.isGitfile` +- Added `RebaseOptions` to `Repository.prototype.rebaseContinue` +- Added `NodeGit.Reference.updateTerminal` +- Exposed `Remote` methods: + - `Remote.createWithOpts` +- Exposed `Tag.createFromBuffer` +- Expose `Tree.prototype.createUpdated(repo, numUpdates, updates)` + +##### Fixed +- Updates lodash dependency to address security notice +- Fixed a prototype problem with cherrypick, merge, and other collections that have a function at their root. call, apply, and bind should now be on NodeGit.Cherrypick. +- Bumped libssh2 to resolve security notice. +- Improve speed and correctness of fileHistoryWalk. The API should not have changed; however, when the end of the walk has been reached, `reachedEndOfHistory` will be specified on the resulting array. +- Fixes openssl prebuilt downloads for electron builds +- Fixes commits retrieved from `Commit.prototype.parent` +- Bump Node-Gyp to 4.0.0 to fix tar security vulnerability +- Optimized a set of routines in NodeGit. These methods as written in Javascript require hundreds or thousands of requests to async workers to retrieve data. We've batched these requests and performed them on a single async worker. There are now native implementations of the following: + - `Repository.prototype.getReferences`: Retrieves all references on async worker. + - `Repository.prototype.getRemotes`: Retrieves all remotes on async worker. + - `Repository.prototype.getSubmodules`: Retrieves all submodules on async worker. + - `Repository.prototype.refreshReferences`: Open sourced function from GitKraken. Grabs a lot of information about references on an async worker. + - `Revwalk.prototype.commitWalk`: Retrieves up to N commits from a revwalk on an async worker. +- When installing on a machine that has yarn and does not have npm, the preinstall script should succeed now +- `ceiling_dirs` is now an optional parameter to `Repository.discover` +- Added support for building on IBM i (PASE) machines +- Fixed leak where struct/option types were leaking libgit2 pointers +- Switched `NodeGit.Oid.fromString`'s internal implementation from `git_oid_fromstr` to `git_oid_fromstrp` +- Fixed builds for Electron 4 +- Updated `Signature.prototype.toString` to optionally include timestamps + +##### LibGit2 Bump +- Fixes gitignore issue with pattern negation +- `Remote.list` now gets the correct list of remotes if remotes are changed by external process +- Always use builtin regex for linux for portability +- Use Iconv on OSX for better internationalization support. +- Removed LibCurl from LibGit2: + - Now with built-in NTLM proxy support + - Now with built-in Negotiate/Kerberos proxy support + - Working with proxy URLs may be different as curl could auto detect scheme for proxies +- Various git config fixes +- Various git ignore fixes +- Various libgit2 performance improvements +- Windows/Linux now use PCRE for regex, OSX uses regcomp_l, this should address collation issues in diffing + +#### Merged PRs into NodeGit +- [Add deprecation warnings for enums that need them. #1711](https://github.com/nodegit/nodegit/pull/1711) +- [https://github.com/nodegit/nodegit/pull/1706](https://github.com/nodegit/nodegit/pull/1706) +- [Reintroduce Odb.prototype.addDiskAlternate #1695](https://github.com/nodegit/nodegit/pull/1695) +- [Fix behaviour of Repository#getReferences #1708](https://github.com/nodegit/nodegit/pull/1708) +- [Bump libgit2 #1705](https://github.com/nodegit/nodegit/pull/1705) +- [Fix Tree#createUpdated #1704](https://github.com/nodegit/nodegit/pull/1704) +- [Fix failing tests on CI #1703](https://github.com/nodegit/nodegit/pull/1703) +- [Audit lodash and fix package-lock.json #1702](https://github.com/nodegit/nodegit/pull/1702) +- [Implement support for Node 12 #1696](https://github.com/nodegit/nodegit/pull/1696) +- [Remove NSEC #1699](https://github.com/nodegit/nodegit/pull/1699) +- [Use builtin regex library for linux for better portability #1693](https://github.com/nodegit/nodegit/pull/1693) +- [Remove pcre-config from binding.gyp #1694](https://github.com/nodegit/nodegit/pull/1694) +- [refresh_references.cc: skip refs that can't be directly resolved #1689](https://github.com/nodegit/nodegit/pull/1689) +- [Bump libgit2 to fork of latest master #1690](https://github.com/nodegit/nodegit/pull/1690) +- [Bump libssh2 to 1.8.2 and fix some npm audit warnings #1678](https://github.com/nodegit/nodegit/pull/1678) +- [Root functions should keep their function prototypes correctly #1681](https://github.com/nodegit/nodegit/pull/1681) +- [refresh_references.cc: bust LibGit2 remote list cache by reading config #1685](https://github.com/nodegit/nodegit/pull/1685) +- [Implement faster file history walk #1676](https://github.com/nodegit/nodegit/pull/1676) +- [EOL for Node 6 and Ubuntu 14.04 #1649](https://github.com/nodegit/nodegit/pull/1649) +- [Ensures that commits from parent(*) has a repository #1658](https://github.com/nodegit/nodegit/pull/1658) +- [Update openssl conan distributions #1663](https://github.com/nodegit/nodegit/pull/1663) +- [Support signing in Repository#mergeBranches #1664](https://github.com/nodegit/nodegit/pull/1664) +- [Dependency upgrade node-gyp upgraded to 4.0.0 #1672](https://github.com/nodegit/nodegit/pull/1672) +- [Add additional getters to streamline information gathering (breaking change) #1671](https://github.com/nodegit/nodegit/pull/1671) +- [Clean up some dangerous memory accesses in callbacks #1642](https://github.com/nodegit/nodegit/pull/1642) +- [Output the item that was deprecated when giving deprecation notice #1643](https://github.com/nodegit/nodegit/pull/1643) +- [Don't fail yarn installs when we can't find npm #1644](https://github.com/nodegit/nodegit/pull/1644) +- [`ceiling_dirs` parameter in `Repository.discover` is optional #1245](https://github.com/nodegit/nodegit/pull/1245) +- [Add missing `shouldAlloc` declarations for git_merge_analysis* functions #1641](https://github.com/nodegit/nodegit/pull/1641) +- [Fix regex state causing subsequent runs of Tag.extractSignature to fail #1630](https://github.com/nodegit/nodegit/pull/1630) +- [Update LibGit2 docs to v0.28.0 #1631](https://github.com/nodegit/nodegit/pull/1631) +- [Add support for building on IBM i (PASE) #1634](https://github.com/nodegit/nodegit/pull/1634) +- [Expose more config methods #1635](https://github.com/nodegit/nodegit/pull/1635) +- [Catch errors and pass them to libgit2 as error codes in rebase signingcb #1636](https://github.com/nodegit/nodegit/pull/1636) +- [Simplify check for IBM i operating system #1637](https://github.com/nodegit/nodegit/pull/1637) +- [Bump LibGit2 to fork of v0.28.1 #1638](https://github.com/nodegit/nodegit/pull/1638) +- [We should clear the persistent cell in structs when they are destroyed #1629](https://github.com/nodegit/nodegit/pull/1629) +- [Fix "errorno" typo #1628](https://github.com/nodegit/nodegit/pull/1628) +- [Bump Libgit2 fork to v0.28.0 #1627](https://github.com/nodegit/nodegit/pull/1627) +- [Fix macOS and Windows Electron 4 builds #1626](https://github.com/nodegit/nodegit/pull/1626) +- [Fix non-existent / dangling refs cause Repository.prototype.createCommitWithSignature to fail #1624](https://github.com/nodegit/nodegit/pull/1624) +- [Handle new gyp information for electron builds #1623](https://github.com/nodegit/nodegit/pull/1623) +- [Use same API for signingCb in all places that can be crypto signed #1621](https://github.com/nodegit/nodegit/pull/1621) +- [Breaking: Repository.prototype.continueRebase enhancements #1619](https://github.com/nodegit/nodegit/pull/1619) +- [adds support for gpg commit signing (fixes #1018) #1448](https://github.com/nodegit/nodegit/pull/1448) +- [Add `updateRef` parameter to Repository#createCommitWithSignature #1610](https://github.com/nodegit/nodegit/pull/1610) +- [Documentation fixes. #1611](https://github.com/nodegit/nodegit/pull/1611) +- [Add Commit#amendWithSignature #1616](https://github.com/nodegit/nodegit/pull/1616) +- [Bump libgit2 to a preview of v0.28 #1615](https://github.com/nodegit/nodegit/pull/1615) +- [Fix issues with Commit#amendWithSignature #1617](https://github.com/nodegit/nodegit/pull/1617) +- [Marked Repository.createBlobFromBuffer as async #1614](https://github.com/nodegit/nodegit/pull/1614) +- [Add functionality for creating Tags with signatures and extracting signatures from Tags #1618](https://github.com/nodegit/nodegit/pull/1618) + +#### Merged PRs into LibGit2 +- [Add sign capability to git_rebase_commit #4913](https://github.com/libgit2/libgit2/pull/4913) +- [Parallelize checkout_create_the_new for perf #4205](https://github.com/libgit2/libgit2/pull/4205) +- [config_file: refresh when creating an iterator](https://github.com/libgit2/libgit2/pull/5181) +- [azure: drop powershell](https://github.com/libgit2/libgit2/pull/5141) +- [fuzzer: use futils instead of fileops](https://github.com/libgit2/libgit2/pull/5180) +- [w32: fix unlinking of directory symlinks](https://github.com/libgit2/libgit2/pull/5151) +- [patch_parse: fix segfault due to line containing static contents](https://github.com/libgit2/libgit2/pull/5179) +- [ignore: fix determining whether a shorter pattern negates another](https://github.com/libgit2/libgit2/pull/5173) +- [patch_parse: handle missing newline indicator in old file](https://github.com/libgit2/libgit2/pull/5159) +- [patch_parse: do not depend on parsed buffer's lifetime](https://github.com/libgit2/libgit2/pull/5158) +- [sha1: fix compilation of WinHTTP backend](https://github.com/libgit2/libgit2/pull/5174) +- [repository: do not initialize HEAD if it's provided by templates](https://github.com/libgit2/libgit2/pull/5176) +- [configuration: cvar -> configmap](https://github.com/libgit2/libgit2/pull/5138) +- [Evict cache items more efficiently](https://github.com/libgit2/libgit2/pull/5172) +- [clar: fix suite count](https://github.com/libgit2/libgit2/pull/5175) +- [Ignore VS2017 specific files and folders](https://github.com/libgit2/libgit2/pull/5163) +- [gitattributes: ignore macros defined in subdirectories](https://github.com/libgit2/libgit2/pull/5156) +- [clar: correctly account for "data" suites when counting](https://github.com/libgit2/libgit2/pull/5168) +- [Allocate memory more efficiently when packing objects](https://github.com/libgit2/libgit2/pull/5170) +- [fileops: fix creation of directory in filesystem root](https://github.com/libgit2/libgit2/pull/5131) +- [win32: fix fuzzers and have CI build them](https://github.com/libgit2/libgit2/pull/5160) +- [Config parser separation](https://github.com/libgit2/libgit2/pull/5134) +- [config_file: implement stat cache to avoid repeated rehashing](https://github.com/libgit2/libgit2/pull/5132) +- [ci: build with ENABLE_WERROR on Windows](https://github.com/libgit2/libgit2/pull/5143) +- [Fix Regression: attr: Correctly load system attr file (on Windows)](https://github.com/libgit2/libgit2/pull/5152) +- [hash: fix missing error return on production builds](https://github.com/libgit2/libgit2/pull/5145) +- [Resolve static check warnings in example code](https://github.com/libgit2/libgit2/pull/5142) +- [Multiple hash algorithms](https://github.com/libgit2/libgit2/pull/4438) +- [More documentation](https://github.com/libgit2/libgit2/pull/5128) +- [Incomplete commondir support](https://github.com/libgit2/libgit2/pull/4967) +- [Remove warnings](https://github.com/libgit2/libgit2/pull/5078) +- [Re-run flaky tests](https://github.com/libgit2/libgit2/pull/5140) +- [errors: use lowercase](https://github.com/libgit2/libgit2/pull/5137) +- [largefile tests: only write 2GB on 32-bit platforms](https://github.com/libgit2/libgit2/pull/5136) +- [Fix broken link in README](https://github.com/libgit2/libgit2/pull/5129) +- [net: remove unused `git_headlist_cb`](https://github.com/libgit2/libgit2/pull/5122) +- [cmake: default NTLM client to off if no HTTPS support](https://github.com/libgit2/libgit2/pull/5124) +- [attr: rename constants and macros for consistency](https://github.com/libgit2/libgit2/pull/5119) +- [Change API instances of `fromnoun` to `from_noun` (with an underscore)](https://github.com/libgit2/libgit2/pull/5117) +- [object: rename git_object__size to git_object_size](https://github.com/libgit2/libgit2/pull/5118) +- [Replace fnmatch with wildmatch](https://github.com/libgit2/libgit2/pull/5110) +- [Documentation fixes](https://github.com/libgit2/libgit2/pull/5111) +- [Removal of `p_fallocate`](https://github.com/libgit2/libgit2/pull/5114) +- [Modularize our TLS & hash detection](https://github.com/libgit2/libgit2/pull/5055) +- [tests: merge::analysis: use test variants to avoid duplicated test suites](https://github.com/libgit2/libgit2/pull/5109) +- [Rename options initialization functions](https://github.com/libgit2/libgit2/pull/5101) +- [deps: ntlmclient: disable implicit fallthrough warnings](https://github.com/libgit2/libgit2/pull/5112) +- [gitignore with escapes](https://github.com/libgit2/libgit2/pull/5097) +- [Handle URLs with a colon after host but no port](https://github.com/libgit2/libgit2/pull/5108) +- [Merge analysis support for bare repos](https://github.com/libgit2/libgit2/pull/5022) +- [Add memleak check docs](https://github.com/libgit2/libgit2/pull/5104) +- [Data-driven tests](https://github.com/libgit2/libgit2/pull/5098) +- [sha1dc: update to fix endianess issues on AIX/HP-UX](https://github.com/libgit2/libgit2/pull/5107) +- [Add NTLM support for HTTP(s) servers and proxies](https://github.com/libgit2/libgit2/pull/5052) +- [Callback type names should be suffixed with `_cb`](https://github.com/libgit2/libgit2/pull/5102) +- [tests: checkout: fix symlink.git being created outside of sandbox](https://github.com/libgit2/libgit2/pull/5099) +- [ignore: handle escaped trailing whitespace](https://github.com/libgit2/libgit2/pull/5095) +- [Ignore: only treat one leading slash as a root identifier](https://github.com/libgit2/libgit2/pull/5074) +- [online tests: use gitlab for auth failures](https://github.com/libgit2/libgit2/pull/5094) +- [Ignore files: don't ignore whitespace](https://github.com/libgit2/libgit2/pull/5076) +- [cache: fix cache eviction using deallocated key](https://github.com/libgit2/libgit2/pull/5088) +- [SECURITY.md: split out security-relevant bits from readme](https://github.com/libgit2/libgit2/pull/5085) +- [Restore NetBSD support](https://github.com/libgit2/libgit2/pull/5086) +- [repository: fix garbage return value](https://github.com/libgit2/libgit2/pull/5084) +- [cmake: disable fallthrough warnings for PCRE](https://github.com/libgit2/libgit2/pull/5083) +- [Configuration parsing: validate section headers with quotes](https://github.com/libgit2/libgit2/pull/5073) +- [Loosen restriction on wildcard "*" refspecs](https://github.com/libgit2/libgit2/pull/5060) +- [Use PCRE for our fallback regex engine when regcomp_l is unavailable](https://github.com/libgit2/libgit2/pull/4935) +- [Remote URL last-chance resolution](https://github.com/libgit2/libgit2/pull/5062) +- [Skip UTF8 BOM in ignore files](https://github.com/libgit2/libgit2/pull/5075) +- [We've already added `ZLIB_LIBRARIES` to `LIBGIT2_LIBS` so don't also add the `z` library](https://github.com/libgit2/libgit2/pull/5080) +- [Define SYMBOLIC_LINK_FLAG_DIRECTORY if required](https://github.com/libgit2/libgit2/pull/5077) +- [Support symlinks for directories in win32](https://github.com/libgit2/libgit2/pull/5065) +- [rebase: orig_head and onto accessors](https://github.com/libgit2/libgit2/pull/5057) +- [cmake: correctly detect if system provides `regcomp`](https://github.com/libgit2/libgit2/pull/5063) +- [Correctly write to missing locked global config](https://github.com/libgit2/libgit2/pull/5023) +- [[RFC] util: introduce GIT_DOWNCAST macro](https://github.com/libgit2/libgit2/pull/4561) +- [examples: implement SSH authentication](https://github.com/libgit2/libgit2/pull/5051) +- [git_repository_init: stop traversing at windows root](https://github.com/libgit2/libgit2/pull/5050) +- [config_file: check result of git_array_alloc](https://github.com/libgit2/libgit2/pull/5053) +- [patch_parse.c: Handle CRLF in parse_header_start](https://github.com/libgit2/libgit2/pull/5027) +- [fix typo](https://github.com/libgit2/libgit2/pull/5045) +- [sha1: don't inline `git_hash_global_init` for win32](https://github.com/libgit2/libgit2/pull/5039) +- [ignore: treat paths with trailing "/" as directories](https://github.com/libgit2/libgit2/pull/5040) +- [Test that largefiles can be read through the tree API](https://github.com/libgit2/libgit2/pull/4874) +- [Tests for symlinked user config](https://github.com/libgit2/libgit2/pull/5034) +- [patch_parse: fix parsing addition/deletion of file with space](https://github.com/libgit2/libgit2/pull/5035) +- [Optimize string comparisons](https://github.com/libgit2/libgit2/pull/5018) +- [Negation of subdir ignore causes other subdirs to be unignored](https://github.com/libgit2/libgit2/pull/5020) +- [xdiff: fix typo](https://github.com/libgit2/libgit2/pull/5024) +- [docs: clarify relation of safe and forced checkout strategy](https://github.com/libgit2/libgit2/pull/5032) +- [Each hash implementation should define `git_hash_global_init`](https://github.com/libgit2/libgit2/pull/5026) +- [[Doc] Update URL to git2-rs](https://github.com/libgit2/libgit2/pull/5012) +- [remote: Rename git_remote_completion_type to _t](https://github.com/libgit2/libgit2/pull/5008) +- [odb: provide a free function for custom backends](https://github.com/libgit2/libgit2/pull/5005) +- [Have git_branch_lookup accept GIT_BRANCH_ALL](https://github.com/libgit2/libgit2/pull/5000) +- [Rename git_transfer_progress to git_indexer_progress](https://github.com/libgit2/libgit2/pull/4997) +- [High-level map APIs](https://github.com/libgit2/libgit2/pull/4901) +- [refdb_fs: fix loose/packed refs lookup racing with repacks](https://github.com/libgit2/libgit2/pull/4984) +- [Allocator restructuring](https://github.com/libgit2/libgit2/pull/4998) +- [cache: fix misnaming of `git_cache_free`](https://github.com/libgit2/libgit2/pull/4992) +- [examples: produce single cgit2 binary](https://github.com/libgit2/libgit2/pull/4956) +- [Remove public 'inttypes.h' header](https://github.com/libgit2/libgit2/pull/4991) +- [Prevent reading out of bounds memory](https://github.com/libgit2/libgit2/pull/4996) +- [Fix a memory leak in odb_otype_fast()](https://github.com/libgit2/libgit2/pull/4987) +- [Make stdalloc__reallocarray call stdalloc__realloc](https://github.com/libgit2/libgit2/pull/4986) +- [Remove `git_time_monotonic`](https://github.com/libgit2/libgit2/pull/4990) +- [Fix a _very_ improbable memory leak in git_odb_new()](https://github.com/libgit2/libgit2/pull/4988) +- [ci: publish documentation on merge](https://github.com/libgit2/libgit2/pull/4989) +- [Enable creation of worktree from bare repo's default branch](https://github.com/libgit2/libgit2/pull/4982) +- [Allow bypassing check for '.keep' file](https://github.com/libgit2/libgit2/pull/4965) +- [Deprecation: export the deprecated functions properly](https://github.com/libgit2/libgit2/pull/4979) +- [ci: skip ssh tests on macOS nightly](https://github.com/libgit2/libgit2/pull/4980) +- [CI build fixups](https://github.com/libgit2/libgit2/pull/4976) +- [v0.28 rc1](https://github.com/libgit2/libgit2/pull/4970) +- [Docs](https://github.com/libgit2/libgit2/pull/4968) +- [Documentation fixes](https://github.com/libgit2/libgit2/pull/4954) +- [ci: add an individual coverity pipeline](https://github.com/libgit2/libgit2/pull/4964) +- [ci: run docurium to create documentation](https://github.com/libgit2/libgit2/pull/4961) +- [ci: return coverity to the nightlies](https://github.com/libgit2/libgit2/pull/4962) +- [Clean up some warnings](https://github.com/libgit2/libgit2/pull/4950) +- [Nightlies: use `latest` docker images](https://github.com/libgit2/libgit2/pull/4869) +- [index: preserve extension parsing errors](https://github.com/libgit2/libgit2/pull/4858) +- [Deprecate functions and constants more gently](https://github.com/libgit2/libgit2/pull/4952) +- [Don't use deprecated constants](https://github.com/libgit2/libgit2/pull/4957) +- [Fix VS warning C4098: 'giterr_set_str' : void function returning a value](https://github.com/libgit2/libgit2/pull/4955) +- [Move `giterr` to `git_error`](https://github.com/libgit2/libgit2/pull/4917) +- [odb: Fix odb foreach to also close on positive error code](https://github.com/libgit2/libgit2/pull/4949) +- [repository: free memory in symlink detection function](https://github.com/libgit2/libgit2/pull/4948) +- [ci: update poxyproxy, run in quiet mode](https://github.com/libgit2/libgit2/pull/4947) +- [Add/multiply with overflow tweaks](https://github.com/libgit2/libgit2/pull/4945) +- [Improve deprecation of old enums](https://github.com/libgit2/libgit2/pull/4944) +- [Move `git_ref_t` to `git_reference_t`](https://github.com/libgit2/libgit2/pull/4939) +- [More `git_obj` to `git_object` updates](https://github.com/libgit2/libgit2/pull/4940) +- [ci: only run invasive tests in nightly](https://github.com/libgit2/libgit2/pull/4943) +- [Always build a cdecl library](https://github.com/libgit2/libgit2/pull/4930) +- [changelog: document changes since 0.27](https://github.com/libgit2/libgit2/pull/4932) +- [Fix a bunch of warnings](https://github.com/libgit2/libgit2/pull/4925) +- [mailmap: prefer ethomson@edwardthomson.com](https://github.com/libgit2/libgit2/pull/4941) +- [Convert tests/resources/push.sh to LF endings](https://github.com/libgit2/libgit2/pull/4937) +- [Get rid of some test files that were accidentally committed](https://github.com/libgit2/libgit2/pull/4936) +- [Fix crash on remote connection when GIT_PROXY_AUTO is set but no proxy is detected](https://github.com/libgit2/libgit2/pull/4934) +- [Make ENABLE_WERROR actually work](https://github.com/libgit2/libgit2/pull/4924) +- [Remove unconditional -Wno-deprecated-declaration on macOS](https://github.com/libgit2/libgit2/pull/4931) +- [Fix warning 'function': incompatible types - from 'git_cvar_value *' to 'int *' (C4133) on VS](https://github.com/libgit2/libgit2/pull/4926) +- [Fix Linux warnings](https://github.com/libgit2/libgit2/pull/4928) +- [Coverity fixes](https://github.com/libgit2/libgit2/pull/4922) +- [Shutdown callback count](https://github.com/libgit2/libgit2/pull/4919) +- [Update CRLF filtering to match modern git](https://github.com/libgit2/libgit2/pull/4904) +- [refdb_fs: refactor error handling in `refdb_reflog_fs__delete`](https://github.com/libgit2/libgit2/pull/4915) +- [Remove empty (sub-)directories when deleting refs](https://github.com/libgit2/libgit2/pull/4833) +- [Support creating annotated commits from annotated tags](https://github.com/libgit2/libgit2/pull/4910) +- [Fix segfault in loose_backend__readstream](https://github.com/libgit2/libgit2/pull/4906) +- [make proxy_stream_close close target stream even on errors](https://github.com/libgit2/libgit2/pull/4905) +- [Index API updates for consistency](https://github.com/libgit2/libgit2/pull/4807) +- [Allow merge analysis against any reference](https://github.com/libgit2/libgit2/pull/4770) +- [revwalk: Allow changing hide_cb](https://github.com/libgit2/libgit2/pull/4888) +- [Unused function warnings](https://github.com/libgit2/libgit2/pull/4895) +- [Add builtin proxy support for the http transport](https://github.com/libgit2/libgit2/pull/4870) +- [config: fix adding files if their parent directory is a file](https://github.com/libgit2/libgit2/pull/4898) +- [Allow certificate and credential callbacks to decline to act](https://github.com/libgit2/libgit2/pull/4879) +- [Fix warning C4133 incompatible types in MSVC](https://github.com/libgit2/libgit2/pull/4896) +- [index: introduce git_index_iterator](https://github.com/libgit2/libgit2/pull/4884) +- [commit: fix out-of-bound reads when parsing truncated author fields](https://github.com/libgit2/libgit2/pull/4894) +- [tests: 🌀 address two null argument instances #4847](https://github.com/libgit2/libgit2/pull/4847) +- [Some OpenSSL issues](https://github.com/libgit2/libgit2/pull/4875) +- [worktree: Expose git_worktree_add_init_options](https://github.com/libgit2/libgit2/pull/4892) +- [transport/http: Include non-default ports in Host header](https://github.com/libgit2/libgit2/pull/4882) +- [Support symlinks on Windows when core.symlinks=true](https://github.com/libgit2/libgit2/pull/4713) +- [strntol: fix out-of-bounds reads when parsing numbers with leading sign](https://github.com/libgit2/libgit2/pull/4886) +- [apply: small fixups in the test suite](https://github.com/libgit2/libgit2/pull/4885) +- [signature: fix out-of-bounds read when parsing timezone offset](https://github.com/libgit2/libgit2/pull/4883) +- [Remote creation API](https://github.com/libgit2/libgit2/pull/4667) +- [Index collision fixes](https://github.com/libgit2/libgit2/pull/4818) +- [Patch (diff) application](https://github.com/libgit2/libgit2/pull/4705) +- [smart transport: only clear url on hard reset (regression)](https://github.com/libgit2/libgit2/pull/4880) +- [Tree parsing fixes](https://github.com/libgit2/libgit2/pull/4871) +- [CI: Fix macOS leak detection](https://github.com/libgit2/libgit2/pull/4860) +- [README: more CI status badges](https://github.com/libgit2/libgit2/pull/4800) +- [ci: Fix some minor issues](https://github.com/libgit2/libgit2/pull/4867) +- [Object parse fixes](https://github.com/libgit2/libgit2/pull/4864) +- [Windows CI: fail build on test failure](https://github.com/libgit2/libgit2/pull/4862) +- [ci: run all the jobs during nightly builds](https://github.com/libgit2/libgit2/pull/4863) +- [strtol removal](https://github.com/libgit2/libgit2/pull/4851) +- [ buf::oom tests: use custom allocator for oom failures](https://github.com/libgit2/libgit2/pull/4854) +- [ci: arm docker builds](https://github.com/libgit2/libgit2/pull/4804) +- [Win32 path canonicalization refactoring](https://github.com/libgit2/libgit2/pull/4852) +- [Check object existence when creating a tree from an index](https://github.com/libgit2/libgit2/pull/4840) +- [Ninja build](https://github.com/libgit2/libgit2/pull/4841) +- [docs: fix transparent/opaque confusion in the conventions file](https://github.com/libgit2/libgit2/pull/4853) +- [Configuration variables can appear on the same line as the section header](https://github.com/libgit2/libgit2/pull/4819) +- [path: export the dotgit-checking functions](https://github.com/libgit2/libgit2/pull/4849) +- [cmake: correct comment from libssh to libssh2](https://github.com/libgit2/libgit2/pull/4850) +- [Object parsing fuzzer](https://github.com/libgit2/libgit2/pull/4845) +- [config: Port config_file_fuzzer to the new in-memory backend.](https://github.com/libgit2/libgit2/pull/4842) +- [Add some more tests for git_futils_rmdir_r and some cleanup](https://github.com/libgit2/libgit2/pull/4828) +- [diff_stats: use git's formatting of renames with common directories](https://github.com/libgit2/libgit2/pull/4830) +- [ignore unsupported http authentication contexts](https://github.com/libgit2/libgit2/pull/4839) +- [submodule: ignore path and url attributes if they look like options](https://github.com/libgit2/libgit2/pull/4837) +- [Smart packet security fixes](https://github.com/libgit2/libgit2/pull/4836) +- [config_file: properly ignore includes without "path" value](https://github.com/libgit2/libgit2/pull/4832) +- [int-conversion](https://github.com/libgit2/libgit2/pull/4831) +- [cmake: enable new quoted argument policy CMP0054](https://github.com/libgit2/libgit2/pull/4829) +- [fix check if blob is uninteresting when inserting tree to packbuilder](https://github.com/libgit2/libgit2/pull/4824) +- [Documentation fixups](https://github.com/libgit2/libgit2/pull/4827) +- [CI: refactoring](https://github.com/libgit2/libgit2/pull/4812) +- [In-memory configuration](https://github.com/libgit2/libgit2/pull/4767) +- [Some warnings](https://github.com/libgit2/libgit2/pull/4784) +- [index: release the snapshot instead of freeing the index](https://github.com/libgit2/libgit2/pull/4803) +- [online::clone: free url and username before resetting](https://github.com/libgit2/libgit2/pull/4816) +- [git_remote_prune to be O(n * logn)](https://github.com/libgit2/libgit2/pull/4794) +- [Rename "VSTS" to "Azure DevOps" and "Azure Pipelines"](https://github.com/libgit2/libgit2/pull/4813) +- [cmake: enable -Wformat and -Wformat-security](https://github.com/libgit2/libgit2/pull/4810) +- [Fix revwalk limiting regression](https://github.com/libgit2/libgit2/pull/4809) +- [path validation: `char` is not signed by default.](https://github.com/libgit2/libgit2/pull/4805) +- [revwalk: refer the sorting modes more to git's options](https://github.com/libgit2/libgit2/pull/4811) +- [Clar XML output redux](https://github.com/libgit2/libgit2/pull/4778) +- [remote: store the connection data in a private struct](https://github.com/libgit2/libgit2/pull/4785) +- [docs: clarify and include licenses of dependencies](https://github.com/libgit2/libgit2/pull/4789) +- [config_file: fix quadratic behaviour when adding config multivars](https://github.com/libgit2/libgit2/pull/4799) +- [config: Fix a leak parsing multi-line config entries](https://github.com/libgit2/libgit2/pull/4792) +- [Prevent heap-buffer-overflow](https://github.com/libgit2/libgit2/pull/4797) +- [ci: remove travis](https://github.com/libgit2/libgit2/pull/4790) +- [Update VSTS YAML files with the latest syntax](https://github.com/libgit2/libgit2/pull/4791) +- [Documentation fixes](https://github.com/libgit2/libgit2/pull/4788) +- [config: convert unbounded recursion into a loop](https://github.com/libgit2/libgit2/pull/4781) +- [Document giterr_last() use only after error. #4772](https://github.com/libgit2/libgit2/pull/4773) +- [util: make the qsort_r check work on macOS](https://github.com/libgit2/libgit2/pull/4765) +- [fuzzer: update for indexer changes](https://github.com/libgit2/libgit2/pull/4782) +- [tree: accept null ids in existing trees when updating](https://github.com/libgit2/libgit2/pull/4727) +- [Pack file verification](https://github.com/libgit2/libgit2/pull/4374) +- [cmake: detect and use libc-provided iconv](https://github.com/libgit2/libgit2/pull/4777) +- [Coverity flavored clang analyzer fixes](https://github.com/libgit2/libgit2/pull/4774) +- [tests: verify adding index conflicts with invalid filemodes fails](https://github.com/libgit2/libgit2/pull/4776) +- [worktree: unlock should return 1 when the worktree isn't locked](https://github.com/libgit2/libgit2/pull/4769) +- [Add a fuzzer for config files](https://github.com/libgit2/libgit2/pull/4752) +- [Fix 'invalid packet line' for ng packets containing errors](https://github.com/libgit2/libgit2/pull/4763) +- [Fix leak in index.c](https://github.com/libgit2/libgit2/pull/4768) +- [threads::diff: use separate git_repository objects](https://github.com/libgit2/libgit2/pull/4754) +- [travis: remove Coverity cron job](https://github.com/libgit2/libgit2/pull/4766) +- [parse: Do not initialize the content in context to NULL](https://github.com/libgit2/libgit2/pull/4749) +- [config_file: Don't crash on options without a section](https://github.com/libgit2/libgit2/pull/4750) +- [ci: Correct the status code check so Coverity doesn't force-fail Travis](https://github.com/libgit2/libgit2/pull/4764) +- [ci: remove appveyor](https://github.com/libgit2/libgit2/pull/4760) +- [diff: fix OOM on AIX when finding similar deltas in empty diff](https://github.com/libgit2/libgit2/pull/4761) +- [travis: do not execute Coverity analysis for all cron jobs](https://github.com/libgit2/libgit2/pull/4755) +- [ci: enable compilation with "-Werror"](https://github.com/libgit2/libgit2/pull/4759) +- [smart_pkt: fix potential OOB-read when processing ng packet](https://github.com/libgit2/libgit2/pull/4758) +- [Fix a double-free in config parsing](https://github.com/libgit2/libgit2/pull/4751) +- [Fuzzers](https://github.com/libgit2/libgit2/pull/4728) +- [ci: run VSTS builds on master and maint branches](https://github.com/libgit2/libgit2/pull/4746) +- [Windows: default credentials / fallback credential handling](https://github.com/libgit2/libgit2/pull/4743) +- [ci: add VSTS build badge to README](https://github.com/libgit2/libgit2/pull/4745) +- [ci: set PKG_CONFIG_PATH for travis](https://github.com/libgit2/libgit2/pull/4744) +- [CI: Refactor and introduce VSTS builds](https://github.com/libgit2/libgit2/pull/4723) +- [revwalk: remove tautologic condition for hiding a commit](https://github.com/libgit2/libgit2/pull/4742) +- [winhttp: retry erroneously failing requests](https://github.com/libgit2/libgit2/pull/4731) +- [Add a configurable limit to the max pack size that will be indexed](https://github.com/libgit2/libgit2/pull/4721) +- [mbedtls: remove unused variable "cacert"](https://github.com/libgit2/libgit2/pull/4739) +- [Squash some leaks](https://github.com/libgit2/libgit2/pull/4732) +- [Add a checkout example](https://github.com/libgit2/libgit2/pull/4692) +- [Assorted Coverity fixes](https://github.com/libgit2/libgit2/pull/4702) +- [Remove GIT_PKT_PACK entirely](https://github.com/libgit2/libgit2/pull/4704) +- [ ignore: improve `git_ignore_path_is_ignored` description Git analogy](https://github.com/libgit2/libgit2/pull/4722) +- [alloc: don't overwrite allocator during init if set](https://github.com/libgit2/libgit2/pull/4724) +- [C90 standard compliance](https://github.com/libgit2/libgit2/pull/4700) +- [Delta OOB access](https://github.com/libgit2/libgit2/pull/4719) +- [Release v0.27.3](https://github.com/libgit2/libgit2/pull/4717) +- [streams: report OpenSSL errors if global init fails](https://github.com/libgit2/libgit2/pull/4710) +- [patch_parse: populate line numbers while parsing diffs](https://github.com/libgit2/libgit2/pull/4687) +- [Fix git_worktree_validate failing on bare repositories](https://github.com/libgit2/libgit2/pull/4686) +- [git_refspec_transform: Handle NULL dst](https://github.com/libgit2/libgit2/pull/4699) +- [Add a "dirty" state to the index when it has unsaved changes](https://github.com/libgit2/libgit2/pull/4536) +- [refspec: rename `git_refspec__free` to `git_refspec__dispose`](https://github.com/libgit2/libgit2/pull/4709) +- [streams: openssl: Handle error in SSL_CTX_new](https://github.com/libgit2/libgit2/pull/4701) +- [refspec: add public parsing api](https://github.com/libgit2/libgit2/pull/4519) +- [Fix interaction between limited flag and sorting over resets](https://github.com/libgit2/libgit2/pull/4688) +- [deps: fix implicit fallthrough warning in http-parser](https://github.com/libgit2/libgit2/pull/4691) +- [Fix assorted leaks found via fuzzing](https://github.com/libgit2/libgit2/pull/4698) +- [Fix type confusion in git_smart__connect](https://github.com/libgit2/libgit2/pull/4695) +- [Verify ref_pkt's are long enough](https://github.com/libgit2/libgit2/pull/4696) +- [Config parser cleanups](https://github.com/libgit2/libgit2/pull/4411) +- [Fix last references to deprecated git_buf_free](https://github.com/libgit2/libgit2/pull/4685) +- [revwalk: avoid walking the entire history when output is unsorted](https://github.com/libgit2/libgit2/pull/4606) +- [Add mailmap support.](https://github.com/libgit2/libgit2/pull/4586) +- [tree: remove unused functions](https://github.com/libgit2/libgit2/pull/4683) +- [Link `mbedTLS` libraries in when `SHA1_BACKEND` == "mbedTLS"](https://github.com/libgit2/libgit2/pull/4678) +- [editorconfig: allow trailing whitespace in markdown](https://github.com/libgit2/libgit2/pull/4676) +- [docs: fix statement about tab width](https://github.com/libgit2/libgit2/pull/4681) +- [diff: fix enum value being out of allowed range](https://github.com/libgit2/libgit2/pull/4680) +- [pack: rename `git_packfile_stream_free`](https://github.com/libgit2/libgit2/pull/4436) +- [Stop leaking the memory](https://github.com/libgit2/libgit2/pull/4677) +- [Bugfix release v0.27.2](https://github.com/libgit2/libgit2/pull/4632) +- [Fix stash save bug with fast path index check](https://github.com/libgit2/libgit2/pull/4668) +- [path: unify `git_path_is_*` APIs](https://github.com/libgit2/libgit2/pull/4662) +- [Fix negative gitignore rules with leading directories ](https://github.com/libgit2/libgit2/pull/4670) +- [Custom memory allocators](https://github.com/libgit2/libgit2/pull/4576) +- [index: Fix alignment issues in write_disk_entry()](https://github.com/libgit2/libgit2/pull/4655) +- [travis: war on leaks](https://github.com/libgit2/libgit2/pull/4558) +- [refdb_fs: fix regression: failure when globbing for non-existant references](https://github.com/libgit2/libgit2/pull/4665) +- [tests: submodule: do not rely on config iteration order](https://github.com/libgit2/libgit2/pull/4673) +- [Detect duplicated submodules for the same path](https://github.com/libgit2/libgit2/pull/4641) +- [Fix docurium missing includes](https://github.com/libgit2/libgit2/pull/4530) +- [github: update issue template](https://github.com/libgit2/libgit2/pull/4627) +- [streams: openssl: add missing check on OPENSSL_LEGACY_API](https://github.com/libgit2/libgit2/pull/4661) +- [mbedtls: don't require mbedtls from our pkgconfig file](https://github.com/libgit2/libgit2/pull/4656) +- [Fixes for CVE 2018-11235](https://github.com/libgit2/libgit2/pull/4660) +- [Backport fixes for CVE 2018-11235](https://github.com/libgit2/libgit2/pull/4659) +- [Added note about Windows junction points to the differences from git document](https://github.com/libgit2/libgit2/pull/4653) +- [cmake: resolve libraries found by pkg-config ](https://github.com/libgit2/libgit2/pull/4642) +- [refdb_fs: enhance performance of globbing](https://github.com/libgit2/libgit2/pull/4629) +- [global: adjust init count under lock](https://github.com/libgit2/libgit2/pull/4645) +- [Fix GCC 8.1 warnings](https://github.com/libgit2/libgit2/pull/4646) +- [Worktrees can be made from bare repositories](https://github.com/libgit2/libgit2/pull/4630) +- [docs: add documentation to state differences from the git cli](https://github.com/libgit2/libgit2/pull/4605) +- [Sanitize the hunk header to ensure it contains UTF-8 valid data](https://github.com/libgit2/libgit2/pull/4542) +- [examples: ls-files: add ls-files to list paths in the index](https://github.com/libgit2/libgit2/pull/4380) +- [OpenSSL legacy API cleanups](https://github.com/libgit2/libgit2/pull/4608) +- [worktree: add functions to get name and path](https://github.com/libgit2/libgit2/pull/4640) +- [Fix deletion of unrelated branch on worktree](https://github.com/libgit2/libgit2/pull/4633) +- [mbedTLS support](https://github.com/libgit2/libgit2/pull/4173) +- [Configuration entry iteration in order](https://github.com/libgit2/libgit2/pull/4525) +- [blame_git: fix coalescing step never being executed](https://github.com/libgit2/libgit2/pull/4580) +- [Fix leaks in master](https://github.com/libgit2/libgit2/pull/4636) +- [Leak fixes for v0.27.1](https://github.com/libgit2/libgit2/pull/4635) +- [worktree: Read worktree specific reflog for HEAD](https://github.com/libgit2/libgit2/pull/4577) +- [fixed stack smashing due to wrong size of struct stat on the stack](https://github.com/libgit2/libgit2/pull/4631) +- [scripts: add backporting script](https://github.com/libgit2/libgit2/pull/4476) +- [worktree: add ability to create worktree with pre-existing branch](https://github.com/libgit2/libgit2/pull/4524) +- [refs: preserve the owning refdb when duping reference](https://github.com/libgit2/libgit2/pull/4618) +- [Submodules-API should report .gitmodules parse errors instead of ignoring them](https://github.com/libgit2/libgit2/pull/4522) +- [Typedef git_pkt_type and clarify recv_pkt return type](https://github.com/libgit2/libgit2/pull/4514) +- [online::clone: validate user:pass in HTTP_PROXY](https://github.com/libgit2/libgit2/pull/4556) +- [ transports: ssh: disconnect session before freeing it ](https://github.com/libgit2/libgit2/pull/4596) +- [revwalk: fix uninteresting revs sometimes not limiting graphwalk](https://github.com/libgit2/libgit2/pull/4622) +- [attr_file: fix handling of directory patterns with trailing spaces](https://github.com/libgit2/libgit2/pull/4614) +- [transports: local: fix assert when fetching into repo with symrefs](https://github.com/libgit2/libgit2/pull/4613) +- [remote/proxy: fix git_transport_certificate_check_db description](https://github.com/libgit2/libgit2/pull/4597) +- [Flag options in describe.h as being optional](https://github.com/libgit2/libgit2/pull/4587) +- [diff: Add missing GIT_DELTA_TYPECHANGE -> 'T' mapping.](https://github.com/libgit2/libgit2/pull/4611) +- [appveyor: fix typo in registry key to disable DHE](https://github.com/libgit2/libgit2/pull/4609) +- [Fix build with LibreSSL 2.7](https://github.com/libgit2/libgit2/pull/4607) +- [appveyor: workaround for intermittent test failures](https://github.com/libgit2/libgit2/pull/4603) +- [sha1dc: update to fix errors with endianess](https://github.com/libgit2/libgit2/pull/4601) +- [submodule: check index for path and prefix before adding submodule](https://github.com/libgit2/libgit2/pull/4378) +- [odb: mempack: fix leaking objects when freeing mempacks](https://github.com/libgit2/libgit2/pull/4602) +- [types: remove unused git_merge_result](https://github.com/libgit2/libgit2/pull/4598) +- [checkout: change default strategy to SAFE](https://github.com/libgit2/libgit2/pull/4531) +- [Add myself to git.git-authors](https://github.com/libgit2/libgit2/pull/4570) + + +## v0.25.0-alpha.16 [(2019-07-23)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.16) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.15...v0.25.0-alpha.16) + +#### Summary of changes +- Adds support for Node 12 +- Updates lodash dependency to address security notice +- Expose Tree.prototype.createUpdated(repo, numUpdates, updates) +- Bumps libgit2 + - Fixes gitignore issue with pattern negation + - Remote.list now gets the correct list of remotes if remotes are changed by external process + +#### Merged PRs into NodeGit +- [Bump libgit2 #1705](https://github.com/nodegit/nodegit/pull/1705) +- [Fix Tree#createUpdated #1704](https://github.com/nodegit/nodegit/pull/1704) +- [Fix failing tests on CI #1703](https://github.com/nodegit/nodegit/pull/1703) +- [Audit lodash and fix package-lock.json #1702](https://github.com/nodegit/nodegit/pull/1702) +- [Implement support for Node 12 #1696](https://github.com/nodegit/nodegit/pull/1696) + +#### Merged PRs into LibGit2 +- [config_file: refresh when creating an iterator #5181](https://github.com/libgit2/libgit2/pull/5181) +- [azure: drop powershell #5141](https://github.com/libgit2/libgit2/pull/5141) +- [fuzzer: use futils instead of fileops #5180](https://github.com/libgit2/libgit2/pull/5180) +- [w32: fix unlinking of directory symlinks #5151](https://github.com/libgit2/libgit2/pull/5151) +- [patch_parse: fix segfault due to line containing static contents #5179](https://github.com/libgit2/libgit2/pull/5179) +- [ignore: fix determining whether a shorter pattern negates another #5173](https://github.com/libgit2/libgit2/pull/5173) +- [patch_parse: handle missing newline indicator in old file #5159](https://github.com/libgit2/libgit2/pull/5159) +- [patch_parse: do not depend on parsed buffer's lifetime #5158](https://github.com/libgit2/libgit2/pull/5158) +- [sha1: fix compilation of WinHTTP backend #5174](https://github.com/libgit2/libgit2/pull/5174) +- [repository: do not initialize HEAD if it's provided by templates #5176](https://github.com/libgit2/libgit2/pull/5176) +- [configuration: cvar -> configmap #5138](https://github.com/libgit2/libgit2/pull/5138) +- [Evict cache items more efficiently #5172](https://github.com/libgit2/libgit2/pull/5172) +- [clar: fix suite count #5175](https://github.com/libgit2/libgit2/pull/5175) +- [Ignore VS2017 specific files and folders #5163](https://github.com/libgit2/libgit2/pull/5163) +- [gitattributes: ignore macros defined in subdirectories #5156](https://github.com/libgit2/libgit2/pull/5156) +- [clar: correctly account for "data" suites when counting #5168](https://github.com/libgit2/libgit2/pull/5168) +- [Allocate memory more efficiently when packing objects #5170](https://github.com/libgit2/libgit2/pull/5170) +- [fileops: fix creation of directory in filesystem root #5131](https://github.com/libgit2/libgit2/pull/5131) +- [win32: fix fuzzers and have CI build them #5160](https://github.com/libgit2/libgit2/pull/5160) +- [Config parser separation #5134](https://github.com/libgit2/libgit2/pull/5134) +- [config_file: implement stat cache to avoid repeated rehashing #5132](https://github.com/libgit2/libgit2/pull/5132) +- [ci: build with ENABLE_WERROR on Windows #5143](https://github.com/libgit2/libgit2/pull/5143) +- [Fix Regression: attr: Correctly load system attr file (on Windows) #5152](https://github.com/libgit2/libgit2/pull/5152) +- [hash: fix missing error return on production builds #5145](https://github.com/libgit2/libgit2/pull/5145) +- [Resolve static check warnings in example code #5142](https://github.com/libgit2/libgit2/pull/5142) +- [Multiple hash algorithms #4438](https://github.com/libgit2/libgit2/pull/4438) +- [More documentation #5128](https://github.com/libgit2/libgit2/pull/5128) +- [Incomplete commondir support #4967](https://github.com/libgit2/libgit2/pull/4967) +- [Remove warnings #5078](https://github.com/libgit2/libgit2/pull/5078) +- [Re-run flaky tests #5140](https://github.com/libgit2/libgit2/pull/5140) + + +## v0.25.0-alpha.15 [(2019-07-15)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.15) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.14...v0.25.0-alpha.15) + +#### Summary of changes +- Removed NSEC optimization due to performance regressions in repositories that did not use NSEC optimization cloned via NodeGit. + +#### Merged PRs into NodeGit +- [Remove NSEC #1699](https://github.com/nodegit/nodegit/pull/1699) + + +## v0.25.0-alpha.14 [(2019-07-01)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.14) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.13...v0.25.0-alpha.14) + +#### Summary of changes +- Always use builtin regex for linux for portability + +#### Merged PRs into NodeGit +- [Use builtin regex library for linux for better portability #1693](https://github.com/nodegit/nodegit/pull/1693) +- [Remove pcre-config from binding.gyp #1694](https://github.com/nodegit/nodegit/pull/1694) + +## v0.25.0-alpha.13 [(2019-06-26)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.13) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.12...v0.25.0-alpha.13) + +#### Summary of changes +- Turn on GIT_USE_NSEC on all platforms +- Use Iconv on OSX for better internationalization support. +- Bump libgit2 to bring in: + - NTLM proxy support + - Negotiate/Kerberos proxy support + - Various git config fixes + - Various git ignore fixes + - Various libgit2 performance improvements + - Windows/Linux now use PCRE for regex, OSX uses regcomp_l, this should address collation issues in diffing +- Fixed bug with Repository.prototype.refreshReferences dying on corrupted reference. We now ignore corrupted references + +#### Merged PRs into NodeGit +- [refresh_references.cc: skip refs that can't be directly resolved #1689](https://github.com/nodegit/nodegit/pull/1689) +- [Bump libgit2 to fork of latest master #1690](https://github.com/nodegit/nodegit/pull/1690) + +#### Merged PRs into LibGit2 +- [errors: use lowercase](https://github.com/libgit2/libgit2/pull/5137) +- [largefile tests: only write 2GB on 32-bit platforms](https://github.com/libgit2/libgit2/pull/5136) +- [Fix broken link in README](https://github.com/libgit2/libgit2/pull/5129) +- [net: remove unused `git_headlist_cb`](https://github.com/libgit2/libgit2/pull/5122) +- [cmake: default NTLM client to off if no HTTPS support](https://github.com/libgit2/libgit2/pull/5124) +- [attr: rename constants and macros for consistency](https://github.com/libgit2/libgit2/pull/5119) +- [Change API instances of `fromnoun` to `from_noun` (with an underscore)](https://github.com/libgit2/libgit2/pull/5117) +- [object: rename git_object__size to git_object_size](https://github.com/libgit2/libgit2/pull/5118) +- [Replace fnmatch with wildmatch](https://github.com/libgit2/libgit2/pull/5110) +- [Documentation fixes](https://github.com/libgit2/libgit2/pull/5111) +- [Removal of `p_fallocate`](https://github.com/libgit2/libgit2/pull/5114) +- [Modularize our TLS & hash detection](https://github.com/libgit2/libgit2/pull/5055) +- [tests: merge::analysis: use test variants to avoid duplicated test suites](https://github.com/libgit2/libgit2/pull/5109) +- [Rename options initialization functions](https://github.com/libgit2/libgit2/pull/5101) +- [deps: ntlmclient: disable implicit fallthrough warnings](https://github.com/libgit2/libgit2/pull/5112) +- [gitignore with escapes](https://github.com/libgit2/libgit2/pull/5097) +- [Handle URLs with a colon after host but no port](https://github.com/libgit2/libgit2/pull/5108) +- [Merge analysis support for bare repos](https://github.com/libgit2/libgit2/pull/5022) +- [Add memleak check docs](https://github.com/libgit2/libgit2/pull/5104) +- [Data-driven tests](https://github.com/libgit2/libgit2/pull/5098) +- [sha1dc: update to fix endianess issues on AIX/HP-UX](https://github.com/libgit2/libgit2/pull/5107) +- [Add NTLM support for HTTP(s) servers and proxies](https://github.com/libgit2/libgit2/pull/5052) +- [Callback type names should be suffixed with `_cb`](https://github.com/libgit2/libgit2/pull/5102) +- [tests: checkout: fix symlink.git being created outside of sandbox](https://github.com/libgit2/libgit2/pull/5099) +- [ignore: handle escaped trailing whitespace](https://github.com/libgit2/libgit2/pull/5095) +- [Ignore: only treat one leading slash as a root identifier](https://github.com/libgit2/libgit2/pull/5074) +- [online tests: use gitlab for auth failures](https://github.com/libgit2/libgit2/pull/5094) +- [Ignore files: don't ignore whitespace](https://github.com/libgit2/libgit2/pull/5076) +- [cache: fix cache eviction using deallocated key](https://github.com/libgit2/libgit2/pull/5088) +- [SECURITY.md: split out security-relevant bits from readme](https://github.com/libgit2/libgit2/pull/5085) +- [Restore NetBSD support](https://github.com/libgit2/libgit2/pull/5086) +- [repository: fix garbage return value](https://github.com/libgit2/libgit2/pull/5084) +- [cmake: disable fallthrough warnings for PCRE](https://github.com/libgit2/libgit2/pull/5083) +- [Configuration parsing: validate section headers with quotes](https://github.com/libgit2/libgit2/pull/5073) +- [Loosen restriction on wildcard "*" refspecs](https://github.com/libgit2/libgit2/pull/5060) +- [Use PCRE for our fallback regex engine when regcomp_l is unavailable](https://github.com/libgit2/libgit2/pull/4935) +- [Remote URL last-chance resolution](https://github.com/libgit2/libgit2/pull/5062) +- [Skip UTF8 BOM in ignore files](https://github.com/libgit2/libgit2/pull/5075) +- [We've already added `ZLIB_LIBRARIES` to `LIBGIT2_LIBS` so don't also add the `z` library](https://github.com/libgit2/libgit2/pull/5080) +- [Define SYMBOLIC_LINK_FLAG_DIRECTORY if required](https://github.com/libgit2/libgit2/pull/5077) +- [Support symlinks for directories in win32](https://github.com/libgit2/libgit2/pull/5065) +- [rebase: orig_head and onto accessors](https://github.com/libgit2/libgit2/pull/5057) +- [cmake: correctly detect if system provides `regcomp`](https://github.com/libgit2/libgit2/pull/5063) +- [Correctly write to missing locked global config](https://github.com/libgit2/libgit2/pull/5023) +- [[RFC] util: introduce GIT_DOWNCAST macro](https://github.com/libgit2/libgit2/pull/4561) +- [examples: implement SSH authentication](https://github.com/libgit2/libgit2/pull/5051) +- [git_repository_init: stop traversing at windows root](https://github.com/libgit2/libgit2/pull/5050) +- [config_file: check result of git_array_alloc](https://github.com/libgit2/libgit2/pull/5053) +- [patch_parse.c: Handle CRLF in parse_header_start](https://github.com/libgit2/libgit2/pull/5027) +- [fix typo](https://github.com/libgit2/libgit2/pull/5045) +- [sha1: don't inline `git_hash_global_init` for win32](https://github.com/libgit2/libgit2/pull/5039) +- [ignore: treat paths with trailing "/" as directories](https://github.com/libgit2/libgit2/pull/5040) +- [Test that largefiles can be read through the tree API](https://github.com/libgit2/libgit2/pull/4874) +- [Tests for symlinked user config](https://github.com/libgit2/libgit2/pull/5034) +- [patch_parse: fix parsing addition/deletion of file with space](https://github.com/libgit2/libgit2/pull/5035) +- [Optimize string comparisons](https://github.com/libgit2/libgit2/pull/5018) +- [Negation of subdir ignore causes other subdirs to be unignored](https://github.com/libgit2/libgit2/pull/5020) +- [xdiff: fix typo](https://github.com/libgit2/libgit2/pull/5024) +- [docs: clarify relation of safe and forced checkout strategy](https://github.com/libgit2/libgit2/pull/5032) +- [Each hash implementation should define `git_hash_global_init`](https://github.com/libgit2/libgit2/pull/5026) +- [[Doc] Update URL to git2-rs](https://github.com/libgit2/libgit2/pull/5012) +- [remote: Rename git_remote_completion_type to _t](https://github.com/libgit2/libgit2/pull/5008) +- [odb: provide a free function for custom backends](https://github.com/libgit2/libgit2/pull/5005) +- [Have git_branch_lookup accept GIT_BRANCH_ALL](https://github.com/libgit2/libgit2/pull/5000) +- [Rename git_transfer_progress to git_indexer_progress](https://github.com/libgit2/libgit2/pull/4997) +- [High-level map APIs](https://github.com/libgit2/libgit2/pull/4901) +- [refdb_fs: fix loose/packed refs lookup racing with repacks](https://github.com/libgit2/libgit2/pull/4984) +- [Allocator restructuring](https://github.com/libgit2/libgit2/pull/4998) +- [cache: fix misnaming of `git_cache_free`](https://github.com/libgit2/libgit2/pull/4992) +- [examples: produce single cgit2 binary](https://github.com/libgit2/libgit2/pull/4956) +- [Remove public 'inttypes.h' header](https://github.com/libgit2/libgit2/pull/4991) +- [Prevent reading out of bounds memory](https://github.com/libgit2/libgit2/pull/4996) +- [Fix a memory leak in odb_otype_fast()](https://github.com/libgit2/libgit2/pull/4987) +- [Make stdalloc__reallocarray call stdalloc__realloc](https://github.com/libgit2/libgit2/pull/4986) +- [Remove `git_time_monotonic`](https://github.com/libgit2/libgit2/pull/4990) +- [Fix a _very_ improbable memory leak in git_odb_new()](https://github.com/libgit2/libgit2/pull/4988) +- [ci: publish documentation on merge](https://github.com/libgit2/libgit2/pull/4989) +- [Enable creation of worktree from bare repo's default branch](https://github.com/libgit2/libgit2/pull/4982) +- [Allow bypassing check for '.keep' file](https://github.com/libgit2/libgit2/pull/4965) +- [Release v0.28.1](https://github.com/libgit2/libgit2/pull/4983) + + + +## v0.25.0-alpha.12 [(2019-06-03)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.12) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.11...v0.25.0-alpha.12) + +#### Summary of changes +- Fix bug in Repository.prototype.refreshReferences where new remote references from a new remote added/fetched on a separte repo instance do not show up in the result. +- Fixed a prototype problem with cherrypick, merge, and other collections that have a function at their root. call, apply, and bind should now be on NodeGit.Cherrypick. +- Bumped libssh2 to resolve security notice. + +#### Merged PRs into NodeGit +- [Bump libssh2 to 1.8.2 and fix some npm audit warnings #1678](https://github.com/nodegit/nodegit/pull/1678) +- [Root functions should keep their function prototypes correctly #1681](https://github.com/nodegit/nodegit/pull/1681) +- [refresh_references.cc: bust LibGit2 remote list cache by reading config #1685](https://github.com/nodegit/nodegit/pull/1685) + + +## v0.25.0-alpha.11 [(2019-05-20)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.11) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.10...v0.25.0-alpha.11) + +#### Summary of changes +- Improve speed and correctness of fileHistoryWalk. The API should not have changed; however, when the end of the walk has been reached, `reachedEndOfHistory` will be specified on the resulting array. + +#### Merged PRs into NodeGit +- [Implement faster file history walk #1676](https://github.com/nodegit/nodegit/pull/1676) + + +## v0.25.0-alpha.10 [(2019-05-03)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.10) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.9...v0.25.0-alpha.10) + +#### Summary of changes +- Drops support for Ubuntu 14 after EOL +- Fixes openssl prebuilt downloads for electron builds +- Fixes commits retrieved from Commit.prototype.parent +- *DEPRECATION* Support signing commits in Repository.prototype.mergeBranches. The last parameter `processMergeMessageCallback` is now deprecated, but will continue to work. Use the options object instead, which will contain the `processMergeMessageCallback`, as well as the `signingCb`. +- Bump Node-Gyp to 4.0.0 to fix tar security vulnerability +- *BREAKING* `getRemotes` no longer returns remote names, it now returns remote objects directly. Use `getRemoteNames` to get a list of remote names. +- Optimized a set of routines in NodeGit. These methods as written in Javascript require hundreds or thousands of requests to async workers to retrieve data. We've batched these requests and performed them on a single async worker. There are now native implementations of the following: + - Repository.prototype.getReferences: Retrieves all references on async worker. + - Repository.prototype.getRemotes: Retrieves all remotes on async worker. + - Repository.prototype.getSubmodules: Retrieves all submodules on async worker. + - Repository.prototype.refreshReferences: Open sourced function from GitKraken. Grabs a lot of information about references on an async worker. + - Revwalk.prototype.commitWalk: Retrieves up to N commits from a revwalk on an async worker. + +#### Merged PRs into NodeGit +- [EOL for Node 6 and Ubuntu 14.04 #1649](https://github.com/nodegit/nodegit/pull/1649) +- [Ensures that commits from parent(*) has a repository #1658](https://github.com/nodegit/nodegit/pull/1658) +- [Update openssl conan distributions #1663](https://github.com/nodegit/nodegit/pull/1663) +- [Support signing in Repository#mergeBranches #1664](https://github.com/nodegit/nodegit/pull/1664) +- [Dependency upgrade node-gyp upgraded to 4.0.0 #1672](https://github.com/nodegit/nodegit/pull/1672) +- [Add additional getters to streamline information gathering (breaking change) #1671](https://github.com/nodegit/nodegit/pull/1671) + + + +## v0.25.0-alpha.9 [(2019-03-04)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.9) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.8...v0.25.0-alpha.9) + +#### Summary of changes +- Removed access to the diff_so_far param in git_diff_notify_cb and git_diff_progress_cb +- Changed FilterSource.prototype.repo to async to prevent segfaults on filters that run during Submodule.status +- Clean up deprecation messages to inform users of what was deprecated, not just what users should switch to +- When installing on a machine that has yarn and does not have npm, the preinstall script should succeed now +- ceiling_dirs is now an optional parameter to Repository.discover + +#### Merged PRs into NodeGit +- [Clean up some dangerous memory accesses in callbacks #1642](https://github.com/nodegit/nodegit/pull/1642) +- [Output the item that was deprecated when giving deprecation notice #1643](https://github.com/nodegit/nodegit/pull/1643) +- [Don't fail yarn installs when we can't find npm #1644](https://github.com/nodegit/nodegit/pull/1644) +- [`ceiling_dirs` parameter in `Repository.discover` is optional #1245](https://github.com/nodegit/nodegit/pull/1245) + + +## v0.25.0-alpha.8 [(2019-02-27)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.8) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.7...v0.25.0-alpha.8) + +#### Summary of changes +- Fixed segfault in NodeGit.Merge.analysis and NodeGit.Merge.analysisForRef + +#### Merged PRs into NodeGit +- [Add missing `shouldAlloc` declarations for git_merge_analysis* functions #1641](https://github.com/nodegit/nodegit/pull/1641) + + +## v0.25.0-alpha.7 [(2019-02-20)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.7) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.6...v0.25.0-alpha.7) + +#### Summary of changes +- Fixed bug where repeated uses of extractSignature would fail because of the use of regex.prototype.match +- Added support for building on IBM i (PASE) machines +- Fixed bug where signingCb in rebases would not return error codes to LibGit2 if the signingCb threw or rejected +- Exposed AnnotatedCommit methods: + - AnnotatedCommit.prototype.ref +- Exposed Apply methods: + - Apply.apply applies a diff to the repository + - Apply.toTree applies a diff to a tree +- Exposed Config methods: + - Config.prototype.deleteEntry + - Config.prototype.deleteMultivar + - Config.prototype.getBool + - Config.prototype.getInt32 + - Config.prototype.getInt64 + - Config.prototype.setMultivar + - Config.prototype.snapshot +- Exposed ConfigIterator with methods: + - ConfigIterator.create + - ConfigIterator.createGlob + - ConfigIterator.createMultivar + - ConfigIterator.prototype.next +- Exposed Merge methods: + - Merge.analysis + - Merge.analysisForRef +- Expose Remote methods: + - Remote.createWithOpts + +#### Merged PRs into NodeGit +- [Fix regex state causing subsequent runs of Tag.extractSignature to fail #1630](https://github.com/nodegit/nodegit/pull/1630) +- [Update LibGit2 docs to v0.28.0 #1631](https://github.com/nodegit/nodegit/pull/1631) +- [Add support for building on IBM i (PASE) #1634](https://github.com/nodegit/nodegit/pull/1634) +- [Expose more config methods #1635](https://github.com/nodegit/nodegit/pull/1635) +- [Catch errors and pass them to libgit2 as error codes in rebase signingcb #1636](https://github.com/nodegit/nodegit/pull/1636) +- [Simplify check for IBM i operating system #1637](https://github.com/nodegit/nodegit/pull/1637) +- [Bump LibGit2 to fork of v0.28.1 #1638](https://github.com/nodegit/nodegit/pull/1638) + + +## v0.25.0-alpha.6 [(2019-02-14)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.6) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.5...v0.25.0-alpha.6) + +#### Summary of changes +- Bumped LibGit2 to v0.28.0. +- Fixed problem with continue rebase preventing users from skipping commits +- Fixed leak where struct/option types were leaking libgit2 pointers + +#### Merged PRs into NodeGit +- [We should clear the persistent cell in structs when they are destroyed #1629](https://github.com/nodegit/nodegit/pull/1629) +- [Fix "errorno" typo #1628](https://github.com/nodegit/nodegit/pull/1628) +- [Bump Libgit2 fork to v0.28.0 #1627](https://github.com/nodegit/nodegit/pull/1627) + + +## v0.25.0-alpha.5 [(2019-02-11)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.5) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.4...v0.25.0-alpha.5) + +#### Summary of changes +- Fixed builds for Electron 4 for real this time + +#### Merged PRs into NodeGit +- [Fix macOS and Windows Electron 4 builds #1626](https://github.com/nodegit/nodegit/pull/1626) + + +## v0.25.0-alpha.4 [(2019-02-08)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.4) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.3...v0.25.0-alpha.4) + +#### Summary of changes +- Fixed bug where signing the init commit failed due to being unable to update the `HEAD` ref. +- Changed `NodeGit.Signature.default` to async, because it actually ends up reading the config. +- Fixed bug where templates were not reporting errors for synchronous methods. It's a bit of a wide net, but in general, + it is now possible certain sync methods in NodeGit will begin failin that did not fail before. This is the correct + behavior. +- Switched `NodeGit.Oid.fromString`'s internal implementation from `git_oid_fromstr` to `git_oid_fromstrp` +- Fixed builds for Electron 4 +- Added `NodeGit.Reference.updateTerminal` + +#### Merged PRs into NodeGit +- [Fix non-existent / dangling refs cause Repository.prototype.createCommitWithSignature to fail #1624](https://github.com/nodegit/nodegit/pull/1624) +- [Handle new gyp information for electron builds #1623](https://github.com/nodegit/nodegit/pull/1623) + + +## v0.25.0-alpha.3 [(2019-02-05)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.3) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.2...v0.25.0-alpha.3) + +#### Summary of changes +- Enforced consistent use of signing callbacks within the application. Any object that implements the signingCallback + pattern for signing commits or tags should use the exact same callback type and with the same meaning. + `type SigningCallback = (content: string) => {| code: number, field?: string, signedData?: string |};` + If the code is `NodeGit.Error.CODE.OK` or 0, the operation will succeed and _at least_ signedData is expected to be filled out. + If the code is a negative number, except for `NodeGit.Error.CODE.PASSTHROUGH`, the signing operation will fail. + If the code is `NodeGit.Error.CODE.PASSTHROUGH`, the operation will continue without signing the object. + +#### Merged PRs into NodeGit +- [Use same API for signingCb in all places that can be crypto signed #1621](https://github.com/nodegit/nodegit/pull/1621) + + +## v0.25.0-alpha.2 [(2019-02-01)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.1...v0.25.0-alpha.2) + +#### Summary of changes +- Added RebaseOptions to repository.prototype.rebaseContinue + +#### Merged PRs into NodeGit +- [Breaking: Repository.prototype.continueRebase enhancements #1619](https://github.com/nodegit/nodegit/pull/1619) + + +## v0.25.0-alpha.1 [(2019-01-30)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.24.0...v0.25.0-alpha.1) + +#### Summary of changes +- Bump Libgit2 to preview of v0.28.0 +- Add signing support for commits and annotated tags +- Updated Signature.prototype.toString to optionally include timestamps +- [BREAKING] Converted Buf.prototype.set and Buf.prototype.grow from async to sync +- Added complete support for libgit2 types: + - git_index_name_entry + - git_index_reuc_entry + - git_mailmap +- Exposed git_path_is_gitfile +- Exposed git_tag_create_frombuffer + +#### Merged PRs into NodeGit +- [adds support for gpg commit signing (fixes #1018) #1448](https://github.com/nodegit/nodegit/pull/1448) +- [Add `updateRef` parameter to Repository#createCommitWithSignature #1610](https://github.com/nodegit/nodegit/pull/1610) +- [Documentation fixes. #1611](https://github.com/nodegit/nodegit/pull/1611) +- [Add Commit#amendWithSignature #1616](https://github.com/nodegit/nodegit/pull/1616) +- [Bump libgit2 to a preview of v0.28 #1615](https://github.com/nodegit/nodegit/pull/1615) +- [Fix issues with Commit#amendWithSignature #1617](https://github.com/nodegit/nodegit/pull/1617) +- [Marked Repository.createBlobFromBuffer as async #1614](https://github.com/nodegit/nodegit/pull/1614) +- [Add functionality for creating Tags with signatures and extracting signatures from Tags #1618](https://github.com/nodegit/nodegit/pull/1618) + + +## v0.24.0 [(2019-01-16)](https://github.com/nodegit/nodegit/releases/tag/v0.24.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.23.0...v0.24.0) + +#### Summary of changes +- Garbage collect most of the library. +- All free functions have been removed. The expectation is that they will be collected by the GC. +- All init options methods have been removed. They were never supposed to be exposed in the first place. +- Added support for performing history walks on directories. +- Fix various bugs that led to segfaults or incorrect behavior. +- Removed ssl and crypto dependency from non-electron builds. + +##### Removed methods +Mostly due to missing support anyway, please report anything you were using as an issue. + - NodeGit.Blob.createFromStreamCommit + - NodeGit.Branch.Iterator.prototype.new + - NodeGit.Config.initBackend + - NodeGit.Config.prototype.snapshot + - NodeGit.Config.prototype.setBool + - NodeGit.Config.prototype.setInt32 + - NodeGit.Config.prototype.setInt64 + - NodeGit.Index.prototype.owner + - NodeGit.Note.iteratorNew + - NodeGit.Note.next + - NodeGit.Odb.prototype.addDiskAlternate + - NodeGit.Repository.prototype.configSnapshot + - NodeGit.Signature.prototype.dup + - NodeGit.Tag.foreach + - NodeGit.Transport.init + - NodeGit.Transport.sshWithPaths + - NodeGit.Transport.unregister + +##### Newly exposed methods: + - NodeGit.Config.prototype.getEntry + - NodeGit.Config.prototype.snapshot + - NodeGit.Config.prototype.refresh + - NodeGit.Config.prototype.setBool + - NodeGit.Config.prototype.setInt32 + - NodeGit.Config.prototype.setInt64 + - NodeGit.Diff.prototype.isSortedIcase + - NodeGit.DiffStats.prototype.deletions + - NodeGit.DiffStats.prototype.filesChanged + - NodeGit.DiffStats.prototype.insertions + - NodeGit.DiffStats.prototype.toBuf + - NodeGit.Odb.hashfile + - NodeGit.Odb.prototype.readPrefix + - NodeGit.OidShorten.prototype.add + - NodeGit.OidShorten.create + - NodeGit.PathspecMatchList.prototype.diffEntry + - NodeGit.PathspecMatchList.prototype.entry + - NodeGit.PathspecMatchList.prototype.entrycount + - NodeGit.PathspecMatchList.prototype.failedEntry + - NodeGit.PathspecMatchList.prototype.failedEntryCount + +##### Newly exposed types + - NodeGit.DescribeFormatOptions + - NodeGit.DiffStats + - NodeGit.OidShorten + - NodeGit.PathspecMatchList + +#### Merged PRs into NodeGit +- [Garbage collection: Free mostly everything automatically #1570](https://github.com/nodegit/nodegit/pull/1570) +- [Fix typo in GitHub issue template #1586](https://github.com/nodegit/nodegit/pull/1586) +- [More suitable example about Signature #1582](https://github.com/nodegit/nodegit/pull/1582) +- [Add support for directories when using `fileHistoryWalk` #1583](https://github.com/nodegit/nodegit/pull/1583) +- [Add a test for Repository's getReferenceCommit #1601](https://github.com/nodegit/nodegit/pull/1601) +- [Check parameters before performing reset #1603](https://github.com/nodegit/nodegit/pull/1603) +- [Remove ssl and crypto dependency on non-electron builds #1600](https://github.com/nodegit/nodegit/pull/1600) +- [Clean up libssh2 configure step #1574](https://github.com/nodegit/nodegit/pull/1574) +- [Fix checkout bug in our fork of libgit2 #1609](https://github.com/nodegit/nodegit/pull/1609) +- [Fix segfault in NodeGit.Revert.revert #1605](https://github.com/nodegit/nodegit/pull/1605) + + +## v0.24.0-alpha.1 [(2018-10-25)](https://github.com/nodegit/nodegit/releases/tag/v0.24.0-alpha.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.23.0...v0.24.0-alpha.1) + +#### Summary of changes +- Garbage collect most of the library. +- All free functions have been removed. The expectation is that they will be collected by the GC. +- All init options methods have been removed. They were never supposed to be exposed in the first place. + +##### Removed methods +Mostly due to missing support anyway, please report anything you were using as an issue. + - NodeGit.Blob.createFromStreamCommit + - NodeGit.Branch.Iterator.prototype.new + - NodeGit.Config.initBackend + - NodeGit.Config.prototype.snapshot + - NodeGit.Config.prototype.setBool + - NodeGit.Config.prototype.setInt32 + - NodeGit.Config.prototype.setInt64 + - NodeGit.Index.prototype.owner + - NodeGit.Note.iteratorNew + - NodeGit.Note.next + - NodeGit.Odb.prototype.addDiskAlternate + - NodeGit.Repository.prototype.configSnapshot + - NodeGit.Signature.prototype.dup + - NodeGit.Tag.foreach + - NodeGit.Transport.init + - NodeGit.Transport.sshWithPaths + - NodeGit.Transport.unregister + +##### Newly exposed methods: + - NodeGit.Config.prototype.getEntry + - NodeGit.Config.prototype.snapshot + - NodeGit.Config.prototype.refresh + - NodeGit.Config.prototype.setBool + - NodeGit.Config.prototype.setInt32 + - NodeGit.Config.prototype.setInt64 + - NodeGit.Diff.prototype.isSortedIcase + - NodeGit.DiffStats.prototype.deletions + - NodeGit.DiffStats.prototype.filesChanged + - NodeGit.DiffStats.prototype.insertions + - NodeGit.DiffStats.prototype.toBuf + - NodeGit.Odb.hashfile + - NodeGit.Odb.prototype.readPrefix + - NodeGit.OidShorten.prototype.add + - NodeGit.OidShorten.create + - NodeGit.PathspecMatchList.prototype.diffEntry + - NodeGit.PathspecMatchList.prototype.entry + - NodeGit.PathspecMatchList.prototype.entrycount + - NodeGit.PathspecMatchList.prototype.failedEntry + - NodeGit.PathspecMatchList.prototype.failedEntryCount + +##### Newly exposed types + - NodeGit.DescribeFormatOptions + - NodeGit.DiffStats + - NodeGit.OidShorten + - NodeGit.PathspecMatchList + +#### Merged PRs into NodeGit +- [Garbage collection: Free mostly everything automatically #1570](https://github.com/nodegit/nodegit/pull/1570) + + +## v0.23.0 [(2018-10-22)](https://github.com/nodegit/nodegit/releases/tag/v0.23.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.22.2...v0.23.0) + +#### Summary of changes +- Added Node 10 support. +- We no longer compile OpenSSL. Instead, we prefer the OpenSSL shipped with Node. In electron builds, we prefer the system openssl on linux, and we get prebuilt static libs from Conan. +- Cleaned up some compiler warnings +- Our http_parser dependency is now a submodule. +- Updated some dependencies in npm to get rid of security vulnerabilities and warnings. +- Exposed transfer progress callback for pushing. +- Libssh2 is now preconfigured for both Mac OS and Windows + +#### Merged PRs into NodeGit +- [warn about node v10 incompatibility in readme #1534](https://github.com/nodegit/nodegit/pull/1534) +- [Define error codes to fix compiler warnings about unused variables #1486](https://github.com/nodegit/nodegit/pull/1486) +- [Include http_parser via submodule #1551](https://github.com/nodegit/nodegit/pull/1551) +- [Update dependencies to get rid of security vulnerabilities #1547](https://github.com/nodegit/nodegit/pull/1547) +- [add github issue template #1548](https://github.com/nodegit/nodegit/pull/1548) +- [Enable git_push_transfer_progress - Help wanted #1500](https://github.com/nodegit/nodegit/pull/1500) +- [Fixed createBranch API params #1552](https://github.com/nodegit/nodegit/pull/1552) +- [Use curl-config to find curl #1555](https://github.com/nodegit/nodegit/pull/1555) +- [Update readme #1554](https://github.com/nodegit/nodegit/pull/1554) +- [Node 10 support #1545](https://github.com/nodegit/nodegit/pull/1545) +- [Update dependencies #1519](https://github.com/nodegit/nodegit/pull/1519) +- [Run submodule updates in sequence rather than parallel #1558](https://github.com/nodegit/nodegit/pull/1558) +- [Fix Electron builds on win32 #1560](https://github.com/nodegit/nodegit/pull/1560) +- [Use static `libssh2_config.h` on MacOS builds #1569](https://github.com/nodegit/nodegit/pull/1569) + + +## v0.23.0-alpha.2 [(2018-10-19)](https://github.com/nodegit/nodegit/releases/tag/v0.23.0-alpha.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.23.0-alpha.1...v0.23.0-alpha.2) + +#### Summary of changes +On Mac OS Mojave, libssh2 configure failed to configure, because libssh2 always tries to configure against system libraries. The configure process uses links to determine that a OpenSSL is present. Since OSX and Windows no longer link against the system lib, we've prebuilt the configure steps for both environments. This should be stable when building NodeGit on Mojave. + +#### Merged PRs into NodeGit +- [Use static `libssh2_config.h` on MacOS builds #1569](https://github.com/nodegit/nodegit/pull/1569) + + +## v0.23.0-alpha.1 [(2018-10-01)](https://github.com/nodegit/nodegit/releases/tag/v0.23.0-alpha.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.22.2...v0.23.0-alpha.1) + +#### Summary of changes +- Added Node 10 support. +- We no longer compile OpenSSL. Instead, we prefer the OpenSSL shipped with Node. In electron builds, we prefer the system openssl on linux, and we get prebuilt static libs from Conan. +- Cleaned up some compiler warnings +- Our http_parser dependency is now a submodule. +- Updated some dependencies in npm to get rid of security vulnerabilities and warnings. +- Exposed transfer progress callback for pushing. + +#### Merged PRs into NodeGit +- [warn about node v10 incompatibility in readme #1534](https://github.com/nodegit/nodegit/pull/1534) +- [Define error codes to fix compiler warnings about unused variables #1486](https://github.com/nodegit/nodegit/pull/1486) +- [Include http_parser via submodule #1551](https://github.com/nodegit/nodegit/pull/1551) +- [Update dependencies to get rid of security vulnerabilities #1547](https://github.com/nodegit/nodegit/pull/1547) +- [add github issue template #1548](https://github.com/nodegit/nodegit/pull/1548) +- [Enable git_push_transfer_progress - Help wanted #1500](https://github.com/nodegit/nodegit/pull/1500) +- [Fixed createBranch API params #1552](https://github.com/nodegit/nodegit/pull/1552) +- [Use curl-config to find curl #1555](https://github.com/nodegit/nodegit/pull/1555) +- [Update readme #1554](https://github.com/nodegit/nodegit/pull/1554) +- [Node 10 support #1545](https://github.com/nodegit/nodegit/pull/1545) +- [Update dependencies #1519](https://github.com/nodegit/nodegit/pull/1519) +- [Run submodule updates in sequence rather than parallel #1558](https://github.com/nodegit/nodegit/pull/1558) +- [Fix Electron builds on win32 #1560](https://github.com/nodegit/nodegit/pull/1560) + + +## v0.22.2 [(2018-07-10)](https://github.com/nodegit/nodegit/releases/tag/v0.22.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.22.1...v0.22.2) + +#### Summary of changes +- Bumped libgit2 to 0.27.3 to incorporate security patch. Details can be found here https://github.com/libgit2/libgit2/releases/tag/v0.27.3 +- Also includes changes made in 0.27.2. Details can be found here https://github.com/libgit2/libgit2/releases/tag/v0.27.2 +- Ensure optional params are respected as optional in `NodeGit.Merge.trees` + +#### Merged PRs into NodeGit +- [Fix argument handling in Git.Merge.trees #1507](https://github.com/nodegit/nodegit/pull/1507) + +#### Included non-merged libgit2 PRs: + - [Parallelize checkout_create_the_new for ntfs perf gains #4205](https://github.com/libgit2/libgit2/pull/4205) + - [negotiate always fails via libcurl #4126](https://github.com/libgit2/libgit2/pull/4126) + +#### Included merged libgit2 PRs: +- [Bugfix release v0.27.2 #4632](https://github.com/libgit2/libgit2/pull/4632) +- [Release v0.27.3 #4717](https://github.com/libgit2/libgit2/pull/4717) + + +## v0.22.1 [(2018-04-09)](https://github.com/nodegit/nodegit/releases/tag/v0.22.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.22.0...v0.22.1) + +#### Summary of changes +Bumped libgit2 to 0.27.1 to address security flaw with submodule name validation (CVE-2018-11235, reported by Etienne Stalmans). +Details can be found here https://github.com/libgit2/libgit2/releases/tag/v0.27.1 + + +## v0.22.0 [(2018-04-09)](https://github.com/nodegit/nodegit/releases/tag/v0.22.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.21.2...v0.22.0) + +#### Summary of changes +- Expose [Tag.listMatch](https://libgit2.github.com/libgit2/#v0.26.3/group/tag/git_tag_list_match) +- Expose [Repo.prototype.createCommitBuffer](https://libgit2.github.com/libgit2/#v0.26.3/group/commit/git_commit_create_buffer) +- Bump Libgt2 to 0.27.0. For more information about what was in this release. [Check upstream](https://github.com/libgit2/libgit2/releases/tag/v0.27.0). +- Errors are now properly thrown from + - `Attr.prototype.get` + - `Blob.createFrombuffer` + - `Blob.createFromworkdir` + - `Reference.list` + - `Remote.prototype.getFetchRefspecs` + - `Remote.prototype.getPushRefspecs` + - `Status.file` +- WorkTree is now exposed + - Static methods + - `add` + - `list` + - `lookup` + - `openFromRepository` + - Instance methods + - `isLocked` + - `isPrunable` + - `lock` + - `prune` + - `unlock` + - `validate` +- **BREAKING** Functions that are now async + - `Attr.prototype.getMany` + - `Tag.prototype.target` + - `Treebuilder.prototype.Write` +- **BREAKING** Diffs generated from `Diff.treeToIndex` and `Diff.treeToWorkdirWithIndex` conditionally support `Diff.OPTION.IGNORE_CASE`. Only on repositories where the index is case insensitive will the flag be set on the output diff. The flag itself is ignored when passed to `DiffOptions`. + +#### Merged PRs into NodeGit +- [Add JavaScript Tag.listMatch function for git_tag_list_match #1470](https://github.com/nodegit/nodegit/pull/1470) +- [Expose error code in Status.file #1468](https://github.com/nodegit/nodegit/pull/1468) +- [Travis documentation deploy fixes #1466](https://github.com/nodegit/nodegit/pull/1466) +- [Bump to libgit2 v0.27.0 #1477](https://github.com/nodegit/nodegit/pull/1477) +- [Add repo.createCommitBuffer #1481](https://github.com/nodegit/nodegit/pull/1481) + +#### Included non-merged libgit2 PRs: + - [Parallelize checkout_create_the_new for ntfs perf gains #4205](https://github.com/libgit2/libgit2/pull/4205) + - [negotiate always fails via libcurl #4126](https://github.com/libgit2/libgit2/pull/4126) + + +## v0.21.2 [(2018-03-19)](https://github.com/nodegit/nodegit/releases/tag/v0.21.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.21.1...v0.21.2) + +#### Summary of changes +- Drop support for node 7 +- Fixed an issue where fast-forward rebase would throw an error unexepctedly. +- Expose git_commit_extract_signature +- TreeEntry.prototype.path() should always return posix style separators +- Expose git_config_open_ondisk +- Expose git_config_find_global +- Expose git_config_find_system +- Expose git_config_find_xdg +- Expose git_config_get_path + +#### Merged PRs into NodeGit + - [Fix typo in CHANGELOG.md #1455](https://github.com/nodegit/nodegit/pull/1455) + - [Add two tests for Tag #1452](https://github.com/nodegit/nodegit/pull/1452) + - [Handle fast-forward merges properly in repository.performRebase #1457](https://github.com/nodegit/nodegit/pull/1457) + - [Enable git_commit_extract_signature #1458](https://github.com/nodegit/nodegit/pull/1458) + - [removes 'only' from test #1460](https://github.com/nodegit/nodegit/pull/1460) + - [Deploy documentation and make extended tests visible #1447](https://github.com/nodegit/nodegit/pull/1447) + - [resolves #1433 TreeEntry#path should return posix path #1434](https://github.com/nodegit/nodegit/pull/1434) + - [Exposed git_config_open_ondisk #1459](https://github.com/nodegit/nodegit/pull/1459) + - [Expose git_config functions #1463](https://github.com/nodegit/nodegit/pull/1463) + + +## v0.21.1 [(2018-03-05)](https://github.com/nodegit/nodegit/releases/tag/v0.21.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.21.0...v0.21.1) + +#### Summary of changes +- Fixed an issue where having html escape characters in the path portion of an ssh url always fails when performing remote actions. + +#### Included non-merged libgit2 PRs: +- [Unescape special characters in SSH repo paths #4557](https://github.com/libgit2/libgit2/pull/4557) + +## v0.21.0 [(2018-02-26)](https://github.com/nodegit/nodegit/releases/tag/v0.21.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.20.3...v0.21.0) + +#### Summary of changes to NodeGit: + - [Generate default options for Revert.revert to prevent an exception #1404](https://github.com/nodegit/nodegit/pull/1404) + - [fix issue with re-require()'ing native modules #1354](https://github.com/nodegit/nodegit/pull/1354) + - [Expose JavaScript function name in a rejected promise #1393](https://github.com/nodegit/nodegit/pull/1393) + - [Fix compiling with clang #1344](https://github.com/nodegit/nodegit/pull/1344) + - [Fix typos #1415](https://github.com/nodegit/nodegit/pull/1415) + - [build: add NetBSD support to opensslconf.h #1374](https://github.com/nodegit/nodegit/pull/1374) + - [Fix example by forcing backslashes with path.posix #1346](https://github.com/nodegit/nodegit/pull/1346) + - [Expose the Node.js GC when running `mocha `scripts #1258](https://github.com/nodegit/nodegit/pull/1258) + - [Exposed filter_list; Fixed discard lines to use filters #1414](https://github.com/nodegit/nodegit/pull/1414) + - [Add tests for AnnotatedCommit #1325](https://github.com/nodegit/nodegit/pull/1325) + - [Adding docs for NodeGit #1350](https://github.com/nodegit/nodegit/pull/1350) + - [Fix details-for-tree-entry.js to access fields instead of calling a function #1326](https://github.com/nodegit/nodegit/pull/1326) + - [Add JavaScript version of `git_tag_peel()` #1269](https://github.com/nodegit/nodegit/pull/1269) + - [Fixed documentation error #1417](https://github.com/nodegit/nodegit/pull/1417) + - [Annotate Blame.file as async #1421](https://github.com/nodegit/nodegit/pull/1421) + - [Add two missing tests to Commit #1422](https://github.com/nodegit/nodegit/pull/1422) + - [CI: Update Node.js versions + some deps #1444](https://github.com/nodegit/nodegit/pull/1444) + - [Expose fetch_options.custom_headers #1430](https://github.com/nodegit/nodegit/pull/1430) + +## v0.20.3 [(2017-10-18)](https://github.com/nodegit/nodegit/releases/tag/v0.20.3) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.20.2...v0.20.3) @@ -10,7 +2314,7 @@ - [Updated input docs to allow for git_push_update_reference_cb to generate #1386](https://github.com/nodegit/nodegit/pull/1386) - [Updated descriptors for git_index_find and git_index_find_prefix #1391](https://github.com/nodegit/nodegit/pull/1391) -#### Included merged libgti2 PRs: +#### Included merged libgit2 PRs: - [Fix template dir empty string #4273](https://github.com/libgit2/libgit2/pull/4273) - [travis: upgrade container to Ubuntu 14.04 #4211](https://github.com/libgit2/libgit2/pull/4211) - [merge: perform exact rename detection in linear time #4202](https://github.com/libgit2/libgit2/pull/4202) @@ -63,7 +2367,7 @@ -## v0.20.2 [(2017-08-16)](https://github.com/nodegit/nodegit/releases/tag/v0.20.2) +## v0.20.2 [(2017-09-13)](https://github.com/nodegit/nodegit/releases/tag/v0.20.2) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.20.0...v0.20.2) @@ -83,7 +2387,7 @@ - [Add CI build config for node stable version #1337](https://github.com/nodegit/nodegit/pull/1337) - [removed node v4 tests #1330](https://github.com/nodegit/nodegit/pull/1330) -#### Included merged libgti2 PRs: +#### Included merged libgit2 PRs: - [Include fixups #4288](https://github.com/libgit2/libgit2/pull/4288) - [Docs: Fix inline comments for git_diff_hunk #4330](https://github.com/libgit2/libgit2/pull/4330) - [oid: use memcmp in git_oid__hashcmp #4328](https://github.com/libgit2/libgit2/pull/4328) @@ -159,7 +2463,7 @@ #### Summary of changes outside of libgit2 bump: - You can now convert tree entries in blobs [PR #1272](https://github.com/nodegit/nodegit/pull/1272) -#### Included merged libgti2 PRs: +#### Included merged libgit2 PRs: - [fileops: fix leaking fd in `mmap_ro_file` #4201](https://github.com/libgit2/libgit2/pull/4201) - [README: document our relation to changes in upstream #4198](https://github.com/libgit2/libgit2/pull/4198) @@ -1888,8 +4192,4 @@ We have added Node 6 as a supported platform! Going forward we aim to have 1:1 s [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.0.1...v0.0.2) -## v0.0.1 [(2011-03-10)](https://github.com/nodegit/nodegit/tree/v0.0.1) - - - -\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* +## v0.0.1 [(2011-03-10)](https://github.com/nodegit/nodegit/tree/v0.0.1) \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index de461b0a3a..337971a438 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ Contribution Guidelines We try to be available pretty often to help when problems come up. We like to split incoming questions into two categories: potential bugs/features, and questions. If you want a feature added, or think you've found a bug -in the code (or in the examples), search the [issue tracker](https://github.com/nodegit/nodegit/issues) and if you dont +in the code (or in the examples), search the [issue tracker](https://github.com/nodegit/nodegit/issues) and if you don't find anything, file a new issue. If you just have questions, instead of using issues, [sign up](http://slack.libgit2.org/) to libgit2's Slack instance and then contact us in the [#nodegit channel](https://libgit2.slack.com/messages/nodegit/). diff --git a/README.md b/README.md index 52f2a26f82..72442d791d 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,23 @@ -NodeGit -------- +# NodeGit > Node bindings to the [libgit2](http://libgit2.github.com/) project. - - - - - - - - - - - - - - - - - - -
LinuxOS XWindowsCoverageDependencies
- - - - - Coverage Status - - -
- -**Stable (libgit2@v0.26.0): 0.26.0** +[![Actions Status](https://github.com/nodegit/nodegit/workflows/Testing/badge.svg)](https://github.com/nodegit/nodegit/actions) + +**Stable (libgit2@v0.28.3): 0.28.3** ## Have a problem? Come chat with us! ## Visit [slack.libgit2.org](http://slack.libgit2.org/) to sign up, then join us in #nodegit. ## Maintained by ## -Tim Branyen [@tbranyen](http://twitter.com/tbranyen), -John Haley [@johnhaley81](http://twitter.com/johnhaley81), and -Max Korp [@maxkorp](http://twitter.com/MaximilianoKorp) with help from tons of +Tyler Ang-Wanek [@twwanek](http://twitter.com/twwanek) with help from tons of [awesome contributors](https://github.com/nodegit/nodegit/contributors)! ### Alumni Maintainers ### +Tim Branyen [@tbranyen](http://twitter.com/tbranyen), +John Haley [@johnhaley81](http://twitter.com/johnhaley81), +Max Korp [@maxkorp](http://twitter.com/MaximilianoKorp), Steve Smith [@orderedlist](https://twitter.com/orderedlist), Michael Robinson [@codeofinterest](http://twitter.com/codeofinterest), and Nick Kallen [@nk](http://twitter.com/nk) @@ -100,6 +74,18 @@ In Ubuntu: sudo apt-get install libssl-dev ``` +You will need the following libraries installed on your linux machine: + - libpcre + - libpcreposix + - libkrb5 + - libk5crypto + - libcom_err + +When building locally, you will also need development packages for kerberos and pcre, so both of these utilities must be present on your machine: + - pcre-config + - krb5-config + + If you are still encountering problems while installing, you should try the [Building from source](http://www.nodegit.org/guides/install/from-source/) instructions. diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 7d4463df76..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,62 +0,0 @@ -# appveyor file -# http://www.appveyor.com/docs/appveyor-yml - -os: Windows Server 2012 R2 -image: Visual Studio 2015 - -platform: - - x86 - - x64 - -# build version format -version: "{build}" - -# Set a known clone folder -clone_folder: c:\projects\nodegit - -# fix lineendings in Windows -init: - - git config --global core.autocrlf input - - git config --global user.name "John Doe" - - git config --global user.email johndoe@example.com - -# what combinations to test -environment: - JOBS: 4 - GIT_SSH: c:\projects\nodegit\vendor\plink.exe - GYP_MSVS_VERSION: 2013 - matrix: - # Node.js - - nodejs_version: "8.3.0" - - nodejs_version: "7" - - nodejs_version: "6" - -matrix: - fast_finish: true - -# Get the latest stable version of Node 0.STABLE.latest -install: - - ps: Install-Product node $env:nodejs_version $env:platform - - ps: Start-Process c:\projects\nodegit\vendor\pageant.exe c:\projects\nodegit\vendor\private.ppk - - npm install -g npm - - cmd: npm install -g node-gyp - - appveyor-retry call npm install - -test_script: - - node --version - - npm --version - - appveyor-retry call npm test - -on_success: - - IF %APPVEYOR_REPO_TAG%==true npm install -g node-pre-gyp - - IF %APPVEYOR_REPO_TAG%==true npm install -g aws-sdk - - IF %APPVEYOR_REPO_TAG%==true node lifecycleScripts\clean - - IF %APPVEYOR_REPO_TAG%==true node-pre-gyp package - - IF %APPVEYOR_REPO_TAG%==true node-pre-gyp publish - -build: off - -branches: - only: - - master - - v0.3 diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000000..1b1fc2b328 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,4 @@ +## /examples + + List of examples of using NodeGit to implement common git core operations. + diff --git a/examples/add-and-commit.js b/examples/add-and-commit.js index d9af04ed7a..42215257b8 100644 --- a/examples/add-and-commit.js +++ b/examples/add-and-commit.js @@ -1,15 +1,9 @@ -var nodegit = require("../"); -var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); -var fileName = "newfile.txt"; -var fileContent = "hello world"; -var directoryName = "salad/toast/strangerinastrangeland/theresnowaythisexists"; -// ensureDir is an alias to mkdirp, which has the callback with a weird name -// and in the 3rd position of 4 (the 4th being used for recursion). We have to -// force promisify it, because promisify-node won't detect it on its -// own and assumes sync -fse.ensureDir = promisify(fse.ensureDir); +const nodegit = require("../"); +const path = require("path"); +const fs = require("fs"); +const fileName = "newfile.txt"; +const fileContent = "hello world"; +const directoryName = "salad/toast/strangerinastrangeland/theresnowaythisexists"; /** * This example creates a certain file `newfile.txt`, adds it to the git @@ -17,59 +11,38 @@ fse.ensureDir = promisify(fse.ensureDir); * followed by a `git commit` **/ -var repo; -var index; -var oid; -nodegit.Repository.open(path.resolve(__dirname, "../.git")) -.then(function(repoResult) { - repo = repoResult; - return fse.ensureDir(path.join(repo.workdir(), directoryName)); -}).then(function(){ - return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); -}) -.then(function() { - return fse.writeFile( +(async () => { + const repo = await nodegit.Repository.open(path.resolve(__dirname, "../.git")); + + await fs.promises.mkdir(path.join(repo.workdir(), directoryName), { + recursive: true, + }); + + await fs.promises.writeFile(path.join(repo.workdir(), fileName), fileContent); + await fs.promises.writeFile( path.join(repo.workdir(), directoryName, fileName), fileContent ); -}) -.then(function() { - return repo.refreshIndex(); -}) -.then(function(indexResult) { - index = indexResult; -}) -.then(function() { + + const index = await repo.refreshIndex(); + // this file is in the root of the directory and doesn't need a full path - return index.addByPath(fileName); -}) -.then(function() { + await index.addByPath(fileName); // this file is in a subdirectory and can use a relative path - return index.addByPath(path.join(directoryName, fileName)); -}) -.then(function() { + await index.addByPath(path.posix.join(directoryName, fileName)); // this will write both files to the index - return index.write(); -}) -.then(function() { - return index.writeTree(); -}) -.then(function(oidResult) { - oid = oidResult; - return nodegit.Reference.nameToId(repo, "HEAD"); -}) -.then(function(head) { - return repo.getCommit(head); -}) -.then(function(parent) { - var author = nodegit.Signature.create("Scott Chacon", - "schacon@gmail.com", 123456789, 60); - var committer = nodegit.Signature.create("Scott A Chacon", - "scott@github.com", 987654321, 90); + await index.write(); + + const oid = await index.writeTree(); + + const parent = await repo.getHeadCommit(); + const author = nodegit.Signature.now("Scott Chacon", + "schacon@gmail.com"); + const committer = nodegit.Signature.now("Scott A Chacon", + "scott@github.com"); + + const commitId = await repo.createCommit("HEAD", author, committer, "message", oid, [parent]); - return repo.createCommit("HEAD", author, committer, "message", oid, [parent]); -}) -.done(function(commitId) { console.log("New Commit: ", commitId); -}); +})(); diff --git a/examples/checkout-remote-branch.js b/examples/checkout-remote-branch.js new file mode 100644 index 0000000000..4ebf9050be --- /dev/null +++ b/examples/checkout-remote-branch.js @@ -0,0 +1,26 @@ +var nodegit = require("../"); +var path = require("path"); + +var remoteBranchName = "REMOTE-BRANCH-NAME"; + +nodegit.Repository.open(path.resolve(__dirname, "../.git")) + .then(function(repo) { + + return repo.getHeadCommit() + .then(function (targetCommit) { + return repo.createBranch(remoteBranchName, targetCommit, false); + }) + .then(function (reference) { + return repo.checkoutBranch(reference, {}); + }) + .then(function () { + return repo.getReferenceCommit( + "refs/remotes/origin/" + remoteBranchName); + }) + .then(function (commit) { + nodegit.Reset.reset(repo, commit, 3, {}); + }); + + }).done(function() { + console.log("All done!"); +}); diff --git a/examples/clone.js b/examples/clone.js index a230604643..459713d942 100644 --- a/examples/clone.js +++ b/examples/clone.js @@ -1,6 +1,5 @@ var nodegit = require("../"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var path = "/tmp/nodegit-clone-demo"; fse.remove(path).then(function() { @@ -15,7 +14,7 @@ fse.remove(path).then(function() { certificateCheck: function() { // github will fail cert check on some OSX machines // this overrides that check - return 1; + return 0; } } } diff --git a/examples/cloneFromGithubWith2Factor.js b/examples/cloneFromGithubWith2Factor.js index 1dbf0a2c05..62e0df8073 100644 --- a/examples/cloneFromGithubWith2Factor.js +++ b/examples/cloneFromGithubWith2Factor.js @@ -1,6 +1,5 @@ var nodegit = require("../"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var path = "/tmp/nodegit-github-2factor-demo"; var token = "{Your GitHub user token}"; @@ -21,7 +20,7 @@ var opts = { return nodegit.Cred.userpassPlaintextNew(token, "x-oauth-basic"); }, certificateCheck: function() { - return 1; + return 0; } } } diff --git a/examples/create-branch.js b/examples/create-branch.js index 28ab6bea53..7374de053e 100644 --- a/examples/create-branch.js +++ b/examples/create-branch.js @@ -9,9 +9,7 @@ nodegit.Repository.open(path.resolve(__dirname, "../.git")) return repo.createBranch( "new-branch", commit, - 0, - repo.defaultSignature(), - "Created new-branch on HEAD"); + 0); }); }).done(function() { console.log("All done!"); diff --git a/examples/create-new-repo.js b/examples/create-new-repo.js index 6cabe9a75d..1df93fbbc8 100644 --- a/examples/create-new-repo.js +++ b/examples/create-new-repo.js @@ -1,49 +1,32 @@ -var nodegit = require("../"); -var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); -var fileName = "newfile.txt"; -var fileContent = "hello world"; -var repoDir = "../../newRepo"; +const nodegit = require("../"); +const path = require("path"); +const fs = require("fs"); +const fileName = "newfile.txt"; +const fileContent = "hello world"; +const repoDir = "../newRepo"; -fse.ensureDir = promisify(fse.ensureDir); -var repository; -var index; +(async () => { + await fs.promises.mkdir(path.resolve(__dirname, repoDir), { + recursive: true, + }); + const repo = await nodegit.Repository.init(path.resolve(__dirname, repoDir), 0); + await fs.promises.writeFile(path.join(repo.workdir(), fileName), fileContent); + const index = await repo.refreshIndex(); + await index.addByPath(fileName); + await index.write(); + + const oid = await index.writeTree(); + + const author = nodegit.Signature.now("Scott Chacon", + "schacon@gmail.com"); + const committer = nodegit.Signature.now("Scott A Chacon", + "scott@github.com"); -fse.ensureDir(path.resolve(__dirname, repoDir)) -.then(function() { - return nodegit.Repository.init(path.resolve(__dirname, repoDir), 0); -}) -.then(function(repo) { - repository = repo; - return fse.writeFile(path.join(repository.workdir(), fileName), fileContent); -}) -.then(function(){ - return repository.refreshIndex(); -}) -.then(function(idx) { - index = idx; -}) -.then(function() { - return index.addByPath(fileName); -}) -.then(function() { - return index.write(); -}) -.then(function() { - return index.writeTree(); -}) -.then(function(oid) { - var author = nodegit.Signature.create("Scott Chacon", - "schacon@gmail.com", 123456789, 60); - var committer = nodegit.Signature.create("Scott A Chacon", - "scott@github.com", 987654321, 90); - - // Since we're creating an inital commit, it has no parents. Note that unlike + // Since we're creating an initial commit, it has no parents. Note that unlike // normal we don't get the head either, because there isn't one yet. - return repository.createCommit("HEAD", author, committer, "message", oid, []); -}) -.done(function(commitId) { + const commitId = await repo.createCommit("HEAD", author, committer, "message", oid, []); console.log("New Commit: ", commitId); -}); +})(); + + diff --git a/examples/details-for-tree-entry.js b/examples/details-for-tree-entry.js index 6c4a0dc28e..13dcd4e210 100644 --- a/examples/details-for-tree-entry.js +++ b/examples/details-for-tree-entry.js @@ -1,29 +1,26 @@ -var nodegit = require("../"); -var path = require("path"); +const nodegit = require("../"); +const path = require("path"); /** * This shows how to get details from a tree entry or a blob **/ -nodegit.Repository.open(path.resolve(__dirname, "../.git")) - .then(function(repo) { - return repo.getTree("e1b0c7ea57bfc5e30ec279402a98168a27838ac9") - .then(function(tree) { - var treeEntry = tree.entryByIndex(0); +(async () => { + const repo = await nodegit.Repository.open(path.resolve(__dirname, "../.git")); + const tree = await repo.getTree("e1b0c7ea57bfc5e30ec279402a98168a27838ac9"); + const treeEntry = tree.entryByIndex(0); + + // Tree entry doesn't have any data associated with the actual entry + // To get that we need to get the index entry that this points to + const index = await repo.refreshIndex(); + const indexEntry = index.getByPath(treeEntry.path()); - // Tree entry doesn't have any data associated with the actual entry - // To get that we need to get the index entry that this points to - return repo.refreshIndex().then(function(index) { - var indexEntry = index.getByPath(treeEntry.path()); + // With the index entry we can now view the details for the tree entry + console.log("Entry path: " + indexEntry.path); + console.log("Entry time in seconds: " + indexEntry.mtime.seconds()); + console.log("Entry oid: " + indexEntry.id.toString()); + console.log("Entry size: " + indexEntry.fileSize); + + console.log("Done!"); +})(); - // With the index entry we can now view the details for the tree entry - console.log("Entry path: " + indexEntry.path()); - console.log("Entry time in seconds: " + indexEntry.mtime().seconds()); - console.log("Entry oid: " + indexEntry.id().toString()); - console.log("Entry size: " + indexEntry.fileSize()); - }); - }); - }) - .done(function() { - console.log("Done!"); - }); diff --git a/examples/diff-commits.js b/examples/diff-commits.js index f68d0fcfb1..b3d6d75107 100644 --- a/examples/diff-commits.js +++ b/examples/diff-commits.js @@ -1,41 +1,41 @@ -var nodegit = require("../"); -var path = require("path"); +const nodegit = require("../"); +const path = require("path"); // This code examines the diffs between a particular commit and all of its // parents. Since this commit is not a merge, it only has one parent. This is // similar to doing `git show`. -nodegit.Repository.open(path.resolve(__dirname, "../.git")) -.then(function(repo) { - return repo.getCommit("59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5"); -}) -.then(function(commit) { +(async () => { + const repo = await nodegit.Repository.open(path.resolve(__dirname, "../.git")) + const commit = await repo.getCommit("59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5"); console.log("commit " + commit.sha()); - console.log("Author:", commit.author().name() + - " <" + commit.author().email() + ">"); + console.log( + "Author:", commit.author().name() + + " <" + commit.author().email() + ">" + ); console.log("Date:", commit.date()); console.log("\n " + commit.message()); - return commit.getDiff(); -}) -.done(function(diffList) { - diffList.forEach(function(diff) { - diff.patches().then(function(patches) { - patches.forEach(function(patch) { - patch.hunks().then(function(hunks) { - hunks.forEach(function(hunk) { - hunk.lines().then(function(lines) { - console.log("diff", patch.oldFile().path(), - patch.newFile().path()); - console.log(hunk.header().trim()); - lines.forEach(function(line) { - console.log(String.fromCharCode(line.origin()) + - line.content().trim()); - }); - }); - }); - }); - }); - }); - }); -}); + const diffList = await commit.getDiff(); + for (const diff of diffList) { + const patches = await diff.patches(); + for (const patch of patches) { + const hunks = await patch.hunks(); + for (const hunk of hunks) { + const lines = await hunk.lines(); + console.log( + "diff", + patch.oldFile().path(), + patch.newFile().path() + ); + console.log(hunk.header().trim()); + for (const line of lines) { + console.log( + String.fromCharCode(line.origin()) + + line.content().trim() + ); + } + } + } + } +})(); diff --git a/examples/general.js b/examples/general.js index ce432cb50f..b06c4d7954 100644 --- a/examples/general.js +++ b/examples/general.js @@ -1,12 +1,10 @@ -var nodegit = require("../"); -var path = require("path"); -var oid; -var odb; -var repo; +const nodegit = require("../"); +const path = require("path"); + // **nodegit** is a javascript library for node.js that wraps libgit2, a // pure C implementation of the Git core. It provides an asynchronous -// interface around any functions that do I/O, and a sychronous interface +// interface around any functions that do I/O, and a synchronous interface // around the rest. // // This file is an example of using that API in a real, JS file. @@ -19,348 +17,301 @@ var repo; // Nearly, all git operations in the context of a repository. // To open a repository, -nodegit.Repository.open(path.resolve(__dirname, "../.git")) - .then(function(repoResult) { - repo = repoResult; - console.log("Opened repository."); - - // ### SHA-1 Value Conversions - - // Objects in git (commits, blobs, etc.) are referred to by their SHA value - // **nodegit** uses a simple wrapper around hash values called an `Oid`. - // The oid validates that the SHA is well-formed. - - oid = nodegit.Oid.fromString("c27d9c35e3715539d941254f2ce57042b978c49c"); - - // Most functions in in **nodegit** that take an oid will also take a - // string, so for example, you can look up a commit by a string SHA or - // an Oid, but but any functions that create new SHAs will always return - // an Oid. - - // If you have a oid, you can easily get the hex value of the SHA again. - console.log("Sha hex string:", oid.toString()); - - // ### Working with the Object Database - - // **libgit2** provides [direct access][odb] to the object database. The - // object database is where the actual objects are stored in Git. For - // working with raw objects, we'll need to get this structure from the - // repository. - return repo.odb(); - }) - - .then(function(odbResult) { - odb = odbResult; - - // We can read raw objects directly from the object database if we have - // the oid (SHA) of the object. This allows us to access objects without - // knowing thier type and inspect the raw bytes unparsed. - - return odb.read(oid); - }) - - .then(function(object) { - // A raw object only has three properties - the type (commit, blob, tree - // or tag), the size of the raw data and the raw, unparsed data itself. - // For a commit or tag, that raw data is human readable plain ASCII - // text. For a blob it is just file contents, so it could be text or - // binary data. For a tree it is a special binary format, so it's unlikely - // to be hugely helpful as a raw object. - var data = object.data(); - var type = object.type(); - var size = object.size(); - - console.log("Object size and type:", size, type); - console.log("Raw data: ", data.toString().substring(100), "..."); - - }) - - .then(function() { - // You can also write raw object data to Git. This is pretty cool because - // it gives you direct access to the key/value properties of Git. Here - // we'll write a new blob object that just contains a simple string. - // Notice that we have to specify the object type. - return odb.write("test data", "test data".length, nodegit.Object.TYPE.BLOB); - }) - - .then(function(oid) { - // Now that we've written the object, we can check out what SHA1 was - // generated when the object was written to our database. - console.log("Written Object: ", oid.toString()); - }) - - .then(function() { - // ### Object Parsing - - // libgit2 has methods to parse every object type in Git so you don't have - // to work directly with the raw data. This is much faster and simpler - // than trying to deal with the raw data yourself. - - // #### Commit Parsing - - // [Parsing commit objects][pco] is simple and gives you access to all the - // data in the commit - the author (name, email, datetime), committer - // (same), tree, message, encoding and parent(s). - - oid = nodegit.Oid.fromString("698c74e817243efe441a5d1f3cbaf3998282ca86"); - - // Many methods in **nodegit** are asynchronous, because they do file - // or network I/O. By convention, all asynchronous methods are named - // imperatively, like `getCommit`, `open`, `read`, `write`, etc., whereas - // synchronous methods are named nominatively, like `type`, `size`, `name`. - - return repo.getCommit(oid); - }) - - .then(function(commit) { - // Each of the properties of the commit object are accessible via methods, - // including commonly needed variations, such as `git_commit_time` which - // returns the author time and `git_commit_message` which gives you the - // commit message. - console.log("Commit:", commit.message(), - commit.author().name(), commit.date()); - - // Commits can have zero or more parents. The first (root) commit will - // have no parents, most commits will have one (i.e. the commit it was - // based on) and merge commits will have two or more. Commits can - // technically have any number, though it's rare to have more than two. - return commit.getParents(); - }) - - .then(function(parents) { - parents.forEach(function(parent) { - console.log("Parent:", parent.toString()); - }); - }) - - .then(function() { - // #### Writing Commits - - // nodegit provides a couple of methods to create commit objects easily as - // well. - var author = nodegit.Signature.create("Scott Chacon", - "schacon@gmail.com", 123456789, 60); - var committer = nodegit.Signature.create("Scott A Chacon", - "scott@github.com", 987654321, 90); - - // Commit objects need a tree to point to and optionally one or more - // parents. Here we're creating oid objects to create the commit with, - // but you can also use existing ones: - var treeId = nodegit.Oid.fromString( - "4170d10f19600b9cb086504e8e05fe7d863358a2"); - var parentId = nodegit.Oid.fromString( - "eebd0ead15d62eaf0ba276da53af43bbc3ce43ab"); - - return repo.getTree(treeId).then(function(tree) { - return repo.getCommit(parentId).then(function(parent) { - // Here we actually create the commit object with a single call with all - // the values we need to create the commit. The SHA key is written to - // the `commit_id` variable here. - return repo.createCommit( - null /* do not update the HEAD */, - author, - committer, - "example commit", - tree, - [parent]); - }).then(function(oid) { - console.log("New Commit:", oid.toString()); - }); - }); - }) - - .then(function() { - // #### Tag Parsing - - // You can parse and create tags with the [tag management API][tm], which - // functions very similarly to the commit lookup, parsing and creation - // methods, since the objects themselves are very similar. - - oid = nodegit.Oid.fromString("dcc4aa9fcdaced037434cb149ed3b6eab4d0709d"); - return repo.getTag(oid); - }) - - .then(function(tag) { - // Now that we have the tag object, we can extract the information it - // generally contains: the target (usually a commit object), the type of - // the target object (usually "commit"), the name ("v1.0"), the tagger (a - // git_signature - name, email, timestamp), and the tag message. - console.log(tag.name(), tag.targetType(), tag.message()); - - return tag.target(); - }) - - .then(function (target) { - console.log("Target is commit:", target.isCommit()); - }) - - .then(function() { - // #### Tree Parsing - - // A Tree is how Git represents the state of the filesystem - // at a given revision. In general, a tree corresponds to a directory, - // and files in that directory are either files (blobs) or directories. - - // [Tree parsing][tp] is a bit different than the other objects, in that - // we have a subtype which is the tree entry. This is not an actual - // object type in Git, but a useful structure for parsing and traversing - // tree entries. - - oid = nodegit.Oid.fromString("e1b0c7ea57bfc5e30ec279402a98168a27838ac9"); - return repo.getTree(oid); - }) - - .then(function(tree) { - console.log("Tree Size:", tree.entryCount()); - - function dfs(tree) { - var promises = []; - - tree.entries().forEach(function(entry) { - if (entry.isDirectory()) { - promises.push(entry.getTree().then(dfs)); - } else if (entry.isFile()) { - console.log("Tree Entry:", entry.name()); - } - }); - - return Promise.all(promises); +(async () => { + const repo = await nodegit.Repository.open(path.resolve(__dirname, "../.git")); + console.log("Opened repository."); + + // ### SHA-1 Value Conversions + + // Objects in git (commits, blobs, etc.) are referred to by their SHA value + // **nodegit** uses a simple wrapper around hash values called an `Oid`. + // The oid validates that the SHA is well-formed. + + let oid = nodegit.Oid.fromString("c27d9c35e3715539d941254f2ce57042b978c49c"); + + // Most functions in in **nodegit** that take an oid will also take a + // string, so for example, you can look up a commit by a string SHA or + // an Oid, but any functions that create new SHAs will always return + // an Oid. + + // If you have a oid, you can easily get the hex value of the SHA again. + console.log("Sha hex string:", oid.toString()); + + // ### Working with the Object Database + + // **libgit2** provides [direct access][odb] to the object database. The + // object database is where the actual objects are stored in Git. For + // working with raw objects, we'll need to get this structure from the + // repository. + const odb = await repo.odb(); + + // We can read raw objects directly from the object database if we have + // the oid (SHA) of the object. This allows us to access objects without + // knowing their type and inspect the raw bytes unparsed. + + const object = await odb.read(oid); + + // A raw object only has three properties - the type (commit, blob, tree + // or tag), the size of the raw data and the raw, unparsed data itself. + // For a commit or tag, that raw data is human readable plain ASCII + // text. For a blob it is just file contents, so it could be text or + // binary data. For a tree it is a special binary format, so it's unlikely + // to be hugely helpful as a raw object. + const data = object.data(); + const type = object.type(); + const size = object.size(); + + console.log("Object size and type:", size, type); + console.log("Raw data: ", data.toString().substring(100), "..."); + + // You can also write raw object data to Git. This is pretty cool because + // it gives you direct access to the key/value properties of Git. Here + // we'll write a new blob object that just contains a simple string. + // Notice that we have to specify the object type. + oid = await odb.write("test data", "test data".length, nodegit.Object.TYPE.BLOB); + + // Now that we've written the object, we can check out what SHA1 was + // generated when the object was written to our database. + console.log("Written Object: ", oid.toString()); + + // ### Object Parsing + + // libgit2 has methods to parse every object type in Git so you don't have + // to work directly with the raw data. This is much faster and simpler + // than trying to deal with the raw data yourself. + + // #### Commit Parsing + + // [Parsing commit objects][pco] is simple and gives you access to all the + // data in the commit - the author (name, email, datetime), committer + // (same), tree, message, encoding and parent(s). + + oid = nodegit.Oid.fromString("698c74e817243efe441a5d1f3cbaf3998282ca86"); + + // Many methods in **nodegit** are asynchronous, because they do file + // or network I/O. By convention, all asynchronous methods are named + // imperatively, like `getCommit`, `open`, `read`, `write`, etc., whereas + // synchronous methods are named nominatively, like `type`, `size`, `name`. + + const commit = await repo.getCommit(oid); + + // Each of the properties of the commit object are accessible via methods, + // including commonly needed variations, such as `git_commit_time` which + // returns the author time and `git_commit_message` which gives you the + // commit message. + console.log( + "Commit:", commit.message(), + commit.author().name(), commit.date() + ); + + // Commits can have zero or more parents. The first (root) commit will + // have no parents, most commits will have one (i.e. the commit it was + // based on) and merge commits will have two or more. Commits can + // technically have any number, though it's rare to have more than two. + const parents = await commit.getParents(); + for (const parent of parents) { + console.log("Parent:", parent.toString()); + } + + // #### Writing Commits + + // nodegit provides a couple of methods to create commit objects easily as + // well. + const author = nodegit.Signature.now("Scott Chacon", + "schacon@gmail.com"); + const committer = nodegit.Signature.now("Scott A Chacon", + "scott@github.com"); + + // Commit objects need a tree to point to and optionally one or more + // parents. Here we're creating oid objects to create the commit with, + // but you can also use existing ones: + const treeId = nodegit.Oid.fromString( + "4170d10f19600b9cb086504e8e05fe7d863358a2"); + const parentId = nodegit.Oid.fromString( + "eebd0ead15d62eaf0ba276da53af43bbc3ce43ab"); + + let tree = await repo.getTree(treeId); + const parent = await repo.getCommit(parentId); + // Here we actually create the commit object with a single call with all + // the values we need to create the commit. The SHA key is written to + // the `commit_id` variable here. + oid = await repo.createCommit( + null /* do not update the HEAD */, + author, + committer, + "example commit", + tree, + [parent] + ); + console.log("New Commit:", oid.toString()); + + // #### Tag Parsing + + // You can parse and create tags with the [tag management API][tm], which + // functions very similarly to the commit lookup, parsing and creation + // methods, since the objects themselves are very similar. + + oid = nodegit.Oid.fromString("dcc4aa9fcdaced037434cb149ed3b6eab4d0709d"); + const tag = await repo.getTag(oid); + + // Now that we have the tag object, we can extract the information it + // generally contains: the target (usually a commit object), the type of + // the target object (usually "commit"), the name ("v1.0"), the tagger (a + // git_signature - name, email, timestamp), and the tag message. + console.log(tag.name(), tag.targetType(), tag.message()); + + const target = await tag.target(); + console.log("Target is commit:", target.isCommit()); + + // #### Tree Parsing + + // A Tree is how Git represents the state of the filesystem + // at a given revision. In general, a tree corresponds to a directory, + // and files in that directory are either files (blobs) or directories. + + // [Tree parsing][tp] is a bit different than the other objects, in that + // we have a subtype which is the tree entry. This is not an actual + // object type in Git, but a useful structure for parsing and traversing + // tree entries. + + oid = nodegit.Oid.fromString("e1b0c7ea57bfc5e30ec279402a98168a27838ac9"); + tree = await repo.getTree(oid); + + console.log("Tree Size:", tree.entryCount()); + + /** + * @param {nodegit.Tree} tree + */ + function dfs(tree) { + const promises = []; + + for (const entry of tree.entries()) { + if (entry.isDirectory()) { + promises.push(entry.getTree().then(dfs)); + } else if (entry.isFile()) { + console.log("Tree Entry:", entry.name()); + } } - return dfs(tree).then(function() { - // You can also access tree entries by path if you know the path of the - // entry you're looking for. - return tree.getEntry("example/general.js").then(function(entry) { - // Entries which are files have blobs associated with them: - entry.getBlob(function(error, blob) { - console.log("Blob size:", blob.size()); - }); - }); - }); - }) - - .then(function() { - // #### Blob Parsing - - // The last object type is the simplest and requires the least parsing - // help. Blobs are just file contents and can contain anything, there is - // no structure to it. The main advantage to using the [simple blob - // api][ba] is that when you're creating blobs you don't have to calculate - // the size of the content. There is also a helper for reading a file - // from disk and writing it to the db and getting the oid back so you - // don't have to do all those steps yourself. - - oid = nodegit.Oid.fromString("991c06b7b1ec6f939488427e4b41a4fa3e1edd5f"); - return repo.getBlob(oid); - }) - - .then(function(blob) { - // You can access a node.js Buffer with the raw contents - // of the blob directly. Note that this buffer may not - // contain ASCII data for certain blobs (e.g. binary files). - var buffer = blob.content(); - - // If you know that the blob is UTF-8, however, - console.log("Blob contents:", blob.toString().slice(0, 38)); - console.log("Buffer:", buffer.toString().substring(100), "..."); - }) - - .then(function() { - // ### Revwalking - - // The libgit2 [revision walking api][rw] provides methods to traverse the - // directed graph created by the parent pointers of the commit objects. - // Since all commits point back to the commit that came directly before - // them, you can walk this parentage as a graph and find all the commits - // that were ancestors of (reachable from) a given starting point. This - // can allow you to create `git log` type functionality. - - oid = nodegit.Oid.fromString("698c74e817243efe441a5d1f3cbaf3998282ca86"); - - // To use the revwalker, create a new walker, tell it how you want to sort - // the output and then push one or more starting points onto the walker. - // If you want to emulate the output of `git log` you would push the SHA - // of the commit that HEAD points to into the walker and then start - // traversing them. You can also "hide" commits that you want to stop at - // or not see any of their ancestors. So if you want to emulate `git log - // branch1..branch2`, you would push the oid of `branch2` and hide the oid - // of `branch1`. - var revWalk = repo.createRevWalk(); - - revWalk.sorting(nodegit.Revwalk.SORT.TOPOLOGICAL, - nodegit.Revwalk.SORT.REVERSE); - - revWalk.push(oid); - - // Now that we have the starting point pushed onto the walker, we start - // asking for ancestors. It will return them in the sorting order we asked - // for as commit oids. We can then lookup and parse the commited pointed - // at by the returned OID; note that this operation is specially fast - // since the raw contents of the commit object will be cached in memory - - function walk() { - return revWalk.next().then(function(oid) { - if (!oid) { - return; - } - - return repo.getCommit(oid).then(function(commit) { - console.log("Commit:", commit.toString()); - return walk(); - }); - }); + return Promise.all(promises); + } + + await dfs(tree); + + // You can also access tree entries by path if you know the path of the + // entry you're looking for. + const entry = await tree.getEntry("example/general.js"); + // Entries which are files have blobs associated with them: + let blob = await entry.getBlob(); + console.log("Blob size:", blob.rawsize()); + + // #### Blob Parsing + + // The last object type is the simplest and requires the least parsing + // help. Blobs are just file contents and can contain anything, there is + // no structure to it. The main advantage to using the [simple blob + // api][ba] is that when you're creating blobs you don't have to calculate + // the size of the content. There is also a helper for reading a file + // from disk and writing it to the db and getting the oid back so you + // don't have to do all those steps yourself. + + oid = nodegit.Oid.fromString("991c06b7b1ec6f939488427e4b41a4fa3e1edd5f"); + blob = await repo.getBlob(oid); + // You can access a node.js Buffer with the raw contents + // of the blob directly. Note that this buffer may not + // contain ASCII data for certain blobs (e.g. binary files). + const buffer = blob.content(); + + // If you know that the blob is UTF-8, however, + console.log("Blob contents:", blob.toString().slice(0, 38)); + console.log("Buffer:", buffer.toString().substring(100), "..."); + + // ### Revwalking + + // The libgit2 [revision walking api][rw] provides methods to traverse the + // directed graph created by the parent pointers of the commit objects. + // Since all commits point back to the commit that came directly before + // them, you can walk this parentage as a graph and find all the commits + // that were ancestors of (reachable from) a given starting point. This + // can allow you to create `git log` type functionality. + + oid = nodegit.Oid.fromString("698c74e817243efe441a5d1f3cbaf3998282ca86"); + + // To use the revwalker, create a new walker, tell it how you want to sort + // the output and then push one or more starting points onto the walker. + // If you want to emulate the output of `git log` you would push the SHA + // of the commit that HEAD points to into the walker and then start + // traversing them. You can also "hide" commits that you want to stop at + // or not see any of their ancestors. So if you want to emulate `git log + // branch1..branch2`, you would push the oid of `branch2` and hide the oid + // of `branch1`. + const revWalk = repo.createRevWalk(); + + revWalk.sorting( + nodegit.Revwalk.SORT.TOPOLOGICAL, + nodegit.Revwalk.SORT.REVERSE + ); + + revWalk.push(oid); + + // Now that we have the starting point pushed onto the walker, we start + // asking for ancestors. It will return them in the sorting order we asked + // for as commit oids. We can then lookup and parse the commits pointed + // at by the returned OID; note that this operation is specially fast + // since the raw contents of the commit object will be cached in memory. + + async function walk() { + let oid; + try { + oid = await revWalk.next(); + } catch(error) { + if (error.errno !== nodegit.Error.CODE.ITEROVER) { + throw error; + } else { + return; + } } + const commit = await repo.getCommit(oid); + console.log("Commit:", commit.toString()); return walk(); - }) - - .then(function() { - // ### Index File Manipulation - - // The [index file API][gi] allows you to read, traverse, update and write - // the Git index file (sometimes thought of as the staging area). - return repo.refreshIndex(); - }) - - .then(function(index) { - // For each entry in the index, you can get a bunch of information - // including the SHA (oid), path and mode which map to the tree objects - // that are written out. It also has filesystem properties to help - // determine what to inspect for changes (ctime, mtime, dev, ino, uid, - // gid, file_size and flags) All these properties are exported publicly in - // the `IndexEntry` class - - index.entries().forEach(function(entry) { - console.log("Index Entry:", entry.path(), entry.mtime().seconds()); - }); - }) - - .then(function() { - // ### References - - // The [reference API][ref] allows you to list, resolve, create and update - // references such as branches, tags and remote references (everything in - // the .git/refs directory). - - return repo.getReferenceNames(nodegit.Reference.TYPE.LISTALL); - }) - - .then(function(referenceNames) { - var promises = []; - - referenceNames.forEach(function(referenceName) { - promises.push(repo.getReference(referenceName).then(function(reference) { - if (reference.isConcrete()) { - console.log("Reference:", referenceName, reference.target()); - } else if (reference.isSymbolic()) { - console.log("Reference:", referenceName, reference.symbolicTarget()); - } - })); - }); + } - return Promise.all(promises); - }) + await walk(); + + // ### Index File Manipulation + + // The [index file API][gi] allows you to read, traverse, update and write + // the Git index file (sometimes thought of as the staging area). + const index = await repo.refreshIndex(); + + // For each entry in the index, you can get a bunch of information + // including the SHA (oid), path and mode which map to the tree objects + // that are written out. It also has filesystem properties to help + // determine what to inspect for changes (ctime, mtime, dev, ino, uid, + // gid, file_size and flags) All these properties are exported publicly in + // the `IndexEntry` class + + for (const entry of index.entries()) { + console.log("Index Entry:", entry.path, entry.mtime.seconds()); + } + + // ### References + + // The [reference API][ref] allows you to list, resolve, create and update + // references such as branches, tags and remote references (everything in + // the .git/refs directory). + + const referenceNames = await repo.getReferenceNames(nodegit.Reference.TYPE.ALL); + + for (const referenceName of referenceNames) { + const reference = await repo.getReference(referenceName); + if (reference.isConcrete()) { + console.log("Reference:", referenceName, reference.target()); + } else if (reference.isSymbolic()) { + console.log("Reference:", referenceName, reference.symbolicTarget()); + } + } - .done(function() { - console.log("Done!"); - }); + console.log("Done!"); +})(); diff --git a/examples/index-add-and-remove.js b/examples/index-add-and-remove.js index d34199bde9..74354ed5dc 100644 --- a/examples/index-add-and-remove.js +++ b/examples/index-add-and-remove.js @@ -1,7 +1,6 @@ var nodegit = require("../"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); nodegit.Repository.open(path.resolve(__dirname, "../.git")) .then(function(repo) { diff --git a/examples/merge-cleanly.js b/examples/merge-cleanly.js index 8e30283158..e277477bf8 100644 --- a/examples/merge-cleanly.js +++ b/examples/merge-cleanly.js @@ -1,8 +1,6 @@ var nodegit = require("../"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); -fse.ensureDir = promisify(fse.ensureDir); +var fse = require("fs-extra"); var ourFileName = "ourNewFile.txt"; var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; @@ -20,10 +18,10 @@ var theirCommit; var ourBranch; var theirBranch; -var ourSignature = nodegit.Signature.create("Ron Paul", - "RonPaul@TollRoadsRBest.info", 123456789, 60); -var theirSignature = nodegit.Signature.create("Greg Abbott", - "Gregggg@IllTollYourFace.us", 123456789, 60); +var ourSignature = nodegit.Signature.now("Ron Paul", + "RonPaul@TollRoadsRBest.info"); +var theirSignature = nodegit.Signature.now("Greg Abbott", + "Gregggg@IllTollYourFace.us"); // Create a new repository in a clean directory, and add our first file fse.remove(path.resolve(__dirname, repoDir)) diff --git a/examples/merge-with-conflicts.js b/examples/merge-with-conflicts.js index 13e07c8d5f..55fb87d3b8 100644 --- a/examples/merge-with-conflicts.js +++ b/examples/merge-with-conflicts.js @@ -1,8 +1,6 @@ var nodegit = require("../"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); -fse.ensureDir = promisify(fse.ensureDir); +var fse = require("fs-extra"); var repoDir = "../../newRepo"; var fileName = "newFile.txt"; @@ -12,12 +10,12 @@ var ourFileContent = "Big Bobs are best, IMHO.\n"; var theirFileContent = "Nobody expects the small Bobquisition!\n"; var finalFileContent = "Big Bobs are beautiful and the small are unexpected!\n"; -var baseSignature = nodegit.Signature.create("Peaceful Bob", - "justchill@bob.net", 123456789, 60); -var ourSignature = nodegit.Signature.create("Big Bob", - "impressive@bob.net", 123456789, 60); -var theirSignature = nodegit.Signature.create("Small Bob", - "underestimated@bob.net", 123456789, 60); +var baseSignature = nodegit.Signature.now("Peaceful Bob", + "justchill@bob.net"); +var ourSignature = nodegit.Signature.now("Big Bob", + "impressive@bob.net"); +var theirSignature = nodegit.Signature.now("Small Bob", + "underestimated@bob.net"); var ourBranchName = "ours"; var theirBranchName = "theirs"; @@ -177,8 +175,8 @@ fse.remove(path.resolve(__dirname, repoDir)) } }) -// we need to get a new index as the other one isnt backed to -// the repository in the usual fashion, and just behaves weirdly +// we need to get a new index as the other one is not backed to +// the repository in the usual fashion, and just behaves weirdly. .then(function() { return repository.refreshIndex() .then(function(index) { diff --git a/examples/pull.js b/examples/pull.js index 7f5fc9af01..fe2d83411a 100644 --- a/examples/pull.js +++ b/examples/pull.js @@ -16,7 +16,7 @@ nodegit.Repository.open(path.resolve(__dirname, repoDir)) return nodegit.Cred.sshKeyFromAgent(userName); }, certificateCheck: function() { - return 1; + return 0; } } }); diff --git a/examples/push.js b/examples/push.js index ac340820f5..5c19b70349 100644 --- a/examples/push.js +++ b/examples/push.js @@ -1,8 +1,6 @@ var nodegit = require("../"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); -fse.ensureDir = promisify(fse.ensureDir); +var fse = require("fs-extra"); var fileName = "newFile.txt"; var fileContent = "hello world"; @@ -12,8 +10,8 @@ var repoDir = "../../newRepo"; var repository; var remote; -var signature = nodegit.Signature.create("Foo bar", - "foo@bar.com", 123456789, 60); +var signature = nodegit.Signature.now("Foo bar", + "foo@bar.com"); // Create a new repository in a clean directory, and add our first file fse.remove(path.resolve(__dirname, repoDir)) diff --git a/examples/read-file.js b/examples/read-file.js index 991a5ae390..9da5ed1758 100644 --- a/examples/read-file.js +++ b/examples/read-file.js @@ -1,25 +1,19 @@ -var nodegit = require("../"), - path = require("path"); +const nodegit = require("../"); +const path = require("path"); // This example opens a certain file, `README.md`, at a particular commit, // and prints the first 10 lines as well as some metadata. -var _entry; -nodegit.Repository.open(path.resolve(__dirname, "../.git")) - .then(function(repo) { - return repo.getCommit("59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5"); - }) - .then(function(commit) { - return commit.getEntry("README.md"); - }) - .then(function(entry) { - _entry = entry; - return _entry.getBlob(); - }) - .then(function(blob) { - console.log(_entry.name(), _entry.sha(), blob.rawsize() + "b"); - console.log("========================================================\n\n"); - var firstTenLines = blob.toString().split("\n").slice(0, 10).join("\n"); - console.log(firstTenLines); - console.log("..."); - }) - .done(); + +(async () => { + const repo = await nodegit.Repository.open(path.resolve(__dirname, "../.git")); + const commit = await repo.getCommit("59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5"); + const entry = await commit.getEntry("README.md"); + const blob = await entry.getBlob(); + + console.log(entry.name(), entry.sha(), blob.rawsize() + "b"); + console.log("========================================================\n\n"); + const firstTenLines = blob.toString().split("\n").slice(0, 10).join("\n"); + console.log(firstTenLines); + console.log("..."); +})(); + diff --git a/examples/remove-and-commit.js b/examples/remove-and-commit.js index 10751f061a..4ba8c777a5 100644 --- a/examples/remove-and-commit.js +++ b/examples/remove-and-commit.js @@ -40,10 +40,10 @@ nodegit.Repository.open(path.resolve(__dirname, "../.git")) return _repository.getCommit(head); }) .then(function(parent) { - var author = nodegit.Signature.create("Scott Chacon", - "schacon@gmail.com", 123456789, 60); - var committer = nodegit.Signature.create("Scott A Chacon", - "scott@github.com", 987654321, 90); + var author = nodegit.Signature.now("Scott Chacon", + "schacon@gmail.com"); + var committer = nodegit.Signature.now("Scott A Chacon", + "scott@github.com"); return _repository.createCommit("HEAD", author, committer, "message", _oid, [parent]); diff --git a/examples/walk-history.js b/examples/walk-history.js index 2e41ce2da6..7bdab9fb96 100644 --- a/examples/walk-history.js +++ b/examples/walk-history.js @@ -10,7 +10,7 @@ nodegit.Repository.open(path.resolve(__dirname, "../.git")) }) .then(function(firstCommitOnMaster){ // History returns an event. - var history = firstCommitOnMaster.history(nodegit.Revwalk.SORT.Time); + var history = firstCommitOnMaster.history(nodegit.Revwalk.SORT.TIME); // History emits "commit" event for each commit in the branch's history history.on("commit", function(commit) { diff --git a/generate/README.md b/generate/README.md new file mode 100644 index 0000000000..3ee5446d60 --- /dev/null +++ b/generate/README.md @@ -0,0 +1,21 @@ +## /generate + +The scripts and templates in this dir help generate the source code and tests for NodeGit. The major components of generate are: + + 1. Input + 2. Scripts + 3. Templates + +### Input + + All the **configuration** required for the parser to generate the source code and tests. For more details, check the Input directory. + +### Scripts + + The scripts that generate the final configuration (*snapshot of the library*) `idefs.json`, `missing-tests.json`. These configurations are then used to generate `src` for the library. + +### Templates + + All the Combyne templates are placed here. The filters, partials, templates all help NodeGit generate the source code. + + > For more information on Combyne: [tbranyen/combyne](https://github.com/tbranyen/combyne) diff --git a/generate/index.js b/generate/index.js index 6bdaa42ef1..753897d5b7 100644 --- a/generate/index.js +++ b/generate/index.js @@ -6,6 +6,23 @@ var submoduleStatus = require("../lifecycleScripts/submodules/getStatus"); module.exports = function generate() { console.log("[nodegit] Generating native code"); + function tryGenerate(numRetries = 3) { + // There appears to be a race condition in the generate code somewhere + // Until we fix that, we should try to generate a few times before + try { + generateJson(); + generateNativeCode(); + generateMissingTests(); + } catch (error) { + if (numRetries > 0) { + console.log("[nodegit] WARNING - Failed to generate native code, trying again"); + tryGenerate(numRetries - 1); + } else { + throw error; + } + } + } + return submoduleStatus() .then(function(statuses) { var dirtySubmodules = statuses @@ -22,14 +39,11 @@ module.exports = function generate() { }); } }) - .then(function() { - generateJson(); - generateNativeCode(); - generateMissingTests(); - }) + .then(tryGenerate) .catch(function(e) { console.error("[nodegit] ERROR - Could not generate native code"); console.error(e); + throw e; }); } diff --git a/generate/input/README.md b/generate/input/README.md new file mode 100644 index 0000000000..f0d7573eed --- /dev/null +++ b/generate/input/README.md @@ -0,0 +1,15 @@ +## /generate/input + This folder contains the main config files to generate NodeGit's JavaScript functions. + + #### callbacks.json + Add all meta data about the callbacks from libgit2 that need to be implemented in NodeGit. + + #### descriptor.json + Customize the generated code using this configuration file. Enter the function's signature, arguments and their metadata and which functions can be skipped in this file. If you are using a manual template, remove all of its references from this file. + + #### libgit2-docs.json + These are provided by the libgit2 team. It includes all the metadata about the API provided by the libgit2 library. To grab the latest version of this file, download https://libgit2.org/libgit2/HEAD.json. + + #### libgit2-supplement.json + Use this confiuration file to group and override parts of the generated code. NodeGit tries its best to generate the right classes and structs, if it is not quite right, then use this config file to group/remove the functions. + > If you're using manual templates, update the `cFile` reference to point to the manual template. diff --git a/generate/input/callbacks.json b/generate/input/callbacks.json index 215dc5ed9e..aa08429954 100644 --- a/generate/input/callbacks.json +++ b/generate/input/callbacks.json @@ -1,13 +1,28 @@ { - "git_attr_foreach_cb": { + "git_apply_delta_cb": { "args": [ { - "name": "name", - "cType": "const char *" + "name": "delta", + "cType": "const git_diff_delta *" }, { - "name": "value", - "cType": "const char *" + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 1, + "success": 0, + "error": -1, + "cancel": -1 + } + }, + "git_apply_hunk_cb": { + "args": [ + { + "name": "hunk", + "cType": "const git_diff_hunk *" }, { "name": "payload", @@ -18,14 +33,19 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, - "git_blob_chunk_cb": { + "git_attr_foreach_cb": { "args": [ { - "name": "entry", - "cType": "const git_config_entry *" + "name": "name", + "cType": "const char *" + }, + { + "name": "value", + "cType": "const char *" }, { "name": "payload", @@ -36,7 +56,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_checkout_notify_cb": { @@ -70,7 +91,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": 0 } }, "git_checkout_progress_cb": { @@ -93,10 +115,7 @@ } ], "return": { - "type": "int", - "noResults": 1, - "success": 0, - "error": -1, + "type": "void", "throttle": 100 } }, @@ -111,11 +130,57 @@ "cType": "void *" } ], + "return": { + "type": "void", + "throttle": 100 + } + }, + "git_commit_create_cb": { + "args": [ + { + "name": "out", + "cType": "git_oid *", + "isReturn": true + }, + { + "name": "author", + "cType": "const git_signature *" + }, + { + "name": "committer", + "cType": "const git_signature *" + }, + { + "name": "message_encoding", + "cType": "const char *" + }, + { + "name": "message", + "cType": "const char *" + }, + { + "name": "tree", + "cType": "const git_tree *" + }, + { + "name": "parent_count", + "cType": "size_t" + }, + { + "name": "parents", + "cType": "const git_oid * []" + }, + { + "name": "payload", + "cType": "void *" + } + ], "return": { "type": "int", - "noResults": 1, + "noResults": -30, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_config_foreach_cb": { @@ -133,14 +198,15 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, - "git_cred_acquire_cb": { + "git_credential_acquire_cb": { "args": [ { - "name": "cred", - "cType": "git_cred **", + "name": "credential", + "cType": "git_credential **", "isReturn": true }, { @@ -164,7 +230,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_diff_binary_cb": { @@ -186,7 +253,8 @@ "type": "int", "noResults": 0, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_diff_file_cb": { @@ -209,7 +277,7 @@ "noResults": 1, "success": 0, "error": -1, - "throttle": 100 + "cancel": -1 } }, "git_diff_hunk_cb": { @@ -231,7 +299,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_diff_line_cb": { @@ -257,14 +326,16 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_diff_notify_cb": { "args": [ { "name": "diff_so_far", - "cType": "const git_diff *" + "cType": "const git_diff *", + "ignore": true }, { "name": "delta_to_add", @@ -283,13 +354,16 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } - },"git_diff_progress_cb": { + }, + "git_diff_progress_cb": { "args": [ { "name": "diff_so_far", - "cType": "const git_diff *" + "cType": "const git_diff *", + "ignore": true }, { "name": "old_path", @@ -308,104 +382,108 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, - "git_filter_apply_fn": { - "args": [ - { - "name": "self", - "cType": "git_filter *" - }, - { - "name": "payload", - "cType": "void **" - }, - { - "name": "to", - "cType": "git_buf *" - }, - { - "name": "from", - "cType": "const git_buf *" - }, - { - "name": "src", - "cType": "const git_filter_source *" - } - ], - "return": { - "type": "int", - "noResults": -30, - "success": 0, - "error": -1 - } - }, - "git_filter_check_fn": { - "args": [ - { - "name": "self", - "cType": "git_filter *" - }, - { + "git_filter_apply_fn": { + "args": [ + { + "name": "self", + "cType": "git_filter *" + }, + { "name": "payload", "cType": "void **" - }, - { + }, + { + "name": "to", + "cType": "git_buf *" + }, + { + "name": "from", + "cType": "const git_buf *" + }, + { "name": "src", "cType": "const git_filter_source *" - }, - { - "name": "attr_values", - "cType": "const char **" - } - ], - "return": { - "type": "int", - "noResults": -30, - "success": 0, - "error": -1 - } - }, - "git_filter_cleanup_fn": { - "args": [ - { - "name": "self", - "cType": "git_filter *" - }, - { - "name": "payload", - "cType": "void *" - } - ], - "return": { - "type": "void" - } - }, - "git_filter_init_fn": { - "args": [ - { - "name": "self", - "cType": "git_filter *" - } - ], - "return": { - "type": "int", + } + ], + "return": { + "type": "int", + "noResults": -30, + "success": 0, + "error": -1, + "cancel": -1 + } + }, + "git_filter_check_fn": { + "args": [ + { + "name": "self", + "cType": "git_filter *" + }, + { + "name": "payload", + "cType": "void **" + }, + { + "name": "src", + "cType": "const git_filter_source *" + }, + { + "name": "attr_values", + "cType": "const char **" + } + ], + "return": { + "type": "int", + "noResults": -30, + "success": 0, + "error": -1, + "cancel": -1 + } + }, + "git_filter_cleanup_fn": { + "args": [ + { + "name": "self", + "cType": "git_filter *" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "void" + } + }, + "git_filter_init_fn": { + "args": [ + { + "name": "self", + "cType": "git_filter *" + } + ], + "return": { + "type": "int", "noResults": 0, - "success": 0, - "error": -1 - } - }, - "git_filter_shutdown_fn": { - "args": [ - { - "name": "self", - "cType": "git_filter *" - } - ], - "return": { - "type": "void" - } + "success": 0, + "error": -1, + "cancel": -1 + } + }, + "git_filter_shutdown_fn": { + "args": [ + { + "name": "self", + "cType": "git_filter *" + } + ], + "return": { + "type": "void" + } }, "git_index_matched_path_cb": { "args": [ @@ -426,7 +504,28 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 + } + }, + "git_indexer_progress_cb": { + "args": [ + { + "name": "stats", + "cType": "const git_indexer_progress *" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 0, + "success": 0, + "error": -1, + "cancel": -1, + "throttle": 100 } }, "git_note_foreach_cb": { @@ -448,7 +547,8 @@ "type": "int", "noResults": 0, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_odb_foreach_cb": { @@ -461,7 +561,14 @@ "name": "payload", "cType": "void *" } - ] + ], + "return": { + "type": "int", + "noResults": 0, + "success": 0, + "error": -1, + "cancel": -1 + } }, "git_packbuilder_foreach_cb": { "args": [ @@ -482,14 +589,38 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 + } + }, + "git_push_update_reference_cb": { + "args": [ + { + "name": "refname", + "cType": "const char *" + }, + { + "name": "status", + "cType": "const char *" + }, + { + "name": "data", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 1, + "success": 0, + "error": -1, + "cancel": -1 } }, "git_remote_create_cb": { "args": [ { "name": "out", - "cType": "git_repository **", + "cType": "git_remote **", "isReturn": true }, { @@ -513,7 +644,29 @@ "type": "int", "noResults": 0, "success": 0, - "error": 1 + "error": -1, + "cancel": -1 + } + }, + "git_remote_ready_cb": { + "args": [ + { + "name": "remote", + "cType": "git_remote *" + }, + { + "name": "direction", + "cType": "int" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "success": 0, + "error": -1 } }, "git_repository_create_cb": { @@ -540,7 +693,8 @@ "type": "int", "noResults": 0, "success": 0, - "error": 1 + "error": 1, + "cancel": -1 } }, "git_reference_foreach_cb": { @@ -558,7 +712,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_reference_foreach_name_cb": { @@ -576,7 +731,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_repository_fetchhead_foreach_cb": { @@ -606,7 +762,8 @@ "type": "int", "noResults": 0, "success": 0, - "error": 1 + "error": -1, + "cancel": -1 } }, "git_repository_mergehead_foreach_cb": { @@ -624,7 +781,8 @@ "type": "int", "noResults": 0, "success": 0, - "error": 1 + "error": -1, + "cancel": -1 } }, "git_revwalk_hide_cb": { @@ -642,30 +800,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 - } - }, - "git_smart_subtransport_cb": { - "args": [ - { - "name": "out", - "cType": "git_smart_subtransport **", - "isReturn": true - }, - { - "name": "owner", - "cType": "git_transport*" - }, - { - "name": "param", - "cType": "void *" - } - ], - "return": { - "type": "int", - "noResults": 0, - "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_stash_apply_progress_cb": { @@ -684,6 +820,7 @@ "noResults":0, "success": 0, "error": -1, + "cancel": -1, "throttle": 100 } }, @@ -710,7 +847,8 @@ "type": "int", "noResults":0, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_status_cb": { @@ -732,7 +870,8 @@ "type": "int", "noResults": 0, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_submodule_cb": { @@ -754,7 +893,8 @@ "type": "int", "noResults": 0, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_tag_foreach_cb": { @@ -776,18 +916,27 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, - "git_transfer_progress_cb": { + "git_push_transfer_progress_cb": { "args": [ { - "name": "stats", - "cType": "const git_transfer_progress *" + "name": "current", + "type": "unsigned int" + }, + { + "name": "total", + "type": "unsigned int" + }, + { + "name": "bytes", + "type": "size_t" }, { "name": "payload", - "cType": "void *" + "type": "void *" } ], "return": { @@ -795,6 +944,7 @@ "noResults": 0, "success": 0, "error": -1, + "cancel": -1, "throttle": 100 } }, @@ -818,7 +968,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_transport_certificate_check_cb": { @@ -844,7 +995,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_transport_message_cb": { @@ -866,7 +1018,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_treebuilder_filter_cb": { @@ -884,7 +1037,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": 0 } }, "git_treewalk_cb": { @@ -906,29 +1060,35 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, - "git_push_update_reference_cb": { + "git_url_resolve_cb": { "args": [ { - "name": "refname", - "cType": "const char *" + "name": "url_resolved", + "cType": "git_buf *" }, { - "name": "status", + "name": "url", "cType": "const char *" }, { - "name": "data", + "name": "direction", + "cType": "int" + }, + { + "name": "payload", "cType": "void *" } ], "return": { "type": "int", - "noResults": 1, + "noResults": -30, "success": 0, - "error": -1 + "error": -1, + "cancel": -30 } } } diff --git a/generate/input/descriptor.json b/generate/input/descriptor.json index 25a01481d0..99837534db 100644 --- a/generate/input/descriptor.json +++ b/generate/input/descriptor.json @@ -4,6 +4,19 @@ "JsName": "STATES", "isMask": false }, + "blob_filter_flag": { + "values": { + "GIT_BLOB_FILTER_CHECK_FOR_BINARY": { + "JsName": "CHECK_FOR_BINARY" + }, + "GIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES": { + "JsName": "NO_SYSTEM_ATTRIBUTES" + }, + "GIT_BLOB_FILTER_ATTTRIBUTES_FROM_HEAD": { + "JsName": "ATTTRIBUTES_FROM_HEAD" + } + } + }, "branch": { "JsName": "BRANCH", "isMask": false @@ -20,6 +33,10 @@ } } }, + "credential": { + "JsName": "TYPE", + "owner": "Credential" + }, "describe_strategy": { "ignore": true }, @@ -48,16 +65,20 @@ "repository_init_flag": { "removeString": "INIT_" }, - "otype": { + "object": { "JsName": "TYPE", "owner": "Object", "removeString": "OBJ_" }, + "oid": { + "JsName": "TYPE", + "owner": "Oid" + }, "proxy": { "JsName": "PROXY", "isMask": false }, - "ref": { + "reference": { "owner": "Reference", "JsName": "TYPE" }, @@ -65,27 +86,95 @@ "JsName": "TYPE", "isMask": false }, + "revspec": { + "JsName": "TYPE", + "isMask": false + }, "sort": { "owner": "Revwalk" }, "status": { "JsName": "STATUS", "isMask": false + }, + "stream": { + "ignore": true } }, "types": { + "allocator": { + "ignore": true + }, "annotated_commit": { + "selfFreeing": true, "functions": { + "git_annotated_commit_free": { + "ignore": true + }, "git_annotated_commit_id": { "return": { "ownedByThis": true } + }, + "git_annotated_commit_from_ref": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + }, + "git_annotated_commit_from_fetchhead": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + }, + "git_annotated_commit_lookup": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + }, + "git_annotated_commit_from_revspec": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + } + } + }, + "apply_options": { + "hasConstructor": true + }, + "apply": { + "functions": { + "git_apply": { + "args": { + "options": { + "isOptional": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_apply_options_init": { + "ignore": true } } }, "attr": { "functions": { + "git_attr_cache_flush": { + "return": { + "isErrorCode": true + } + }, "git_attr_foreach": { "ignore": true }, @@ -95,27 +184,64 @@ "value_out": { "isReturn": true } + }, + "return": { + "isErrorCode": true } }, "git_attr_get_many": { + "isAsync": true, "args": { "values_out": { "isReturn": true, "jsClassName": "Array" } + }, + "return": { + "isErrorCode": true } } } }, "blame": { + "selfFreeing": true, "cType": "git_blame", "functions": { + "git_blame_buffer": { + "args": { + "out": { + "ownedBy": ["reference"] + } + } + }, "git_blame_file": { "args": { + "out": { + "ownedBy": ["repo"] + }, "options": { "isOptional": true } } + }, + "git_blame_free": { + "ignore": true + }, + "git_blame_get_hunk_byindex": { + "return": { + "ownedByThis": true + } + }, + "git_blame_get_hunk_byline": { + "return": { + "ownedByThis": true + } + }, + "git_blame_init_options": { + "ignore": true + }, + "git_blame_options_init": { + "ignore": true } } }, @@ -128,8 +254,12 @@ }, "blob": { "selfFreeing": true, + "ownerFn": { + "name": "git_blob_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { - "git_blob_create_frombuffer": { + "git_blob_create_from_buffer": { "isAsync": true, "args": { "id": { @@ -139,9 +269,12 @@ "cppClassName": "Buffer", "jsClassName": "Buffer" } + }, + "return": { + "isErrorCode": true } }, - "git_blob_create_fromworkdir": { + "git_blob_create_from_workdir": { "isAsync": true, "args": { "id": { @@ -152,7 +285,10 @@ "isErrorCode": true } }, - "git_blob_create_fromdisk": { + "git_blob_create_fromworkdir": { + "ignore": true + }, + "git_blob_create_from_disk": { "isAsync": true, "args": { "id": { @@ -163,7 +299,41 @@ "isErrorCode": true } }, - "git_blob_create_fromchunks": { + "git_blob_create_from_stream": { + "ignore": true + }, + "git_blob_create_from_stream_commit": { + "ignore": true + }, + "git_blob_filter": { + "isAsync": true, + "isPrototypeMethod": true, + "args": { + "out": { + "isReturn": true, + "cppClassName": "GitBuf", + "jsClassName": "Buffer", + "shouldAlloc": true + }, + "blob": { + "cppClassName": "GitBlob", + "jsClassName": "Blob", + "isSelf": true + }, + "as_path": { + "cppClassName": "String", + "jsClassName": "String", + "cType": "const char *" + }, + "opts": { + "isOptional": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_blob_filter_options_init": { "ignore": true }, "git_blob_filtered_content": { @@ -196,6 +366,9 @@ "isErrorCode": true } }, + "git_blob_free": { + "ignore": true + }, "git_blob_id": { "return": { "ownedByThis": true @@ -203,6 +376,7 @@ }, "git_blob_rawcontent": { "return": { + "ownedByThis": true, "cppClassName": "Wrapper", "jsClassName": "Buffer" } @@ -213,11 +387,11 @@ "node_buffer.h" ] }, + "blob_filter_options": { + "hasConstructor": true + }, "branch": { "functions": { - "git_branch_iterator_free": { - "ignore": true - }, "git_branch_create": { "args": { "force": { @@ -248,6 +422,12 @@ "isErrorCode": true } }, + "git_branch_iterator_free": { + "ignore": true + }, + "git_branch_iterator_new": { + "ignore": true + }, "git_branch_next": { "ignore": true }, @@ -258,20 +438,10 @@ "args": { "out": { "isReturn": true, - "cppClassName": "GitBuf", + "cppClassName": "GitBuf", "jsClassName": "Buffer", "cType": "git_buf *", "shouldAlloc": true - }, - "repo": { - "cppClassName": "GitRepository", - "jsClassName": "Repo", - "cType": "git_repository *" - }, - "canonical_branch_name": { - "cppClassName": "String", - "jsClassName": "String", - "cType": "const char *" } }, "return": { @@ -281,7 +451,7 @@ "git_branch_set_upstream": { "isAsync": true, "args": { - "upstream_name": { + "branch_name": { "isOptional": true } }, @@ -303,7 +473,11 @@ ] }, "buf": { + "freeFunctionName": "git_buf_dispose", "functions": { + "git_buf_free": { + "ignore": true + }, "git_buf_grow": { "cppFunctionName": "Grow", "jsFunctionName": "grow", @@ -319,7 +493,7 @@ "jsClassName": "Number", "isErrorCode": true }, - "isAsync": true + "isAsync": false }, "git_buf_set": { "cppFunctionName": "Set", @@ -340,13 +514,16 @@ "jsClassName": "Number", "isErrorCode": true }, - "isAsync": true + "isAsync": false } }, "dependencies": [ "../include/git_buf_converter.h" ] }, + "cert": { + "needsForwardDeclaration": false + }, "cert_hostkey": { "fields": { "hash_md5": { @@ -356,6 +533,10 @@ "hash_sha1": { "cppClassName": "String", "size": 20 + }, + "hash_sha256": { + "cppClassName": "String", + "size": 32 } } }, @@ -386,6 +567,9 @@ }, "git_checkout_index": { "args": { + "index": { + "isOptional": true + }, "opts": { "isOptional": true } @@ -395,6 +579,12 @@ "isErrorCode": true } }, + "git_checkout_init_options": { + "ignore": true + }, + "git_checkout_options_init": { + "ignore": true + }, "git_checkout_tree": { "args": { "treeish": { @@ -414,10 +604,28 @@ "cherrypick": { "functions": { "git_cherrypick": { + "args": { + "cherrypick_options": { + "isOptional": true + } + }, "isAsync": true, "return": { "isErrorCode": true } + }, + "git_cherrypick_commit": { + "args": { + "merge_options": { + "isOptional": true + } + } + }, + "git_cherrypick_init_options": { + "ignore": true + }, + "git_cherrypick_options_init": { + "ignore": true } } }, @@ -429,6 +637,12 @@ "isOptional": true } } + }, + "git_clone_init_options": { + "ignore": true + }, + "git_clone_options_init": { + "ignore": true } } }, @@ -450,6 +664,10 @@ }, "commit": { "selfFreeing": true, + "ownerFn": { + "name": "git_commit_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { "git_commit_amend": { "isAsync": true, @@ -475,6 +693,9 @@ "update_ref": { "isOptional": true } + }, + "return": { + "isErrorCode": true } }, "git_commit_author": { @@ -511,7 +732,27 @@ } }, "git_commit_create_buffer": { - "ignore": true + "args": { + "out": { + "isReturn": true, + "cppClassName": "GitBuf", + "jsClassName": "Buffer", + "shouldAlloc": true + }, + "message_encoding": { + "isOptional": true + }, + "parents": { + "cType": "const git_commit **", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitCommit" + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_commit_create_from_callback": { "ignore": true @@ -523,6 +764,9 @@ "ignore": true }, "git_commit_extract_signature": { + "isAsync": true + }, + "git_commit_free": { "ignore": true }, "git_commit_id": { @@ -555,7 +799,18 @@ } } }, + "commitarray": { + "fields": { + "commits": { + "ignore": true + }, + "count": { + "ignore": true + } + } + }, "config": { + "selfFreeing": true, "functions": { "git_config_add_backend": { "ignore": true @@ -567,22 +822,66 @@ "ignore": true }, "git_config_delete_entry": { - "ignore": true + "return": { + "isErrorCode": true + } }, "git_config_delete_multivar": { - "ignore": true + "return": { + "isErrorCode": true + } }, "git_config_entry_free": { "ignore": true }, "git_config_find_global": { - "ignore": true + "isAsync": true, + "args": { + "out": { + "isReturn": true, + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_config_find_programdata": { + "isAsync": true, + "return": { + "isErrorCode": true + }, + "args": { + "out": { + "isReturn": true, + "isSelf": false, + "shouldAlloc": true + } + } }, "git_config_find_system": { - "ignore": true + "isAsync": true, + "args": { + "out": { + "isReturn": true, + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_config_find_xdg": { - "ignore": true + "isAsync": true, + "args": { + "out": { + "isReturn": true, + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_config_foreach": { "ignore": true @@ -594,16 +893,44 @@ "ignore": true }, "git_config_get_bool": { - "ignore": true + "args": { + "out": { + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_config_get_entry": { - "ignore": true + "args": { + "out": { + "isReturn": true, + "ownedByThis": true + } + } }, "git_config_get_int32": { - "ignore": true + "args": { + "out": { + "cType": "int32_t *", + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_config_get_int64": { - "ignore": true + "args": { + "out": { + "cType": "int64_t *", + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_config_get_mapped": { "ignore": true @@ -627,32 +954,38 @@ } }, "git_config_get_path": { - "ignore": true - }, - "git_config_iterator_free": { - "ignore": true - }, - "git_config_iterator_glob_new": { - "ignore": true - }, - "git_config_iterator_new": { - "ignore": true + "isAsync": true, + "args": { + "out": { + "isReturn": true, + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_config_init_backend": { "ignore": true }, - "git_config_lookup_map_value": { - "ignore": true + "git_config_lock": { + "isAsync": true, + "args": { + "tx": { + "isReturn": true, + "ownedByThis": true + } + }, + "return": { + "isErrorCode": true + } }, - "git_config_multivar_iterator_new": { + "git_config_lookup_map_value": { "ignore": true }, "git_config_new": { "ignore": true }, - "git_config_next": { - "ignore": true - }, "git_config_open_default": { "isAsync": true, "return": { @@ -666,7 +999,15 @@ "ignore": true }, "git_config_open_ondisk": { - "ignore": true + "isAsync": true, + "return": { + "isErrorCode": true + }, + "args": { + "out": { + "isReturn": true + } + } }, "git_config_parse_bool": { "ignore": true @@ -680,32 +1021,44 @@ "git_config_parse_path": { "ignore": true }, - "git_config_refresh": { - "ignore": true - }, "git_config_set_bool": { - "ignore": true + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_config_set_int32": { - "ignore": true + "isAsync": true, + "return": { + "isErrorCode": true + } }, - "git_config_set_string": { + "git_config_set_int64": { "isAsync": true, "return": { "isErrorCode": true } }, - "git_config_find_programdata": { + "git_config_set_multivar": { "isAsync": true, "return": { "isErrorCode": true - }, + } + }, + "git_config_set_string": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_config_snapshot": { "args": { "out": { - "isReturn": true, - "isSelf": false, - "shouldAlloc": true + "ownedByThis": true } + }, + "return": { + "isErrorCode": true } } }, @@ -716,64 +1069,146 @@ "config_backend": { "ignore": true }, + "config_entry": { + "selfFreeing": true + }, "config_iterator": { - "ignore": true + "needsForwardDeclaration": false, + "selfFreeing": true, + "fields": { + "backend": { + "ignore": true + }, + "flags": { + "ignore": true + }, + "free": { + "ignore": true + }, + "next": { + "ignore": true + } + }, + "functions": { + "git_config_iterator_free": { + "ignore": true + }, + "git_config_iterator_new": { + "args": { + "out": { + "ownedBy": ["cfg"] + } + }, + "return": { + "isErrorCode": true + } + }, + "git_config_iterator_glob_new": { + "jsFunctionName": "createGlob", + "args": { + "out": { + "ownedBy": ["cfg"] + } + }, + "return": { + "isErrorCode": true + } + }, + "git_config_multivar_iterator_new": { + "jsFunctionName": "createMultivar", + "args": { + "out": { + "ownedBy": ["cfg"] + } + }, + "return": { + "isErrorCode": true + } + }, + "git_config_next": { + "jsFunctionName": "next", + "args": { + "entry": { + "ownedByThis": true + } + }, + "return": { + "isErrorCode": true + } + } + } }, - "cred": { - "cType": "git_cred", + "config_backend_memory_options": { + "selfFreeing": true, + "cDependencies": [ + "git2/sys/config.h" + ] + }, + "credential": { + "needsForwardDeclaration": false, + "selfFreeing": true, + "cType": "git_credential", + "fields": { + "free": { + "ignore": true + } + }, "functions": { - "git_cred_default_new": { + "git_credential_default_new": { "isAsync": false }, - "git_cred_ssh_custom_new": { + "git_credential_free": { "ignore": true }, - "git_cred_ssh_interactive_new": { + "git_credential_ssh_custom_new": { "ignore": true }, - "git_cred_ssh_key_from_agent": { + "git_credential_ssh_interactive_new": { + "ignore": true + }, + "git_credential_ssh_key_from_agent": { "isAsync": false }, - "git_cred_ssh_key_new": { + "git_credential_ssh_key_new": { "isAsync": false }, - "git_cred_userpass": { + "git_credential_userpass": { "ignore": true }, - "git_cred_userpass_plaintext_new": { + "git_credential_userpass_plaintext_new": { "isAsync": false } } }, - "cred_ssh_custom": { + "credential_default": { "ignore": true }, - "cred_ssh_interactive": { + "credential_ssh_custom": { "ignore": true }, - "cred_ssh_key": { + "credential_ssh_interactive": { "ignore": true }, - "cred_username": { - "fields": { - "username": { - "cppClassName": "String", - "cType": "char *" - } - } + "credential_ssh_key": { + "ignore": true }, - "cred_userpass_payload": { - "cDependencies": [ - "git2/cred_helpers.h" - ] + "credential_username": { + "ignore": true + }, + "credential_userpass_payload": { + "ignore": true }, - "cred_userpass_plaintext": { + "credential_userpass_plaintext": { "ignore": true }, "describe": { "ignore": true }, + "describe_format_options": { + "hasConstructor": true + }, "diff": { + "selfFreeing": true, "cDependencies": [ "git2/sys/diff.h" ], @@ -828,6 +1263,9 @@ "git_diff_find_init_options": { "ignore": true }, + "git_diff_find_options_init": { + "ignore": true + }, "git_diff_find_similar": { "args": { "diff": { @@ -853,14 +1291,54 @@ "git_diff_format_email_init_options": { "ignore": true }, + "git_diff_format_email_options_init": { + "ignore": true + }, "git_diff_free": { "ignore": true }, + "git_diff_get_perfdata": { + "isAsync": false, + "args": { + "out": { + "isReturn": true, + "shouldAlloc": true + }, + "diff": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } + }, "git_diff_get_stats": { - "ignore": true + "isAsync": true, + "args": { + "out": { + "isReturn": true, + "ownedByThis": true + }, + "diff": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_diff_index_to_index": { + "args": { + "diff": { + "ownedBy": ["repo"] + } + } }, "git_diff_index_to_workdir": { "args": { + "diff": { + "ownedBy": ["repo"] + }, "index": { "isOptional": true }, @@ -872,12 +1350,12 @@ "git_diff_init_options": { "ignore": true }, - "git_diff_is_sorted_icase": { - "ignore": true - }, "git_diff_merge": { "isAsync": true, "args": { + "from": { + "ownedByThis": true + }, "onto": { "isSelf": true } @@ -889,28 +1367,22 @@ "git_diff_num_deltas_of_type": { "ignore": true }, - "git_diff_print": { - "ignore": true - }, - "git_diff_print_callback__to_buf": { - "ignore": true - }, - "git_diff_print_callback__to_file_handle": { + "git_diff_options_init": { "ignore": true }, - "git_diff_stats_deletions": { + "git_diff_patchid_init_options": { "ignore": true }, - "git_diff_stats_files_changed": { + "git_diff_patchid_options_init": { "ignore": true }, - "git_diff_stats_free": { + "git_diff_print": { "ignore": true }, - "git_diff_stats_insertions": { + "git_diff_print_callback__to_buf": { "ignore": true }, - "git_diff_stats_to_buf": { + "git_diff_print_callback__to_file_handle": { "ignore": true }, "git_diff_status_char": { @@ -931,6 +1403,9 @@ }, "git_diff_tree_to_index": { "args": { + "diff": { + "ownedBy": ["repo"] + }, "old_tree": { "isOptional": true }, @@ -944,6 +1419,9 @@ }, "git_diff_tree_to_tree": { "args": { + "diff": { + "ownedBy": ["repo"] + }, "old_tree": { "isOptional": true }, @@ -957,6 +1435,9 @@ }, "git_diff_tree_to_workdir": { "args": { + "diff": { + "ownedBy": ["repo"] + }, "old_tree": { "isOptional": true }, @@ -967,6 +1448,9 @@ }, "git_diff_tree_to_workdir_with_index": { "args": { + "diff": { + "ownedBy": ["repo"] + }, "old_tree": { "isOptional": true }, @@ -989,6 +1473,7 @@ "ignore": true }, "diff_perfdata": { + "selfFreeing": true, "cDependencies": [ "git2/sys/diff.h" ] @@ -996,6 +1481,44 @@ "diff_similarity_metric": { "ignore": true }, + "diff_stats": { + "selfFreeing": true, + "functions": { + "git_diff_stats_deletions": { + "args": { + "stats": { + "isSelf": true + } + } + }, + "git_diff_stats_files_changed": { + "args": { + "stats": { + "isSelf": true + } + } + }, + "git_diff_stats_free": { + "ignore": true + }, + "git_diff_stats_insertions": { + "args": { + "stats": { + "isSelf": true + } + } + }, + "git_diff_stats_to_buf": { + "cppFunctionName": "DiffStatsToBuf", + "isAsync": true, + "args": { + "stats": { + "isSelf": true + } + } + } + } + }, "error_code": { "values": { "GIT_ERROR": { @@ -1003,65 +1526,156 @@ } } }, + "email": { + "cDependencies": [ + "git2/sys/email.h" + ] + }, + "email_create_options": { + "hasConstructor": true + }, + "fetch": { + "functions": { + "git_fetch_init_options": { + "ignore": true + }, + "git_fetch_options_init": { + "ignore": true + } + } + }, + "fetch_options": { + "dependencies": [ + "../include/str_array_converter.h" + ] + }, "filter": { "selfFreeing": false, "hasConstructor": true, + "cDependencies": [ + "git2/sys/filter.h" + ], + "fields": { + "cleanup": { + "ignore": true + }, + "stream": { + "ignore": true + } + } + }, + "filter_source": { + "functions": { + "git_filter_source_filemode": { + "isPrototypeMethod": true, + "args": { + "src": { + "isSelf": true + } + } + }, + "git_filter_source_flags": { + "isPrototypeMethod": true, + "args": { + "src": { + "isSelf": true + } + } + }, + "git_filter_source_id": { + "isPrototypeMethod": true, + "args": { + "src": { + "isSelf": true + } + }, + "return": { + "ownedByThis": true + } + }, + "git_filter_source_mode": { + "isPrototypeMethod": true, + "args": { + "src": { + "isSelf": true + } + } + }, + "git_filter_source_path": { + "isPrototypeMethod": true, + "args": { + "src": { + "isSelf": true + } + } + }, + "git_filter_source_repo": { + "isPrototypeMethod": true, + "args": { + "src": { + "isSelf": true + } + } + } + }, + "cDependencies": [ + "git2/sys/filter.h" + ] + }, + "filter_list": { + "selfFreeing": true, "functions": { "git_filter_list_apply_to_blob": { - "ignore": true + "isPrototypeMethod": true, + "args": { + "filters": { + "isSelf": true + }, + "out": { + "shouldAlloc": true + } + } }, "git_filter_list_apply_to_data": { - "ignore": true + "isPrototypeMethod": true, + "args": { + "filters": { + "isSelf": true + }, + "out": { + "shouldAlloc": true + } + } }, "git_filter_list_apply_to_file": { - "ignore": true + "isPrototypeMethod": true, + "args": { + "filters": { + "isSelf": true + }, + "out": { + "shouldAlloc": true + } + } }, "git_filter_list_free": { "ignore": true }, - "git_filter_list_load": { + "git_filter_list_new": { "ignore": true }, "git_filter_list_push": { "ignore": true - }, - "git_filter_source_filemode": { - "ignore": true - }, - "git_filter_source_flags": { - "ignore": true - }, - "git_filter_source_id": { - "ignore": true - }, - "git_filter_source_mode": { - "ignore": true - }, - "git_filter_source_options": { - "ignore": true - }, - "git_filter_source_path": { - "ignore": true - }, - "git_filter_source_repo": { - "ignore": true } }, - "cDependencies": [ - "git2/sys/filter.h" - ], - "fields": { - "stream": { - "ignore": true - } - } - }, - "filter_source": { - "ignore": false, - "cDependencies": [ - "git2/sys/filter.h" + "dependencies": [ + "../include/git_buf_converter.h", + "../include/filter_registry.h" ] }, + "giterr": { + "ignore": true + }, "graph": { "functions": { "git_graph_ahead_behind": { @@ -1085,10 +1699,43 @@ "return": { "isResultOrError": true } + }, + "git_graph_reachable_from_any": { + "args": { + "descendant_array": { + "cType": "git_oid *", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitOid" + } + }, + "isAsync": true, + "return": { + "isResultOrError": true + } } } }, "hashsig": { + "selfFreeing": true, + "freeFunctionName": "git_hashsig_free", + "functions": { + "git_hashsig_create": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_hashsig_create_fromfile": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_hashsig_free": { + "ignore": true + } + }, "cDependencies": [ "git2/sys/hashsig.h" ] @@ -1102,11 +1749,25 @@ "isReturn": true } }, - "isAsync": true + "isAsync": true, + "return": { + "isErrorCode": true + } } } }, + "imaxdiv": { + "ignore": true + }, + "imaxdiv_t": { + "ignore": true + }, "index": { + "selfFreeing": true, + "ownerFn": { + "name": "git_index_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { "git_index_add": { "isAsync": true, @@ -1140,6 +1801,9 @@ "git_index_add_frombuffer": { "ignore": true }, + "git_index_add_from_buffer": { + "ignore": true + }, "git_index_checksum": { "return": { "ownedByThis": true @@ -1180,13 +1844,16 @@ "git_index_conflict_get": { "args": { "ancestor_out": { - "isReturn": true + "isReturn": true, + "ownedBy": ["index"] }, "our_out": { - "isReturn": true + "isReturn": true, + "ownedBy": ["index"] }, "their_out": { - "isReturn": true + "isReturn": true, + "ownedBy": ["index"] } }, "isAsync": true, @@ -1252,9 +1919,13 @@ "git_index_open": { "isAsync": true, "return": { + "selfOwned": true, "isErrorCode": true } }, + "git_index_owner": { + "ignore": true + }, "git_index_read": { "args": { "force": { @@ -1352,36 +2023,249 @@ "../include/str_array_converter.h" ] }, + "index_conflict_iterator": { + "selfFreeing": true, + "freeFunctionName": "git_index_conflict_iterator_free", + "functions": { + "git_index_conflict_iterator_free": { + "ignore": true + }, + "git_index_conflict_iterator_new": { + "args": { + "iterator_out": { + "ownedBy": ["index"] + } + } + }, + "git_index_conflict_next": { + "isAsync": false, + "jsFunctionName": "next", + "cppFunctionName": "Next", + "args": { + "ancestor_out": { + "isReturn": true, + "ownedByThis": true + }, + "our_out": { + "isReturn": true, + "ownedByThis": true + }, + "their_out": { + "isReturn": true, + "ownedByThis": true + } + } + } + } + }, "index_entry": { + "isReturnable": true, "hasConstructor": true, "ignoreInit": true }, - "indexer": { - "cType": "git_indexer", + "index_iterator": { + "selfFreeing": true, + "freeFunctionName": "git_index_iterator_free", "functions": { - "git_indexer_append": { + "git_index_iterator_free": { "ignore": true }, - "git_indexer_hash": { - "return": { - "ownedByThis": true + "git_index_iterator_new": { + "args": { + "iterator_out": { + "ownedBy": ["index"] + } } }, - "git_indexer_new": { - "ignore": true + "git_index_iterator_next": { + "isAsync": false, + "args": { + "out": { + "ownedByThis": true + } + } } } }, - "mempack": { + "index_name_entry": { "functions": { - "git_mempack_new": { - "ignore": true + "git_index_name_add": { + "cppFunctionName": "Add", + "jsFunctionName": "add", + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_name_clear": { + "cppFunctionName": "Clear", + "jsFunctionName": "clear", + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_name_entrycount": { + "cppFunctionName": "Entrycount", + "jsFunctionName": "entryCount" + }, + "git_index_name_get_byindex": { + "cppFunctionName": "GetByIndex", + "jsFunctionName": "getByIndex", + "isPrototypeMethod": false + } + }, + "cDependencies": [ + "git2/sys/index.h" + ] + }, + "index_reuc_entry": { + "fields": { + "mode": { + "cType": "uint32_t [3]" + } + }, + "functions": { + "git_index_reuc_add": { + "cppFunctionName": "Add", + "jsFunctionName": "add", + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_reuc_clear": { + "cppFunctionName": "Clear", + "jsFunctionName": "clear", + "isAsync": true, + "isPrototypeMethod": false, + "return": { + "isErrorCode": true + } + }, + "git_index_reuc_entrycount": { + "cppFunctionName": "Entrycount", + "jsFunctionName": "entryCount" + }, + "git_index_reuc_find": { + "args": { + "at_pos": { + "isReturn": true, + "shouldAlloc": true + } + }, + "cppFunctionName": "Find", + "jsFunctionName": "find", + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_reuc_get_byindex": { + "cppFunctionName": "GetByIndex", + "jsFunctionName": "getByIndex", + "isPrototypeMethod": false + }, + "git_index_reuc_get_bypath": { + "cppFunctionName": "GetByPath", + "jsFunctionName": "getByPath", + "isPrototypeMethod": false }, - "git_mempack_reset": { + "git_index_reuc_remove": { + "cppFunctionName": "Remove", + "jsFunctionName": "remove", + "isAsync": true, + "isPrototypeMethod": false, + "return": { + "isErrorCode": true + } + } + }, + "cDependencies": [ + "git2/sys/index.h" + ] + }, + "index_time": { + "isReturnable": true, + "hasConstructor": true, + "ignoreInit": true + }, + "indexer": { + "ignore": true + }, + "indexer_options": { + "ignore": true + }, + "LIBSSH2_SESSION": { + "ignore": true + }, + "LIBSSH2_USERAUTH_KBDINT_PROMPT": { + "ignore": true + }, + "LIBSSH2_USERAUTH_KBDINT_RESPONSE": { + "ignore": true + }, + "_LIBSSH2_SESSION": { + "ignore": true + }, + "_LIBSSH2_USERAUTH_KBDINT_PROMPT": { + "ignore": true + }, + "_LIBSSH2_USERAUTH_KBDINT_RESPONSE": { + "ignore": true + }, + "mailmap": { + "selfFreeing": true, + "freeFunctionName": "git_mailmap_free", + "functions": { + "git_mailmap_add_entry": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_mailmap_free": { "ignore": true + }, + "git_mailmap_from_buffer": { + "return": { + "isErrorCode": true + } + }, + "git_mailmap_from_repository": { + "args": { + "out": { + "ownedBy": ["repo"] + } + }, + "return": { + "isErrorCode": true + } + }, + "git_mailmap_resolve": { + "args": { + "real_name": { + "isReturn": true + }, + "real_email": { + "isReturn": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_mailmap_resolve_signature": { + "return": { + "isErrorCode": true + } } } }, + "mempack": { + "ignore": true + }, "merge": { "functions": { "git_merge": { @@ -1404,10 +2288,12 @@ "jsClassName": "Number" }, "merge_opts": { + "isOptional": true, "cType": "git_merge_options *", "cppClassName": "GitMergeOptions" }, "checkout_opts": { + "isOptional": true, "cType": "git_checkout_options *", "cppClassName": "GitCheckoutOptions" } @@ -1417,7 +2303,58 @@ } }, "git_merge_analysis": { - "ignore": true + "isAsync": true, + "args": { + "analysis_out": { + "isReturn": true, + "shouldAlloc": true + }, + "preference_out": { + "isReturn": true, + "shouldAlloc": true + }, + "their_heads": { + "cType": "const git_annotated_commit **", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitAnnotatedCommit" + }, + "their_heads_len": { + "cType": "size_t", + "cppClassName": "Number", + "jsClassName": "Number" + } + }, + "return": { + "isErrorCode": true + } + }, + "git_merge_analysis_for_ref": { + "isAsync": true, + "args": { + "analysis_out": { + "isReturn": true, + "shouldAlloc": true + }, + "preference_out": { + "isReturn": true, + "shouldAlloc": true + }, + "their_heads": { + "cType": "const git_annotated_commit **", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitAnnotatedCommit" + }, + "their_heads_len": { + "cType": "size_t", + "cppClassName": "Number", + "jsClassName": "Number" + } + }, + "return": { + "isErrorCode": true + } }, "git_merge_base_many": { "ignore": true @@ -1441,48 +2378,124 @@ "git_merge_file_from_index": { "ignore": true }, + "git_merge_file_input_init": { + "ignore": true + }, + "git_merge_file_init_input": { + "ignore": true + }, "git_merge_file_init_options": { "ignore": true }, - "git_merge_file_result_free": { + "git_merge_file_options_init": { + "ignore": true + }, + "git_merge_init_options": { + "ignore": true + }, + "git_merge_options_init": { "ignore": true + }, + "git_merge_trees": { + "args": { + "ancestor_tree": { + "isOptional": true + }, + "opts": { + "isOptional": true + } + } } } }, "merge_driver": { "ignore": true }, + "merge_driver_source": { + "ignore": true + }, + "merge_file_result": { + "ignore": true + }, + "merge_result": { + "ignore": true + }, "message": { - "functions": { - "git_message_prettify": { - "ignore": true - } - } + "ignore": true + }, + "message_trailer": { + "ignore": true + }, + "message_trailer_array": { + "ignore": true }, "note": { + "selfFreeing": true, "functions": { - "git_note_iterator_free": { - "ignore": true + "git_note_author": { + "return": { + "ownedByThis": true + } }, - "git_note_create": { + "git_note_commit_create": { "args": { - "out": { + "notes_commit_out": { + "isReturn": true, + "shouldAlloc": true + }, + "notes_blob_out": { + "isReturn": true, "shouldAlloc": true } } }, - "git_note_id": { + "git_note_commit_remove": { + "isAsync": true, + "args": { + "notes_commit_out": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_note_comitter": { "return": { "ownedByThis": true } }, - "git_note_remove": { + "git_note_create": { + "args": { + "out": { + "shouldAlloc": true + } + } + }, + "git_note_foreach": { "isAsync": true, "return": { "isErrorCode": true } }, - "git_note_foreach": { + "git_note_free": { + "ignore": true + }, + "git_note_id": { + "return": { + "ownedByThis": true + } + }, + "git_note_iterator_free": { + "ignore": true + }, + "git_note_iterator_new": { + "ignore": true + }, + "git_note_next": { + "ignore": true + }, + "git_note_remove": { "isAsync": true, "return": { "isErrorCode": true @@ -1491,7 +2504,15 @@ } }, "object": { + "selfFreeing": true, + "ownerFn": { + "name": "git_object_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { + "git_object_free": { + "ignore": true + }, "git_object_id": { "return": { "ownedByThis": true @@ -1507,6 +2528,7 @@ } }, "odb": { + "selfFreeing": true, "functions": { "git_odb_add_alternate": { "ignore": true @@ -1514,24 +2536,44 @@ "git_odb_add_backend": { "ignore": true }, - "git_odb_backend_loose": { - "ignore": true - }, - "git_odb_backend_one_pack": { - "ignore": true - }, - "git_odb_backend_pack": { - "ignore": true + "git_odb_add_disk_alternate": { + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_odb_exists": { - "ignore": true + "ignore": true, + "isAsync": true, + "args": { + "db": { + "isSelf": true + } + } }, "git_odb_exists_prefix": { + "isAsync": true, + "args": { + "db": { + "isSelf": true + }, + "out": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_odb_expand_ids": { "ignore": true }, "git_odb_foreach": { "ignore": true }, + "git_odb_free": { + "ignore": true + }, "git_odb_get_backend": { "ignore": true }, @@ -1539,7 +2581,15 @@ "ignore": true }, "git_odb_hashfile": { - "ignore": true + "isAsync": true, + "args": { + "out": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + } }, "git_odb_init_backend": { "ignore": true @@ -1556,27 +2606,29 @@ "git_odb_open_wstream": { "ignore": true }, + "git_odb_read": { + "isAsync": true, + "cppFunctionName": "OdbRead", + "args": { + "obj": { + "isReturn": true, + "ownedByThis": true + } + } + }, "git_odb_read_header": { "ignore": true }, "git_odb_read_prefix": { - "ignore": true + "args": { + "out": { + "ownedByThis": true + } + } }, "git_odb_refresh": { "ignore": true }, - "git_odb_stream_finalize_write": { - "ignore": true - }, - "git_odb_stream_free": { - "ignore": true - }, - "git_odb_stream_read": { - "ignore": true - }, - "git_odb_stream_write": { - "ignore": true - }, "git_odb_write": { "args": { "data": { @@ -1601,14 +2653,25 @@ }, "ignore": true }, + "odb_expand_id": { + "ignore": true + }, "odb_object": { + "selfFreeing": true, "functions": { "git_odb_object_data": { "return": { + "ownedByThis": true, "cppClassName": "Wrapper", "jsClassName": "Buffer" } }, + "git_odb_object_dup": { + "ignore": true + }, + "git_odb_object_free": { + "ignore": true + }, "git_odb_object_id": { "return": { "ownedByThis": true @@ -1633,10 +2696,17 @@ "shouldAlloc": true, "functions": { "git_oid_cpy": { + "isAsync": false, "args": { + "src": { + "shouldAlloc": false + }, "out": { "isReturn": true } + }, + "return": { + "isErrorCode": true } }, "git_oid_fmt": { @@ -1646,13 +2716,25 @@ "ignore": true }, "git_oid_fromstr": { - "isAsync": false + "ignore": true }, "git_oid_fromstrn": { "ignore": true }, "git_oid_fromstrp": { - "ignore": true + "isAsync": false, + "jsFunctionName": "fromString", + "args": { + "out": { + "isReturn": true + }, + "str": { + "shouldAlloc": false + } + }, + "return": { + "isErrorCode": true + } }, "git_oid_nfmt": { "ignore": true @@ -1660,15 +2742,6 @@ "git_oid_pathfmt": { "ignore": true }, - "git_oid_shorten_add": { - "ignore": true - }, - "git_oid_shorten_free": { - "ignore": true - }, - "git_oid_shorten_new": { - "ignore": true - }, "git_oid_tostr": { "ignore": true } @@ -1679,21 +2752,73 @@ } } }, + "oid_shorten": { + "selfFreeing": true, + "functions": { + "git_oid_shorten_new": { + "isPrototypeMethod": false + }, + "git_oid_shorten_add": { + "args": { + "os": { + "isSelf": true + } + } + }, + "git_oid_shorten_free": { + "ignore": true + } + } + }, + "oidarray": { + "selfFreeing": true, + "functions": { + "git_oidarray_free": { + "ignore": true + } + } + }, "openssl": { - "cDependencies": [ - "git2/sys/openssl.h" - ] + "ignore": true }, "packbuilder": { + "selfFreeing": true, "functions": { "git_packbuilder_foreach": { "ignore": true }, + "git_packbuilder_free": { + "ignore": true + }, "git_packbuilder_hash": { "return": { "ownedByThis": true } }, + "git_packbuilder_insert": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_packbuilder_insert_commit": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_packbuilder_insert_recur": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_packbuilder_insert_walk": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, "git_packbuilder_new": { "isAsync": false }, @@ -1702,30 +2827,72 @@ }, "git_packbuilder_write": { "ignore": true + }, + "git_packbuilder_write_buf": { + "ignore": true } } }, "patch": { + "selfFreeing": true, "dependencies": [ "../include/convenient_patch.h" ], + "ownerFn": { + "name": "git_patch_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { "git_patch_free": { "ignore": true }, + "git_patch_from_blobs": { + "isAsync": true, + "args": { + "out": { + "isReturn": true + }, + "old_blob": { + "isOptional": true + }, + "old_as_path": { + "isOptional": true + }, + "new_blob": { + "isOptional": true + }, + "new_as_path": { + "isOptional": true + }, + "opts": { + "isOptional": true + } + } + }, + "git_patch_from_blob_and_buffer": { + "ignore": true + }, "git_patch_from_buffers": { "ignore": true }, "git_patch_from_diff": { "isAsync": true, + "args": { + "out": { + "ownedBy": ["diff"] + } + } + }, + "git_patch_get_delta": { "return": { - "isErrorCode": true + "ownedByThis": true } }, "git_patch_get_hunk": { "args": { "out": { - "returnName": "hunk" + "returnName": "hunk", + "ownedByThis": true }, "lines_in_hunk": { "shouldAlloc": true, @@ -1740,6 +2907,11 @@ }, "git_patch_get_line_in_hunk": { "isAsync": true, + "args": { + "out": { + "ownedByThis": true + } + }, "return": { "isErrorCode": true } @@ -1768,35 +2940,112 @@ } } }, + "path": { + "cDependencies": [ + "git2/sys/path.h" + ] + }, "pathspec": { + "selfFreeing": true, + "dependencies": [ + "../include/str_array_converter.h" + ], "functions": { - "git_pathspec_match_list_free": { + "git_pathspec_free": { "ignore": true }, + "git_pathspec_match_diff": { + "isAsync": true, + "args": { + "out": { + "ownedBy": ["diff"], + "ownedByThis": true + } + } + }, + "git_pathspec_match_index": { + "isAsync": true, + "args": { + "out": { + "ownedBy": ["index"], + "ownedByThis": true + } + } + }, "git_pathspec_new": { "isAsync": false + }, + "git_pathspec_match_tree": { + "isAsync": true, + "args": { + "out": { + "ownedBy": ["tree"], + "ownedByThis": true + } + } + }, + "git_pathspec_match_workdir": { + "isAsync": true, + "args": { + "out": { + "ownedBy": ["repo"], + "ownedByThis": true + } + } } } }, - "push": { - "cType": "git_push", + "pathspec_match_list": { + "selfFreeing": true, "functions": { - "git_push_finish": { - "isAsync": true, + "git_pathspec_match_list_diff_entry": { "return": { - "isErrorCode": true + "ownedByThis": true } }, - "git_push_set_callbacks": { + "git_pathspec_match_list_free": { + "ignore": true + } + } + }, + "proxy": { + "functions": { + "git_proxy_init_options": { "ignore": true }, - "git_push_status_foreach": { + "git_proxy_options_init": { "ignore": true } } }, + "push": { + "ignore": true + }, + "push_options": { + "dependencies": [ + "../include/str_array_converter.h" + ] + }, "rebase": { + "hasConstructor": false, + "selfFreeing": true, "functions": { + "git_rebase_abort": { + "isAsync": true, + "args": { + "rebase": { + "cType": "git_rebase *", + "cppClassName": "GitRebase", + "jsClassName": "Rebase", + "isOptional": false, + "isSelf": true, + "isReturn": false + } + }, + "return": { + "isErrorCode": true + } + }, "git_rebase_commit": { "isAsync": true, "args": { @@ -1833,6 +3082,10 @@ }, "git_rebase_init": { "args": { + "out": { + "isSelf": true, + "ownedBy": ["repo"] + }, "upstream": { "isOptional": true }, @@ -1843,33 +3096,120 @@ "isOptional": true }, "opts": { + "preserveOnThis": true, "isOptional": true } } }, - "git_rebase_abort": { + "git_rebase_init_options": { + "ignore": true + }, + "git_rebase_inmemory_index": { + "args": { + "out": { + "ownedByThis": true + } + } + }, + "git_rebase_next": { "isAsync": true, "args": { - "rebase": { - "cType": "git_rebase *", - "cppClassName": "GitRebase", - "jsClassName": "Rebase", - "isOptional": false, - "isSelf": true, - "isReturn": false + "operation": { + "isReturn": true, + "ownedByThis": true } }, "return": { "isErrorCode": true } + }, + "git_rebase_open": { + "args": { + "out": { + "isSelf": true, + "ownedBy": ["repo"] + }, + "opts": { + "isOptional": true, + "preserveOnThis": true + } + } + }, + "git_rebase_operation_byindex": { + "return": { + "ownedByThis": true + } + }, + "git_rebase_operation_current": { + "return": { + "ownedByThis": true + } + }, + "git_rebase_options_init": { + "ignore": true + } + } + }, + "rebase_options": { + "fields": { + "signing_cb": { + "ignore": true + }, + "commit_create_cb": { + "args": [ + { + "name": "out", + "cType": "git_oid *" + }, + { + "name": "author", + "cType": "const git_signature *" + }, + { + "name": "committer", + "cType": "const git_signature *" + }, + { + "name": "message_encoding", + "cType": "const char *" + }, + { + "name": "message", + "cType": "const char *" + }, + { + "name": "tree", + "cType": "const git_tree *" + }, + { + "name": "parent_count", + "cType": "size_t" + }, + { + "name": "parents", + "cType": "const git_oid **", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitOid", + "arrayLengthArgumentName": "parent_count" + }, + { + "name": "payload", + "cType": "void *" + } + ] } } }, "refdb": { + "selfFreeing": true, "functions": { "git_refdb_backend_fs": { "ignore": true }, + "git_refdb_free": { + "ignore": true + }, "git_refdb_init_backend": { "ignore": true }, @@ -1878,6 +3218,13 @@ }, "git_refdb_new": { "ignore": true + }, + "git_refdb_open": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } } } }, @@ -1887,6 +3234,10 @@ "reference": { "cppClassName": "GitRefs", "selfFreeing": true, + "ownerFn": { + "name": "git_reference_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { "git_reference__alloc": { "ignore": true @@ -1926,7 +3277,10 @@ "key": "strings" } }, - "isAsync": true + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_reference_next": { "ignore": true @@ -1961,7 +3315,23 @@ "ignore": true }, "reflog": { + "selfFreeing": true, "functions": { + "git_reflog_entry_byindex": { + "return": { + "ownedByThis": true + } + }, + "git_reflog_free": { + "ignore": true + }, + "git_reflog_read": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + }, "git_reflog_write": { "isAsync": true, "isSelf": true, @@ -1973,6 +3343,11 @@ }, "reflog_entry": { "functions": { + "git_reflog_entry_committer": { + "return": { + "ownedByThis": true + } + }, "git_reflog_entry_id_new": { "return": { "ownedByThis": true @@ -1986,12 +3361,24 @@ } }, "refspec": { + "selfFreeing": true, "cType": "git_refspec", "functions": { - "git_refspec_rtransform": { + "git_refspec_free": { "ignore": true }, - "git_refspec_string": { + "git_refspec_parse": { + "isAsync": true, + "args": { + "refspec": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_refspec_rtransform": { "ignore": true }, "git_refspec_transform": { @@ -2001,10 +3388,15 @@ }, "remote": { "dependencies": [ + "../include/str_array_converter.h", "../include/remote_head.h" ], "cType": "git_remote", "selfFreeing": true, + "ownerFn": { + "name": "git_remote_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { "git_remote_create": { "isAsync": true, @@ -2012,19 +3404,65 @@ "isErrorCode": true } }, - "git_remote_connect": { + "git_remote_create_detached": { + "isAsync": true, + "args": { + "out": { + "selfOwned": true + } + } + }, + "git_remote_create_init_options": { + "ignore": true + }, + "git_remote_create_options_init": { + "ignore": true + }, + "git_remote_create_with_opts": { + "args": { + "opts": { + "isOptional": true + } + } + }, + "git_remote_connect": { + "isAsync": true, + "args": { + "callbacks": { + "isOptional": true, + "preserveOnThis": true + }, + "proxy_opts": { + "isOptional": true, + "preserveOnThis": true + }, + "custom_headers": { + "isOptional": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_remote_connect_ext": { + "isAsync": true + }, + "git_remote_connect_options_init": { + "ignore": true + }, + "git_remote_disconnect": { "isAsync": true, "return": { "isErrorCode": true } }, - "git_remote_disconnect": { - "isAsync": true - }, "git_remote_download": { "args": { "refspecs": { "isOptional": true + }, + "opts": { + "isOptional": true } }, "isAsync": true, @@ -2056,6 +3494,9 @@ }, "git_remote_fetch": { "args": { + "opts": { + "isOptional": true + }, "reflog_message": { "isOptional": true }, @@ -2068,6 +3509,9 @@ "isErrorCode": true } }, + "git_remote_free": { + "ignore": true + }, "git_remote_get_fetch_refspecs": { "args": { "array": { @@ -2079,7 +3523,10 @@ "key": "strings" } }, - "isAsync": true + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_remote_get_push_refspecs": { "args": { @@ -2092,13 +3539,20 @@ "key": "strings" } }, - "isAsync": true + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_remote_get_refspec": { "return": { + "selfFreeing": false, "ownedByThis": true } }, + "git_remote_init_callbacks": { + "ignore": true + }, "git_remote_list": { "args": { "out": { @@ -2115,7 +3569,31 @@ "ignore": true }, "git_remote_rename": { - "ignore": true + "isAsync": true, + "args": { + "problems": { + "isReturn": true, + "shouldAlloc": true, + "cppClassName": "Array", + "jsClassName": "Array", + "size": "count", + "key": "strings" + } + }, + "return": { + "isErrorCode": true + } + }, + "git_remote_prune": { + "args": { + "callbacks": { + "isOptional": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_remote_push": { "isAsync": true, @@ -2123,6 +3601,9 @@ "isErrorCode": true }, "args": { + "refspecs": { + "isOptional": true + }, "opts": { "isOptional": true } @@ -2141,9 +3622,36 @@ "return": { "ownedByThis": true } + }, + "git_remote_update_tips": { + "isAsync": true, + "args": { + "reflog_message": { + "isOptional": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_remote_upload": { + "args": { + "refspecs": { + "isOptional": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } } } }, + "remote_connect_options": { + "dependencies": [ + "../include/str_array_converter.h" + ] + }, "remote_callbacks": { "fields": { "completion": { @@ -2155,11 +3663,8 @@ "push_negotiation": { "ignore": true }, - "push_transfer_progress": { - "ignore": true - }, "sideband_progress": { - "ignore": true + "ignore": false }, "update_tips": { "ignore": true @@ -2174,16 +3679,59 @@ "selfFreeing": true }, "repository": { + "hasConstructor": false, + "selfFreeing": true, + "isSingleton": true, "dependencies": [ - "git2/sys/repository.h" + "git2/sys/repository.h", + "../include/commit.h", + "../include/submodule.h", + "../include/remote.h" ], "functions": { + "git_repository__cleanup": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_repository_commit_parents": { + "isAsync": true, + "args": { + "commits": { + "shouldAlloc": true, + "selfFreeing": true, + "isReturn": true, + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitCommit", + "size": "count", + "key": "commits" + } + }, + "return": { + "isErrorCode": true + } + }, + "git_repository_config": { + "args": { + "out": { + "ownedByThis": true + } + } + }, + "git_repository_config_snapshot": { + "ignore": true + }, "git_repository_discover": { "isAsync": true, "return": { "isErrorCode": true }, "args": { + "ceiling_dirs": { + "isOptional": true + }, "out": { "isReturn": true, "isSelf": false, @@ -2191,19 +3739,30 @@ } } }, - "git_repository_init_init_options": { - "ignore": true - }, "git_repository_fetchhead_foreach": { "isAsync": true, "return": { "isErrorCode": true } }, + "git_repository_free": { + "ignore": true + }, "git_repository_hashfile": { "ignore": true }, "git_repository_ident": { + "args": { + "name": { + "isReturn": true + }, + "email": { + "isReturn": true + } + }, + "isAsync": false + }, + "git_repository_init_options_init": { "ignore": true }, "git_repository_mergehead_foreach": { @@ -2218,6 +3777,34 @@ "git_repository_new": { "ignore": true }, + "git_repository_odb": { + "isAsync": true, + "args": { + "odb": { + "ownedByThis": true + }, + "repo": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_repository_refdb": { + "isAsync": true, + "args": { + "out": { + "ownedByThis": true + }, + "repo": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } + }, "git_repository_reinit_filesystem": { "ignore": true }, @@ -2238,6 +3825,9 @@ "index": { "isOptional": true } + }, + "return": { + "isErrorCode": true } }, "git_repository_set_odb": { @@ -2245,6 +3835,19 @@ }, "git_repository_set_refdb": { "ignore": true + }, + "git_repository_statistics": { + "isAsync": true + }, + "git_repository_submodule_cache_all": { + "return": { + "isErrorCode": true + } + }, + "git_repository_submodule_cache_clear": { + "return": { + "isErrorCode": true + } } } }, @@ -2271,6 +3874,9 @@ }, "git_revert_init_options": { "ignore": true + }, + "git_revert_options_init": { + "ignore": true } } }, @@ -2282,8 +3888,12 @@ } }, "reset": { + "dependencies": [ + "../include/str_array_converter.h" + ], "functions": { "git_reset": { + "isCollectionRoot": true, "args": { "checkout_opts": { "isOptional": true @@ -2324,11 +3934,12 @@ } } }, - "revspec": { - "ignore": true - }, "revwalk": { "selfFreeing": true, + "ownerFn": { + "name": "git_revwalk_repository", + "singletonCppClassName": "GitRepository" + }, "dependencies": [ "../include/commit.h", "../include/functions/copy.h" @@ -2337,22 +3948,43 @@ "git_revwalk_add_hide_cb": { "ignore": true }, + "git_revwalk_free": { + "ignore": true + }, "git_revwalk_new": { "isAsync": false } } }, "signature": { + "selfFreeing": true, "dupFunction": "git_signature_dup", "functions": { "git_signature_default": { - "isAsync": false + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_signature_dup": { + "ignore": true + }, + "git_signature_free": { + "ignore": true }, "git_signature_new": { "isAsync": false }, "git_signature_now": { - "isAsync": false + "isAsync": false, + "args": { + "sig_out": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + } } } }, @@ -2369,17 +4001,37 @@ } } }, + "smart_subtransport": { + "ignore": true + }, "smart_subtransport_definition": { "ignore": true }, + "smart_subtransport_stream": { + "ignore": true + }, "stash": { "functions": { "git_stash_apply": { + "args": { + "options": { + "isOptional": true + } + }, "isAsync": true, "return": { "isErrorCode": true } }, + "git_stash_apply_init_options": { + "ignore": true + }, + "git_stash_apply_options_init": { + "ignore": true + }, + "git_stash_save_options_init": { + "ignore": true + }, "git_stash_drop": { "isAsync": true, "return": { @@ -2393,6 +4045,11 @@ } }, "git_stash_pop": { + "args": { + "options": { + "isOptional": true + } + }, "isAsync": true, "return": { "isErrorCode": true @@ -2411,13 +4068,24 @@ } } }, + "stash_save_options": { + "dependencies": [ + "../include/str_array_converter.h" + ] + }, + "stdalloc": { + "ignore": true + }, "status": { "cDependencies": [ "git2/sys/diff.h" ], "functions": { "git_status_byindex": { - "isAsync": false + "isAsync": false, + "return": { + "ownedBy": ["statuslist"] + } }, "git_status_file": { "isAsync": true, @@ -2425,10 +4093,10 @@ "status_flags": { "isReturn": true, "shouldAlloc": true - }, - "return": { - "isErrorCode": true } + }, + "return": { + "isErrorCode": true } }, "git_status_foreach": { @@ -2443,16 +4111,41 @@ "isErrorCode": true } }, - "git_status_init_options": { - "ignore": true - } - } - }, - "status_list": { - "functions": { + "git_status_init_options": { + "ignore": true + }, + "git_status_options_init": { + "ignore": true + } + } + }, + "status_list": { + "selfFreeing": true, + "functions": { + "git_status_list_free": { + "ignore": true + }, + "git_status_list_get_perfdata": { + "isAsync": false, + "args": { + "out": { + "isReturn": true, + "shouldAlloc": true + }, + "status": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } + }, "git_status_list_new": { "isAsync": true, "args": { + "out": { + "ownedBy": ["repo"] + }, "opts": { "isOptional": true } @@ -2464,6 +4157,16 @@ } }, "strarray": { + "selfFreeing": true, + "freeFunctionName": "git_strarray_dispose", + "functions": { + "git_strarray_dispose": { + "ignore": true + }, + "git_strarray_free": { + "ignore": true + } + }, "dependencies": [ "../include/str_array_converter.h" ] @@ -2474,7 +4177,16 @@ "git2/sys/stream.h" ] }, + "stream_registration": { + "ignore": true + }, "submodule": { + "hasConstructor": false, + "selfFreeing": true, + "ownerFn": { + "name": "git_submodule_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { "git_submodule_add_to_index": { "isAsync": true, @@ -2513,6 +4225,9 @@ "type": "int" } }, + "git_submodule_free": { + "ignore": true + }, "git_submodule_index_id": { "return": { "ownedByThis": true @@ -2611,16 +4326,26 @@ "return": { "isErrorCode": true } + }, + "git_submodule_update_init_options": { + "ignore": true + }, + "git_submodule_update_options_init": { + "ignore": true } } }, "tag": { + "dependencies": [ + "../include/str_array_converter.h" + ], "selfFreeing": true, + "ownerFn": { + "name": "git_tag_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { - "git_tag_foreach": { - "ignore": true - }, - "git_tag_create": { + "git_tag_annotation_create": { "args": { "oid": { "isReturn": true @@ -2631,15 +4356,18 @@ }, "isAsync": true }, - "git_tag_create_frombuffer": { - "ignore": true - }, - "git_tag_id": { + "git_tag_create": { + "args": { + "oid": { + "isReturn": true + } + }, "return": { - "ownedByThis": true - } + "isErrorCode": true + }, + "isAsync": true }, - "git_tag_create_lightweight": { + "git_tag_create_from_buffer": { "args": { "oid": { "isReturn": true @@ -2650,7 +4378,7 @@ }, "isAsync": true }, - "git_tag_annotation_create": { + "git_tag_create_lightweight": { "args": { "oid": { "isReturn": true @@ -2661,6 +4389,17 @@ }, "isAsync": true }, + "git_tag_foreach": { + "ignore": true + }, + "git_tag_free": { + "ignore": true + }, + "git_tag_id": { + "return": { + "ownedByThis": true + } + }, "git_tag_list": { "args": { "tag_names": { @@ -2672,7 +4411,26 @@ "key": "strings" } }, - "isAsync": true + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_tag_list_match": { + "args": { + "tag_names": { + "isReturn": true, + "shouldAlloc": true, + "cppClassName": "Array", + "jsClassName": "Array", + "size": "count", + "key": "strings" + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_tag_tagger": { "return": { @@ -2680,10 +4438,14 @@ } }, "git_tag_target": { + "isAsync": true, "args": { "target_out": { "isReturn": true } + }, + "return": { + "isErrorCode": true } }, "git_tag_target_id": { @@ -2696,15 +4458,27 @@ "isErrorCode": true }, "isAsync": true + }, + "git_tag_peel": { + "args": { + "tag_target_out": { + "isReturn": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } } } }, "time": { "dupFunction": "git_time_dup", - "dependencies": [ - "git2/sys/time.h" - ] - + "functions": { + "git_time_sign": { + "ignore": true + } + } }, "trace": { "functions": { @@ -2713,16 +4487,75 @@ } } }, + "transaction": { + "selfFreeing": true, + "functions": { + "git_transaction_free": { + "ignore": true + }, + "git_transaction_new": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + } + } + }, "transfer_progress": { "dupFunction": "git_transfer_progress_dup" }, "transport": { "cType": "git_transport", "needsForwardDeclaration": false, + "fields": { + "cancel": { + "ignore": true + }, + "close": { + "ignore": true + }, + "connect": { + "ignore": true + }, + "download_pack": { + "ignore": true + }, + "free": { + "ignore": true + }, + "is_connected": { + "ignore": true + }, + "ls": { + "ignore": true + }, + "negotiate_fetch": { + "ignore": true + }, + "push": { + "ignore": true + }, + "read_flags": { + "ignore": true + }, + "set_callbacks": { + "ignore": true + }, + "set_custom_headers": { + "ignore": true + }, + "version": { + "ignore": true + } + }, "functions": { "git_transport_dummy": { "ignore": true }, + "git_transport_init": { + "ignore": true + }, "git_transport_local": { "ignore": true }, @@ -2734,6 +4567,12 @@ }, "git_transport_smart": { "ignore": true + }, + "git_transport_ssh_with_paths": { + "ignore": true + }, + "git_transport_unregister": { + "ignore": true } }, "cDependencies": [ @@ -2742,30 +4581,58 @@ }, "tree": { "selfFreeing": true, + "ownerFn": { + "name": "git_tree_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { + "git_tree_create_updated": { + "args": { + "updates": { + "cType": "git_tree_update *", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitTreeUpdate" + } + } + }, "git_tree_entry_byid": { "return": { - "ownedByThis": true, - "selfFreeing": false + "ownedByThis": true } }, "git_tree_entry_byindex": { "jsFunctionName": "_entryByIndex", "return": { - "ownedByThis": true, - "selfFreeing": false + "ownedByThis": true } }, "git_tree_entry_byname": { "jsFunctionName": "_entryByName", "return": { - "ownedByThis": true, - "selfFreeing": false + "ownedByThis": true + } + }, + "git_tree_entry_bypath": { + "isAsync": true, + "args": { + "out": { + "ownedByThis": true + }, + "root": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true } }, "git_tree_entrycount": { "jsFunctionName": "entryCount" }, + "git_tree_free": { + "ignore": true + }, "git_tree_id": { "return": { "ownedByThis": true @@ -2777,13 +4644,21 @@ } }, "treebuilder": { + "selfFreeing": true, "functions": { + "git_treebuilder_clear": { + "return": { + "isErrorCode": true + } + }, "git_treebuilder_filter": { "ignore": true }, + "git_treebuilder_free": { + "ignore": true + }, "git_treebuilder_get": { "return": { - "selfFreeing": false, "ownedByThis": true } }, @@ -2797,10 +4672,14 @@ } }, "git_treebuilder_write": { + "isAsync": true, "args": { "id": { "isReturn": true } + }, + "return": { + "isErrorCode": true } }, "git_treebuilder_write_with_buffer": { @@ -2808,6 +4687,9 @@ }, "git_treebuilder_new": { "args": { + "out": { + "ownedBy": ["repo"] + }, "source": { "isOptional": true } @@ -2820,6 +4702,12 @@ "dupFunction": "git_tree_entry_dup", "freeFunctionName": "git_tree_entry_free", "functions": { + "git_tree_entry_dup": { + "ignore": true + }, + "git_tree_entry_free": { + "ignore": true + }, "git_tree_entry_id": { "return": { "ownedByThis": true @@ -2838,9 +4726,92 @@ } } }, + "win32": { + "ignore": true + }, + "worktree": { + "selfFreeing": true, + "cType": "git_worktree", + "freeFunctionName": "git_worktree_free", + "functions": { + "git_worktree_add": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + }, + "git_worktree_add_init_options": { + "ignore": true + }, + "git_worktree_add_options_init": { + "ignore": true + }, + "git_worktree_free": { + "ignore": true + }, + "git_worktree_is_prunable": { + "args": { + "opts": { + "isOptional": true + } + }, + "isAsync": true + }, + "git_worktree_lookup": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + }, + "git_worktree_open_from_repository": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + }, + "git_worktree_prune_init_options": { + "ignore": true + }, + "git_worktree_prune_options_init": { + "ignore": true + }, + "git_worktree_prune": { + "args": { + "opts": { + "isOptional": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + } + }, + "dependencies": [ + "../include/git_buf_converter.h" + ] + }, + "tree_update": { + "hasConstructor": true, + "ignoreInit": true + }, "writestream": { "cType": "git_writestream", - "needsForwardDeclaration": false + "needsForwardDeclaration": false, + "fields": { + "close": { + "ignore": true + }, + "free": { + "ignore": true + }, + "write": { + "ignore": true + } + } } } } diff --git a/generate/input/libgit2-docs.json b/generate/input/libgit2-docs.json index fb9f175af2..e1969402e7 100644 --- a/generate/input/libgit2-docs.json +++ b/generate/input/libgit2-docs.json @@ -1,47 +1,68 @@ { "files": [ { - "file": "annotated_commit.h", + "file": "git2/annotated_commit.h", "functions": [ "git_annotated_commit_from_ref", "git_annotated_commit_from_fetchhead", "git_annotated_commit_lookup", "git_annotated_commit_from_revspec", "git_annotated_commit_id", + "git_annotated_commit_ref", "git_annotated_commit_free" ], "meta": {}, - "lines": 112 + "lines": 128 }, { - "file": "attr.h", + "file": "git2/apply.h", + "functions": [ + "git_apply_delta_cb", + "git_apply_hunk_cb", + "git_apply_options_init", + "git_apply_to_tree", + "git_apply" + ], + "meta": {}, + "lines": 182 + }, + { + "file": "git2/attr.h", "functions": [ "git_attr_value", "git_attr_get", + "git_attr_get_ext", "git_attr_get_many", + "git_attr_get_many_ext", + "git_attr_foreach_cb", "git_attr_foreach", + "git_attr_foreach_ext", "git_attr_cache_flush", "git_attr_add_macro" ], "meta": {}, - "lines": 240 + "lines": 378 }, { - "file": "blame.h", + "file": "git2/blame.h", "functions": [ - "git_blame_init_options", + "git_blame_options_init", + "git_blame_linecount", + "git_blame_hunkcount", + "git_blame_hunk_byindex", + "git_blame_hunk_byline", + "git_blame_line_byindex", "git_blame_get_hunk_count", "git_blame_get_hunk_byindex", "git_blame_get_hunk_byline", - "git_blame_file", "git_blame_buffer", "git_blame_free" ], "meta": {}, - "lines": 207 + "lines": 385 }, { - "file": "blob.h", + "file": "git2/blob.h", "functions": [ "git_blob_lookup", "git_blob_lookup_prefix", @@ -50,20 +71,22 @@ "git_blob_owner", "git_blob_rawcontent", "git_blob_rawsize", - "git_blob_filtered_content", - "git_blob_create_fromworkdir", - "git_blob_create_fromdisk", - "git_blob_create_fromstream", - "git_blob_create_fromstream_commit", - "git_blob_create_frombuffer", + "git_blob_filter_options_init", + "git_blob_filter", + "git_blob_create_from_workdir", + "git_blob_create_from_disk", + "git_blob_create_from_stream", + "git_blob_create_from_stream_commit", + "git_blob_create_from_buffer", "git_blob_is_binary", + "git_blob_data_is_binary", "git_blob_dup" ], "meta": {}, - "lines": 228 + "lines": 350 }, { - "file": "branch.h", + "file": "git2/branch.h", "functions": [ "git_branch_create", "git_branch_create_from_annotated", @@ -76,60 +99,66 @@ "git_branch_name", "git_branch_upstream", "git_branch_set_upstream", - "git_branch_is_head" + "git_branch_upstream_name", + "git_branch_is_head", + "git_branch_is_checked_out", + "git_branch_remote_name", + "git_branch_upstream_remote", + "git_branch_upstream_merge", + "git_branch_name_is_valid" ], "meta": {}, - "lines": 246 + "lines": 339 }, { - "file": "buffer.h", - "functions": [ - "git_buf_free", - "git_buf_grow", - "git_buf_set", - "git_buf_is_binary", - "git_buf_contains_nul" - ], + "file": "git2/buffer.h", + "functions": ["git_buf_dispose"], + "meta": {}, + "lines": 71 + }, + { + "file": "git2/cert.h", + "functions": ["git_transport_certificate_check_cb"], "meta": {}, - "lines": 122 + "lines": 168 }, { - "file": "checkout.h", + "file": "git2/checkout.h", "functions": [ "git_checkout_notify_cb", "git_checkout_progress_cb", "git_checkout_perfdata_cb", - "git_checkout_init_options", + "git_checkout_options_init", "git_checkout_head", "git_checkout_index", "git_checkout_tree" ], "meta": {}, - "lines": 361 + "lines": 463 }, { - "file": "cherrypick.h", + "file": "git2/cherrypick.h", "functions": [ - "git_cherrypick_init_options", + "git_cherrypick_options_init", "git_cherrypick_commit", "git_cherrypick" ], "meta": {}, - "lines": 84 + "lines": 94 }, { - "file": "clone.h", + "file": "git2/clone.h", "functions": [ "git_remote_create_cb", "git_repository_create_cb", - "git_clone_init_options", + "git_clone_options_init", "git_clone" ], "meta": {}, - "lines": 203 + "lines": 220 }, { - "file": "commit.h", + "file": "git2/commit.h", "functions": [ "git_commit_lookup", "git_commit_lookup_prefix", @@ -145,6 +174,8 @@ "git_commit_time_offset", "git_commit_committer", "git_commit_author", + "git_commit_committer_with_mailmap", + "git_commit_author_with_mailmap", "git_commit_raw_header", "git_commit_tree", "git_commit_tree_id", @@ -156,28 +187,34 @@ "git_commit_extract_signature", "git_commit_create", "git_commit_create_v", + "git_commit_create_from_stage", "git_commit_amend", "git_commit_create_buffer", "git_commit_create_with_signature", - "git_commit_dup" + "git_commit_dup", + "git_commit_create_cb", + "git_commitarray_dispose" ], "meta": {}, - "lines": 471 + "lines": 670 }, { - "file": "common.h", + "file": "git2/common.h", "functions": [ "git_libgit2_version", + "git_libgit2_prerelease", "git_libgit2_features", + "git_libgit2_feature_backend", "git_libgit2_opts" ], "meta": {}, - "lines": 312 + "lines": 569 }, { - "file": "config.h", + "file": "git2/config.h", "functions": [ "git_config_entry_free", + "git_config_foreach_cb", "git_config_find_global", "git_config_find_xdg", "git_config_find_system", @@ -188,6 +225,7 @@ "git_config_open_ondisk", "git_config_open_level", "git_config_open_global", + "git_config_set_writeorder", "git_config_snapshot", "git_config_free", "git_config_get_entry", @@ -222,38 +260,91 @@ "git_config_lock" ], "meta": {}, - "lines": 724 + "lines": 847 + }, + { + "file": "git2/credential.h", + "functions": [ + "git_credential_acquire_cb", + "git_credential_free", + "git_credential_has_username", + "git_credential_get_username", + "git_credential_userpass_plaintext_new", + "git_credential_default_new", + "git_credential_username_new", + "git_credential_ssh_key_new", + "git_credential_ssh_key_memory_new", + "git_credential_ssh_interactive_cb", + "git_credential_ssh_interactive_new", + "git_credential_ssh_key_from_agent", + "git_credential_sign_cb", + "git_credential_ssh_custom_new" + ], + "meta": {}, + "lines": 338 + }, + { + "file": "git2/credential_helpers.h", + "functions": ["git_credential_userpass"], + "meta": {}, + "lines": 49 }, { - "file": "cred_helpers.h", + "file": "git2/deprecated.h", "functions": [ - "git_cred_userpass" + "git_blob_filtered_content", + "git_filter_list_stream_data", + "git_filter_list_apply_to_data", + "git_treebuilder_write_with_buffer", + "git_buf_grow", + "git_buf_set", + "git_buf_is_binary", + "git_buf_contains_nul", + "git_buf_free", + "git_commit_signing_cb", + "git_diff_format_email", + "git_diff_commit_as_email", + "git_diff_format_email_options_init", + "giterr_last", + "giterr_clear", + "giterr_set_str", + "giterr_set_oom", + "git_object__size", + "git_remote_is_valid_name", + "git_reference_is_valid_name", + "git_oidarray_free", + "git_headlist_cb", + "git_strarray_copy", + "git_strarray_free", + "git_blame_init_options" ], "meta": {}, - "lines": 48 + "lines": 1035 }, { - "file": "describe.h", + "file": "git2/describe.h", "functions": [ + "git_describe_options_init", + "git_describe_format_options_init", "git_describe_commit", "git_describe_workdir", "git_describe_format", "git_describe_result_free" ], "meta": {}, - "lines": 161 + "lines": 201 }, { - "file": "diff.h", + "file": "git2/diff.h", "functions": [ "git_diff_notify_cb", "git_diff_progress_cb", - "git_diff_init_options", + "git_diff_options_init", "git_diff_file_cb", "git_diff_binary_cb", "git_diff_hunk_cb", "git_diff_line_cb", - "git_diff_find_init_options", + "git_diff_find_options_init", "git_diff_free", "git_diff_tree_to_tree", "git_diff_tree_to_index", @@ -281,70 +372,69 @@ "git_diff_stats_deletions", "git_diff_stats_to_buf", "git_diff_stats_free", - "git_diff_format_email", - "git_diff_commit_as_email", - "git_diff_format_email_init_options" + "git_diff_patchid_options_init", + "git_diff_patchid" ], "meta": {}, - "lines": 1401 + "lines": 1502 }, { - "file": "errors.h", - "functions": [ - "giterr_last", - "giterr_clear", - "giterr_set_str", - "giterr_set_oom" - ], + "file": "git2/email.h", + "functions": ["git_email_create_from_commit"], + "meta": {}, + "lines": 102 + }, + { + "file": "git2/errors.h", + "functions": ["git_error_last"], "meta": {}, - "lines": 145 + "lines": 149 }, { - "file": "filter.h", + "file": "git2/filter.h", "functions": [ "git_filter_list_load", + "git_filter_list_load_ext", "git_filter_list_contains", - "git_filter_list_apply_to_data", + "git_filter_list_apply_to_buffer", "git_filter_list_apply_to_file", "git_filter_list_apply_to_blob", - "git_filter_list_stream_data", + "git_filter_list_stream_buffer", "git_filter_list_stream_file", "git_filter_list_stream_blob", "git_filter_list_free" ], "meta": {}, - "lines": 210 + "lines": 278 }, { - "file": "global.h", - "functions": [ - "git_libgit2_init", - "git_libgit2_shutdown" - ], + "file": "git2/global.h", + "functions": ["git_libgit2_init", "git_libgit2_shutdown"], "meta": {}, - "lines": 39 + "lines": 45 }, { - "file": "graph.h", + "file": "git2/graph.h", "functions": [ "git_graph_ahead_behind", - "git_graph_descendant_of" + "git_graph_descendant_of", + "git_graph_reachable_from_any" ], "meta": {}, - "lines": 51 + "lines": 73 }, { - "file": "ignore.h", + "file": "git2/ignore.h", "functions": [ "git_ignore_add_rule", "git_ignore_clear_internal_rules", "git_ignore_path_is_ignored" ], "meta": {}, - "lines": 74 + "lines": 83 }, { - "file": "index.h", + "file": "git2/index.h", "functions": [ "git_index_matched_path_cb", "git_index_open", @@ -371,8 +461,11 @@ "git_index_add", "git_index_entry_stage", "git_index_entry_is_conflict", + "git_index_iterator_new", + "git_index_iterator_next", + "git_index_iterator_free", "git_index_add_bypath", - "git_index_add_frombuffer", + "git_index_add_from_buffer", "git_index_remove_bypath", "git_index_add_all", "git_index_remove_all", @@ -389,27 +482,45 @@ "git_index_conflict_iterator_free" ], "meta": {}, - "lines": 805 + "lines": 928 }, { - "file": "indexer.h", + "file": "git2/indexer.h", "functions": [ + "git_indexer_progress_cb", + "git_indexer_options_init", "git_indexer_new", "git_indexer_append", "git_indexer_commit", "git_indexer_hash", + "git_indexer_name", "git_indexer_free" ], "meta": {}, - "lines": 72 + "lines": 207 + }, + { + "file": "git2/mailmap.h", + "functions": [ + "git_mailmap_new", + "git_mailmap_free", + "git_mailmap_add_entry", + "git_mailmap_from_buffer", + "git_mailmap_from_repository", + "git_mailmap_resolve", + "git_mailmap_resolve_signature" + ], + "meta": {}, + "lines": 116 }, { - "file": "merge.h", + "file": "git2/merge.h", "functions": [ - "git_merge_file_init_input", - "git_merge_file_init_options", - "git_merge_init_options", + "git_merge_file_input_init", + "git_merge_file_options_init", + "git_merge_options_init", "git_merge_analysis", + "git_merge_analysis_for_ref", "git_merge_base", "git_merge_bases", "git_merge_base_many", @@ -423,46 +534,31 @@ "git_merge" ], "meta": {}, - "lines": 579 - }, - { - "file": "message.h", - "functions": [ - "git_message_prettify" - ], - "meta": {}, - "lines": 39 + "lines": 666 }, { - "file": "net.h", + "file": "git2/message.h", "functions": [ - "git_headlist_cb" + "git_message_prettify", + "git_message_trailers", + "git_message_trailer_array_free" ], "meta": {}, - "lines": 55 + "lines": 81 }, + { "file": "git2/net.h", "functions": [], "meta": {}, "lines": 51 }, { - "file": "notes.h", + "file": "git2/notes.h", "functions": [ "git_note_foreach_cb", - "git_note_iterator_new", "git_note_iterator_free", - "git_note_next", - "git_note_read", - "git_note_author", - "git_note_committer", - "git_note_message", - "git_note_id", - "git_note_create", - "git_note_remove", - "git_note_free", - "git_note_foreach" + "git_note_next" ], "meta": {}, - "lines": 213 + "lines": 91 }, { - "file": "object.h", + "file": "git2/object.h", "functions": [ "git_object_lookup", "git_object_lookup_prefix", @@ -475,15 +571,15 @@ "git_object_type2string", "git_object_string2type", "git_object_typeisloose", - "git_object__size", "git_object_peel", - "git_object_dup" + "git_object_dup", + "git_object_rawcontent_is_valid" ], "meta": {}, - "lines": 237 + "lines": 274 }, { - "file": "odb.h", + "file": "git2/odb.h", "functions": [ "git_odb_foreach_cb", "git_odb_new", @@ -494,6 +590,7 @@ "git_odb_read_prefix", "git_odb_read_header", "git_odb_exists", + "git_odb_exists_ext", "git_odb_exists_prefix", "git_odb_expand_ids", "git_odb_refresh", @@ -506,6 +603,7 @@ "git_odb_stream_free", "git_odb_open_rstream", "git_odb_write_pack", + "git_odb_write_multi_pack_index", "git_odb_hash", "git_odb_hashfile", "git_odb_object_dup", @@ -517,23 +615,24 @@ "git_odb_add_backend", "git_odb_add_alternate", "git_odb_num_backends", - "git_odb_get_backend" + "git_odb_get_backend", + "git_odb_set_commit_graph" ], "meta": {}, - "lines": 537 + "lines": 691 }, { - "file": "odb_backend.h", + "file": "git2/odb_backend.h", "functions": [ "git_odb_backend_pack", - "git_odb_backend_loose", - "git_odb_backend_one_pack" + "git_odb_backend_one_pack", + "git_odb_backend_loose" ], "meta": {}, - "lines": 130 + "lines": 246 }, { - "file": "oid.h", + "file": "git2/oid.h", "functions": [ "git_oid_fromstr", "git_oid_fromstrp", @@ -550,24 +649,22 @@ "git_oid_ncmp", "git_oid_streq", "git_oid_strcmp", - "git_oid_iszero", + "git_oid_is_zero", "git_oid_shorten_new", "git_oid_shorten_add", "git_oid_shorten_free" ], "meta": {}, - "lines": 264 + "lines": 366 }, { - "file": "oidarray.h", - "functions": [ - "git_oidarray_free" - ], + "file": "git2/oidarray.h", + "functions": ["git_oidarray_dispose"], "meta": {}, - "lines": 34 + "lines": 38 }, { - "file": "pack.h", + "file": "git2/pack.h", "functions": [ "git_packbuilder_new", "git_packbuilder_set_threads", @@ -576,8 +673,11 @@ "git_packbuilder_insert_commit", "git_packbuilder_insert_walk", "git_packbuilder_insert_recur", + "git_packbuilder_write_buf", "git_packbuilder_write", "git_packbuilder_hash", + "git_packbuilder_name", + "git_packbuilder_foreach_cb", "git_packbuilder_foreach", "git_packbuilder_object_count", "git_packbuilder_written", @@ -586,11 +686,12 @@ "git_packbuilder_free" ], "meta": {}, - "lines": 236 + "lines": 274 }, { - "file": "patch.h", + "file": "git2/patch.h", "functions": [ + "git_patch_owner", "git_patch_from_diff", "git_patch_from_blobs", "git_patch_from_blob_and_buffer", @@ -607,10 +708,10 @@ "git_patch_to_buf" ], "meta": {}, - "lines": 268 + "lines": 284 }, { - "file": "pathspec.h", + "file": "git2/pathspec.h", "functions": [ "git_pathspec_new", "git_pathspec_free", @@ -627,22 +728,24 @@ "git_pathspec_match_list_failed_entry" ], "meta": {}, - "lines": 260 + "lines": 284 }, { - "file": "proxy.h", - "functions": [ - "git_proxy_init_options" - ], + "file": "git2/proxy.h", + "functions": ["git_proxy_options_init"], "meta": {}, - "lines": 88 + "lines": 103 }, { - "file": "rebase.h", + "file": "git2/rebase.h", "functions": [ - "git_rebase_init_options", + "git_rebase_options_init", "git_rebase_init", "git_rebase_open", + "git_rebase_orig_head_name", + "git_rebase_orig_head_id", + "git_rebase_onto_name", + "git_rebase_onto_id", "git_rebase_operation_entrycount", "git_rebase_operation_current", "git_rebase_operation_byindex", @@ -654,10 +757,10 @@ "git_rebase_free" ], "meta": {}, - "lines": 316 + "lines": 397 }, { - "file": "refdb.h", + "file": "git2/refdb.h", "functions": [ "git_refdb_new", "git_refdb_open", @@ -665,10 +768,10 @@ "git_refdb_free" ], "meta": {}, - "lines": 63 + "lines": 66 }, { - "file": "reflog.h", + "file": "git2/reflog.h", "functions": [ "git_reflog_read", "git_reflog_write", @@ -688,7 +791,7 @@ "lines": 166 }, { - "file": "refs.h", + "file": "git2/refs.h", "functions": [ "git_reference_lookup", "git_reference_name_to_id", @@ -710,6 +813,8 @@ "git_reference_delete", "git_reference_remove", "git_reference_list", + "git_reference_foreach_cb", + "git_reference_foreach_name_cb", "git_reference_foreach", "git_reference_foreach_name", "git_reference_dup", @@ -729,34 +834,40 @@ "git_reference_is_note", "git_reference_normalize_name", "git_reference_peel", - "git_reference_is_valid_name", + "git_reference_name_is_valid", "git_reference_shorthand" ], "meta": {}, - "lines": 741 + "lines": 769 }, { - "file": "refspec.h", + "file": "git2/refspec.h", "functions": [ + "git_refspec_parse", + "git_refspec_free", "git_refspec_src", "git_refspec_dst", "git_refspec_string", "git_refspec_force", "git_refspec_direction", + "git_refspec_src_matches_negative", "git_refspec_src_matches", "git_refspec_dst_matches", "git_refspec_transform", "git_refspec_rtransform" ], "meta": {}, - "lines": 100 + "lines": 126 }, { - "file": "remote.h", + "file": "git2/remote.h", "functions": [ "git_remote_create", + "git_remote_create_options_init", + "git_remote_create_with_opts", "git_remote_create_with_fetchspec", "git_remote_create_anonymous", + "git_remote_create_detached", "git_remote_lookup", "git_remote_dup", "git_remote_owner", @@ -765,24 +876,31 @@ "git_remote_pushurl", "git_remote_set_url", "git_remote_set_pushurl", + "git_remote_set_instance_url", + "git_remote_set_instance_pushurl", "git_remote_add_fetch", "git_remote_get_fetch_refspecs", "git_remote_add_push", "git_remote_get_push_refspecs", "git_remote_refspec_count", "git_remote_get_refspec", - "git_remote_connect", "git_remote_ls", "git_remote_connected", "git_remote_stop", "git_remote_disconnect", "git_remote_free", "git_remote_list", - "git_push_transfer_progress", + "git_push_transfer_progress_cb", "git_push_negotiation", + "git_push_update_reference_cb", + "git_url_resolve_cb", + "git_remote_ready_cb", "git_remote_init_callbacks", - "git_fetch_init_options", - "git_push_init_options", + "git_fetch_options_init", + "git_push_options_init", + "git_remote_connect_options_init", + "git_remote_connect", + "git_remote_connect_ext", "git_remote_download", "git_remote_upload", "git_remote_update_tips", @@ -794,33 +912,39 @@ "git_remote_set_autotag", "git_remote_prune_refs", "git_remote_rename", - "git_remote_is_valid_name", + "git_remote_name_is_valid", "git_remote_delete", "git_remote_default_branch" ], "meta": {}, - "lines": 820 + "lines": 1244 }, { - "file": "repository.h", + "file": "git2/repository.h", "functions": [ "git_repository_open", + "git_repository_open_from_worktree", "git_repository_wrap_odb", "git_repository_discover", "git_repository_open_ext", "git_repository_open_bare", "git_repository_free", "git_repository_init", - "git_repository_init_init_options", + "git_repository_init_options_init", "git_repository_init_ext", "git_repository_head", + "git_repository_head_for_worktree", "git_repository_head_detached", + "git_repository_head_detached_for_worktree", "git_repository_head_unborn", "git_repository_is_empty", + "git_repository_item_path", "git_repository_path", "git_repository_workdir", + "git_repository_commondir", "git_repository_set_workdir", "git_repository_is_bare", + "git_repository_is_worktree", "git_repository_config", "git_repository_config_snapshot", "git_repository_odb", @@ -829,7 +953,9 @@ "git_repository_message", "git_repository_message_remove", "git_repository_state_cleanup", + "git_repository_fetchhead_foreach_cb", "git_repository_fetchhead_foreach", + "git_repository_mergehead_foreach_cb", "git_repository_mergehead_foreach", "git_repository_hashfile", "git_repository_set_head", @@ -841,43 +967,41 @@ "git_repository_get_namespace", "git_repository_is_shallow", "git_repository_ident", - "git_repository_set_ident" + "git_repository_set_ident", + "git_repository_oid_type", + "git_repository_commit_parents" ], "meta": {}, - "lines": 771 + "lines": 1014 }, { - "file": "reset.h", + "file": "git2/reset.h", "functions": [ "git_reset", "git_reset_from_annotated", "git_reset_default" ], "meta": {}, - "lines": 107 + "lines": 119 }, { - "file": "revert.h", + "file": "git2/revert.h", "functions": [ - "git_revert_init_options", + "git_revert_options_init", "git_revert_commit", "git_revert" ], "meta": {}, - "lines": 84 + "lines": 91 }, { - "file": "revparse.h", - "functions": [ - "git_revparse_single", - "git_revparse_ext", - "git_revparse" - ], + "file": "git2/revparse.h", + "functions": ["git_revparse_single", "git_revparse_ext", "git_revparse"], "meta": {}, "lines": 108 }, { - "file": "revwalk.h", + "file": "git2/revwalk.h", "functions": [ "git_revwalk_new", "git_revwalk_reset", @@ -899,26 +1023,30 @@ "git_revwalk_add_hide_cb" ], "meta": {}, - "lines": 291 + "lines": 298 }, { - "file": "signature.h", + "file": "git2/signature.h", "functions": [ "git_signature_new", "git_signature_now", + "git_signature_default_from_env", "git_signature_default", "git_signature_from_buffer", "git_signature_dup", "git_signature_free" ], "meta": {}, - "lines": 99 + "lines": 143 }, { - "file": "stash.h", + "file": "git2/stash.h", "functions": [ + "git_stash_save", + "git_stash_save_options_init", + "git_stash_save_with_opts", "git_stash_apply_progress_cb", - "git_stash_apply_init_options", + "git_stash_apply_options_init", "git_stash_apply", "git_stash_cb", "git_stash_foreach", @@ -926,13 +1054,13 @@ "git_stash_pop" ], "meta": {}, - "lines": 253 + "lines": 323 }, { - "file": "status.h", + "file": "git2/status.h", "functions": [ "git_status_cb", - "git_status_init_options", + "git_status_options_init", "git_status_foreach", "git_status_foreach_ext", "git_status_file", @@ -943,27 +1071,26 @@ "git_status_should_ignore" ], "meta": {}, - "lines": 366 + "lines": 451 }, { - "file": "strarray.h", - "functions": [ - "git_strarray_free", - "git_strarray_copy" - ], + "file": "git2/strarray.h", + "functions": ["git_strarray_dispose"], "meta": {}, - "lines": 53 + "lines": 37 }, { - "file": "submodule.h", + "file": "git2/submodule.h", "functions": [ "git_submodule_cb", - "git_submodule_update_init_options", + "git_submodule_update_options_init", "git_submodule_update", "git_submodule_lookup", + "git_submodule_dup", "git_submodule_free", "git_submodule_foreach", "git_submodule_add_setup", + "git_submodule_clone", "git_submodule_add_finalize", "git_submodule_add_to_index", "git_submodule_owner", @@ -992,179 +1119,28 @@ "git_submodule_location" ], "meta": {}, - "lines": 632 - }, - { - "file": "sys/commit.h", - "functions": [ - "git_commit_create_from_ids", - "git_commit_create_from_callback" - ], - "meta": {}, - "lines": 76 - }, - { - "file": "sys/config.h", - "functions": [ - "git_config_init_backend", - "git_config_add_backend" - ], - "meta": {}, - "lines": 123 - }, - { - "file": "sys/diff.h", - "functions": [ - "git_diff_print_callback__to_buf", - "git_diff_print_callback__to_file_handle", - "git_diff_get_perfdata", - "git_status_list_get_perfdata" - ], - "meta": {}, - "lines": 90 - }, - { - "file": "sys/filter.h", - "functions": [ - "git_filter_lookup", - "git_filter_list_new", - "git_filter_list_push", - "git_filter_list_length", - "git_filter_source_repo", - "git_filter_source_path", - "git_filter_source_filemode", - "git_filter_source_id", - "git_filter_source_mode", - "git_filter_source_flags", - "git_filter_init_fn", - "git_filter_shutdown_fn", - "git_filter_check_fn", - "git_filter_apply_fn", - "git_filter_cleanup_fn", - "git_filter_register", - "git_filter_unregister" - ], - "meta": {}, - "lines": 317 - }, - { - "file": "sys/hashsig.h", - "functions": [ - "git_hashsig_create", - "git_hashsig_create_fromfile", - "git_hashsig_free", - "git_hashsig_compare" - ], - "meta": {}, - "lines": 102 - }, - { - "file": "sys/mempack.h", - "functions": [ - "git_mempack_new", - "git_mempack_reset" - ], - "meta": {}, - "lines": 81 - }, - { - "file": "sys/merge.h", - "functions": [ - "git_merge_driver_init_fn", - "git_merge_driver_shutdown_fn", - "git_merge_driver_apply_fn" - ], - "meta": {}, - "lines": 135 - }, - { - "file": "sys/odb_backend.h", - "functions": [ - "git_odb_init_backend" - ], - "meta": {}, - "lines": 117 - }, - { - "file": "sys/openssl.h", - "functions": [ - "git_openssl_set_locking" - ], - "meta": {}, - "lines": 34 - }, - { - "file": "sys/refdb_backend.h", - "functions": [ - "git_refdb_init_backend", - "git_refdb_backend_fs", - "git_refdb_set_backend" - ], - "meta": {}, - "lines": 214 - }, - { - "file": "sys/refs.h", - "functions": [ - "git_reference__alloc", - "git_reference__alloc_symbolic" - ], - "meta": {}, - "lines": 45 - }, - { - "file": "sys/repository.h", - "functions": [ - "git_repository_new", - "git_repository__cleanup", - "git_repository_reinit_filesystem", - "git_repository_set_config", - "git_repository_set_odb", - "git_repository_set_refdb", - "git_repository_set_index", - "git_repository_set_bare", - "git_repository_submodule_cache_all", - "git_repository_submodule_cache_clear" - ], - "meta": {}, - "lines": 165 - }, - { - "file": "sys/stream.h", - "functions": [ - "git_stream_register_tls" - ], - "meta": {}, - "lines": 54 + "lines": 674 }, { - "file": "sys/time.h", - "functions": [ - "git_time_monotonic" - ], + "file": "git2/sys/commit_graph.h", + "functions": [], "meta": {}, - "lines": 27 + "lines": 99 }, + { "file": "git2/sys/config.h", "functions": [], "meta": {}, "lines": 162 }, + { "file": "git2/sys/filter.h", "functions": [], "meta": {}, "lines": 109 }, + { "file": "git2/sys/hashsig.h", "functions": [], "meta": {}, "lines": 55 }, + { "file": "git2/sys/merge.h", "functions": [], "meta": {}, "lines": 49 }, + { "file": "git2/sys/path.h", "functions": [], "meta": {}, "lines": 51 }, + { "file": "git2/sys/stream.h", "functions": [], "meta": {}, "lines": 105 }, { - "file": "sys/transport.h", - "functions": [ - "git_transport_init", - "git_transport_new", - "git_transport_ssh_with_paths", - "git_transport_unregister", - "git_transport_dummy", - "git_transport_local", - "git_transport_smart", - "git_transport_smart_certificate_check", - "git_smart_subtransport_http", - "git_smart_subtransport_git", - "git_smart_subtransport_ssh" - ], + "file": "git2/sys/transport.h", + "functions": [], "meta": {}, - "lines": 379 + "lines": 328 }, { - "file": "tag.h", + "file": "git2/tag.h", "functions": [ "git_tag_lookup", "git_tag_lookup_prefix", @@ -1179,48 +1155,49 @@ "git_tag_message", "git_tag_create", "git_tag_annotation_create", - "git_tag_create_frombuffer", + "git_tag_create_from_buffer", "git_tag_create_lightweight", "git_tag_delete", "git_tag_list", "git_tag_list_match", + "git_tag_foreach_cb", "git_tag_foreach", "git_tag_peel", - "git_tag_dup" + "git_tag_dup", + "git_tag_name_is_valid" ], "meta": {}, - "lines": 357 + "lines": 380 }, { - "file": "trace.h", - "functions": [ - "git_trace_callback", - "git_trace_set" - ], + "file": "git2/trace.h", + "functions": ["git_trace_cb", "git_trace_set"], "meta": {}, - "lines": 63 + "lines": 68 }, { - "file": "transport.h", + "file": "git2/transaction.h", "functions": [ - "git_transport_cb", - "git_cred_has_username", - "git_cred_userpass_plaintext_new", - "git_cred_ssh_key_new", - "git_cred_ssh_interactive_new", - "git_cred_ssh_key_from_agent", - "git_cred_ssh_custom_new", - "git_cred_default_new", - "git_cred_username_new", - "git_cred_ssh_key_memory_new", - "git_cred_free", - "git_cred_acquire_cb" + "git_transaction_new", + "git_transaction_lock_ref", + "git_transaction_set_target", + "git_transaction_set_symbolic_target", + "git_transaction_set_reflog", + "git_transaction_remove", + "git_transaction_commit", + "git_transaction_free" ], "meta": {}, - "lines": 338 + "lines": 117 + }, + { + "file": "git2/transport.h", + "functions": ["git_transport_message_cb", "git_transport_cb"], + "meta": {}, + "lines": 45 }, { - "file": "tree.h", + "file": "git2/tree.h", "functions": [ "git_tree_lookup", "git_tree_lookup_prefix", @@ -1251,32 +1228,44 @@ "git_treebuilder_filter_cb", "git_treebuilder_filter", "git_treebuilder_write", - "git_treebuilder_write_with_buffer", "git_treewalk_cb", "git_tree_walk", "git_tree_dup", "git_tree_create_updated" ], "meta": {}, - "lines": 478 + "lines": 481 }, + { "file": "git2/types.h", "functions": [], "meta": {}, "lines": 382 }, { - "file": "types.h", + "file": "git2/worktree.h", "functions": [ - "git_transfer_progress_cb", - "git_transport_message_cb", - "git_transport_certificate_check_cb" + "git_worktree_list", + "git_worktree_lookup", + "git_worktree_open_from_repository", + "git_worktree_free", + "git_worktree_validate", + "git_worktree_add_options_init", + "git_worktree_add", + "git_worktree_lock", + "git_worktree_unlock", + "git_worktree_is_locked", + "git_worktree_name", + "git_worktree_path", + "git_worktree_prune_options_init", + "git_worktree_is_prunable", + "git_worktree_prune" ], "meta": {}, - "lines": 425 + "lines": 273 } ], "functions": { "git_annotated_commit_from_ref": { "type": "function", - "file": "annotated_commit.h", - "line": 33, - "lineto": 36, + "file": "git2/annotated_commit.h", + "line": 40, + "lineto": 43, "args": [ { "name": "out", @@ -1296,19 +1285,21 @@ ], "argline": "git_annotated_commit **out, git_repository *repo, const git_reference *ref", "sig": "git_annotated_commit **::git_repository *::const git_reference *", - "return": { - "type": "int", - "comment": " 0 on success or error code" - }, + "return": { "type": "int", "comment": " 0 on success or error code" }, "description": "

Creates a git_annotated_commit from the given reference.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n", "comments": "", - "group": "annotated" + "group": "annotated", + "examples": { + "checkout.c": [ + "ex/v1.9.1/checkout.html#git_annotated_commit_from_ref-1" + ] + } }, "git_annotated_commit_from_fetchhead": { "type": "function", - "file": "annotated_commit.h", - "line": 50, - "lineto": 55, + "file": "git2/annotated_commit.h", + "line": 57, + "lineto": 62, "args": [ { "name": "out", @@ -1338,19 +1329,16 @@ ], "argline": "git_annotated_commit **out, git_repository *repo, const char *branch_name, const char *remote_url, const git_oid *id", "sig": "git_annotated_commit **::git_repository *::const char *::const char *::const git_oid *", - "return": { - "type": "int", - "comment": " 0 on success or error code" - }, + "return": { "type": "int", "comment": " 0 on success or error code" }, "description": "

Creates a git_annotated_commit from the given fetch head data.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n", "comments": "", "group": "annotated" }, "git_annotated_commit_lookup": { "type": "function", - "file": "annotated_commit.h", - "line": 75, - "lineto": 78, + "file": "git2/annotated_commit.h", + "line": 82, + "lineto": 85, "args": [ { "name": "out", @@ -1370,19 +1358,16 @@ ], "argline": "git_annotated_commit **out, git_repository *repo, const git_oid *id", "sig": "git_annotated_commit **::git_repository *::const git_oid *", - "return": { - "type": "int", - "comment": " 0 on success or error code" - }, + "return": { "type": "int", "comment": " 0 on success or error code" }, "description": "

Creates a git_annotated_commit from the given commit id.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n", "comments": "

An annotated commit contains information about how it was looked up, which may be useful for functions like merge or rebase to provide context to the operation. For example, conflict files will include the name of the source or target branches being merged. It is therefore preferable to use the most specific function (eg git_annotated_commit_from_ref) instead of this one when that data is known.

\n", "group": "annotated" }, "git_annotated_commit_from_revspec": { "type": "function", - "file": "annotated_commit.h", - "line": 92, - "lineto": 95, + "file": "git2/annotated_commit.h", + "line": 99, + "lineto": 102, "args": [ { "name": "out", @@ -1402,19 +1387,16 @@ ], "argline": "git_annotated_commit **out, git_repository *repo, const char *revspec", "sig": "git_annotated_commit **::git_repository *::const char *", - "return": { - "type": "int", - "comment": " 0 on success or error code" - }, - "description": "

Creates a git_annotated_comit from a revision string.

\n", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Creates a git_annotated_commit from a revision string.

\n", "comments": "

See man gitrevisions, or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for information on the syntax accepted.

\n", "group": "annotated" }, "git_annotated_commit_id": { "type": "function", - "file": "annotated_commit.h", - "line": 103, - "lineto": 104, + "file": "git2/annotated_commit.h", + "line": 110, + "lineto": 111, "args": [ { "name": "commit", @@ -1424,19 +1406,50 @@ ], "argline": "const git_annotated_commit *commit", "sig": "const git_annotated_commit *", - "return": { - "type": "const git_oid *", - "comment": " commit id" - }, + "return": { "type": "const git_oid *", "comment": " commit id" }, "description": "

Gets the commit ID that the given git_annotated_commit refers to.

\n", "comments": "", - "group": "annotated" + "group": "annotated", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_annotated_commit_id-2"], + "merge.c": [ + "ex/v1.9.1/merge.html#git_annotated_commit_id-1", + "ex/v1.9.1/merge.html#git_annotated_commit_id-2", + "ex/v1.9.1/merge.html#git_annotated_commit_id-3" + ] + } + }, + "git_annotated_commit_ref": { + "type": "function", + "file": "git2/annotated_commit.h", + "line": 119, + "lineto": 120, + "args": [ + { + "name": "commit", + "type": "const git_annotated_commit *", + "comment": "the given annotated commit" + } + ], + "argline": "const git_annotated_commit *commit", + "sig": "const git_annotated_commit *", + "return": { "type": "const char *", "comment": " ref name." }, + "description": "

Get the refname that the given git_annotated_commit refers to.

\n", + "comments": "", + "group": "annotated", + "examples": { + "checkout.c": [ + "ex/v1.9.1/checkout.html#git_annotated_commit_ref-3", + "ex/v1.9.1/checkout.html#git_annotated_commit_ref-4", + "ex/v1.9.1/checkout.html#git_annotated_commit_ref-5" + ] + } }, "git_annotated_commit_free": { "type": "function", - "file": "annotated_commit.h", - "line": 111, - "lineto": 112, + "file": "git2/annotated_commit.h", + "line": 127, + "lineto": 128, "args": [ { "name": "commit", @@ -1446,30 +1459,123 @@ ], "argline": "git_annotated_commit *commit", "sig": "git_annotated_commit *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "void", "comment": null }, "description": "

Frees a git_annotated_commit.

\n", "comments": "", - "group": "annotated" + "group": "annotated", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_annotated_commit_free-6"] + } }, - "git_attr_value": { + "git_apply_options_init": { "type": "function", - "file": "attr.h", - "line": 102, - "lineto": 102, + "file": "git2/apply.h", + "line": 127, + "lineto": 127, "args": [ { - "name": "attr", - "type": "const char *", - "comment": "The attribute" - } + "name": "opts", + "type": "git_apply_options *", + "comment": "The `git_apply_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_APPLY_OPTIONS_VERSION`" + } + ], + "argline": "git_apply_options *opts, unsigned int version", + "sig": "git_apply_options *::unsigned int", + "return": { "type": "int", "comment": " 0 on success or -1 on failure." }, + "description": "

Initialize git_apply_options structure

\n", + "comments": "

Initialize a git_apply_options with default values. Equivalent to creating an instance with GIT_APPLY_OPTIONS_INIT.

\n", + "group": "apply" + }, + "git_apply_to_tree": { + "type": "function", + "file": "git2/apply.h", + "line": 140, + "lineto": 145, + "args": [ + { + "name": "out", + "type": "git_index **", + "comment": "the postimage of the application" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to apply" + }, + { + "name": "preimage", + "type": "git_tree *", + "comment": "the tree to apply the diff to" + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "the diff to apply" + }, + { + "name": "options", + "type": "const git_apply_options *", + "comment": "the options for the apply (or null for defaults)" + } + ], + "argline": "git_index **out, git_repository *repo, git_tree *preimage, git_diff *diff, const git_apply_options *options", + "sig": "git_index **::git_repository *::git_tree *::git_diff *::const git_apply_options *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Apply a git_diff to a git_tree, and return the resulting image\n as an index.

\n", + "comments": "", + "group": "apply" + }, + "git_apply": { + "type": "function", + "file": "git2/apply.h", + "line": 178, + "lineto": 182, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to apply to" + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "the diff to apply" + }, + { + "name": "location", + "type": "git_apply_location_t", + "comment": "the location to apply (workdir, index or both)" + }, + { + "name": "options", + "type": "const git_apply_options *", + "comment": "the options for the apply (or null for defaults)" + } + ], + "argline": "git_repository *repo, git_diff *diff, git_apply_location_t location, const git_apply_options *options", + "sig": "git_repository *::git_diff *::git_apply_location_t::const git_apply_options *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Apply a git_diff to the given repository, making changes directly\n in the working directory, the index, or both.

\n", + "comments": "", + "group": "apply" + }, + "git_attr_value": { + "type": "function", + "file": "git2/attr.h", + "line": 106, + "lineto": 106, + "args": [ + { "name": "attr", "type": "const char *", "comment": "The attribute" } ], "argline": "const char *attr", "sig": "const char *", "return": { - "type": "git_attr_t", + "type": "git_attr_value_t", "comment": " the value type for the attribute" }, "description": "

Return the value type for a given attribute.

\n", @@ -1478,9 +1584,9 @@ }, "git_attr_get": { "type": "function", - "file": "attr.h", - "line": 145, - "lineto": 150, + "file": "git2/attr.h", + "line": 195, + "lineto": 200, "args": [ { "name": "value_out", @@ -1510,19 +1616,55 @@ ], "argline": "const char **value_out, git_repository *repo, uint32_t flags, const char *path, const char *name", "sig": "const char **::git_repository *::uint32_t::const char *::const char *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Look up the value of one git attribute for path.

\n", "comments": "", "group": "attr" }, + "git_attr_get_ext": { + "type": "function", + "file": "git2/attr.h", + "line": 218, + "lineto": 223, + "args": [ + { + "name": "value_out", + "type": "const char **", + "comment": "Output of the value of the attribute. Use the GIT_ATTR_...\n macros to test for TRUE, FALSE, UNSPECIFIED, etc. or just\n use the string value for attributes set to a value. You\n should NOT modify or free this value." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the path." + }, + { + "name": "opts", + "type": "git_attr_options *", + "comment": "The `git_attr_options` to use when querying these attributes." + }, + { + "name": "path", + "type": "const char *", + "comment": "The path to check for attributes. Relative paths are\n interpreted relative to the repo root. The file does\n not have to exist, but if it does not, then it will be\n treated as a plain file (not a directory)." + }, + { + "name": "name", + "type": "const char *", + "comment": "The name of the attribute to look up." + } + ], + "argline": "const char **value_out, git_repository *repo, git_attr_options *opts, const char *path, const char *name", + "sig": "const char **::git_repository *::git_attr_options *::const char *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Look up the value of one git attribute for path with extended options.

\n", + "comments": "", + "group": "attr" + }, "git_attr_get_many": { "type": "function", - "file": "attr.h", - "line": 181, - "lineto": 187, + "file": "git2/attr.h", + "line": 255, + "lineto": 261, "args": [ { "name": "values_out", @@ -1557,19 +1699,60 @@ ], "argline": "const char **values_out, git_repository *repo, uint32_t flags, const char *path, size_t num_attr, const char **names", "sig": "const char **::git_repository *::uint32_t::const char *::size_t::const char **", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Look up a list of git attributes for path.

\n", "comments": "

Use this if you have a known list of attributes that you want to look up in a single call. This is somewhat more efficient than calling git_attr_get() multiple times.

\n\n

For example, you might write:

\n\n
 const char *attrs[] = { "crlf", "diff", "foo" };     const char **values[3];     git_attr_get_many(values, repo, 0, "my/fun/file.c", 3, attrs);\n
\n\n

Then you could loop through the 3 values to get the settings for the three attributes you asked about.

\n", "group": "attr" }, + "git_attr_get_many_ext": { + "type": "function", + "file": "git2/attr.h", + "line": 280, + "lineto": 286, + "args": [ + { + "name": "values_out", + "type": "const char **", + "comment": "An array of num_attr entries that will have string\n pointers written into it for the values of the attributes.\n You should not modify or free the values that are written\n into this array (although of course, you should free the\n array itself if you allocated it)." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the path." + }, + { + "name": "opts", + "type": "git_attr_options *", + "comment": "The `git_attr_options` to use when querying these attributes." + }, + { + "name": "path", + "type": "const char *", + "comment": "The path inside the repo to check attributes. This\n does not have to exist, but if it does not, then\n it will be treated as a plain file (i.e. not a directory)." + }, + { + "name": "num_attr", + "type": "size_t", + "comment": "The number of attributes being looked up" + }, + { + "name": "names", + "type": "const char **", + "comment": "An array of num_attr strings containing attribute names." + } + ], + "argline": "const char **values_out, git_repository *repo, git_attr_options *opts, const char *path, size_t num_attr, const char **names", + "sig": "const char **::git_repository *::git_attr_options *::const char *::size_t::const char **", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Look up a list of git attributes for path with extended options.

\n", + "comments": "", + "group": "attr" + }, "git_attr_foreach": { "type": "function", - "file": "attr.h", - "line": 209, - "lineto": 214, + "file": "git2/attr.h", + "line": 319, + "lineto": 324, "args": [ { "name": "repo", @@ -1589,7 +1772,7 @@ { "name": "callback", "type": "git_attr_foreach_cb", - "comment": "Function to invoke on each attribute name and value. The\n value may be NULL is the attribute is explicitly set to\n UNSPECIFIED using the '!' sign. Callback will be invoked\n only once per attribute name, even if there are multiple\n rules for a given file. The highest priority rule will be\n used. Return a non-zero value from this to stop looping.\n The value will be returned from `git_attr_foreach`." + "comment": "Function to invoke on each attribute name and value.\n See git_attr_foreach_cb." }, { "name": "payload", @@ -1607,75 +1790,111 @@ "comments": "", "group": "attr" }, + "git_attr_foreach_ext": { + "type": "function", + "file": "git2/attr.h", + "line": 339, + "lineto": 344, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the path." + }, + { + "name": "opts", + "type": "git_attr_options *", + "comment": "The `git_attr_options` to use when querying these attributes." + }, + { + "name": "path", + "type": "const char *", + "comment": "Path inside the repo to check attributes. This does not have\n to exist, but if it does not, then it will be treated as a\n plain file (i.e. not a directory)." + }, + { + "name": "callback", + "type": "git_attr_foreach_cb", + "comment": "Function to invoke on each attribute name and value.\n See git_attr_foreach_cb." + }, + { + "name": "payload", + "type": "void *", + "comment": "Passed on as extra parameter to callback function." + } + ], + "argline": "git_repository *repo, git_attr_options *opts, const char *path, git_attr_foreach_cb callback, void *payload", + "sig": "git_repository *::git_attr_options *::const char *::git_attr_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Loop over all the git attributes for a path with extended options.

\n", + "comments": "", + "group": "attr" + }, "git_attr_cache_flush": { "type": "function", - "file": "attr.h", - "line": 224, - "lineto": 225, + "file": "git2/attr.h", + "line": 357, + "lineto": 358, "args": [ { "name": "repo", "type": "git_repository *", - "comment": null + "comment": "The repository containing the gitattributes cache" } ], "argline": "git_repository *repo", "sig": "git_repository *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "int", "comment": " 0 on success, or an error code" }, "description": "

Flush the gitattributes cache.

\n", "comments": "

Call this if you have reason to believe that the attributes files on disk no longer match the cached contents of memory. This will cause the attributes files to be reloaded the next time that an attribute access function is called.

\n", "group": "attr" }, "git_attr_add_macro": { "type": "function", - "file": "attr.h", - "line": 237, - "lineto": 240, + "file": "git2/attr.h", + "line": 375, + "lineto": 378, "args": [ { "name": "repo", "type": "git_repository *", - "comment": null + "comment": "The repository to add the macro in." }, { "name": "name", "type": "const char *", - "comment": null + "comment": "The name of the macro." }, { "name": "values", "type": "const char *", - "comment": null + "comment": "The value for the macro." } ], "argline": "git_repository *repo, const char *name, const char *values", "sig": "git_repository *::const char *::const char *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Add a macro definition.

\n", - "comments": "

Macros will automatically be loaded from the top level .gitattributes file of the repository (plus the build-in "binary" macro). This function allows you to add others. For example, to add the default macro, you would call:

\n\n
 git_attr_add_macro(repo, "binary", "-diff -crlf");\n
\n", + "comments": "

Macros will automatically be loaded from the top level .gitattributes file of the repository (plus the built-in "binary" macro). This function allows you to add others. For example, to add the default macro, you would call:

\n\n
 git_attr_add_macro(repo, "binary", "-diff -crlf");\n
\n", "group": "attr" }, - "git_blame_init_options": { + "git_blame_options_init": { "type": "function", - "file": "blame.h", - "line": 92, - "lineto": 94, + "file": "git2/blame.h", + "line": 146, + "lineto": 148, "args": [ { "name": "opts", "type": "git_blame_options *", - "comment": "The `git_blame_options` struct to initialize" + "comment": "The `git_blame_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_BLAME_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_BLAME_OPTIONS_VERSION`." } ], "argline": "git_blame_options *opts, unsigned int version", @@ -1684,37 +1903,53 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_blame_options with default values. Equivalent to\n creating an instance with GIT_BLAME_OPTIONS_INIT.

\n", + "description": "

Initialize git_blame_options structure

\n", + "comments": "

Initializes a git_blame_options with default values. Equivalent to creating an instance with GIT_BLAME_OPTIONS_INIT.

\n", + "group": "blame" + }, + "git_blame_linecount": { + "type": "function", + "file": "git2/blame.h", + "line": 244, + "lineto": 244, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "The blame structure to query." + } + ], + "argline": "git_blame *blame", + "sig": "git_blame *", + "return": { "type": "size_t", "comment": " The number of line." }, + "description": "

Gets the number of lines that exist in the blame structure.

\n", "comments": "", "group": "blame" }, - "git_blame_get_hunk_count": { + "git_blame_hunkcount": { "type": "function", - "file": "blame.h", - "line": 137, - "lineto": 137, + "file": "git2/blame.h", + "line": 252, + "lineto": 252, "args": [ { "name": "blame", "type": "git_blame *", - "comment": null + "comment": "The blame structure to query." } ], "argline": "git_blame *blame", "sig": "git_blame *", - "return": { - "type": "uint32_t", - "comment": null - }, + "return": { "type": "size_t", "comment": " The number of hunks." }, "description": "

Gets the number of hunks that exist in the blame structure.

\n", "comments": "", "group": "blame" }, - "git_blame_get_hunk_byindex": { + "git_blame_hunk_byindex": { "type": "function", - "file": "blame.h", - "line": 146, - "lineto": 148, + "file": "git2/blame.h", + "line": 261, + "lineto": 263, "args": [ { "name": "blame", @@ -1723,12 +1958,12 @@ }, { "name": "index", - "type": "uint32_t", + "type": "size_t", "comment": "index of the hunk to retrieve" } ], - "argline": "git_blame *blame, uint32_t index", - "sig": "git_blame *::uint32_t", + "argline": "git_blame *blame, size_t index", + "sig": "git_blame *::size_t", "return": { "type": "const git_blame_hunk *", "comment": " the hunk at the given index, or NULL on error" @@ -1737,11 +1972,11 @@ "comments": "", "group": "blame" }, - "git_blame_get_hunk_byline": { + "git_blame_hunk_byline": { "type": "function", - "file": "blame.h", - "line": 157, - "lineto": 159, + "file": "git2/blame.h", + "line": 273, + "lineto": 275, "args": [ { "name": "blame", @@ -1760,62 +1995,118 @@ "type": "const git_blame_hunk *", "comment": " the hunk that contains the given line, or NULL on error" }, - "description": "

Gets the hunk that relates to the given line number in the newest commit.

\n", + "description": "

Gets the hunk that relates to the given line number in the newest\n commit.

\n", "comments": "", "group": "blame", "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_blame_get_hunk_byline-1" - ] + "blame.c": ["ex/v1.9.1/blame.html#git_blame_hunk_byline-1"] } }, - "git_blame_file": { + "git_blame_line_byindex": { "type": "function", - "file": "blame.h", - "line": 172, - "lineto": 176, + "file": "git2/blame.h", + "line": 284, + "lineto": 286, "args": [ { - "name": "out", - "type": "git_blame **", - "comment": "pointer that will receive the blame object" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "repository whose history is to be walked" - }, - { - "name": "path", - "type": "const char *", - "comment": "path to file to consider" + "name": "blame", + "type": "git_blame *", + "comment": "the blame structure to query" }, { - "name": "options", - "type": "git_blame_options *", - "comment": "options for the blame operation. If NULL, this is treated as\n though GIT_BLAME_OPTIONS_INIT were passed." + "name": "idx", + "type": "size_t", + "comment": "the (1-based) line number" } ], - "argline": "git_blame **out, git_repository *repo, const char *path, git_blame_options *options", - "sig": "git_blame **::git_repository *::const char *::git_blame_options *", + "argline": "git_blame *blame, size_t idx", + "sig": "git_blame *::size_t", "return": { - "type": "int", - "comment": " 0 on success, or an error code. (use giterr_last for information\n about the error.)" + "type": "const git_blame_line *", + "comment": " the blamed line, or NULL on error" }, - "description": "

Get the blame for a single file.

\n", + "description": "

Gets the information about the line in the blame.

\n", "comments": "", - "group": "blame", - "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_blame_file-2" - ] - } + "group": "blame" }, - "git_blame_buffer": { + "git_blame_get_hunk_count": { "type": "function", - "file": "blame.h", - "line": 196, - "lineto": 200, + "file": "git2/blame.h", + "line": 296, + "lineto": 296, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "The blame structure to query." + } + ], + "argline": "git_blame *blame", + "sig": "git_blame *", + "return": { "type": "uint32_t", "comment": " The number of hunks." }, + "description": "

Gets the number of hunks that exist in the blame structure.

\n", + "comments": "", + "group": "blame" + }, + "git_blame_get_hunk_byindex": { + "type": "function", + "file": "git2/blame.h", + "line": 305, + "lineto": 307, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "the blame structure to query" + }, + { + "name": "index", + "type": "uint32_t", + "comment": "index of the hunk to retrieve" + } + ], + "argline": "git_blame *blame, uint32_t index", + "sig": "git_blame *::uint32_t", + "return": { + "type": "const git_blame_hunk *", + "comment": " the hunk at the given index, or NULL on error" + }, + "description": "

Gets the blame hunk at the given index.

\n", + "comments": "", + "group": "blame" + }, + "git_blame_get_hunk_byline": { + "type": "function", + "file": "git2/blame.h", + "line": 316, + "lineto": 318, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "the blame structure to query" + }, + { + "name": "lineno", + "type": "size_t", + "comment": "the (1-based) line number to find a hunk for" + } + ], + "argline": "git_blame *blame, size_t lineno", + "sig": "git_blame *::size_t", + "return": { + "type": "const git_blame_hunk *", + "comment": " the hunk that contains the given line, or NULL on error" + }, + "description": "

Gets the hunk that relates to the given line number in the newest commit.

\n", + "comments": "", + "group": "blame" + }, + "git_blame_buffer": { + "type": "function", + "file": "git2/blame.h", + "line": 374, + "lineto": 378, "args": [ { "name": "out", @@ -1823,7 +2114,7 @@ "comment": "pointer that will receive the resulting blame data" }, { - "name": "reference", + "name": "base", "type": "git_blame *", "comment": "cached blame from the history of the file (usually the output\n from git_blame_file)" }, @@ -1838,21 +2129,21 @@ "comment": "number of valid bytes in the buffer" } ], - "argline": "git_blame **out, git_blame *reference, const char *buffer, size_t buffer_len", + "argline": "git_blame **out, git_blame *base, const char *buffer, size_t buffer_len", "sig": "git_blame **::git_blame *::const char *::size_t", "return": { "type": "int", - "comment": " 0 on success, or an error code. (use giterr_last for information\n about the error)" + "comment": " 0 on success, or an error code. (use git_error_last for information\n about the error)" }, - "description": "

Get blame data for a file that has been modified in memory. The reference\n parameter is a pre-calculated blame for the in-odb history of the file. This\n means that once a file blame is completed (which can be expensive), updating\n the buffer blame is very fast.

\n", + "description": "

Get blame data for a file that has been modified in memory. The blame\n parameter is a pre-calculated blame for the in-odb history of the file.\n This means that once a file blame is completed (which can be expensive),\n updating the buffer blame is very fast.

\n", "comments": "

Lines that differ between the buffer and the committed version are marked as having a zero OID for their final_commit_id.

\n", "group": "blame" }, "git_blame_free": { "type": "function", - "file": "blame.h", - "line": 207, - "lineto": 207, + "file": "git2/blame.h", + "line": 385, + "lineto": 385, "args": [ { "name": "blame", @@ -1862,24 +2153,17 @@ ], "argline": "git_blame *blame", "sig": "git_blame *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "void", "comment": null }, "description": "

Free memory allocated by git_blame_file or git_blame_buffer.

\n", "comments": "", "group": "blame", - "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_blame_free-3" - ] - } + "examples": { "blame.c": ["ex/v1.9.1/blame.html#git_blame_free-2"] } }, "git_blob_lookup": { "type": "function", - "file": "blob.h", - "line": 33, - "lineto": 33, + "file": "git2/blob.h", + "line": 37, + "lineto": 40, "args": [ { "name": "blob", @@ -1899,27 +2183,20 @@ ], "argline": "git_blob **blob, git_repository *repo, const git_oid *id", "sig": "git_blob **::git_repository *::const git_oid *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Lookup a blob object from a repository.

\n", "comments": "", "group": "blob", "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_blob_lookup-4" - ], - "general.c": [ - "ex/HEAD/general.html#git_blob_lookup-1" - ] + "blame.c": ["ex/v1.9.1/blame.html#git_blob_lookup-3"], + "general.c": ["ex/v1.9.1/general.html#git_blob_lookup-1"] } }, "git_blob_lookup_prefix": { "type": "function", - "file": "blob.h", - "line": 47, - "lineto": 47, + "file": "git2/blob.h", + "line": 54, + "lineto": 54, "args": [ { "name": "blob", @@ -1944,49 +2221,35 @@ ], "argline": "git_blob **blob, git_repository *repo, const git_oid *id, size_t len", "sig": "git_blob **::git_repository *::const git_oid *::size_t", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Lookup a blob object from a repository,\n given a prefix of its identifier (short id).

\n", "comments": "", "group": "blob" }, "git_blob_free": { "type": "function", - "file": "blob.h", - "line": 60, - "lineto": 60, + "file": "git2/blob.h", + "line": 67, + "lineto": 67, "args": [ - { - "name": "blob", - "type": "git_blob *", - "comment": "the blob to close" - } + { "name": "blob", "type": "git_blob *", "comment": "the blob to close" } ], "argline": "git_blob *blob", "sig": "git_blob *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "void", "comment": null }, "description": "

Close an open blob

\n", "comments": "

This is a wrapper around git_object_free()

\n\n

IMPORTANT: It is necessary to call this method when you stop using a blob. Failure to do so will cause a memory leak.

\n", "group": "blob", "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_blob_free-5" - ], - "general.c": [ - "ex/HEAD/general.html#git_blob_free-2" - ] + "blame.c": ["ex/v1.9.1/blame.html#git_blob_free-4"], + "general.c": ["ex/v1.9.1/general.html#git_blob_free-2"] } }, "git_blob_id": { "type": "function", - "file": "blob.h", - "line": 68, - "lineto": 68, + "file": "git2/blob.h", + "line": 75, + "lineto": 75, "args": [ { "name": "blob", @@ -2006,9 +2269,9 @@ }, "git_blob_owner": { "type": "function", - "file": "blob.h", - "line": 76, - "lineto": 76, + "file": "git2/blob.h", + "line": 83, + "lineto": 83, "args": [ { "name": "blob", @@ -2028,9 +2291,9 @@ }, "git_blob_rawcontent": { "type": "function", - "file": "blob.h", - "line": 89, - "lineto": 89, + "file": "git2/blob.h", + "line": 96, + "lineto": 96, "args": [ { "name": "blob", @@ -2042,28 +2305,22 @@ "sig": "const git_blob *", "return": { "type": "const void *", - "comment": " the pointer" + "comment": " \n\n `unsigned char *` the pointer, or NULL on error" }, "description": "

Get a read-only buffer with the raw content of a blob.

\n", "comments": "

A pointer to the raw content of a blob is returned; this pointer is owned internally by the object and shall not be free'd. The pointer may be invalidated at a later time.

\n", "group": "blob", "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_blob_rawcontent-6" - ], - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_blob_rawcontent-1" - ], - "general.c": [ - "ex/HEAD/general.html#git_blob_rawcontent-3" - ] + "blame.c": ["ex/v1.9.1/blame.html#git_blob_rawcontent-5"], + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_blob_rawcontent-1"], + "general.c": ["ex/v1.9.1/general.html#git_blob_rawcontent-3"] } }, "git_blob_rawsize": { "type": "function", - "file": "blob.h", - "line": 97, - "lineto": 97, + "file": "git2/blob.h", + "line": 104, + "lineto": 104, "args": [ { "name": "blob", @@ -2073,31 +2330,51 @@ ], "argline": "const git_blob *blob", "sig": "const git_blob *", - "return": { - "type": "git_off_t", - "comment": " size on bytes" - }, + "return": { "type": "git_object_size_t", "comment": " size in bytes" }, "description": "

Get the size in bytes of the contents of a blob

\n", "comments": "", "group": "blob", "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_blob_rawsize-7" - ], - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_blob_rawsize-2" - ], + "blame.c": ["ex/v1.9.1/blame.html#git_blob_rawsize-6"], + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_blob_rawsize-2"], "general.c": [ - "ex/HEAD/general.html#git_blob_rawsize-4", - "ex/HEAD/general.html#git_blob_rawsize-5" + "ex/v1.9.1/general.html#git_blob_rawsize-4", + "ex/v1.9.1/general.html#git_blob_rawsize-5" ] } }, - "git_blob_filtered_content": { + "git_blob_filter_options_init": { "type": "function", - "file": "blob.h", - "line": 122, - "lineto": 126, + "file": "git2/blob.h", + "line": 201, + "lineto": 203, + "args": [ + { + "name": "opts", + "type": "git_blob_filter_options *", + "comment": "The `git_blob_filter_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass GIT_BLOB_FILTER_OPTIONS_VERSION" + } + ], + "argline": "git_blob_filter_options *opts, unsigned int version", + "sig": "git_blob_filter_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_blob_filter_options structure

\n", + "comments": "

Initializes a git_blob_filter_options with default values. Equivalent to creating an instance with GIT_BLOB_FILTER_OPTIONS_INIT.

\n", + "group": "blob" + }, + "git_blob_filter": { + "type": "function", + "file": "git2/blob.h", + "line": 227, + "lineto": 231, "args": [ { "name": "out", @@ -2115,26 +2392,26 @@ "comment": "Path used for file attribute lookups, etc." }, { - "name": "check_for_binary_data", - "type": "int", - "comment": "Should this test if blob content contains\n NUL bytes / looks like binary data before applying filters?" + "name": "opts", + "type": "git_blob_filter_options *", + "comment": "Options to use for filtering the blob" } ], - "argline": "git_buf *out, git_blob *blob, const char *as_path, int check_for_binary_data", - "sig": "git_buf *::git_blob *::const char *::int", + "argline": "git_buf *out, git_blob *blob, const char *as_path, git_blob_filter_options *opts", + "sig": "git_buf *::git_blob *::const char *::git_blob_filter_options *", "return": { "type": "int", - "comment": " 0 on success or an error code" + "comment": " \n\n[enum] git_error_code 0 on success or an error code" }, "description": "

Get a buffer with the filtered content of a blob.

\n", - "comments": "

This applies filters as if the blob was being checked out to the working directory under the specified filename. This may apply CRLF filtering or other types of changes depending on the file attributes set for the blob and the content detected in it.

\n\n

The output is written into a git_buf which the caller must free when done (via git_buf_free).

\n\n

If no filters need to be applied, then the out buffer will just be populated with a pointer to the raw content of the blob. In that case, be careful to not free the blob until done with the buffer or copy it into memory you own.

\n", + "comments": "

This applies filters as if the blob was being checked out to the working directory under the specified filename. This may apply CRLF filtering or other types of changes depending on the file attributes set for the blob and the content detected in it.

\n\n

The output is written into a git_buf which the caller must dispose when done (via git_buf_dispose).

\n\n

If no filters need to be applied, then the out buffer will just be populated with a pointer to the raw content of the blob. In that case, be careful to not free the blob until done with the buffer or copy it into memory you own.

\n", "group": "blob" }, - "git_blob_create_fromworkdir": { + "git_blob_create_from_workdir": { "type": "function", - "file": "blob.h", - "line": 139, - "lineto": 139, + "file": "git2/blob.h", + "line": 244, + "lineto": 244, "args": [ { "name": "id", @@ -2154,19 +2431,16 @@ ], "argline": "git_oid *id, git_repository *repo, const char *relative_path", "sig": "git_oid *::git_repository *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Read a file from the working folder of a repository\n and write it to the Object Database as a loose blob

\n", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Read a file from the working folder of a repository and write it\n to the object database.

\n", "comments": "", "group": "blob" }, - "git_blob_create_fromdisk": { + "git_blob_create_from_disk": { "type": "function", - "file": "blob.h", - "line": 151, - "lineto": 151, + "file": "git2/blob.h", + "line": 257, + "lineto": 260, "args": [ { "name": "id", @@ -2186,19 +2460,16 @@ ], "argline": "git_oid *id, git_repository *repo, const char *path", "sig": "git_oid *::git_repository *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Read a file from the filesystem and write its content\n to the Object Database as a loose blob

\n", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Read a file from the filesystem (not necessarily inside the\n working folder of the repository) and write it to the object\n database.

\n", "comments": "", "group": "blob" }, - "git_blob_create_fromstream": { + "git_blob_create_from_stream": { "type": "function", - "file": "blob.h", - "line": 178, - "lineto": 181, + "file": "git2/blob.h", + "line": 287, + "lineto": 290, "args": [ { "name": "out", @@ -2218,19 +2489,16 @@ ], "argline": "git_writestream **out, git_repository *repo, const char *hintpath", "sig": "git_writestream **::git_repository *::const char *", - "return": { - "type": "int", - "comment": " 0 or error code" - }, - "description": "

Create a stream to write a new blob into the object db

\n", - "comments": "

This function may need to buffer the data on disk and will in general not be the right choice if you know the size of the data to write. If you have data in memory, use git_blob_create_frombuffer(). If you do not, but know the size of the contents (and don't want/need to perform filtering), use git_odb_open_wstream().

\n\n

Don't close this stream yourself but pass it to git_blob_create_fromstream_commit() to commit the write to the object db and get the object id.

\n\n

If the hintpath parameter is filled, it will be used to determine what git filters should be applied to the object before it is written to the object database.

\n", + "return": { "type": "int", "comment": " 0 or error code" }, + "description": "

Create a stream to write a new blob into the object database.

\n", + "comments": "

This function may need to buffer the data on disk and will in general not be the right choice if you know the size of the data to write. If you have data in memory, use git_blob_create_from_buffer(). If you do not, but know the size of the contents (and don't want/need to perform filtering), use git_odb_open_wstream().

\n\n

Don't close this stream yourself but pass it to git_blob_create_from_stream_commit() to commit the write to the object db and get the object id.

\n\n

If the hintpath parameter is filled, it will be used to determine what git filters should be applied to the object before it is written to the object database.

\n", "group": "blob" }, - "git_blob_create_fromstream_commit": { + "git_blob_create_from_stream_commit": { "type": "function", - "file": "blob.h", - "line": 192, - "lineto": 194, + "file": "git2/blob.h", + "line": 301, + "lineto": 303, "args": [ { "name": "out", @@ -2245,19 +2513,16 @@ ], "argline": "git_oid *out, git_writestream *stream", "sig": "git_oid *::git_writestream *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Close the stream and write the blob to the object db

\n", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Close the stream and finalize writing the blob to the object database.

\n", "comments": "

The stream will be closed and freed.

\n", "group": "blob" }, - "git_blob_create_frombuffer": { + "git_blob_create_from_buffer": { "type": "function", - "file": "blob.h", - "line": 205, - "lineto": 206, + "file": "git2/blob.h", + "line": 314, + "lineto": 315, "args": [ { "name": "id", @@ -2267,34 +2532,27 @@ { "name": "repo", "type": "git_repository *", - "comment": "repository where to blob will be written" + "comment": "repository where the blob will be written" }, { "name": "buffer", "type": "const void *", "comment": "data to be written into the blob" }, - { - "name": "len", - "type": "size_t", - "comment": "length of the data" - } + { "name": "len", "type": "size_t", "comment": "length of the data" } ], "argline": "git_oid *id, git_repository *repo, const void *buffer, size_t len", "sig": "git_oid *::git_repository *::const void *::size_t", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Write an in-memory buffer to the ODB as a blob

\n", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Write an in-memory buffer to the object database as a blob.

\n", "comments": "", "group": "blob" }, "git_blob_is_binary": { "type": "function", - "file": "blob.h", - "line": 219, - "lineto": 219, + "file": "git2/blob.h", + "line": 328, + "lineto": 328, "args": [ { "name": "blob", @@ -2306,17 +2564,40 @@ "sig": "const git_blob *", "return": { "type": "int", - "comment": " 1 if the content of the blob is detected\n as binary; 0 otherwise." + "comment": " \n\n bool 1 if the content of the blob is detected\n as binary; 0 otherwise." }, - "description": "

Determine if the blob content is most certainly binary or not.

\n", + "description": "

Determine if the blob content is most likely binary or not.

\n", "comments": "

The heuristic used to guess if a file is binary is taken from core git: Searching for NUL bytes and looking for a reasonable ratio of printable to non-printable characters among the first 8000 bytes.

\n", "group": "blob" }, + "git_blob_data_is_binary": { + "type": "function", + "file": "git2/blob.h", + "line": 340, + "lineto": 340, + "args": [ + { + "name": "data", + "type": "const char *", + "comment": "The blob data which content should be analyzed" + }, + { "name": "len", "type": "size_t", "comment": "The length of the data" } + ], + "argline": "const char *data, size_t len", + "sig": "const char *::size_t", + "return": { + "type": "int", + "comment": " 1 if the content of the blob is detected\n as binary; 0 otherwise." + }, + "description": "

Determine if the given content is most certainly binary or not;\n this is the same mechanism used by git_blob_is_binary but only\n looking at raw data.

\n", + "comments": "", + "group": "blob" + }, "git_blob_dup": { "type": "function", - "file": "blob.h", - "line": 228, - "lineto": 228, + "file": "git2/blob.h", + "line": 350, + "lineto": 350, "args": [ { "name": "out", @@ -2331,19 +2612,16 @@ ], "argline": "git_blob **out, git_blob *source", "sig": "git_blob **::git_blob *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0." }, "description": "

Create an in-memory copy of a blob. The copy must be explicitly\n free'd or it will leak.

\n", "comments": "", "group": "blob" }, "git_branch_create": { "type": "function", - "file": "branch.h", - "line": 50, - "lineto": 55, + "file": "git2/branch.h", + "line": 53, + "lineto": 58, "args": [ { "name": "out", @@ -2353,17 +2631,17 @@ { "name": "repo", "type": "git_repository *", - "comment": null + "comment": "the repository to create the branch in." }, { "name": "branch_name", "type": "const char *", - "comment": "Name for the branch; this name is\n validated for consistency. It should also not conflict with\n an already existing branch name." + "comment": "Name for the branch; this name is\n validated for consistency. It should also not conflict with\n an already existing branch name." }, { "name": "target", "type": "const git_commit *", - "comment": "Commit to which this branch should point. This object\n must belong to the given `repo`." + "comment": "Commit to which this branch should point. This object\n must belong to the given `repo`." }, { "name": "force", @@ -2383,51 +2661,56 @@ }, "git_branch_create_from_annotated": { "type": "function", - "file": "branch.h", - "line": 68, - "lineto": 73, + "file": "git2/branch.h", + "line": 77, + "lineto": 82, "args": [ { "name": "ref_out", "type": "git_reference **", - "comment": null + "comment": "Pointer where to store the underlying reference." }, { - "name": "repository", + "name": "repo", "type": "git_repository *", - "comment": null + "comment": "the repository to create the branch in." }, { "name": "branch_name", "type": "const char *", - "comment": null + "comment": "Name for the branch; this name is\n validated for consistency. It should also not conflict with\n an already existing branch name." }, { - "name": "commit", + "name": "target", "type": "const git_annotated_commit *", - "comment": null + "comment": "Annotated commit to which this branch should point. This\n object must belong to the given `repo`." }, { "name": "force", "type": "int", - "comment": null + "comment": "Overwrite existing branch." } ], - "argline": "git_reference **ref_out, git_repository *repository, const char *branch_name, const git_annotated_commit *commit, int force", + "argline": "git_reference **ref_out, git_repository *repo, const char *branch_name, const git_annotated_commit *target, int force", "sig": "git_reference **::git_repository *::const char *::const git_annotated_commit *::int", "return": { "type": "int", - "comment": null + "comment": " 0, GIT_EINVALIDSPEC or an error code." }, "description": "

Create a new branch pointing at a target commit

\n", - "comments": "

This behaves like git_branch_create() but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages.

\n\n

See the documentation for git_branch_create().

\n", - "group": "branch" + "comments": "

This behaves like git_branch_create() but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages.

\n", + "group": "branch", + "examples": { + "checkout.c": [ + "ex/v1.9.1/checkout.html#git_branch_create_from_annotated-7" + ] + } }, "git_branch_delete": { "type": "function", - "file": "branch.h", - "line": 85, - "lineto": 85, + "file": "git2/branch.h", + "line": 94, + "lineto": 94, "args": [ { "name": "branch", @@ -2442,14 +2725,14 @@ "comment": " 0 on success, or an error code." }, "description": "

Delete an existing branch reference.

\n", - "comments": "

If the branch is successfully deleted, the passed reference object will be invalidated. The reference must be freed manually by the user.

\n", + "comments": "

Note that if the deletion succeeds, the reference object will not be valid anymore, and should be freed immediately by the user using git_reference_free().

\n", "group": "branch" }, "git_branch_iterator_new": { "type": "function", - "file": "branch.h", - "line": 101, - "lineto": 104, + "file": "git2/branch.h", + "line": 110, + "lineto": 113, "args": [ { "name": "out", @@ -2469,19 +2752,16 @@ ], "argline": "git_branch_iterator **out, git_repository *repo, git_branch_t list_flags", "sig": "git_branch_iterator **::git_repository *::git_branch_t", - "return": { - "type": "int", - "comment": " 0 on success or an error code" - }, + "return": { "type": "int", "comment": " 0 on success or an error code" }, "description": "

Create an iterator which loops over the requested branches.

\n", "comments": "", "group": "branch" }, "git_branch_next": { "type": "function", - "file": "branch.h", - "line": 114, - "lineto": 114, + "file": "git2/branch.h", + "line": 123, + "lineto": 123, "args": [ { "name": "out", @@ -2511,9 +2791,9 @@ }, "git_branch_iterator_free": { "type": "function", - "file": "branch.h", - "line": 121, - "lineto": 121, + "file": "git2/branch.h", + "line": 130, + "lineto": 130, "args": [ { "name": "iter", @@ -2523,24 +2803,21 @@ ], "argline": "git_branch_iterator *iter", "sig": "git_branch_iterator *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "void", "comment": null }, "description": "

Free a branch iterator

\n", "comments": "", "group": "branch" }, "git_branch_move": { "type": "function", - "file": "branch.h", - "line": 138, - "lineto": 142, + "file": "git2/branch.h", + "line": 153, + "lineto": 157, "args": [ { "name": "out", "type": "git_reference **", - "comment": null + "comment": "New reference object for the updated name." }, { "name": "branch", @@ -2565,14 +2842,14 @@ "comment": " 0 on success, GIT_EINVALIDSPEC or an error code." }, "description": "

Move/rename an existing local branch reference.

\n", - "comments": "

The new branch name will be checked for validity. See git_tag_create() for rules about valid names.

\n", + "comments": "

The new branch name will be checked for validity. See git_tag_create() for rules about valid names.

\n\n

Note that if the move succeeds, the old reference object will not be valid anymore, and should be freed immediately by the user using git_reference_free().

\n", "group": "branch" }, "git_branch_lookup": { "type": "function", - "file": "branch.h", - "line": 165, - "lineto": 169, + "file": "git2/branch.h", + "line": 177, + "lineto": 181, "args": [ { "name": "out", @@ -2602,78 +2879,47 @@ "comment": " 0 on success; GIT_ENOTFOUND when no matching branch\n exists, GIT_EINVALIDSPEC, otherwise an error code." }, "description": "

Lookup a branch by its name in a repository.

\n", - "comments": "

The generated reference must be freed by the user.

\n\n

The branch name will be checked for validity. See git_tag_create() for rules about valid names.

\n", + "comments": "

The generated reference must be freed by the user. The branch name will be checked for validity.

\n", "group": "branch" }, "git_branch_name": { "type": "function", - "file": "branch.h", - "line": 186, - "lineto": 188, + "file": "git2/branch.h", + "line": 198, + "lineto": 200, "args": [ { "name": "out", "type": "const char **", - "comment": "where the pointer of branch name is stored;\n this is valid as long as the ref is not freed." + "comment": "Pointer to the abbreviated reference name.\n Owned by ref, do not free." }, { "name": "ref", "type": "const git_reference *", - "comment": "the reference ideally pointing to a branch" + "comment": "A reference object, ideally pointing to a branch" } ], "argline": "const char **out, const git_reference *ref", "sig": "const char **::const git_reference *", "return": { "type": "int", - "comment": " 0 on success; otherwise an error code (e.g., if the\n ref is no local or remote branch)." - }, - "description": "

Return the name of the given local or remote branch.

\n", - "comments": "

The name of the branch matches the definition of the name for git_branch_lookup. That is, if the returned name is given to git_branch_lookup() then the reference is returned that was given to this function.

\n", - "group": "branch" - }, - "git_branch_remote_name": { - "type": "function", - "file": "branch.h", - "line": 274, - "lineto": 277, - "args": [ - { - "name": "out", - "type": "git_buf *", - "comment": "where the name is stored." - }, - { - "name": "repo", - "type": "git_respository *", - "comment": "the repo to check." - }, - { - "name": "canonical_branch_name", - "type": "const char *", - "comment": "the ref name of the branch" - } - ], - "argline": "git_buf *out, git_repository *repo, const char *canonical_branch_name", - "sig": "git_buf *::git_repository *::const char *", - "return": { - "type": "int", - "comment": " 0 on success; otherwise an error code (e.g., if the\n ref is no local or remote branch)." + "comment": " 0 on success; GIT_EINVALID if the reference isn't either a local or\n remote branch, otherwise an error code." }, - "description": "

Return the name of the given remote branch.

\n", - "comments": "

\n", - "group": "branch" + "description": "

Get the branch name

\n", + "comments": "

Given a reference object, this will check that it really is a branch (ie. it lives under "refs/heads/" or "refs/remotes/"), and return the branch part of it.

\n", + "group": "branch", + "examples": { "merge.c": ["ex/v1.9.1/merge.html#git_branch_name-4"] } }, "git_branch_upstream": { "type": "function", - "file": "branch.h", - "line": 202, - "lineto": 204, + "file": "git2/branch.h", + "line": 216, + "lineto": 218, "args": [ { "name": "out", "type": "git_reference **", - "comment": "Pointer where to store the retrieved\n reference." + "comment": "Pointer where to store the retrieved reference." }, { "name": "branch", @@ -2685,17 +2931,17 @@ "sig": "git_reference **::const git_reference *", "return": { "type": "int", - "comment": " 0 on success; GIT_ENOTFOUND when no remote tracking\n reference exists, otherwise an error code." + "comment": " 0 on success; GIT_ENOTFOUND when no remote tracking\n reference exists, otherwise an error code." }, - "description": "

Return the reference supporting the remote tracking branch,\n given a local branch reference.

\n", - "comments": "", + "description": "

Get the upstream of a branch

\n", + "comments": "

Given a reference, this will return a new reference object corresponding to its remote tracking branch. The reference must be a local branch.

\n", "group": "branch" }, "git_branch_set_upstream": { "type": "function", - "file": "branch.h", - "line": 216, - "lineto": 216, + "file": "git2/branch.h", + "line": 235, + "lineto": 237, "args": [ { "name": "branch", @@ -2703,194 +2949,252 @@ "comment": "the branch to configure" }, { - "name": "upstream_name", + "name": "branch_name", "type": "const char *", - "comment": "remote-tracking or local branch to set as\n upstream. Pass NULL to unset." + "comment": "remote-tracking or local branch to set as upstream." } ], - "argline": "git_reference *branch, const char *upstream_name", + "argline": "git_reference *branch, const char *branch_name", "sig": "git_reference *::const char *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " \n\n git_error_t 0 on success; GIT_ENOTFOUND if there's no branch named `branch_name`\n or an error code" }, - "description": "

Set the upstream configuration for a given local branch

\n", - "comments": "", + "description": "

Set a branch's upstream branch

\n", + "comments": "

This will update the configuration to set the branch named branch_name as the upstream of branch. Pass a NULL name to unset the upstream information.

\n", + "group": "branch" + }, + "git_branch_upstream_name": { + "type": "function", + "file": "git2/branch.h", + "line": 253, + "lineto": 256, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "the buffer into which the name will be written." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the branches live." + }, + { + "name": "refname", + "type": "const char *", + "comment": "reference name of the local branch." + } + ], + "argline": "git_buf *out, git_repository *repo, const char *refname", + "sig": "git_buf *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND when no remote tracking reference exists,\n or an error code." + }, + "description": "

Get the upstream name of a branch

\n", + "comments": "

Given a local branch, this will return its remote-tracking branch information, as a full reference name, ie. "feature/nice" would become "refs/remote/origin/feature/nice", depending on that branch's configuration.

\n", "group": "branch" }, "git_branch_is_head": { "type": "function", - "file": "branch.h", - "line": 245, - "lineto": 246, + "file": "git2/branch.h", + "line": 266, + "lineto": 267, "args": [ { "name": "branch", "type": "const git_reference *", - "comment": "Current underlying reference of the branch." + "comment": "A reference to a local branch." } ], "argline": "const git_reference *branch", "sig": "const git_reference *", "return": { "type": "int", - "comment": " 1 if HEAD points at the branch, 0 if it isn't,\n error code otherwise." + "comment": " 1 if HEAD points at the branch, 0 if it isn't, or a negative value\n \t\t as an error code." }, - "description": "

Determine if the current local branch is pointed at by HEAD.

\n", + "description": "

Determine if HEAD points to the given branch

\n", "comments": "", "group": "branch" }, - "git_buf_free": { + "git_branch_is_checked_out": { "type": "function", - "file": "buffer.h", - "line": 72, - "lineto": 72, + "file": "git2/branch.h", + "line": 279, + "lineto": 280, "args": [ { - "name": "buffer", - "type": "git_buf *", - "comment": "The buffer to deallocate" + "name": "branch", + "type": "const git_reference *", + "comment": "A reference to a local branch." } ], - "argline": "git_buf *buffer", - "sig": "git_buf *", + "argline": "const git_reference *branch", + "sig": "const git_reference *", "return": { - "type": "void", - "comment": null + "type": "int", + "comment": " 1 if branch is checked out, 0 if it isn't, an error code otherwise." }, - "description": "

Free the memory referred to by the git_buf.

\n", - "comments": "

Note that this does not free the git_buf itself, just the memory pointed to by buffer->ptr. This will not free the memory if it looks like it was not allocated internally, but it will clear the buffer back to the empty state.

\n", - "group": "buf", - "examples": { - "diff.c": [ - "ex/HEAD/diff.html#git_buf_free-1" - ], - "remote.c": [ - "ex/HEAD/remote.html#git_buf_free-1" - ], - "tag.c": [ - "ex/HEAD/tag.html#git_buf_free-1" - ] - } + "description": "

Determine if any HEAD points to the current branch

\n", + "comments": "

This will iterate over all known linked repositories (usually in the form of worktrees) and report whether any HEAD is pointing at the current branch.

\n", + "group": "branch" }, - "git_buf_grow": { + "git_branch_remote_name": { "type": "function", - "file": "buffer.h", - "line": 95, - "lineto": 95, + "file": "git2/branch.h", + "line": 298, + "lineto": 301, "args": [ { - "name": "buffer", + "name": "out", "type": "git_buf *", - "comment": "The buffer to be resized; may or may not be allocated yet" + "comment": "The buffer into which the name will be written." }, { - "name": "target_size", - "type": "size_t", - "comment": "The desired available size" + "name": "repo", + "type": "git_repository *", + "comment": "The repository where the branch lives." + }, + { + "name": "refname", + "type": "const char *", + "comment": "complete name of the remote tracking branch." } ], - "argline": "git_buf *buffer, size_t target_size", - "sig": "git_buf *::size_t", + "argline": "git_buf *out, git_repository *repo, const char *refname", + "sig": "git_buf *::git_repository *::const char *", "return": { "type": "int", - "comment": " 0 on success, -1 on allocation failure" + "comment": " 0 on success, GIT_ENOTFOUND when no matching remote was found,\n GIT_EAMBIGUOUS when the branch maps to several remotes,\n otherwise an error code." }, - "description": "

Resize the buffer allocation to make more space.

\n", - "comments": "

This will attempt to grow the buffer to accommodate the target size.

\n\n

If the buffer refers to memory that was not allocated by libgit2 (i.e. the asize field is zero), then ptr will be replaced with a newly allocated block of data. Be careful so that memory allocated by the caller is not lost. As a special variant, if you pass target_size as 0 and the memory is not allocated by libgit2, this will allocate a new buffer of size size and copy the external data into it.

\n\n

Currently, this will never shrink a buffer, only expand it.

\n\n

If the allocation fails, this will return an error and the buffer will be marked as invalid for future operations, invaliding the contents.

\n", - "group": "buf" + "description": "

Find the remote name of a remote-tracking branch

\n", + "comments": "

This will return the name of the remote whose fetch refspec is matching the given branch. E.g. given a branch "refs/remotes/test/master", it will extract the "test" part. If refspecs from multiple remotes match, the function will return GIT_EAMBIGUOUS.

\n", + "group": "branch" }, - "git_buf_set": { + "git_branch_upstream_remote": { "type": "function", - "file": "buffer.h", - "line": 105, - "lineto": 106, + "file": "git2/branch.h", + "line": 314, + "lineto": 314, "args": [ { - "name": "buffer", + "name": "buf", "type": "git_buf *", - "comment": "The buffer to set" + "comment": "the buffer into which to write the name" }, { - "name": "data", - "type": "const void *", - "comment": "The data to copy into the buffer" + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to look" }, { - "name": "datalen", - "type": "size_t", - "comment": "The length of the data to copy into the buffer" + "name": "refname", + "type": "const char *", + "comment": "the full name of the branch" } ], - "argline": "git_buf *buffer, const void *data, size_t datalen", - "sig": "git_buf *::const void *::size_t", - "return": { - "type": "int", - "comment": " 0 on success, -1 on allocation failure" - }, - "description": "

Set buffer to a copy of some raw data.

\n", - "comments": "", - "group": "buf" + "argline": "git_buf *buf, git_repository *repo, const char *refname", + "sig": "git_buf *::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Retrieve the upstream remote of a local branch

\n", + "comments": "

This will return the currently configured "branch.*.remote" for a given branch. This branch must be local.

\n", + "group": "branch" }, - "git_buf_is_binary": { + "git_branch_upstream_merge": { "type": "function", - "file": "buffer.h", - "line": 114, - "lineto": 114, + "file": "git2/branch.h", + "line": 327, + "lineto": 327, "args": [ { "name": "buf", - "type": "const git_buf *", - "comment": "Buffer to check" + "type": "git_buf *", + "comment": "the buffer into which to write the name" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to look" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the full name of the branch" } ], - "argline": "const git_buf *buf", - "sig": "const git_buf *", - "return": { - "type": "int", - "comment": " 1 if buffer looks like non-text data" - }, - "description": "

Check quickly if buffer looks like it contains binary data

\n", - "comments": "", - "group": "buf" + "argline": "git_buf *buf, git_repository *repo, const char *refname", + "sig": "git_buf *::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Retrieve the upstream merge of a local branch

\n", + "comments": "

This will return the currently configured "branch.*.merge" for a given branch. This branch must be local.

\n", + "group": "branch" }, - "git_buf_contains_nul": { + "git_branch_name_is_valid": { "type": "function", - "file": "buffer.h", - "line": 122, - "lineto": 122, + "file": "git2/branch.h", + "line": 339, + "lineto": 339, "args": [ { - "name": "buf", - "type": "const git_buf *", - "comment": "Buffer to check" + "name": "valid", + "type": "int *", + "comment": "output pointer to set with validity of given branch name" + }, + { + "name": "name", + "type": "const char *", + "comment": "a branch name to test" } ], - "argline": "const git_buf *buf", - "sig": "const git_buf *", - "return": { - "type": "int", - "comment": " 1 if buffer contains a NUL byte" - }, - "description": "

Check quickly if buffer contains a NUL byte

\n", + "argline": "int *valid, const char *name", + "sig": "int *::const char *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Determine whether a branch name is valid, meaning that (when prefixed\n with refs/heads/) that it is a valid reference name, and that any\n additional branch name restrictions are imposed (eg, it cannot start\n with a -).

\n", "comments": "", - "group": "buf" + "group": "branch" }, - "git_checkout_init_options": { + "git_buf_dispose": { "type": "function", - "file": "checkout.h", - "line": 308, - "lineto": 310, + "file": "git2/buffer.h", + "line": 71, + "lineto": 71, + "args": [ + { + "name": "buffer", + "type": "git_buf *", + "comment": "The buffer to deallocate" + } + ], + "argline": "git_buf *buffer", + "sig": "git_buf *", + "return": { "type": "void", "comment": null }, + "description": "

Free the memory referred to by the git_buf.

\n", + "comments": "

Note that this does not free the git_buf itself, just the memory pointed to by buffer->ptr.

\n", + "group": "buf", + "examples": { + "diff.c": [ + "ex/v1.9.1/diff.html#git_buf_dispose-1", + "ex/v1.9.1/diff.html#git_buf_dispose-2" + ], + "tag.c": ["ex/v1.9.1/tag.html#git_buf_dispose-1"] + } + }, + "git_checkout_options_init": { + "type": "function", + "file": "git2/checkout.h", + "line": 410, + "lineto": 412, "args": [ { "name": "opts", "type": "git_checkout_options *", - "comment": "the `git_checkout_options` struct to initialize." + "comment": "The `git_checkout_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_CHECKOUT_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_CHECKOUT_OPTIONS_VERSION`." } ], "argline": "git_checkout_options *opts, unsigned int version", @@ -2899,15 +3203,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_checkout_options with default values. Equivalent to\n creating an instance with GIT_CHECKOUT_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_checkout_options structure

\n", + "comments": "

Initializes a git_checkout_options with default values. Equivalent to creating an instance with GIT_CHECKOUT_OPTIONS_INIT.

\n", "group": "checkout" }, "git_checkout_head": { "type": "function", - "file": "checkout.h", - "line": 329, - "lineto": 331, + "file": "git2/checkout.h", + "line": 431, + "lineto": 433, "args": [ { "name": "repo", @@ -2924,7 +3228,7 @@ "sig": "git_repository *::const git_checkout_options *", "return": { "type": "int", - "comment": " 0 on success, GIT_EUNBORNBRANCH if HEAD points to a non\n existing branch, non-zero value returned by `notify_cb`, or\n other error code \n<\n 0 (use giterr_last for error details)" + "comment": " 0 on success, GIT_EUNBORNBRANCH if HEAD points to a non\n existing branch, non-zero value returned by `notify_cb`, or\n other error code \n<\n 0 (use git_error_last for error details)" }, "description": "

Updates files in the index and the working tree to match the content of\n the commit pointed at by HEAD.

\n", "comments": "

Note that this is not the correct mechanism used to switch branches; do not change your HEAD and then call this method, that would leave you with checkout conflicts since your working directory would then appear to be dirty. Instead, checkout the target of the branch and then update HEAD using git_repository_set_head to point to the branch you checked out.

\n", @@ -2932,9 +3236,9 @@ }, "git_checkout_index": { "type": "function", - "file": "checkout.h", - "line": 342, - "lineto": 345, + "file": "git2/checkout.h", + "line": 444, + "lineto": 447, "args": [ { "name": "repo", @@ -2956,7 +3260,7 @@ "sig": "git_repository *::git_index *::const git_checkout_options *", "return": { "type": "int", - "comment": " 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use giterr_last for error details)" + "comment": " 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use git_error_last for error details)" }, "description": "

Updates files in the working tree to match the content of the index.

\n", "comments": "", @@ -2964,9 +3268,9 @@ }, "git_checkout_tree": { "type": "function", - "file": "checkout.h", - "line": 358, - "lineto": 361, + "file": "git2/checkout.h", + "line": 460, + "lineto": 463, "args": [ { "name": "repo", @@ -2988,27 +3292,31 @@ "sig": "git_repository *::const git_object *::const git_checkout_options *", "return": { "type": "int", - "comment": " 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use giterr_last for error details)" + "comment": " 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use git_error_last for error details)" }, "description": "

Updates files in the index and working tree to match the content of the\n tree pointed at by the treeish.

\n", "comments": "", - "group": "checkout" + "group": "checkout", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_checkout_tree-8"], + "merge.c": ["ex/v1.9.1/merge.html#git_checkout_tree-5"] + } }, - "git_cherrypick_init_options": { + "git_cherrypick_options_init": { "type": "function", - "file": "cherrypick.h", - "line": 47, - "lineto": 49, + "file": "git2/cherrypick.h", + "line": 57, + "lineto": 59, "args": [ { "name": "opts", "type": "git_cherrypick_options *", - "comment": "the `git_cherrypick_options` struct to initialize" + "comment": "The `git_cherrypick_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_CHERRYPICK_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_CHERRYPICK_OPTIONS_VERSION`." } ], "argline": "git_cherrypick_options *opts, unsigned int version", @@ -3017,15 +3325,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_cherrypick_options with default values. Equivalent to\n creating an instance with GIT_CHERRYPICK_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_cherrypick_options structure

\n", + "comments": "

Initializes a git_cherrypick_options with default values. Equivalent to creating an instance with GIT_CHERRYPICK_OPTIONS_INIT.

\n", "group": "cherrypick" }, "git_cherrypick_commit": { "type": "function", - "file": "cherrypick.h", - "line": 65, - "lineto": 71, + "file": "git2/cherrypick.h", + "line": 75, + "lineto": 81, "args": [ { "name": "out", @@ -3045,12 +3353,12 @@ { "name": "our_commit", "type": "git_commit *", - "comment": "the commit to revert against (eg, HEAD)" + "comment": "the commit to cherry-pick against (eg, HEAD)" }, { "name": "mainline", "type": "unsigned int", - "comment": "the parent of the revert commit, if it is a merge" + "comment": "the parent of the `cherrypick_commit`, if it is a merge" }, { "name": "merge_options", @@ -3070,9 +3378,9 @@ }, "git_cherrypick": { "type": "function", - "file": "cherrypick.h", - "line": 81, - "lineto": 84, + "file": "git2/cherrypick.h", + "line": 91, + "lineto": 94, "args": [ { "name": "repo", @@ -3100,21 +3408,21 @@ "comments": "", "group": "cherrypick" }, - "git_clone_init_options": { + "git_clone_options_init": { "type": "function", - "file": "clone.h", - "line": 179, - "lineto": 181, + "file": "git2/clone.h", + "line": 192, + "lineto": 194, "args": [ { "name": "opts", "type": "git_clone_options *", - "comment": "The `git_clone_options` struct to initialize" + "comment": "The `git_clone_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_CLONE_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_CLONE_OPTIONS_VERSION`." } ], "argline": "git_clone_options *opts, unsigned int version", @@ -3123,15 +3431,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_clone_options with default values. Equivalent to\n creating an instance with GIT_CLONE_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_clone_options structure

\n", + "comments": "

Initializes a git_clone_options with default values. Equivalent to creating an instance with GIT_CLONE_OPTIONS_INIT.

\n", "group": "clone" }, "git_clone": { "type": "function", - "file": "clone.h", - "line": 199, - "lineto": 203, + "file": "git2/clone.h", + "line": 216, + "lineto": 220, "args": [ { "name": "out", @@ -3158,22 +3466,17 @@ "sig": "git_repository **::const char *::const char *::const git_clone_options *", "return": { "type": "int", - "comment": " 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `giterr_last` for a detailed error message)" + "comment": " 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `git_error_last` for a detailed error message)" }, "description": "

Clone a remote repository.

\n", - "comments": "

By default this creates its repository and initial remote to match git's defaults. You can use the options in the callback to customize how these are created.

\n", - "group": "clone", - "examples": { - "network/clone.c": [ - "ex/HEAD/network/clone.html#git_clone-1" - ] - } + "comments": "

By default this creates its repository and initial remote to match git's defaults. You can use the options in the callback to customize how these are created.

\n\n

Note that the libgit2 library must be initialized using git_libgit2_init before any APIs can be called, including this one.

\n", + "group": "clone" }, "git_commit_lookup": { "type": "function", - "file": "commit.h", - "line": 36, - "lineto": 37, + "file": "git2/commit.h", + "line": 40, + "lineto": 41, "args": [ { "name": "commit", @@ -3193,29 +3496,26 @@ ], "argline": "git_commit **commit, git_repository *repo, const git_oid *id", "sig": "git_commit **::git_repository *::const git_oid *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Lookup a commit object from a repository.

\n", "comments": "

The returned object should be released with git_commit_free when no longer needed.

\n", "group": "commit", "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_commit_lookup-9"], "general.c": [ - "ex/HEAD/general.html#git_commit_lookup-6", - "ex/HEAD/general.html#git_commit_lookup-7", - "ex/HEAD/general.html#git_commit_lookup-8" + "ex/v1.9.1/general.html#git_commit_lookup-6", + "ex/v1.9.1/general.html#git_commit_lookup-7", + "ex/v1.9.1/general.html#git_commit_lookup-8" ], - "log.c": [ - "ex/HEAD/log.html#git_commit_lookup-1" - ] + "log.c": ["ex/v1.9.1/log.html#git_commit_lookup-1"], + "merge.c": ["ex/v1.9.1/merge.html#git_commit_lookup-6"] } }, "git_commit_lookup_prefix": { "type": "function", - "file": "commit.h", - "line": 55, - "lineto": 56, + "file": "git2/commit.h", + "line": 59, + "lineto": 60, "args": [ { "name": "commit", @@ -3240,19 +3540,16 @@ ], "argline": "git_commit **commit, git_repository *repo, const git_oid *id, size_t len", "sig": "git_commit **::git_repository *::const git_oid *::size_t", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Lookup a commit object from a repository, given a prefix of its\n identifier (short id).

\n", "comments": "

The returned object should be released with git_commit_free when no longer needed.

\n", "group": "commit" }, "git_commit_free": { "type": "function", - "file": "commit.h", - "line": 70, - "lineto": 70, + "file": "git2/commit.h", + "line": 74, + "lineto": 74, "args": [ { "name": "commit", @@ -3262,34 +3559,32 @@ ], "argline": "git_commit *commit", "sig": "git_commit *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "void", "comment": null }, "description": "

Close an open commit

\n", "comments": "

This is a wrapper around git_object_free()

\n\n

IMPORTANT: It is necessary to call this method when you stop using a commit. Failure to do so will cause a memory leak.

\n", "group": "commit", "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_commit_free-10"], "general.c": [ - "ex/HEAD/general.html#git_commit_free-9", - "ex/HEAD/general.html#git_commit_free-10", - "ex/HEAD/general.html#git_commit_free-11", - "ex/HEAD/general.html#git_commit_free-12", - "ex/HEAD/general.html#git_commit_free-13" + "ex/v1.9.1/general.html#git_commit_free-9", + "ex/v1.9.1/general.html#git_commit_free-10", + "ex/v1.9.1/general.html#git_commit_free-11", + "ex/v1.9.1/general.html#git_commit_free-12", + "ex/v1.9.1/general.html#git_commit_free-13" ], "log.c": [ - "ex/HEAD/log.html#git_commit_free-2", - "ex/HEAD/log.html#git_commit_free-3", - "ex/HEAD/log.html#git_commit_free-4", - "ex/HEAD/log.html#git_commit_free-5" + "ex/v1.9.1/log.html#git_commit_free-2", + "ex/v1.9.1/log.html#git_commit_free-3", + "ex/v1.9.1/log.html#git_commit_free-4", + "ex/v1.9.1/log.html#git_commit_free-5" ] } }, "git_commit_id": { "type": "function", - "file": "commit.h", - "line": 78, - "lineto": 78, + "file": "git2/commit.h", + "line": 82, + "lineto": 82, "args": [ { "name": "commit", @@ -3307,19 +3602,15 @@ "comments": "", "group": "commit", "examples": { - "general.c": [ - "ex/HEAD/general.html#git_commit_id-14" - ], - "log.c": [ - "ex/HEAD/log.html#git_commit_id-6" - ] + "general.c": ["ex/v1.9.1/general.html#git_commit_id-14"], + "log.c": ["ex/v1.9.1/log.html#git_commit_id-6"] } }, "git_commit_owner": { "type": "function", - "file": "commit.h", - "line": 86, - "lineto": 86, + "file": "git2/commit.h", + "line": 90, + "lineto": 90, "args": [ { "name": "commit", @@ -3338,16 +3629,16 @@ "group": "commit", "examples": { "log.c": [ - "ex/HEAD/log.html#git_commit_owner-7", - "ex/HEAD/log.html#git_commit_owner-8" + "ex/v1.9.1/log.html#git_commit_owner-7", + "ex/v1.9.1/log.html#git_commit_owner-8" ] } }, "git_commit_message_encoding": { "type": "function", - "file": "commit.h", - "line": 98, - "lineto": 98, + "file": "git2/commit.h", + "line": 102, + "lineto": 102, "args": [ { "name": "commit", @@ -3357,19 +3648,16 @@ ], "argline": "const git_commit *commit", "sig": "const git_commit *", - "return": { - "type": "const char *", - "comment": " NULL, or the encoding" - }, + "return": { "type": "const char *", "comment": " NULL, or the encoding" }, "description": "

Get the encoding for the message of a commit,\n as a string representing a standard encoding name.

\n", "comments": "

The encoding may be NULL if the encoding header in the commit is missing; in that case UTF-8 is assumed.

\n", "group": "commit" }, "git_commit_message": { "type": "function", - "file": "commit.h", - "line": 109, - "lineto": 109, + "file": "git2/commit.h", + "line": 113, + "lineto": 113, "args": [ { "name": "commit", @@ -3388,28 +3676,27 @@ "group": "commit", "examples": { "cat-file.c": [ - "ex/HEAD/cat-file.html#git_commit_message-3", - "ex/HEAD/cat-file.html#git_commit_message-4" + "ex/v1.9.1/cat-file.html#git_commit_message-3", + "ex/v1.9.1/cat-file.html#git_commit_message-4" ], "general.c": [ - "ex/HEAD/general.html#git_commit_message-15", - "ex/HEAD/general.html#git_commit_message-16", - "ex/HEAD/general.html#git_commit_message-17" + "ex/v1.9.1/general.html#git_commit_message-15", + "ex/v1.9.1/general.html#git_commit_message-16", + "ex/v1.9.1/general.html#git_commit_message-17" ], "log.c": [ - "ex/HEAD/log.html#git_commit_message-9", - "ex/HEAD/log.html#git_commit_message-10" + "ex/v1.9.1/log.html#git_commit_message-9", + "ex/v1.9.1/log.html#git_commit_message-10", + "ex/v1.9.1/log.html#git_commit_message-11" ], - "tag.c": [ - "ex/HEAD/tag.html#git_commit_message-2" - ] + "tag.c": ["ex/v1.9.1/tag.html#git_commit_message-2"] } }, "git_commit_message_raw": { "type": "function", - "file": "commit.h", - "line": 117, - "lineto": 117, + "file": "git2/commit.h", + "line": 121, + "lineto": 121, "args": [ { "name": "commit", @@ -3429,9 +3716,9 @@ }, "git_commit_summary": { "type": "function", - "file": "commit.h", - "line": 128, - "lineto": 128, + "file": "git2/commit.h", + "line": 132, + "lineto": 132, "args": [ { "name": "commit", @@ -3451,9 +3738,9 @@ }, "git_commit_body": { "type": "function", - "file": "commit.h", - "line": 141, - "lineto": 141, + "file": "git2/commit.h", + "line": 145, + "lineto": 145, "args": [ { "name": "commit", @@ -3473,9 +3760,9 @@ }, "git_commit_time": { "type": "function", - "file": "commit.h", - "line": 149, - "lineto": 149, + "file": "git2/commit.h", + "line": 153, + "lineto": 153, "args": [ { "name": "commit", @@ -3485,25 +3772,22 @@ ], "argline": "const git_commit *commit", "sig": "const git_commit *", - "return": { - "type": "git_time_t", - "comment": " the time of a commit" - }, + "return": { "type": "git_time_t", "comment": " the time of a commit" }, "description": "

Get the commit time (i.e. committer time) of a commit.

\n", "comments": "", "group": "commit", "examples": { "general.c": [ - "ex/HEAD/general.html#git_commit_time-18", - "ex/HEAD/general.html#git_commit_time-19" + "ex/v1.9.1/general.html#git_commit_time-18", + "ex/v1.9.1/general.html#git_commit_time-19" ] } }, "git_commit_time_offset": { "type": "function", - "file": "commit.h", - "line": 157, - "lineto": 157, + "file": "git2/commit.h", + "line": 161, + "lineto": 161, "args": [ { "name": "commit", @@ -3523,9 +3807,9 @@ }, "git_commit_committer": { "type": "function", - "file": "commit.h", - "line": 165, - "lineto": 165, + "file": "git2/commit.h", + "line": 169, + "lineto": 169, "args": [ { "name": "commit", @@ -3543,22 +3827,16 @@ "comments": "", "group": "commit", "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_commit_committer-5" - ], - "general.c": [ - "ex/HEAD/general.html#git_commit_committer-20" - ], - "log.c": [ - "ex/HEAD/log.html#git_commit_committer-11" - ] + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_commit_committer-5"], + "general.c": ["ex/v1.9.1/general.html#git_commit_committer-20"], + "log.c": ["ex/v1.9.1/log.html#git_commit_committer-12"] } }, "git_commit_author": { "type": "function", - "file": "commit.h", - "line": 173, - "lineto": 173, + "file": "git2/commit.h", + "line": 177, + "lineto": 177, "args": [ { "name": "commit", @@ -3576,24 +3854,80 @@ "comments": "", "group": "commit", "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_commit_author-6" - ], + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_commit_author-6"], "general.c": [ - "ex/HEAD/general.html#git_commit_author-21", - "ex/HEAD/general.html#git_commit_author-22" + "ex/v1.9.1/general.html#git_commit_author-21", + "ex/v1.9.1/general.html#git_commit_author-22" ], "log.c": [ - "ex/HEAD/log.html#git_commit_author-12", - "ex/HEAD/log.html#git_commit_author-13" + "ex/v1.9.1/log.html#git_commit_author-13", + "ex/v1.9.1/log.html#git_commit_author-14" ] } }, + "git_commit_committer_with_mailmap": { + "type": "function", + "file": "git2/commit.h", + "line": 190, + "lineto": 191, + "args": [ + { + "name": "out", + "type": "git_signature **", + "comment": "a pointer to store the resolved signature." + }, + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + }, + { + "name": "mailmap", + "type": "const git_mailmap *", + "comment": "the mailmap to resolve with. (may be NULL)" + } + ], + "argline": "git_signature **out, const git_commit *commit, const git_mailmap *mailmap", + "sig": "git_signature **::const git_commit *::const git_mailmap *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the committer of a commit, using the mailmap to map names and email\n addresses to canonical real names and email addresses.

\n", + "comments": "

Call git_signature_free to free the signature.

\n", + "group": "commit" + }, + "git_commit_author_with_mailmap": { + "type": "function", + "file": "git2/commit.h", + "line": 204, + "lineto": 205, + "args": [ + { + "name": "out", + "type": "git_signature **", + "comment": "a pointer to store the resolved signature." + }, + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + }, + { + "name": "mailmap", + "type": "const git_mailmap *", + "comment": "the mailmap to resolve with. (may be NULL)" + } + ], + "argline": "git_signature **out, const git_commit *commit, const git_mailmap *mailmap", + "sig": "git_signature **::const git_commit *::const git_mailmap *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the author of a commit, using the mailmap to map names and email\n addresses to canonical real names and email addresses.

\n", + "comments": "

Call git_signature_free to free the signature.

\n", + "group": "commit" + }, "git_commit_raw_header": { "type": "function", - "file": "commit.h", - "line": 181, - "lineto": 181, + "file": "git2/commit.h", + "line": 213, + "lineto": 213, "args": [ { "name": "commit", @@ -3613,9 +3947,9 @@ }, "git_commit_tree": { "type": "function", - "file": "commit.h", - "line": 190, - "lineto": 190, + "file": "git2/commit.h", + "line": 222, + "lineto": 222, "args": [ { "name": "tree_out", @@ -3630,28 +3964,25 @@ ], "argline": "git_tree **tree_out, const git_commit *commit", "sig": "git_tree **::const git_commit *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Get the tree pointed to by a commit.

\n", "comments": "", "group": "commit", "examples": { "log.c": [ - "ex/HEAD/log.html#git_commit_tree-14", - "ex/HEAD/log.html#git_commit_tree-15", - "ex/HEAD/log.html#git_commit_tree-16", - "ex/HEAD/log.html#git_commit_tree-17", - "ex/HEAD/log.html#git_commit_tree-18" + "ex/v1.9.1/log.html#git_commit_tree-15", + "ex/v1.9.1/log.html#git_commit_tree-16", + "ex/v1.9.1/log.html#git_commit_tree-17", + "ex/v1.9.1/log.html#git_commit_tree-18", + "ex/v1.9.1/log.html#git_commit_tree-19" ] } }, "git_commit_tree_id": { "type": "function", - "file": "commit.h", - "line": 200, - "lineto": 200, + "file": "git2/commit.h", + "line": 232, + "lineto": 232, "args": [ { "name": "commit", @@ -3669,16 +4000,14 @@ "comments": "", "group": "commit", "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_commit_tree_id-7" - ] + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_commit_tree_id-7"] } }, "git_commit_parentcount": { "type": "function", - "file": "commit.h", - "line": 208, - "lineto": 208, + "file": "git2/commit.h", + "line": 240, + "lineto": 240, "args": [ { "name": "commit", @@ -3696,23 +4025,19 @@ "comments": "", "group": "commit", "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_commit_parentcount-8" - ], - "general.c": [ - "ex/HEAD/general.html#git_commit_parentcount-23" - ], + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_commit_parentcount-8"], + "general.c": ["ex/v1.9.1/general.html#git_commit_parentcount-23"], "log.c": [ - "ex/HEAD/log.html#git_commit_parentcount-19", - "ex/HEAD/log.html#git_commit_parentcount-20" + "ex/v1.9.1/log.html#git_commit_parentcount-20", + "ex/v1.9.1/log.html#git_commit_parentcount-21" ] } }, "git_commit_parent": { "type": "function", - "file": "commit.h", - "line": 218, - "lineto": 221, + "file": "git2/commit.h", + "line": 250, + "lineto": 253, "args": [ { "name": "out", @@ -3732,28 +4057,23 @@ ], "argline": "git_commit **out, const git_commit *commit, unsigned int n", "sig": "git_commit **::const git_commit *::unsigned int", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Get the specified parent of the commit.

\n", "comments": "", "group": "commit", "examples": { - "general.c": [ - "ex/HEAD/general.html#git_commit_parent-24" - ], + "general.c": ["ex/v1.9.1/general.html#git_commit_parent-24"], "log.c": [ - "ex/HEAD/log.html#git_commit_parent-21", - "ex/HEAD/log.html#git_commit_parent-22" + "ex/v1.9.1/log.html#git_commit_parent-22", + "ex/v1.9.1/log.html#git_commit_parent-23" ] } }, "git_commit_parent_id": { "type": "function", - "file": "commit.h", - "line": 232, - "lineto": 234, + "file": "git2/commit.h", + "line": 264, + "lineto": 266, "args": [ { "name": "commit", @@ -3776,19 +4096,15 @@ "comments": "", "group": "commit", "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_commit_parent_id-9" - ], - "log.c": [ - "ex/HEAD/log.html#git_commit_parent_id-23" - ] + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_commit_parent_id-9"], + "log.c": ["ex/v1.9.1/log.html#git_commit_parent_id-24"] } }, "git_commit_nth_gen_ancestor": { "type": "function", - "file": "commit.h", - "line": 250, - "lineto": 253, + "file": "git2/commit.h", + "line": 282, + "lineto": 285, "args": [ { "name": "ancestor", @@ -3818,14 +4134,14 @@ }, "git_commit_header_field": { "type": "function", - "file": "commit.h", - "line": 264, - "lineto": 264, + "file": "git2/commit.h", + "line": 297, + "lineto": 297, "args": [ { "name": "out", "type": "git_buf *", - "comment": "the buffer to fill" + "comment": "the buffer to fill; existing content will be\n overwritten" }, { "name": "commit", @@ -3850,19 +4166,19 @@ }, "git_commit_extract_signature": { "type": "function", - "file": "commit.h", - "line": 282, - "lineto": 282, + "file": "git2/commit.h", + "line": 317, + "lineto": 317, "args": [ { "name": "signature", "type": "git_buf *", - "comment": "the signature block" + "comment": "the signature block; existing content will be\n overwritten" }, { "name": "signed_data", "type": "git_buf *", - "comment": "signed data; this is the commit contents minus the signature block" + "comment": "signed data; this is the commit contents minus the signature block;\n existing content will be overwritten" }, { "name": "repo", @@ -3887,14 +4203,14 @@ "comment": " 0 on success, GIT_ENOTFOUND if the id is not for a commit\n or the commit does not have a signature." }, "description": "

Extract the signature from a commit

\n", - "comments": "

If the id is not for a commit, the error class will be GITERR_INVALID. If the commit does not have a signature, the error class will be GITERR_OBJECT.

\n", + "comments": "

If the id is not for a commit, the error class will be GIT_ERROR_INVALID. If the commit does not have a signature, the error class will be GIT_ERROR_OBJECT.

\n", "group": "commit" }, "git_commit_create": { "type": "function", - "file": "commit.h", - "line": 328, - "lineto": 338, + "file": "git2/commit.h", + "line": 363, + "lineto": 373, "args": [ { "name": "id", @@ -3955,130 +4271,165 @@ }, "description": "

Create new commit in the repository from a list of git_object pointers

\n", "comments": "

The message will not be cleaned up automatically. You can do that with the git_message_prettify() function.

\n", - "group": "commit" + "group": "commit", + "examples": { "merge.c": ["ex/v1.9.1/merge.html#git_commit_create-7"] } }, "git_commit_create_v": { "type": "function", - "file": "commit.h", - "line": 354, - "lineto": 364, + "file": "git2/commit.h", + "line": 420, + "lineto": 430, "args": [ { "name": "id", "type": "git_oid *", - "comment": null + "comment": "Pointer in which to store the OID of the newly created commit" }, { "name": "repo", "type": "git_repository *", - "comment": null + "comment": "Repository where to store the commit" }, { "name": "update_ref", "type": "const char *", - "comment": null + "comment": "If not NULL, name of the reference that\n\twill be updated to point to this commit. If the reference\n\tis not direct, it will be resolved to a direct reference.\n\tUse \"HEAD\" to update the HEAD of the current branch and\n\tmake it point to this commit. If the reference doesn't\n\texist yet, it will be created. If it does exist, the first\n\tparent must be the tip of this branch." }, { "name": "author", "type": "const git_signature *", - "comment": null + "comment": "Signature with author and author time of commit" }, { "name": "committer", "type": "const git_signature *", - "comment": null + "comment": "Signature with committer and * commit time of commit" }, { "name": "message_encoding", "type": "const char *", - "comment": null + "comment": "The encoding for the message in the\n commit, represented with a standard encoding name.\n E.g. \"UTF-8\". If NULL, no encoding header is written and\n UTF-8 is assumed." }, { "name": "message", "type": "const char *", - "comment": null + "comment": "Full message for this commit" }, { "name": "tree", "type": "const git_tree *", - "comment": null + "comment": "An instance of a `git_tree` object that will\n be used as the tree for the commit. This tree object must\n also be owned by the given `repo`." }, { "name": "parent_count", "type": "size_t", - "comment": null + "comment": "Number of parents for this commit" } ], "argline": "git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree, size_t parent_count", "sig": "git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *::size_t", "return": { "type": "int", - "comment": null + "comment": " 0 or an error code\n\tThe created commit will be written to the Object Database and\n\tthe given reference will be updated to point to it" }, "description": "

Create new commit in the repository using a variable argument list.

\n", "comments": "

The message will not be cleaned up automatically. You can do that with the git_message_prettify() function.

\n\n

The parents for the commit are specified as a variable list of pointers to const git_commit *. Note that this is a convenience method which may not be safe to export for certain languages or compilers

\n\n

All other parameters remain the same as git_commit_create().

\n", "group": "commit", "examples": { - "general.c": [ - "ex/HEAD/general.html#git_commit_create_v-25" - ], - "init.c": [ - "ex/HEAD/init.html#git_commit_create_v-1" - ] + "commit.c": ["ex/v1.9.1/commit.html#git_commit_create_v-1"], + "general.c": ["ex/v1.9.1/general.html#git_commit_create_v-25"], + "init.c": ["ex/v1.9.1/init.html#git_commit_create_v-1"] } }, + "git_commit_create_from_stage": { + "type": "function", + "file": "git2/commit.h", + "line": 472, + "lineto": 476, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "pointer to store the new commit's object id" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository to commit changes in" + }, + { + "name": "message", + "type": "const char *", + "comment": "the commit message" + }, + { + "name": "opts", + "type": "const git_commit_create_options *", + "comment": "options for creating the commit" + } + ], + "argline": "git_oid *id, git_repository *repo, const char *message, const git_commit_create_options *opts", + "sig": "git_oid *::git_repository *::const char *::const git_commit_create_options *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EUNCHANGED if there were no changes to commit, or an error code" + }, + "description": "

Commits the staged changes in the repository; this is a near analog to\n git commit -m message.

\n", + "comments": "

By default, empty commits are not allowed.

\n", + "group": "commit" + }, "git_commit_amend": { "type": "function", - "file": "commit.h", - "line": 387, - "lineto": 395, + "file": "git2/commit.h", + "line": 528, + "lineto": 536, "args": [ { "name": "id", "type": "git_oid *", - "comment": null + "comment": "Pointer in which to store the OID of the newly created commit" }, { "name": "commit_to_amend", "type": "const git_commit *", - "comment": null + "comment": "The commit to amend" }, { "name": "update_ref", "type": "const char *", - "comment": null + "comment": "If not NULL, name of the reference that\n\twill be updated to point to this commit. If the reference\n\tis not direct, it will be resolved to a direct reference.\n\tUse \"HEAD\" to update the HEAD of the current branch and\n\tmake it point to this commit. If the reference doesn't\n\texist yet, it will be created. If it does exist, the first\n\tparent must be the tip of this branch." }, { "name": "author", "type": "const git_signature *", - "comment": null + "comment": "Signature with author and author time of commit" }, { "name": "committer", "type": "const git_signature *", - "comment": null + "comment": "Signature with committer and * commit time of commit" }, { "name": "message_encoding", "type": "const char *", - "comment": null + "comment": "The encoding for the message in the\n commit, represented with a standard encoding name.\n E.g. \"UTF-8\". If NULL, no encoding header is written and\n UTF-8 is assumed." }, { "name": "message", "type": "const char *", - "comment": null + "comment": "Full message for this commit" }, { "name": "tree", "type": "const git_tree *", - "comment": null + "comment": "An instance of a `git_tree` object that will\n be used as the tree for the commit. This tree object must\n also be owned by the given `repo`." } ], "argline": "git_oid *id, const git_commit *commit_to_amend, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree", "sig": "git_oid *::const git_commit *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *", "return": { "type": "int", - "comment": null + "comment": " 0 or an error code\n\tThe created commit will be written to the Object Database and\n\tthe given reference will be updated to point to it" }, "description": "

Amend an existing commit by replacing only non-NULL values.

\n", "comments": "

This creates a new commit that is exactly the same as the old commit, except that any non-NULL values will be updated. The new commit has the same parents as the old commit.

\n\n

The update_ref value works as in the regular git_commit_create(), updating the ref to point to the newly rewritten commit. If you want to amend a commit that is not currently the tip of the branch and then rewrite the following commits to reach a ref, pass this as NULL and update the rest of the commit chain and ref separately.

\n\n

Unlike git_commit_create(), the author, committer, message, message_encoding, and tree parameters can be NULL in which case this will use the values from the original commit_to_amend.

\n\n

All parameters have the same meanings as in git_commit_create().

\n", @@ -4086,9 +4437,9 @@ }, "git_commit_create_buffer": { "type": "function", - "file": "commit.h", - "line": 432, - "lineto": 441, + "file": "git2/commit.h", + "line": 573, + "lineto": 582, "args": [ { "name": "out", @@ -4138,19 +4489,16 @@ ], "argline": "git_buf *out, git_repository *repo, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree, size_t parent_count, const git_commit *[] parents", "sig": "git_buf *::git_repository *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *::size_t::const git_commit *[]", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Create a commit and write it into a buffer

\n", "comments": "

Create a commit as with git_commit_create() but instead of writing it to the objectdb, write the contents of the object into a buffer.

\n", "group": "commit" }, "git_commit_create_with_signature": { "type": "function", - "file": "commit.h", - "line": 457, - "lineto": 462, + "file": "git2/commit.h", + "line": 600, + "lineto": 605, "args": [ { "name": "out", @@ -4160,7 +4508,7 @@ { "name": "repo", "type": "git_repository *", - "comment": null + "comment": "the repository to create the commit in." }, { "name": "commit_content", @@ -4170,7 +4518,7 @@ { "name": "signature", "type": "const char *", - "comment": "the signature to add to the commit" + "comment": "the signature to add to the commit. Leave `NULL`\n to create a commit without adding a signature field." }, { "name": "signature_field", @@ -4180,19 +4528,16 @@ ], "argline": "git_oid *out, git_repository *repo, const char *commit_content, const char *signature, const char *signature_field", "sig": "git_oid *::git_repository *::const char *::const char *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Create a commit object from the given buffer and signature

\n", "comments": "

Given the unsigned commit object's contents, its signature and the header field in which to store the signature, attach the signature to the commit and write it into the given repository.

\n", "group": "commit" }, "git_commit_dup": { "type": "function", - "file": "commit.h", - "line": 471, - "lineto": 471, + "file": "git2/commit.h", + "line": 615, + "lineto": 615, "args": [ { "name": "out", @@ -4207,19 +4552,35 @@ ], "argline": "git_commit **out, git_commit *source", "sig": "git_commit **::git_commit *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0" }, "description": "

Create an in-memory copy of a commit. The copy must be explicitly\n free'd or it will leak.

\n", "comments": "", "group": "commit" }, + "git_commitarray_dispose": { + "type": "function", + "file": "git2/commit.h", + "line": 670, + "lineto": 670, + "args": [ + { + "name": "array", + "type": "git_commitarray *", + "comment": "The git_commitarray that contains commits to free" + } + ], + "argline": "git_commitarray *array", + "sig": "git_commitarray *", + "return": { "type": "void", "comment": null }, + "description": "

Free the commits contained in a commit array. This method should\n be called on git_commitarray objects that were provided by the\n library. Not doing so will result in a memory leak.

\n", + "comments": "

This does not free the git_commitarray itself, since the library will never allocate that object directly itself.

\n", + "group": "commitarray" + }, "git_libgit2_version": { "type": "function", - "file": "common.h", - "line": 105, - "lineto": 105, + "file": "git2/common.h", + "line": 119, + "lineto": 119, "args": [ { "name": "major", @@ -4240,41 +4601,73 @@ "argline": "int *major, int *minor, int *rev", "sig": "int *::int *::int *", "return": { - "type": "void", - "comment": null + "type": "int", + "comment": " 0 on success or an error code on failure" }, "description": "

Return the version of the libgit2 library\n being currently used.

\n", "comments": "", "group": "libgit2" }, - "git_libgit2_features": { + "git_libgit2_prerelease": { "type": "function", - "file": "common.h", - "line": 154, - "lineto": 154, + "file": "git2/common.h", + "line": 130, + "lineto": 130, "args": [], "argline": "", "sig": "", "return": { - "type": "int", - "comment": " A combination of GIT_FEATURE_* values." + "type": "const char *", + "comment": " the name of the prerelease state or NULL" + }, + "description": "

Return the prerelease state of the libgit2 library currently being\n used. For nightly builds during active development, this will be\n "alpha". Releases may have a "beta" or release candidate ("rc1",\n "rc2", etc) prerelease. For a final release, this function returns\n NULL.

\n", + "comments": "", + "group": "libgit2" + }, + "git_libgit2_features": { + "type": "function", + "file": "git2/common.h", + "line": 184, + "lineto": 184, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "int", + "comment": " A combination of GIT_FEATURE_* values." }, "description": "

Query compile time options for libgit2.

\n", - "comments": "\n", + "comments": "", "group": "libgit2" }, - "git_libgit2_opts": { + "git_libgit2_feature_backend": { "type": "function", - "file": "common.h", - "line": 312, - "lineto": 312, + "file": "git2/common.h", + "line": 205, + "lineto": 206, "args": [ { - "name": "option", - "type": "int", - "comment": "Option key" + "name": "feature", + "type": "git_feature_t", + "comment": "the feature to query details for" } ], + "argline": "git_feature_t feature", + "sig": "git_feature_t", + "return": { + "type": "const char *", + "comment": " the provider details, or NULL if the feature is not supported" + }, + "description": "

Query the backend details for the compile-time feature in libgit2.

\n", + "comments": "

This will return the "backend" for the feature, which is useful for things like HTTPS or SSH support, that can have multiple backends that could be compiled in.

\n\n

For example, when libgit2 is compiled with dynamic OpenSSL support, the feature backend will be openssl-dynamic. The feature backend names reflect the compilation options specified to the build system (though in all lower case). The backend may be "builtin" for features that are provided by libgit2 itself.

\n\n

If the feature is not supported by the library, this API returns NULL.

\n", + "group": "libgit2" + }, + "git_libgit2_opts": { + "type": "function", + "file": "git2/common.h", + "line": 569, + "lineto": 569, + "args": [{ "name": "option", "type": "int", "comment": "Option key" }], "argline": "int option", "sig": "int", "return": { @@ -4282,36 +4675,39 @@ "comment": " 0 on success, \n<\n0 on failure" }, "description": "

Set or query a library global option

\n", - "comments": "

Available options:

\n\n
* opts(GIT_OPT_GET_MWINDOW_SIZE, size_t *):\n\n    > Get the maximum mmap window size\n\n* opts(GIT_OPT_SET_MWINDOW_SIZE, size_t):\n\n    > Set the maximum mmap window size\n\n* opts(GIT_OPT_GET_MWINDOW_MAPPED_LIMIT, size_t *):\n\n    > Get the maximum memory that will be mapped in total by the library\n\n* opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, size_t):\n\n    >Set the maximum amount of memory that can be mapped at any time        by the library\n\n* opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)\n\n    > Get the search path for a given level of config data.  "level" must       > be one of `GIT_CONFIG_LEVEL_SYSTEM`, `GIT_CONFIG_LEVEL_GLOBAL`,       > `GIT_CONFIG_LEVEL_XDG`, or `GIT_CONFIG_LEVEL_PROGRAMDATA`.        > The search path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_SEARCH_PATH, int level, const char *path)\n\n    > Set the search path for a level of config data.  The search path      > applied to shared attributes and ignore files, too.       >       > - `path` lists directories delimited by GIT_PATH_LIST_SEPARATOR.      >   Pass NULL to reset to the default (generally based on environment       >   variables).  Use magic path `$PATH` to include the old value        >   of the path (if you want to prepend or append, for instance).       >       > - `level` must be `GIT_CONFIG_LEVEL_SYSTEM`,      >   `GIT_CONFIG_LEVEL_GLOBAL`, `GIT_CONFIG_LEVEL_XDG`, or       >   `GIT_CONFIG_LEVEL_PROGRAMDATA`.\n\n* opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_otype type, size_t size)\n\n    > Set the maximum data size for the given type of object to be      > considered eligible for caching in memory.  Setting to value to       > zero means that that type of object will not be cached.       > Defaults to 0 for GIT_OBJ_BLOB (i.e. won't cache blobs) and 4k        > for GIT_OBJ_COMMIT, GIT_OBJ_TREE, and GIT_OBJ_TAG.\n\n* opts(GIT_OPT_SET_CACHE_MAX_SIZE, ssize_t max_storage_bytes)\n\n    > Set the maximum total data size that will be cached in memory     > across all repositories before libgit2 starts evicting objects        > from the cache.  This is a soft limit, in that the library might      > briefly exceed it, but will start aggressively evicting objects       > from cache when that happens.  The default cache size is 256MB.\n\n* opts(GIT_OPT_ENABLE_CACHING, int enabled)\n\n    > Enable or disable caching completely.     >       > Because caches are repository-specific, disabling the cache       > cannot immediately clear all cached objects, but each cache will      > be cleared on the next attempt to update anything in it.\n\n* opts(GIT_OPT_GET_CACHED_MEMORY, ssize_t *current, ssize_t *allowed)\n\n    > Get the current bytes in cache and the maximum that would be      > allowed in the cache.\n\n* opts(GIT_OPT_GET_TEMPLATE_PATH, git_buf *out)\n\n    > Get the default template path.        > The path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_TEMPLATE_PATH, const char *path)\n\n    > Set the default template path.        >       > - `path` directory of template.\n\n* opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, const char *file, const char *path)\n\n    > Set the SSL certificate-authority locations.      >       > - `file` is the location of a file containing several     >   certificates concatenated together.     > - `path` is the location of a directory holding several       >   certificates, one per file.     >       > Either parameter may be `NULL`, but not both.\n\n* opts(GIT_OPT_SET_USER_AGENT, const char *user_agent)\n\n    > Set the value of the User-Agent header.  This value will be       > appended to "git/1.0", for compatibility with other git clients.      >       > - `user_agent` is the value that will be delivered as the     >   User-Agent header on HTTP requests.\n\n* opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, int enabled)\n\n    > Enable strict input validation when creating new objects      > to ensure that all inputs to the new objects are valid.  For      > example, when this is enabled, the parent(s) and tree inputs      > will be validated when creating a new commit.  This defaults      > to enabled.\n\n* opts(GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION, int enabled)\n\n    > Validate the target of a symbolic ref when creating it.  For      > example, `foobar` is not a valid ref, therefore `foobar` is       > not a valid target for a symbolic ref by default, whereas     > `refs/heads/foobar` is.  Disabling this bypasses validation       > so that an arbitrary strings such as `foobar` can be used     > for a symbolic ref target.  This defaults to enabled.\n\n* opts(GIT_OPT_SET_SSL_CIPHERS, const char *ciphers)\n\n    > Set the SSL ciphers use for HTTPS connections.        >       > - `ciphers` is the list of ciphers that are eanbled.\n
\n", + "comments": "

Available options:

\n\n
* opts(GIT_OPT_GET_MWINDOW_SIZE, size_t *):\n\n    > Get the maximum mmap window size\n\n* opts(GIT_OPT_SET_MWINDOW_SIZE, size_t):\n\n    > Set the maximum mmap window size\n\n* opts(GIT_OPT_GET_MWINDOW_MAPPED_LIMIT, size_t *):\n\n    > Get the maximum memory that will be mapped in total by the library\n\n* opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, size_t):\n\n    > Set the maximum amount of memory that can be mapped at any time       > by the library\n\n* opts(GIT_OPT_GET_MWINDOW_FILE_LIMIT, size_t *):\n\n    > Get the maximum number of files that will be mapped at any time by the        > library\n\n* opts(GIT_OPT_SET_MWINDOW_FILE_LIMIT, size_t):\n\n    > Set the maximum number of files that can be mapped at any time        > by the library. The default (0) is unlimited.\n\n* opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)\n\n    > Get the search path for a given level of config data.  "level" must       > be one of `GIT_CONFIG_LEVEL_SYSTEM`, `GIT_CONFIG_LEVEL_GLOBAL`,       > `GIT_CONFIG_LEVEL_XDG`, or `GIT_CONFIG_LEVEL_PROGRAMDATA`.        > The search path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_SEARCH_PATH, int level, const char *path)\n\n    > Set the search path for a level of config data.  The search path      > applied to shared attributes and ignore files, too.       >       > - `path` lists directories delimited by GIT_PATH_LIST_SEPARATOR.      >   Pass NULL to reset to the default (generally based on environment       >   variables).  Use magic path `$PATH` to include the old value        >   of the path (if you want to prepend or append, for instance).       >       > - `level` must be `GIT_CONFIG_LEVEL_SYSTEM`,      >   `GIT_CONFIG_LEVEL_GLOBAL`, `GIT_CONFIG_LEVEL_XDG`, or       >   `GIT_CONFIG_LEVEL_PROGRAMDATA`.\n\n* opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_object_t type, size_t size)\n\n    > Set the maximum data size for the given type of object to be      > considered eligible for caching in memory.  Setting to value to       > zero means that that type of object will not be cached.       > Defaults to 0 for GIT_OBJECT_BLOB (i.e. won't cache blobs) and 4k     > for GIT_OBJECT_COMMIT, GIT_OBJECT_TREE, and GIT_OBJECT_TAG.\n\n* opts(GIT_OPT_SET_CACHE_MAX_SIZE, ssize_t max_storage_bytes)\n\n    > Set the maximum total data size that will be cached in memory     > across all repositories before libgit2 starts evicting objects        > from the cache.  This is a soft limit, in that the library might      > briefly exceed it, but will start aggressively evicting objects       > from cache when that happens.  The default cache size is 256MB.\n\n* opts(GIT_OPT_ENABLE_CACHING, int enabled)\n\n    > Enable or disable caching completely.     >       > Because caches are repository-specific, disabling the cache       > cannot immediately clear all cached objects, but each cache will      > be cleared on the next attempt to update anything in it.\n\n* opts(GIT_OPT_GET_CACHED_MEMORY, ssize_t *current, ssize_t *allowed)\n\n    > Get the current bytes in cache and the maximum that would be      > allowed in the cache.\n\n* opts(GIT_OPT_GET_TEMPLATE_PATH, git_buf *out)\n\n    > Get the default template path.        > The path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_TEMPLATE_PATH, const char *path)\n\n    > Set the default template path.        >       > - `path` directory of template.\n\n* opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, const char *file, const char *path)\n\n    > Set the SSL certificate-authority locations.      >       > - `file` is the location of a file containing several     >   certificates concatenated together.     > - `path` is the location of a directory holding several       >   certificates, one per file.     >       > Calling `GIT_OPT_ADD_SSL_X509_CERT` may override the      > data in `path`.       >       > Either parameter may be `NULL`, but not both.\n
\n\n\n\n

opts(GIT_OPT_SET_ODB_PACKED_PRIORITY, int priority) > Override the default priority of the packed ODB backend which > is added when default backends are assigned to a repository

\n\n

opts(GIT_OPT_SET_ODB_LOOSE_PRIORITY, int priority) > Override the default priority of the loose ODB backend which > is added when default backends are assigned to a repository

\n\n

opts(GIT_OPT_GET_EXTENSIONS, git_strarray *out) > Returns the list of git extensions that are supported. This > is the list of built-in extensions supported by libgit2 and > custom extensions that have been added with > GIT_OPT_SET_EXTENSIONS. Extensions that have been negated > will not be returned. The returned list should be released > with git_strarray_dispose.

\n\n

opts(GIT_OPT_SET_EXTENSIONS, const char **extensions, size_t len) > Set that the given git extensions are supported by the caller. > Extensions supported by libgit2 may be negated by prefixing > them with a !. For example: setting extensions to > { "!noop", "newext" } indicates that the caller does not want > to support repositories with the noop extension but does want > to support repositories with the newext extension.

\n\n

opts(GIT_OPT_GET_OWNER_VALIDATION, int *enabled) > Gets the owner validation setting for repository > directories.

\n\n

opts(GIT_OPT_SET_OWNER_VALIDATION, int enabled) > Set that repository directories should be owned by the current > user. The default is to validate ownership.

\n\n

opts(GIT_OPT_GET_HOMEDIR, git_buf *out) > Gets the current user's home directory, as it will be used > for file lookups. The path is written to the out buffer.

\n\n

opts(GIT_OPT_SET_HOMEDIR, const char *path) > Sets the directory used as the current user's home directory, > for file lookups. > > - path directory of home directory.

\n\n

opts(GIT_OPT_GET_SERVER_CONNECT_TIMEOUT, int *timeout) > Gets the timeout (in milliseconds) to attempt connections to > a remote server.

\n\n

opts(GIT_OPT_SET_SERVER_CONNECT_TIMEOUT, int timeout) > Sets the timeout (in milliseconds) to attempt connections to > a remote server. Set to 0 to use the system default. Note that > this may not be able to be configured longer than the system > default, typically 75 seconds.

\n\n

opts(GIT_OPT_GET_SERVER_TIMEOUT, int *timeout) > Gets the timeout (in milliseconds) for reading from and writing > to a remote server.

\n\n

opts(GIT_OPT_SET_SERVER_TIMEOUT, int timeout) > Sets the timeout (in milliseconds) for reading from and writing > to a remote server. Set to 0 to use the system default.

\n", "group": "libgit2" }, "git_config_entry_free": { "type": "function", - "file": "config.h", - "line": 75, - "lineto": 75, + "file": "git2/config.h", + "line": 131, + "lineto": 131, "args": [ { - "name": "", + "name": "entry", "type": "git_config_entry *", - "comment": null + "comment": "The entry to free." } ], - "argline": "git_config_entry *", + "argline": "git_config_entry *entry", "sig": "git_config_entry *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Free a config entry

\n", + "return": { "type": "void", "comment": null }, + "description": "

Free a config entry.

\n", "comments": "", - "group": "config" + "group": "config", + "examples": { + "config.c": [ + "ex/v1.9.1/config.html#git_config_entry_free-1", + "ex/v1.9.1/config.html#git_config_entry_free-2" + ] + } }, "git_config_find_global": { "type": "function", - "file": "config.h", - "line": 116, - "lineto": 116, + "file": "git2/config.h", + "line": 183, + "lineto": 183, "args": [ { "name": "out", @@ -4326,14 +4722,14 @@ "comment": " 0 if a global configuration file has been found. Its path will be stored in `out`." }, "description": "

Locate the path to the global configuration file

\n", - "comments": "

The user or global configuration file is usually located in $HOME/.gitconfig.

\n\n

This method will try to guess the full path to that file, if the file exists. The returned path may be used on any git_config call to load the global configuration file.

\n\n

This method will not guess the path to the xdg compatible config file (.config/git/config).

\n", + "comments": "

The user or global configuration file is usually located in $HOME/.gitconfig.

\n\n

This method will try to guess the full path to that file, if the file exists. The returned path may be used on any git_config call to load the global configuration file.

\n\n

This method will not guess the path to the xdg compatible config file (.config/git/config).

\n", "group": "config" }, "git_config_find_xdg": { "type": "function", - "file": "config.h", - "line": 133, - "lineto": 133, + "file": "git2/config.h", + "line": 200, + "lineto": 200, "args": [ { "name": "out", @@ -4353,9 +4749,9 @@ }, "git_config_find_system": { "type": "function", - "file": "config.h", - "line": 145, - "lineto": 145, + "file": "git2/config.h", + "line": 212, + "lineto": 212, "args": [ { "name": "out", @@ -4370,14 +4766,14 @@ "comment": " 0 if a system configuration file has been\n\tfound. Its path will be stored in `out`." }, "description": "

Locate the path to the system configuration file

\n", - "comments": "

If /etc/gitconfig doesn't exist, it will look for %PROGRAMFILES%.

\n", + "comments": "

If /etc/gitconfig doesn't exist, it will look for %PROGRAMFILES%.

\n", "group": "config" }, "git_config_find_programdata": { "type": "function", - "file": "config.h", - "line": 156, - "lineto": 156, + "file": "git2/config.h", + "line": 223, + "lineto": 223, "args": [ { "name": "out", @@ -4392,14 +4788,14 @@ "comment": " 0 if a ProgramData configuration file has been\n\tfound. Its path will be stored in `out`." }, "description": "

Locate the path to the configuration file in ProgramData

\n", - "comments": "

Look for the file in %PROGRAMDATA% used by portable git.

\n", + "comments": "

Look for the file in %PROGRAMDATA% used by portable git.

\n", "group": "config" }, "git_config_open_default": { "type": "function", - "file": "config.h", - "line": 168, - "lineto": 168, + "file": "git2/config.h", + "line": 235, + "lineto": 235, "args": [ { "name": "out", @@ -4409,19 +4805,16 @@ ], "argline": "git_config **out", "sig": "git_config **", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Open the global, XDG and system configuration files

\n", "comments": "

Utility wrapper that finds the global, XDG and system configuration files and opens them into a single prioritized config object that can be used when accessing default config data outside a repository.

\n", "group": "config" }, "git_config_new": { "type": "function", - "file": "config.h", - "line": 179, - "lineto": 179, + "file": "git2/config.h", + "line": 246, + "lineto": 246, "args": [ { "name": "out", @@ -4431,19 +4824,16 @@ ], "argline": "git_config **out", "sig": "git_config **", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Allocate a new configuration object

\n", "comments": "

This object is empty, so you have to add a file to it before you can do anything with it.

\n", "group": "config" }, "git_config_add_file_ondisk": { "type": "function", - "file": "config.h", - "line": 206, - "lineto": 210, + "file": "git2/config.h", + "line": 275, + "lineto": 280, "args": [ { "name": "cfg", @@ -4460,14 +4850,19 @@ "type": "git_config_level_t", "comment": "the priority level of the backend" }, + { + "name": "repo", + "type": "const git_repository *", + "comment": "optional repository to allow parsing of\n conditional includes" + }, { "name": "force", "type": "int", "comment": "replace config file at the given priority level" } ], - "argline": "git_config *cfg, const char *path, git_config_level_t level, int force", - "sig": "git_config *::const char *::git_config_level_t::int", + "argline": "git_config *cfg, const char *path, git_config_level_t level, const git_repository *repo, int force", + "sig": "git_config *::const char *::git_config_level_t::const git_repository *::int", "return": { "type": "int", "comment": " 0 on success, GIT_EEXISTS when adding more than one file\n for a given priority level (and force_replace set to 0),\n GIT_ENOTFOUND when the file doesn't exist or error code" @@ -4478,9 +4873,9 @@ }, "git_config_open_ondisk": { "type": "function", - "file": "config.h", - "line": 224, - "lineto": 224, + "file": "git2/config.h", + "line": 294, + "lineto": 294, "args": [ { "name": "out", @@ -4495,24 +4890,19 @@ ], "argline": "git_config **out, const char *path", "sig": "git_config **::const char *", - "return": { - "type": "int", - "comment": " 0 on success, or an error code" - }, + "return": { "type": "int", "comment": " 0 on success, or an error code" }, "description": "

Create a new config instance containing a single on-disk file

\n", "comments": "

This method is a simple utility wrapper for the following sequence of calls: - git_config_new - git_config_add_file_ondisk

\n", "group": "config", "examples": { - "general.c": [ - "ex/HEAD/general.html#git_config_open_ondisk-26" - ] + "general.c": ["ex/v1.9.1/general.html#git_config_open_ondisk-26"] } }, "git_config_open_level": { "type": "function", - "file": "config.h", - "line": 242, - "lineto": 245, + "file": "git2/config.h", + "line": 312, + "lineto": 315, "args": [ { "name": "out", @@ -4542,9 +4932,9 @@ }, "git_config_open_global": { "type": "function", - "file": "config.h", - "line": 259, - "lineto": 259, + "file": "git2/config.h", + "line": 330, + "lineto": 330, "args": [ { "name": "out", @@ -4559,19 +4949,45 @@ ], "argline": "git_config **out, git_config *config", "sig": "git_config **::git_config *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Open the global/XDG configuration file according to git's rules

\n", - "comments": "

Git allows you to store your global configuration at $HOME/.config or $XDG_CONFIG_HOME/git/config. For backwards compatability, the XDG file shouldn't be used unless the use has created it explicitly. With this function you'll open the correct one to write to.

\n", + "comments": "

Git allows you to store your global configuration at $HOME/.gitconfig or $XDG_CONFIG_HOME/git/config. For backwards compatibility, the XDG file shouldn't be used unless the use has created it explicitly. With this function you'll open the correct one to write to.

\n", + "group": "config" + }, + "git_config_set_writeorder": { + "type": "function", + "file": "git2/config.h", + "line": 343, + "lineto": 346, + "args": [ + { + "name": "cfg", + "type": "git_config *", + "comment": "the configuration to change write order of" + }, + { + "name": "levels", + "type": "git_config_level_t *", + "comment": "the ordering of levels for writing" + }, + { + "name": "len", + "type": "size_t", + "comment": "the length of the levels array" + } + ], + "argline": "git_config *cfg, git_config_level_t *levels, size_t len", + "sig": "git_config *::git_config_level_t *::size_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Set the write order for configuration backends. By default, the\n write ordering does not match the read ordering; for example, the\n worktree configuration is a high-priority for reading, but is not\n written to unless explicitly chosen.

\n", + "comments": "", "group": "config" }, "git_config_snapshot": { "type": "function", - "file": "config.h", - "line": 275, - "lineto": 275, + "file": "git2/config.h", + "line": 362, + "lineto": 362, "args": [ { "name": "out", @@ -4586,19 +5002,16 @@ ], "argline": "git_config **out, git_config *config", "sig": "git_config **::git_config *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Create a snapshot of the configuration

\n", "comments": "

Create a snapshot of the current state of a configuration, which allows you to look into a consistent view of the configuration for looking up complex values (e.g. a remote, submodule).

\n\n

The string returned when querying such a config object is valid until it is freed.

\n", "group": "config" }, "git_config_free": { "type": "function", - "file": "config.h", - "line": 282, - "lineto": 282, + "file": "git2/config.h", + "line": 369, + "lineto": 369, "args": [ { "name": "cfg", @@ -4608,25 +5021,23 @@ ], "argline": "git_config *cfg", "sig": "git_config *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "void", "comment": null }, "description": "

Free the configuration and its associated memory and files

\n", "comments": "", "group": "config", "examples": { + "config.c": ["ex/v1.9.1/config.html#git_config_free-3"], "general.c": [ - "ex/HEAD/general.html#git_config_free-27", - "ex/HEAD/general.html#git_config_free-28" + "ex/v1.9.1/general.html#git_config_free-27", + "ex/v1.9.1/general.html#git_config_free-28" ] } }, "git_config_get_entry": { "type": "function", - "file": "config.h", - "line": 294, - "lineto": 297, + "file": "git2/config.h", + "line": 381, + "lineto": 384, "args": [ { "name": "out", @@ -4646,19 +5057,19 @@ ], "argline": "git_config_entry **out, const git_config *cfg, const char *name", "sig": "git_config_entry **::const git_config *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Get the git_config_entry of a config variable.

\n", "comments": "

Free the git_config_entry after use with git_config_entry_free().

\n", - "group": "config" + "group": "config", + "examples": { + "config.c": ["ex/v1.9.1/config.html#git_config_get_entry-4"] + } }, "git_config_get_int32": { "type": "function", - "file": "config.h", - "line": 311, - "lineto": 311, + "file": "git2/config.h", + "line": 398, + "lineto": 398, "args": [ { "name": "out", @@ -4678,24 +5089,22 @@ ], "argline": "int32_t *out, const git_config *cfg, const char *name", "sig": "int32_t *::const git_config *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Get the value of an integer config variable.

\n", "comments": "

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", "group": "config", "examples": { "general.c": [ - "ex/HEAD/general.html#git_config_get_int32-29" + "ex/v1.9.1/general.html#git_config_get_int32-29", + "ex/v1.9.1/general.html#git_config_get_int32-30" ] } }, "git_config_get_int64": { "type": "function", - "file": "config.h", - "line": 325, - "lineto": 325, + "file": "git2/config.h", + "line": 412, + "lineto": 412, "args": [ { "name": "out", @@ -4715,19 +5124,16 @@ ], "argline": "int64_t *out, const git_config *cfg, const char *name", "sig": "int64_t *::const git_config *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Get the value of a long integer config variable.

\n", "comments": "

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", "group": "config" }, "git_config_get_bool": { "type": "function", - "file": "config.h", - "line": 342, - "lineto": 342, + "file": "git2/config.h", + "line": 429, + "lineto": 429, "args": [ { "name": "out", @@ -4747,19 +5153,16 @@ ], "argline": "int *out, const git_config *cfg, const char *name", "sig": "int *::const git_config *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Get the value of a boolean config variable.

\n", "comments": "

This function uses the usual C convention of 0 being false and anything else true.

\n\n

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", "group": "config" }, "git_config_get_path": { "type": "function", - "file": "config.h", - "line": 360, - "lineto": 360, + "file": "git2/config.h", + "line": 447, + "lineto": 447, "args": [ { "name": "out", @@ -4779,19 +5182,16 @@ ], "argline": "git_buf *out, const git_config *cfg, const char *name", "sig": "git_buf *::const git_config *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Get the value of a path config variable.

\n", "comments": "

A leading '~' will be expanded to the global search path (which defaults to the user's home directory but can be overridden via git_libgit2_opts().

\n\n

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", "group": "config" }, "git_config_get_string": { "type": "function", - "file": "config.h", - "line": 378, - "lineto": 378, + "file": "git2/config.h", + "line": 465, + "lineto": 465, "args": [ { "name": "out", @@ -4811,24 +5211,22 @@ ], "argline": "const char **out, const git_config *cfg, const char *name", "sig": "const char **::const git_config *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Get the value of a string config variable.

\n", "comments": "

This function can only be used on snapshot config objects. The string is owned by the config and should not be freed by the user. The pointer will be valid until the config is freed.

\n\n

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", "group": "config", "examples": { "general.c": [ - "ex/HEAD/general.html#git_config_get_string-30" + "ex/v1.9.1/general.html#git_config_get_string-31", + "ex/v1.9.1/general.html#git_config_get_string-32" ] } }, "git_config_get_string_buf": { "type": "function", - "file": "config.h", - "line": 394, - "lineto": 394, + "file": "git2/config.h", + "line": 481, + "lineto": 481, "args": [ { "name": "out", @@ -4848,19 +5246,16 @@ ], "argline": "git_buf *out, const git_config *cfg, const char *name", "sig": "git_buf *::const git_config *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Get the value of a string config variable.

\n", "comments": "

The value of the config will be copied into the buffer.

\n\n

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", "group": "config" }, "git_config_get_multivar_foreach": { "type": "function", - "file": "config.h", - "line": 408, - "lineto": 408, + "file": "git2/config.h", + "line": 500, + "lineto": 500, "args": [ { "name": "cfg", @@ -4890,19 +5285,16 @@ ], "argline": "const git_config *cfg, const char *name, const char *regexp, git_config_foreach_cb callback, void *payload", "sig": "const git_config *::const char *::const char *::git_config_foreach_cb::void *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Get each value of a multivar in a foreach callback

\n", - "comments": "

The callback will be called on each variable found

\n", + "comments": "

The callback will be called on each variable found

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the section and variable parts are lower-cased. The subsection is left unchanged.

\n", "group": "config" }, "git_config_multivar_iterator_new": { "type": "function", - "file": "config.h", - "line": 419, - "lineto": 419, + "file": "git2/config.h", + "line": 516, + "lineto": 516, "args": [ { "name": "out", @@ -4927,19 +5319,16 @@ ], "argline": "git_config_iterator **out, const git_config *cfg, const char *name, const char *regexp", "sig": "git_config_iterator **::const git_config *::const char *::const char *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Get each value of a multivar

\n", - "comments": "", + "comments": "

The regular expression is applied case-sensitively on the normalized form of the variable name: the section and variable parts are lower-cased. The subsection is left unchanged.

\n", "group": "config" }, "git_config_next": { "type": "function", - "file": "config.h", - "line": 431, - "lineto": 431, + "file": "git2/config.h", + "line": 528, + "lineto": 528, "args": [ { "name": "entry", @@ -4959,14 +5348,14 @@ "comment": " 0 or an error code. GIT_ITEROVER if the iteration has completed" }, "description": "

Return the current entry and advance the iterator

\n", - "comments": "

The pointers returned by this function are valid until the iterator is freed.

\n", + "comments": "

The pointers returned by this function are valid until the next call to git_config_next or until the iterator is freed.

\n", "group": "config" }, "git_config_iterator_free": { "type": "function", - "file": "config.h", - "line": 438, - "lineto": 438, + "file": "git2/config.h", + "line": 535, + "lineto": 535, "args": [ { "name": "iter", @@ -4976,19 +5365,16 @@ ], "argline": "git_config_iterator *iter", "sig": "git_config_iterator *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "void", "comment": null }, "description": "

Free a config iterator

\n", "comments": "", "group": "config" }, "git_config_set_int32": { "type": "function", - "file": "config.h", - "line": 449, - "lineto": 449, + "file": "git2/config.h", + "line": 546, + "lineto": 546, "args": [ { "name": "cfg", @@ -5008,19 +5394,16 @@ ], "argline": "git_config *cfg, const char *name, int32_t value", "sig": "git_config *::const char *::int32_t", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Set the value of an integer config variable in the config file\n with the highest level (usually the local one).

\n", "comments": "", "group": "config" }, "git_config_set_int64": { "type": "function", - "file": "config.h", - "line": 460, - "lineto": 460, + "file": "git2/config.h", + "line": 557, + "lineto": 557, "args": [ { "name": "cfg", @@ -5040,19 +5423,16 @@ ], "argline": "git_config *cfg, const char *name, int64_t value", "sig": "git_config *::const char *::int64_t", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Set the value of a long integer config variable in the config file\n with the highest level (usually the local one).

\n", "comments": "", "group": "config" }, "git_config_set_bool": { "type": "function", - "file": "config.h", - "line": 471, - "lineto": 471, + "file": "git2/config.h", + "line": 568, + "lineto": 568, "args": [ { "name": "cfg", @@ -5064,27 +5444,20 @@ "type": "const char *", "comment": "the variable's name" }, - { - "name": "value", - "type": "int", - "comment": "the value to store" - } + { "name": "value", "type": "int", "comment": "the value to store" } ], "argline": "git_config *cfg, const char *name, int value", "sig": "git_config *::const char *::int", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Set the value of a boolean config variable in the config file\n with the highest level (usually the local one).

\n", "comments": "", "group": "config" }, "git_config_set_string": { "type": "function", - "file": "config.h", - "line": 485, - "lineto": 485, + "file": "git2/config.h", + "line": 582, + "lineto": 582, "args": [ { "name": "cfg", @@ -5104,19 +5477,19 @@ ], "argline": "git_config *cfg, const char *name, const char *value", "sig": "git_config *::const char *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Set the value of a string config variable in the config file\n with the highest level (usually the local one).

\n", "comments": "

A copy of the string is made and the user is free to use it afterwards.

\n", - "group": "config" + "group": "config", + "examples": { + "config.c": ["ex/v1.9.1/config.html#git_config_set_string-5"] + } }, "git_config_set_multivar": { "type": "function", - "file": "config.h", - "line": 495, - "lineto": 495, + "file": "git2/config.h", + "line": 595, + "lineto": 595, "args": [ { "name": "cfg", @@ -5133,27 +5506,20 @@ "type": "const char *", "comment": "a regular expression to indicate which values to replace" }, - { - "name": "value", - "type": "const char *", - "comment": "the new value." - } + { "name": "value", "type": "const char *", "comment": "the new value." } ], "argline": "git_config *cfg, const char *name, const char *regexp, const char *value", "sig": "git_config *::const char *::const char *::const char *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Set a multivar in the local config file.

\n", - "comments": "", + "comments": "

The regular expression is applied case-sensitively on the value.

\n", "group": "config" }, "git_config_delete_entry": { "type": "function", - "file": "config.h", - "line": 504, - "lineto": 504, + "file": "git2/config.h", + "line": 605, + "lineto": 605, "args": [ { "name": "cfg", @@ -5168,19 +5534,16 @@ ], "argline": "git_config *cfg, const char *name", "sig": "git_config *::const char *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Delete a config variable from the config file\n with the highest level (usually the local one).

\n", "comments": "", "group": "config" }, "git_config_delete_multivar": { "type": "function", - "file": "config.h", - "line": 515, - "lineto": 515, + "file": "git2/config.h", + "line": 618, + "lineto": 618, "args": [ { "name": "cfg", @@ -5200,19 +5563,16 @@ ], "argline": "git_config *cfg, const char *name, const char *regexp", "sig": "git_config *::const char *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Deletes one or several entries from a multivar in the local config file.

\n", - "comments": "", + "comments": "

The regular expression is applied case-sensitively on the value.

\n", "group": "config" }, "git_config_foreach": { "type": "function", - "file": "config.h", - "line": 533, - "lineto": 536, + "file": "git2/config.h", + "line": 636, + "lineto": 639, "args": [ { "name": "cfg", @@ -5242,9 +5602,9 @@ }, "git_config_iterator_new": { "type": "function", - "file": "config.h", - "line": 547, - "lineto": 547, + "file": "git2/config.h", + "line": 651, + "lineto": 651, "args": [ { "name": "out", @@ -5254,24 +5614,21 @@ { "name": "cfg", "type": "const git_config *", - "comment": "where to ge the variables from" + "comment": "where to get the variables from" } ], "argline": "git_config_iterator **out, const git_config *cfg", "sig": "git_config_iterator **::const git_config *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Iterate over all the config variables

\n", "comments": "

Use git_config_next to advance the iteration and git_config_iterator_free when done.

\n", "group": "config" }, "git_config_iterator_glob_new": { "type": "function", - "file": "config.h", - "line": 559, - "lineto": 559, + "file": "git2/config.h", + "line": 668, + "lineto": 668, "args": [ { "name": "out", @@ -5291,19 +5648,16 @@ ], "argline": "git_config_iterator **out, const git_config *cfg, const char *regexp", "sig": "git_config_iterator **::const git_config *::const char *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Iterate over all the config variables whose name matches a pattern

\n", - "comments": "

Use git_config_next to advance the iteration and git_config_iterator_free when done.

\n", + "comments": "

Use git_config_next to advance the iteration and git_config_iterator_free when done.

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the section and variable parts are lower-cased. The subsection is left unchanged.

\n", "group": "config" }, "git_config_foreach_match": { "type": "function", - "file": "config.h", - "line": 577, - "lineto": 581, + "file": "git2/config.h", + "line": 690, + "lineto": 694, "args": [ { "name": "cfg", @@ -5333,14 +5687,14 @@ "comment": " 0 or the return value of the callback which didn't return 0" }, "description": "

Perform an operation on each config variable matching a regular expression.

\n", - "comments": "

This behaviors like git_config_foreach with an additional filter of a regular expression that filters which config keys are passed to the callback.

\n\n

The pointers passed to the callback are only valid as long as the iteration is ongoing.

\n", + "comments": "

This behaves like git_config_foreach with an additional filter of a regular expression that filters which config keys are passed to the callback.

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the section and variable parts are lower-cased. The subsection is left unchanged.

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the case-insensitive parts are lower-case.

\n", "group": "config" }, "git_config_get_mapped": { "type": "function", - "file": "config.h", - "line": 617, - "lineto": 622, + "file": "git2/config.h", + "line": 730, + "lineto": 735, "args": [ { "name": "out", @@ -5359,8 +5713,8 @@ }, { "name": "maps", - "type": "const git_cvar_map *", - "comment": "array of `git_cvar_map` objects specifying the possible mappings" + "type": "const git_configmap *", + "comment": "array of `git_configmap` objects specifying the possible mappings" }, { "name": "map_n", @@ -5368,21 +5722,21 @@ "comment": "number of mapping objects in `maps`" } ], - "argline": "int *out, const git_config *cfg, const char *name, const git_cvar_map *maps, size_t map_n", - "sig": "int *::const git_config *::const char *::const git_cvar_map *::size_t", + "argline": "int *out, const git_config *cfg, const char *name, const git_configmap *maps, size_t map_n", + "sig": "int *::const git_config *::const char *::const git_configmap *::size_t", "return": { "type": "int", "comment": " 0 on success, error code otherwise" }, "description": "

Query the value of a config variable and return it mapped to\n an integer constant.

\n", - "comments": "

This is a helper method to easily map different possible values to a variable to integer constants that easily identify them.

\n\n

A mapping array looks as follows:

\n\n
git_cvar_map autocrlf_mapping[] = {     {GIT_CVAR_FALSE, NULL, GIT_AUTO_CRLF_FALSE},        {GIT_CVAR_TRUE, NULL, GIT_AUTO_CRLF_TRUE},      {GIT_CVAR_STRING, "input", GIT_AUTO_CRLF_INPUT},        {GIT_CVAR_STRING, "default", GIT_AUTO_CRLF_DEFAULT}};\n
\n\n

On any "false" value for the variable (e.g. "false", "FALSE", "no"), the mapping will store GIT_AUTO_CRLF_FALSE in the out parameter.

\n\n

The same thing applies for any "true" value such as "true", "yes" or "1", storing the GIT_AUTO_CRLF_TRUE variable.

\n\n

Otherwise, if the value matches the string "input" (with case insensitive comparison), the given constant will be stored in out, and likewise for "default".

\n\n

If not a single match can be made to store in out, an error code will be returned.

\n", + "comments": "

This is a helper method to easily map different possible values to a variable to integer constants that easily identify them.

\n\n

A mapping array looks as follows:

\n\n
git_configmap autocrlf_mapping[] = {        {GIT_CVAR_FALSE, NULL, GIT_AUTO_CRLF_FALSE},        {GIT_CVAR_TRUE, NULL, GIT_AUTO_CRLF_TRUE},      {GIT_CVAR_STRING, "input", GIT_AUTO_CRLF_INPUT},        {GIT_CVAR_STRING, "default", GIT_AUTO_CRLF_DEFAULT}};\n
\n\n

On any "false" value for the variable (e.g. "false", "FALSE", "no"), the mapping will store GIT_AUTO_CRLF_FALSE in the out parameter.

\n\n

The same thing applies for any "true" value such as "true", "yes" or "1", storing the GIT_AUTO_CRLF_TRUE variable.

\n\n

Otherwise, if the value matches the string "input" (with case insensitive comparison), the given constant will be stored in out, and likewise for "default".

\n\n

If not a single match can be made to store in out, an error code will be returned.

\n", "group": "config" }, "git_config_lookup_map_value": { "type": "function", - "file": "config.h", - "line": 632, - "lineto": 636, + "file": "git2/config.h", + "line": 746, + "lineto": 750, "args": [ { "name": "out", @@ -5391,116 +5745,88 @@ }, { "name": "maps", - "type": "const git_cvar_map *", - "comment": "array of `git_cvar_map` objects specifying the possible mappings" + "type": "const git_configmap *", + "comment": "array of `git_configmap` objects specifying the possible mappings" }, { "name": "map_n", "type": "size_t", "comment": "number of mapping objects in `maps`" }, - { - "name": "value", - "type": "const char *", - "comment": "value to parse" - } + { "name": "value", "type": "const char *", "comment": "value to parse" } ], - "argline": "int *out, const git_cvar_map *maps, size_t map_n, const char *value", - "sig": "int *::const git_cvar_map *::size_t::const char *", - "return": { - "type": "int", - "comment": null - }, + "argline": "int *out, const git_configmap *maps, size_t map_n, const char *value", + "sig": "int *::const git_configmap *::size_t::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Maps a string value to an integer constant

\n", "comments": "", "group": "config" }, "git_config_parse_bool": { "type": "function", - "file": "config.h", - "line": 648, - "lineto": 648, + "file": "git2/config.h", + "line": 763, + "lineto": 763, "args": [ { "name": "out", "type": "int *", "comment": "place to store the result of the parsing" }, - { - "name": "value", - "type": "const char *", - "comment": "value to parse" - } + { "name": "value", "type": "const char *", "comment": "value to parse" } ], "argline": "int *out, const char *value", "sig": "int *::const char *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Parse a string value as a bool.

\n", "comments": "

Valid values for true are: 'true', 'yes', 'on', 1 or any number different from 0 Valid values for false are: 'false', 'no', 'off', 0

\n", "group": "config" }, "git_config_parse_int32": { "type": "function", - "file": "config.h", - "line": 660, - "lineto": 660, + "file": "git2/config.h", + "line": 776, + "lineto": 776, "args": [ { "name": "out", "type": "int32_t *", "comment": "place to store the result of the parsing" }, - { - "name": "value", - "type": "const char *", - "comment": "value to parse" - } + { "name": "value", "type": "const char *", "comment": "value to parse" } ], "argline": "int32_t *out, const char *value", "sig": "int32_t *::const char *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Parse a string value as an int32.

\n", "comments": "

An optional value suffix of 'k', 'm', or 'g' will cause the value to be multiplied by 1024, 1048576, or 1073741824 prior to output.

\n", "group": "config" }, "git_config_parse_int64": { "type": "function", - "file": "config.h", - "line": 672, - "lineto": 672, + "file": "git2/config.h", + "line": 789, + "lineto": 789, "args": [ { "name": "out", "type": "int64_t *", "comment": "place to store the result of the parsing" }, - { - "name": "value", - "type": "const char *", - "comment": "value to parse" - } + { "name": "value", "type": "const char *", "comment": "value to parse" } ], "argline": "int64_t *out, const char *value", "sig": "int64_t *::const char *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Parse a string value as an int64.

\n", "comments": "

An optional value suffix of 'k', 'm', or 'g' will cause the value to be multiplied by 1024, 1048576, or 1073741824 prior to output.

\n", "group": "config" }, "git_config_parse_path": { "type": "function", - "file": "config.h", - "line": 687, - "lineto": 687, + "file": "git2/config.h", + "line": 805, + "lineto": 805, "args": [ { "name": "out", @@ -5515,19 +5841,16 @@ ], "argline": "git_buf *out, const char *value", "sig": "git_buf *::const char *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Parse a string value as a path.

\n", "comments": "

A leading '~' will be expanded to the global search path (which defaults to the user's home directory but can be overridden via git_libgit2_opts().

\n\n

If the value does not begin with a tilde, the input will be returned.

\n", "group": "config" }, "git_config_backend_foreach_match": { "type": "function", - "file": "config.h", - "line": 701, - "lineto": 705, + "file": "git2/config.h", + "line": 824, + "lineto": 828, "args": [ { "name": "backend", @@ -5552,19 +5875,16 @@ ], "argline": "git_config_backend *backend, const char *regexp, git_config_foreach_cb callback, void *payload", "sig": "git_config_backend *::const char *::git_config_foreach_cb::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Perform an operation on each config variable in given config backend\n matching a regular expression.

\n", - "comments": "

This behaviors like git_config_foreach_match except instead of all config entries it just enumerates through the given backend entry.

\n", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Perform an operation on each config variable in a given config backend,\n matching a regular expression.

\n", + "comments": "

This behaves like git_config_foreach_match except that only config entries from the given backend entry are enumerated.

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the section and variable parts are lower-cased. The subsection is left unchanged.

\n", "group": "config" }, "git_config_lock": { "type": "function", - "file": "config.h", - "line": 724, - "lineto": 724, + "file": "git2/config.h", + "line": 847, + "lineto": 847, "args": [ { "name": "tx", @@ -5579,2825 +5899,2840 @@ ], "argline": "git_transaction **tx, git_config *cfg", "sig": "git_transaction **::git_config *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Lock the backend with the highest priority

\n", "comments": "

Locking disallows anybody else from writing to that backend. Any updates made after locking will not be visible to a reader until the file is unlocked.

\n\n

You can apply the changes by calling git_transaction_commit() before freeing the transaction. Either of these actions will unlock the config.

\n", "group": "config" }, - "git_cred_userpass": { + "git_credential_free": { "type": "function", - "file": "cred_helpers.h", - "line": 43, - "lineto": 48, + "file": "git2/credential.h", + "line": 149, + "lineto": 149, "args": [ { "name": "cred", - "type": "git_cred **", - "comment": "The newly created credential object." - }, - { - "name": "url", - "type": "const char *", - "comment": "The resource for which we are demanding a credential." - }, - { - "name": "user_from_url", - "type": "const char *", - "comment": "The username that was embedded in a \"user\n@\nhost\"\n remote url, or NULL if not included." - }, - { - "name": "allowed_types", - "type": "unsigned int", - "comment": "A bitmask stating which cred types are OK to return." - }, + "type": "git_credential *", + "comment": "the object to free" + } + ], + "argline": "git_credential *cred", + "sig": "git_credential *", + "return": { "type": "void", "comment": null }, + "description": "

Free a credential.

\n", + "comments": "

This is only necessary if you own the object; that is, if you are a transport.

\n", + "group": "credential" + }, + "git_credential_has_username": { + "type": "function", + "file": "git2/credential.h", + "line": 157, + "lineto": 157, + "args": [ { - "name": "payload", - "type": "void *", - "comment": "The payload provided when specifying this callback. (This is\n interpreted as a `git_cred_userpass_payload*`.)" + "name": "cred", + "type": "git_credential *", + "comment": "object to check" } ], - "argline": "git_cred **cred, const char *url, const char *user_from_url, unsigned int allowed_types, void *payload", - "sig": "git_cred **::const char *::const char *::unsigned int::void *", + "argline": "git_credential *cred", + "sig": "git_credential *", "return": { "type": "int", - "comment": null + "comment": " 1 if the credential object has non-NULL username, 0 otherwise" }, - "description": "

Stock callback usable as a git_cred_acquire_cb. This calls\n git_cred_userpass_plaintext_new unless the protocol has not specified\n GIT_CREDTYPE_USERPASS_PLAINTEXT as an allowed type.

\n", + "description": "

Check whether a credential object contains username information.

\n", "comments": "", - "group": "cred" + "group": "credential" }, - "git_describe_commit": { + "git_credential_get_username": { "type": "function", - "file": "describe.h", - "line": 123, - "lineto": 126, + "file": "git2/credential.h", + "line": 165, + "lineto": 165, "args": [ { - "name": "result", - "type": "git_describe_result **", - "comment": "pointer to store the result. You must free this once\n you're done with it." - }, - { - "name": "committish", - "type": "git_object *", - "comment": "a committish to describe" - }, - { - "name": "opts", - "type": "git_describe_options *", - "comment": "the lookup options" + "name": "cred", + "type": "git_credential *", + "comment": "object to check" } ], - "argline": "git_describe_result **result, git_object *committish, git_describe_options *opts", - "sig": "git_describe_result **::git_object *::git_describe_options *", + "argline": "git_credential *cred", + "sig": "git_credential *", "return": { - "type": "int", - "comment": null + "type": "const char *", + "comment": " the credential username, or NULL if not applicable" }, - "description": "

Describe a commit

\n", - "comments": "

Perform the describe operation on the given committish object.

\n", - "group": "describe", - "examples": { - "describe.c": [ - "ex/HEAD/describe.html#git_describe_commit-1" - ] - } + "description": "

Return the username associated with a credential object.

\n", + "comments": "", + "group": "credential" }, - "git_describe_workdir": { + "git_credential_userpass_plaintext_new": { "type": "function", - "file": "describe.h", - "line": 140, - "lineto": 143, + "file": "git2/credential.h", + "line": 176, + "lineto": 179, "args": [ { "name": "out", - "type": "git_describe_result **", - "comment": "pointer to store the result. You must free this once\n you're done with it." + "type": "git_credential **", + "comment": "The newly created credential object." }, { - "name": "repo", - "type": "git_repository *", - "comment": "the repository in which to perform the describe" + "name": "username", + "type": "const char *", + "comment": "The username of the credential." }, { - "name": "opts", - "type": "git_describe_options *", - "comment": "the lookup options" + "name": "password", + "type": "const char *", + "comment": "The password of the credential." } ], - "argline": "git_describe_result **out, git_repository *repo, git_describe_options *opts", - "sig": "git_describe_result **::git_repository *::git_describe_options *", + "argline": "git_credential **out, const char *username, const char *password", + "sig": "git_credential **::const char *::const char *", "return": { "type": "int", - "comment": null + "comment": " 0 for success or an error code for failure" }, - "description": "

Describe a commit

\n", - "comments": "

Perform the describe operation on the current commit and the worktree. After peforming describe on HEAD, a status is run and the description is considered to be dirty if there are.

\n", - "group": "describe", - "examples": { - "describe.c": [ - "ex/HEAD/describe.html#git_describe_workdir-2" - ] - } + "description": "

Create a new plain-text username and password credential object.\n The supplied credential parameter will be internally duplicated.

\n", + "comments": "", + "group": "credential" }, - "git_describe_format": { + "git_credential_default_new": { "type": "function", - "file": "describe.h", - "line": 153, - "lineto": 156, + "file": "git2/credential.h", + "line": 188, + "lineto": 188, "args": [ { "name": "out", - "type": "git_buf *", - "comment": "The buffer to store the result" - }, - { - "name": "result", - "type": "const git_describe_result *", - "comment": "the result from `git_describe_commit()` or\n `git_describe_workdir()`." - }, - { - "name": "opts", - "type": "const git_describe_format_options *", - "comment": "the formatting options" + "type": "git_credential **", + "comment": "The newly created credential object." } ], - "argline": "git_buf *out, const git_describe_result *result, const git_describe_format_options *opts", - "sig": "git_buf *::const git_describe_result *::const git_describe_format_options *", + "argline": "git_credential **out", + "sig": "git_credential **", "return": { "type": "int", - "comment": null + "comment": " 0 for success or an error code for failure" }, - "description": "

Print the describe result to a buffer

\n", + "description": "

Create a "default" credential usable for Negotiate mechanisms like NTLM\n or Kerberos authentication.

\n", "comments": "", - "group": "describe", - "examples": { - "describe.c": [ - "ex/HEAD/describe.html#git_describe_format-3" - ] - } + "group": "credential" }, - "git_describe_result_free": { + "git_credential_username_new": { "type": "function", - "file": "describe.h", - "line": 161, - "lineto": 161, + "file": "git2/credential.h", + "line": 200, + "lineto": 200, "args": [ { - "name": "result", - "type": "git_describe_result *", - "comment": null + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." + }, + { + "name": "username", + "type": "const char *", + "comment": "The username to authenticate with" } ], - "argline": "git_describe_result *result", - "sig": "git_describe_result *", + "argline": "git_credential **out, const char *username", + "sig": "git_credential **::const char *", "return": { - "type": "void", - "comment": null + "type": "int", + "comment": " 0 for success or an error code for failure" }, - "description": "

Free the describe result.

\n", - "comments": "", - "group": "describe" + "description": "

Create a credential to specify a username.

\n", + "comments": "

This is used with ssh authentication to query for the username if none is specified in the url.

\n", + "group": "credential" }, - "git_diff_init_options": { + "git_credential_ssh_key_new": { "type": "function", - "file": "diff.h", - "line": 441, - "lineto": 443, + "file": "git2/credential.h", + "line": 213, + "lineto": 218, "args": [ { - "name": "opts", - "type": "git_diff_options *", - "comment": "The `git_diff_options` struct to initialize" + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." }, { - "name": "version", - "type": "unsigned int", - "comment": "Version of struct; pass `GIT_DIFF_OPTIONS_VERSION`" + "name": "username", + "type": "const char *", + "comment": "username to use to authenticate" + }, + { + "name": "publickey", + "type": "const char *", + "comment": "The path to the public key of the credential." + }, + { + "name": "privatekey", + "type": "const char *", + "comment": "The path to the private key of the credential." + }, + { + "name": "passphrase", + "type": "const char *", + "comment": "The passphrase of the credential." } ], - "argline": "git_diff_options *opts, unsigned int version", - "sig": "git_diff_options *::unsigned int", + "argline": "git_credential **out, const char *username, const char *publickey, const char *privatekey, const char *passphrase", + "sig": "git_credential **::const char *::const char *::const char *::const char *", "return": { "type": "int", - "comment": " Zero on success; -1 on failure." + "comment": " 0 for success or an error code for failure" }, - "description": "

Initializes a git_diff_options with default values. Equivalent to\n creating an instance with GIT_DIFF_OPTIONS_INIT.

\n", + "description": "

Create a new passphrase-protected ssh key credential object.\n The supplied credential parameter will be internally duplicated.

\n", "comments": "", - "group": "diff" + "group": "credential" }, - "git_diff_find_init_options": { + "git_credential_ssh_key_memory_new": { "type": "function", - "file": "diff.h", - "line": 736, - "lineto": 738, + "file": "git2/credential.h", + "line": 230, + "lineto": 235, "args": [ { - "name": "opts", - "type": "git_diff_find_options *", - "comment": "The `git_diff_find_options` struct to initialize" + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." }, { - "name": "version", - "type": "unsigned int", - "comment": "Version of struct; pass `GIT_DIFF_FIND_OPTIONS_VERSION`" + "name": "username", + "type": "const char *", + "comment": "username to use to authenticate." + }, + { + "name": "publickey", + "type": "const char *", + "comment": "The public key of the credential." + }, + { + "name": "privatekey", + "type": "const char *", + "comment": "The private key of the credential." + }, + { + "name": "passphrase", + "type": "const char *", + "comment": "The passphrase of the credential." } ], - "argline": "git_diff_find_options *opts, unsigned int version", - "sig": "git_diff_find_options *::unsigned int", + "argline": "git_credential **out, const char *username, const char *publickey, const char *privatekey, const char *passphrase", + "sig": "git_credential **::const char *::const char *::const char *::const char *", "return": { "type": "int", - "comment": " Zero on success; -1 on failure." + "comment": " 0 for success or an error code for failure" }, - "description": "

Initializes a git_diff_find_options with default values. Equivalent to\n creating an instance with GIT_DIFF_FIND_OPTIONS_INIT.

\n", + "description": "

Create a new ssh key credential object reading the keys from memory.

\n", "comments": "", - "group": "diff" + "group": "credential" }, - "git_diff_free": { + "git_credential_ssh_interactive_new": { "type": "function", - "file": "diff.h", - "line": 752, - "lineto": 752, + "file": "git2/credential.h", + "line": 278, + "lineto": 282, "args": [ { - "name": "diff", - "type": "git_diff *", - "comment": "The previously created diff; cannot be used after free." - } - ], - "argline": "git_diff *diff", - "sig": "git_diff *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Deallocate a diff.

\n", - "comments": "", - "group": "diff", - "examples": { - "diff.c": [ - "ex/HEAD/diff.html#git_diff_free-2" - ], - "log.c": [ - "ex/HEAD/log.html#git_diff_free-24", - "ex/HEAD/log.html#git_diff_free-25" - ] - } - }, - "git_diff_tree_to_tree": { - "type": "function", - "file": "diff.h", - "line": 770, - "lineto": 775, - "args": [ - { - "name": "diff", - "type": "git_diff **", - "comment": "Output pointer to a git_diff pointer to be allocated." - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "The repository containing the trees." + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." }, { - "name": "old_tree", - "type": "git_tree *", - "comment": "A git_tree object to diff from, or NULL for empty tree." + "name": "username", + "type": "const char *", + "comment": "Username to use to authenticate." }, { - "name": "new_tree", - "type": "git_tree *", - "comment": "A git_tree object to diff to, or NULL for empty tree." + "name": "prompt_callback", + "type": "git_credential_ssh_interactive_cb", + "comment": "The callback method used for prompts." }, { - "name": "opts", - "type": "const git_diff_options *", - "comment": "Structure with options to influence diff or NULL for defaults." + "name": "payload", + "type": "void *", + "comment": "Additional data to pass to the callback." } ], - "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, git_tree *new_tree, const git_diff_options *opts", - "sig": "git_diff **::git_repository *::git_tree *::git_tree *::const git_diff_options *", + "argline": "git_credential **out, const char *username, git_credential_ssh_interactive_cb prompt_callback, void *payload", + "sig": "git_credential **::const char *::git_credential_ssh_interactive_cb::void *", "return": { "type": "int", - "comment": null + "comment": " 0 for success or an error code for failure." }, - "description": "

Create a diff with the difference between two tree objects.

\n", - "comments": "

This is equivalent to git diff <old-tree> <new-tree>

\n\n

The first tree will be used for the "old_file" side of the delta and the second tree will be used for the "new_file" side of the delta. You can pass NULL to indicate an empty tree, although it is an error to pass NULL for both the old_tree and new_tree.

\n", - "group": "diff", - "examples": { - "diff.c": [ - "ex/HEAD/diff.html#git_diff_tree_to_tree-3" - ], - "log.c": [ - "ex/HEAD/log.html#git_diff_tree_to_tree-26", - "ex/HEAD/log.html#git_diff_tree_to_tree-27" - ] - } + "description": "

Create a new ssh keyboard-interactive based credential object.\n The supplied credential parameter will be internally duplicated.

\n", + "comments": "", + "group": "credential" }, - "git_diff_tree_to_index": { + "git_credential_ssh_key_from_agent": { "type": "function", - "file": "diff.h", - "line": 796, - "lineto": 801, + "file": "git2/credential.h", + "line": 292, + "lineto": 294, "args": [ { - "name": "diff", - "type": "git_diff **", - "comment": "Output pointer to a git_diff pointer to be allocated." - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "The repository containing the tree and index." - }, - { - "name": "old_tree", - "type": "git_tree *", - "comment": "A git_tree object to diff from, or NULL for empty tree." - }, - { - "name": "index", - "type": "git_index *", - "comment": "The index to diff with; repo index used if NULL." + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." }, { - "name": "opts", - "type": "const git_diff_options *", - "comment": "Structure with options to influence diff or NULL for defaults." + "name": "username", + "type": "const char *", + "comment": "username to use to authenticate" } ], - "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, git_index *index, const git_diff_options *opts", - "sig": "git_diff **::git_repository *::git_tree *::git_index *::const git_diff_options *", + "argline": "git_credential **out, const char *username", + "sig": "git_credential **::const char *", "return": { "type": "int", - "comment": null + "comment": " 0 for success or an error code for failure" }, - "description": "

Create a diff between a tree and repository index.

\n", - "comments": "

This is equivalent to git diff --cached <treeish> or if you pass the HEAD tree, then like git diff --cached.

\n\n

The tree you pass will be used for the "old_file" side of the delta, and the index will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo will be used. In this case, the index will be refreshed from disk (if it has changed) before the diff is generated.

\n", - "group": "diff", - "examples": { - "diff.c": [ - "ex/HEAD/diff.html#git_diff_tree_to_index-4" - ] - } + "description": "

Create a new ssh key credential object used for querying an ssh-agent.\n The supplied credential parameter will be internally duplicated.

\n", + "comments": "", + "group": "credential" }, - "git_diff_index_to_workdir": { + "git_credential_ssh_custom_new": { "type": "function", - "file": "diff.h", - "line": 823, - "lineto": 827, + "file": "git2/credential.h", + "line": 332, + "lineto": 338, "args": [ { - "name": "diff", - "type": "git_diff **", - "comment": "Output pointer to a git_diff pointer to be allocated." - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "The repository." + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." }, { - "name": "index", - "type": "git_index *", - "comment": "The index to diff from; repo index used if NULL." + "name": "username", + "type": "const char *", + "comment": "username to use to authenticate" }, { - "name": "opts", - "type": "const git_diff_options *", - "comment": "Structure with options to influence diff or NULL for defaults." - } - ], - "argline": "git_diff **diff, git_repository *repo, git_index *index, const git_diff_options *opts", - "sig": "git_diff **::git_repository *::git_index *::const git_diff_options *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Create a diff between the repository index and the workdir directory.

\n", - "comments": "

This matches the git diff command. See the note below on git_diff_tree_to_workdir for a discussion of the difference between git diff and git diff HEAD and how to emulate a git diff <treeish> using libgit2.

\n\n

The index will be used for the "old_file" side of the delta, and the working directory will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo will be used. In this case, the index will be refreshed from disk (if it has changed) before the diff is generated.

\n", - "group": "diff", - "examples": { - "diff.c": [ - "ex/HEAD/diff.html#git_diff_index_to_workdir-5" - ] - } - }, - "git_diff_tree_to_workdir": { - "type": "function", - "file": "diff.h", - "line": 852, - "lineto": 856, - "args": [ - { - "name": "diff", - "type": "git_diff **", - "comment": "A pointer to a git_diff pointer that will be allocated." + "name": "publickey", + "type": "const char *", + "comment": "The bytes of the public key." }, { - "name": "repo", - "type": "git_repository *", - "comment": "The repository containing the tree." + "name": "publickey_len", + "type": "size_t", + "comment": "The length of the public key in bytes." }, { - "name": "old_tree", - "type": "git_tree *", - "comment": "A git_tree object to diff from, or NULL for empty tree." + "name": "sign_callback", + "type": "git_credential_sign_cb", + "comment": "The callback method to sign the data during the challenge." }, { - "name": "opts", - "type": "const git_diff_options *", - "comment": "Structure with options to influence diff or NULL for defaults." + "name": "payload", + "type": "void *", + "comment": "Additional data to pass to the callback." } ], - "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, const git_diff_options *opts", - "sig": "git_diff **::git_repository *::git_tree *::const git_diff_options *", + "argline": "git_credential **out, const char *username, const char *publickey, size_t publickey_len, git_credential_sign_cb sign_callback, void *payload", + "sig": "git_credential **::const char *::const char *::size_t::git_credential_sign_cb::void *", "return": { "type": "int", - "comment": null + "comment": " 0 for success or an error code for failure" }, - "description": "

Create a diff between a tree and the working directory.

\n", - "comments": "

The tree you provide will be used for the "old_file" side of the delta, and the working directory will be used for the "new_file" side.

\n\n

This is not the same as git diff <treeish> or git diff-index <treeish>. Those commands use information from the index, whereas this function strictly returns the differences between the tree and the files in the working directory, regardless of the state of the index. Use git_diff_tree_to_workdir_with_index to emulate those commands.

\n\n

To see difference between this and git_diff_tree_to_workdir_with_index, consider the example of a staged file deletion where the file has then been put back into the working dir and further modified. The tree-to-workdir diff for that file is 'modified', but git diff would show status 'deleted' since there is a staged delete.

\n", - "group": "diff", - "examples": { - "diff.c": [ - "ex/HEAD/diff.html#git_diff_tree_to_workdir-6" - ] - } + "description": "

Create an ssh key credential with a custom signing function.

\n", + "comments": "

This lets you use your own function to sign the challenge.

\n\n

This function and its credential type is provided for completeness and wraps libssh2_userauth_publickey(), which is undocumented.

\n\n

The supplied credential parameter will be internally duplicated.

\n", + "group": "credential" }, - "git_diff_tree_to_workdir_with_index": { + "git_credential_userpass": { "type": "function", - "file": "diff.h", - "line": 871, - "lineto": 875, + "file": "git2/credential_helpers.h", + "line": 44, + "lineto": 49, "args": [ { - "name": "diff", - "type": "git_diff **", - "comment": "A pointer to a git_diff pointer that will be allocated." + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." }, { - "name": "repo", - "type": "git_repository *", - "comment": "The repository containing the tree." + "name": "url", + "type": "const char *", + "comment": "The resource for which we are demanding a credential." }, { - "name": "old_tree", - "type": "git_tree *", - "comment": "A git_tree object to diff from, or NULL for empty tree." + "name": "user_from_url", + "type": "const char *", + "comment": "The username that was embedded in a \"user\n@\nhost\"\n remote url, or NULL if not included." }, { - "name": "opts", - "type": "const git_diff_options *", - "comment": "Structure with options to influence diff or NULL for defaults." + "name": "allowed_types", + "type": "unsigned int", + "comment": "A bitmask stating which credential types are OK to return." + }, + { + "name": "payload", + "type": "void *", + "comment": "The payload provided when specifying this callback. (This is\n interpreted as a `git_credential_userpass_payload*`.)" } ], - "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, const git_diff_options *opts", - "sig": "git_diff **::git_repository *::git_tree *::const git_diff_options *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Create a diff between a tree and the working directory using index data\n to account for staged deletes, tracked files, etc.

\n", - "comments": "

This emulates git diff <tree> by diffing the tree to the index and the index to the working directory and blending the results into a single diff that includes staged deleted, etc.

\n", - "group": "diff", - "examples": { - "diff.c": [ - "ex/HEAD/diff.html#git_diff_tree_to_workdir_with_index-7" - ] - } + "argline": "git_credential **out, const char *url, const char *user_from_url, unsigned int allowed_types, void *payload", + "sig": "git_credential **::const char *::const char *::unsigned int::void *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Stock callback usable as a git_credential_acquire_cb. This calls\n git_cred_userpass_plaintext_new unless the protocol has not specified\n GIT_CREDENTIAL_USERPASS_PLAINTEXT as an allowed type.

\n", + "comments": "", + "group": "credential" }, - "git_diff_index_to_index": { + "git_blob_filtered_content": { "type": "function", - "file": "diff.h", - "line": 889, - "lineto": 894, + "file": "git2/deprecated.h", + "line": 124, + "lineto": 128, "args": [ - { - "name": "diff", - "type": "git_diff **", - "comment": "Output pointer to a git_diff pointer to be allocated." - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "The repository containing the indexes." - }, - { - "name": "old_index", - "type": "git_index *", - "comment": "A git_index object to diff from." - }, - { - "name": "new_index", - "type": "git_index *", - "comment": "A git_index object to diff to." - }, - { - "name": "opts", - "type": "const git_diff_options *", - "comment": "Structure with options to influence diff or NULL for defaults." - } + { "name": "out", "type": "git_buf *", "comment": null }, + { "name": "blob", "type": "git_blob *", "comment": null }, + { "name": "as_path", "type": "const char *", "comment": null }, + { "name": "check_for_binary_data", "type": "int", "comment": null } ], - "argline": "git_diff **diff, git_repository *repo, git_index *old_index, git_index *new_index, const git_diff_options *opts", - "sig": "git_diff **::git_repository *::git_index *::git_index *::const git_diff_options *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Create a diff with the difference between two index objects.

\n", - "comments": "

The first index will be used for the "old_file" side of the delta and the second index will be used for the "new_file" side of the delta.

\n", - "group": "diff" + "argline": "git_buf *out, git_blob *blob, const char *as_path, int check_for_binary_data", + "sig": "git_buf *::git_blob *::const char *::int", + "return": { "type": "int", "comment": null }, + "description": "

Deprecated in favor of git_blob_filter.

\n", + "comments": "", + "group": "blob" }, - "git_diff_merge": { + "git_filter_list_stream_data": { "type": "function", - "file": "diff.h", - "line": 909, - "lineto": 911, + "file": "git2/deprecated.h", + "line": 148, + "lineto": 151, + "args": [ + { "name": "filters", "type": "git_filter_list *", "comment": null }, + { "name": "data", "type": "git_buf *", "comment": null }, + { "name": "target", "type": "git_writestream *", "comment": null } + ], + "argline": "git_filter_list *filters, git_buf *data, git_writestream *target", + "sig": "git_filter_list *::git_buf *::git_writestream *", + "return": { "type": "int", "comment": null }, + "description": "

Deprecated in favor of git_filter_list_stream_buffer.

\n", + "comments": "", + "group": "filter" + }, + "git_filter_list_apply_to_data": { + "type": "function", + "file": "git2/deprecated.h", + "line": 158, + "lineto": 161, + "args": [ + { "name": "out", "type": "git_buf *", "comment": null }, + { "name": "filters", "type": "git_filter_list *", "comment": null }, + { "name": "in", "type": "git_buf *", "comment": null } + ], + "argline": "git_buf *out, git_filter_list *filters, git_buf *in", + "sig": "git_buf *::git_filter_list *::git_buf *", + "return": { "type": "int", "comment": null }, + "description": "

Deprecated in favor of git_filter_list_apply_to_buffer.

\n", + "comments": "", + "group": "filter" + }, + "git_treebuilder_write_with_buffer": { + "type": "function", + "file": "git2/deprecated.h", + "line": 187, + "lineto": 188, + "args": [ + { "name": "oid", "type": "git_oid *", "comment": null }, + { "name": "bld", "type": "git_treebuilder *", "comment": null }, + { "name": "tree", "type": "git_buf *", "comment": null } + ], + "argline": "git_oid *oid, git_treebuilder *bld, git_buf *tree", + "sig": "git_oid *::git_treebuilder *::git_buf *", + "return": { "type": "int", "comment": null }, + "description": "

Write the contents of the tree builder as a tree object.\n This is an alias of git_treebuilder_write and is preserved\n for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "treebuilder" + }, + "git_buf_grow": { + "type": "function", + "file": "git2/deprecated.h", + "line": 229, + "lineto": 229, "args": [ { - "name": "onto", - "type": "git_diff *", - "comment": "Diff to merge into." + "name": "buffer", + "type": "git_buf *", + "comment": "The buffer to be resized; may or may not be allocated yet" }, { - "name": "from", - "type": "const git_diff *", - "comment": "Diff to merge." + "name": "target_size", + "type": "size_t", + "comment": "The desired available size" } ], - "argline": "git_diff *onto, const git_diff *from", - "sig": "git_diff *::const git_diff *", + "argline": "git_buf *buffer, size_t target_size", + "sig": "git_buf *::size_t", "return": { "type": "int", - "comment": null + "comment": " 0 on success, -1 on allocation failure" }, - "description": "

Merge one diff into another.

\n", - "comments": "

This merges items from the "from" list into the "onto" list. The resulting diff will have all items that appear in either list. If an item appears in both lists, then it will be "merged" to appear as if the old version was from the "onto" list and the new version is from the "from" list (with the exception that if the item has a pending DELETE in the middle, then it will show as deleted).

\n", - "group": "diff" + "description": "

Resize the buffer allocation to make more space.

\n", + "comments": "

This will attempt to grow the buffer to accommodate the target size.

\n\n

If the buffer refers to memory that was not allocated by libgit2 (i.e. the asize field is zero), then ptr will be replaced with a newly allocated block of data. Be careful so that memory allocated by the caller is not lost. As a special variant, if you pass target_size as 0 and the memory is not allocated by libgit2, this will allocate a new buffer of size size and copy the external data into it.

\n\n

Currently, this will never shrink a buffer, only expand it.

\n\n

If the allocation fails, this will return an error and the buffer will be marked as invalid for future operations, invaliding the contents.

\n", + "group": "buf" }, - "git_diff_find_similar": { + "git_buf_set": { "type": "function", - "file": "diff.h", - "line": 925, - "lineto": 927, + "file": "git2/deprecated.h", + "line": 239, + "lineto": 240, "args": [ { - "name": "diff", - "type": "git_diff *", - "comment": "diff to run detection algorithms on" + "name": "buffer", + "type": "git_buf *", + "comment": "The buffer to set" }, { - "name": "options", - "type": "const git_diff_find_options *", - "comment": "Control how detection should be run, NULL for defaults" + "name": "data", + "type": "const void *", + "comment": "The data to copy into the buffer" + }, + { + "name": "datalen", + "type": "size_t", + "comment": "The length of the data to copy into the buffer" } ], - "argline": "git_diff *diff, const git_diff_find_options *options", - "sig": "git_diff *::const git_diff_find_options *", + "argline": "git_buf *buffer, const void *data, size_t datalen", + "sig": "git_buf *::const void *::size_t", "return": { "type": "int", - "comment": " 0 on success, -1 on failure" + "comment": " 0 on success, -1 on allocation failure" }, - "description": "

Transform a diff marking file renames, copies, etc.

\n", - "comments": "

This modifies a diff in place, replacing old entries that look like renames or copies with new entries reflecting those changes. This also will, if requested, break modified files into add/remove pairs if the amount of change is above a threshold.

\n", - "group": "diff", - "examples": { - "diff.c": [ - "ex/HEAD/diff.html#git_diff_find_similar-8" - ] - } + "description": "

Set buffer to a copy of some raw data.

\n", + "comments": "", + "group": "buf" }, - "git_diff_num_deltas": { + "git_buf_is_binary": { "type": "function", - "file": "diff.h", - "line": 945, - "lineto": 945, + "file": "git2/deprecated.h", + "line": 248, + "lineto": 248, "args": [ { - "name": "diff", - "type": "const git_diff *", - "comment": "A git_diff generated by one of the above functions" + "name": "buf", + "type": "const git_buf *", + "comment": "Buffer to check" } ], - "argline": "const git_diff *diff", - "sig": "const git_diff *", + "argline": "const git_buf *buf", + "sig": "const git_buf *", "return": { - "type": "size_t", - "comment": " Count of number of deltas in the list" + "type": "int", + "comment": " 1 if buffer looks like non-text data" }, - "description": "

Query how many diff records are there in a diff.

\n", + "description": "

Check quickly if buffer looks like it contains binary data

\n", "comments": "", - "group": "diff", - "examples": { - "log.c": [ - "ex/HEAD/log.html#git_diff_num_deltas-28" - ] - } + "group": "buf" }, - "git_diff_num_deltas_of_type": { + "git_buf_contains_nul": { "type": "function", - "file": "diff.h", - "line": 958, - "lineto": 959, + "file": "git2/deprecated.h", + "line": 256, + "lineto": 256, "args": [ { - "name": "diff", - "type": "const git_diff *", - "comment": "A git_diff generated by one of the above functions" - }, - { - "name": "type", - "type": "git_delta_t", - "comment": "A git_delta_t value to filter the count" + "name": "buf", + "type": "const git_buf *", + "comment": "Buffer to check" } ], - "argline": "const git_diff *diff, git_delta_t type", - "sig": "const git_diff *::git_delta_t", + "argline": "const git_buf *buf", + "sig": "const git_buf *", "return": { - "type": "size_t", - "comment": " Count of number of deltas matching delta_t type" + "type": "int", + "comment": " 1 if buffer contains a NUL byte" }, - "description": "

Query how many diff deltas are there in a diff filtered by type.

\n", - "comments": "

This works just like git_diff_entrycount() with an extra parameter that is a git_delta_t and returns just the count of how many deltas match that particular type.

\n", - "group": "diff" + "description": "

Check quickly if buffer contains a NUL byte

\n", + "comments": "", + "group": "buf" }, - "git_diff_get_delta": { + "git_buf_free": { + "type": "function", + "file": "git2/deprecated.h", + "line": 268, + "lineto": 268, + "args": [{ "name": "buffer", "type": "git_buf *", "comment": null }], + "argline": "git_buf *buffer", + "sig": "git_buf *", + "return": { "type": "void", "comment": null }, + "description": "

Free the memory referred to by the git_buf. This is an alias of\n git_buf_dispose and is preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "buf" + }, + "git_diff_format_email": { "type": "function", - "file": "diff.h", - "line": 978, - "lineto": 979, + "file": "git2/deprecated.h", + "line": 374, + "lineto": 377, "args": [ + { "name": "out", "type": "git_buf *", "comment": null }, + { "name": "diff", "type": "git_diff *", "comment": null }, { - "name": "diff", - "type": "const git_diff *", - "comment": "Diff list object" - }, - { - "name": "idx", - "type": "size_t", - "comment": "Index into diff list" + "name": "opts", + "type": "const git_diff_format_email_options *", + "comment": null } ], - "argline": "const git_diff *diff, size_t idx", - "sig": "const git_diff *::size_t", - "return": { - "type": "const git_diff_delta *", - "comment": " Pointer to git_diff_delta (or NULL if `idx` out of range)" - }, - "description": "

Return the diff delta for an entry in the diff list.

\n", - "comments": "

The git_diff_delta pointer points to internal data and you do not have to release it when you are done with it. It will go away when the * git_diff (or any associated git_patch) goes away.

\n\n

Note that the flags on the delta related to whether it has binary content or not may not be set if there are no attributes set for the file and there has been no reason to load the file data at this point. For now, if you need those flags to be up to date, your only option is to either use git_diff_foreach or create a git_patch.

\n", + "argline": "git_buf *out, git_diff *diff, const git_diff_format_email_options *opts", + "sig": "git_buf *::git_diff *::const git_diff_format_email_options *", + "return": { "type": "int", "comment": null }, + "description": "

Create an e-mail ready patch from a diff.

\n", + "comments": "", "group": "diff" }, - "git_diff_is_sorted_icase": { + "git_diff_commit_as_email": { "type": "function", - "file": "diff.h", - "line": 987, - "lineto": 987, + "file": "git2/deprecated.h", + "line": 385, + "lineto": 392, "args": [ + { "name": "out", "type": "git_buf *", "comment": null }, + { "name": "repo", "type": "git_repository *", "comment": null }, + { "name": "commit", "type": "git_commit *", "comment": null }, + { "name": "patch_no", "type": "size_t", "comment": null }, + { "name": "total_patches", "type": "size_t", "comment": null }, + { "name": "flags", "type": "uint32_t", "comment": null }, { - "name": "diff", - "type": "const git_diff *", - "comment": "diff to check" + "name": "diff_opts", + "type": "const git_diff_options *", + "comment": null } ], - "argline": "const git_diff *diff", - "sig": "const git_diff *", - "return": { - "type": "int", - "comment": " 0 if case sensitive, 1 if case is ignored" - }, - "description": "

Check if deltas are sorted case sensitively or insensitively.

\n", + "argline": "git_buf *out, git_repository *repo, git_commit *commit, size_t patch_no, size_t total_patches, uint32_t flags, const git_diff_options *diff_opts", + "sig": "git_buf *::git_repository *::git_commit *::size_t::size_t::uint32_t::const git_diff_options *", + "return": { "type": "int", "comment": null }, + "description": "

Create an e-mail ready patch for a commit.

\n", "comments": "", "group": "diff" }, - "git_diff_foreach": { + "git_diff_format_email_options_init": { "type": "function", - "file": "diff.h", - "line": 1015, - "lineto": 1021, + "file": "git2/deprecated.h", + "line": 404, + "lineto": 406, "args": [ { - "name": "diff", - "type": "git_diff *", - "comment": "A git_diff generated by one of the above functions." - }, - { - "name": "file_cb", - "type": "git_diff_file_cb", - "comment": "Callback function to make per file in the diff." - }, - { - "name": "binary_cb", - "type": "git_diff_binary_cb", - "comment": "Optional callback to make for binary files." - }, - { - "name": "hunk_cb", - "type": "git_diff_hunk_cb", - "comment": "Optional callback to make per hunk of text diff. This\n callback is called to describe a range of lines in the\n diff. It will not be issued for binary files." - }, - { - "name": "line_cb", - "type": "git_diff_line_cb", - "comment": "Optional callback to make per line of diff text. This\n same callback will be made for context lines, added, and\n removed lines, and even for a deleted trailing newline." + "name": "opts", + "type": "git_diff_format_email_options *", + "comment": "The `git_blame_options` struct to initialize." }, { - "name": "payload", - "type": "void *", - "comment": "Reference pointer that will be passed to your callbacks." + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`." } ], - "argline": "git_diff *diff, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", - "sig": "git_diff *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", + "argline": "git_diff_format_email_options *opts, unsigned int version", + "sig": "git_diff_format_email_options *::unsigned int", "return": { "type": "int", - "comment": " 0 on success, non-zero callback return value, or error code" + "comment": " Zero on success; -1 on failure." }, - "description": "

Loop over all deltas in a diff issuing callbacks.

\n", - "comments": "

This will iterate through all of the files described in a diff. You should provide a file callback to learn about each file.

\n\n

The "hunk" and "line" callbacks are optional, and the text diff of the files will only be calculated if they are not NULL. Of course, these callbacks will not be invoked for binary files on the diff or for files whose only changed is a file mode change.

\n\n

Returning a non-zero value from any of the callbacks will terminate the iteration and return the value to the user.

\n", + "description": "

Initialize git_diff_format_email_options structure

\n", + "comments": "

Initializes a git_diff_format_email_options with default values. Equivalent to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.

\n", "group": "diff" }, - "git_diff_status_char": { + "giterr_last": { "type": "function", - "file": "diff.h", - "line": 1034, - "lineto": 1034, - "args": [ - { - "name": "status", - "type": "git_delta_t", - "comment": "The git_delta_t value to look up" - } - ], - "argline": "git_delta_t status", - "sig": "git_delta_t", - "return": { - "type": "char", - "comment": " The single character label for that code" - }, - "description": "

Look up the single character abbreviation for a delta status code.

\n", - "comments": "

When you run git diff --name-status it uses single letter codes in the output such as 'A' for added, 'D' for deleted, 'M' for modified, etc. This function converts a git_delta_t value into these letters for your own purposes. GIT_DELTA_UNTRACKED will return a space (i.e. ' ').

\n", - "group": "diff" + "file": "git2/deprecated.h", + "line": 503, + "lineto": 503, + "args": [], + "argline": "", + "sig": "", + "return": { "type": "const git_error *", "comment": null }, + "description": "

Return the last git_error object that was generated for the\n current thread. This is an alias of git_error_last and is\n preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "giterr" }, - "git_diff_print": { + "giterr_clear": { "type": "function", - "file": "diff.h", - "line": 1059, - "lineto": 1063, + "file": "git2/deprecated.h", + "line": 515, + "lineto": 515, + "args": [], + "argline": "", + "sig": "", + "return": { "type": "void", "comment": null }, + "description": "

Clear the last error. This is an alias of git_error_last and is\n preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "giterr" + }, + "giterr_set_str": { + "type": "function", + "file": "git2/deprecated.h", + "line": 527, + "lineto": 527, + "args": [ + { "name": "error_class", "type": "int", "comment": null }, + { "name": "string", "type": "const char *", "comment": null } + ], + "argline": "int error_class, const char *string", + "sig": "int::const char *", + "return": { "type": "void", "comment": null }, + "description": "

Sets the error message to the given string. This is an alias of\n git_error_set_str and is preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "giterr" + }, + "giterr_set_oom": { + "type": "function", + "file": "git2/deprecated.h", + "line": 539, + "lineto": 539, + "args": [], + "argline": "", + "sig": "", + "return": { "type": "void", "comment": null }, + "description": "

Indicates that an out-of-memory situation occurred. This is an alias\n of git_error_set_oom and is preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "giterr" + }, + "git_object__size": { + "type": "function", + "file": "git2/deprecated.h", + "line": 666, + "lineto": 666, "args": [ { - "name": "diff", - "type": "git_diff *", - "comment": "A git_diff generated by one of the above functions." - }, + "name": "type", + "type": "git_object_t", + "comment": "object type to get its size" + } + ], + "argline": "git_object_t type", + "sig": "git_object_t", + "return": { "type": "size_t", "comment": " size in bytes of the object" }, + "description": "

Get the size in bytes for the structure which\n acts as an in-memory representation of any given\n object type.

\n", + "comments": "

For all the core types, this would the equivalent of calling sizeof(git_commit) if the core types were not opaque on the external API.

\n", + "group": "object" + }, + "git_remote_is_valid_name": { + "type": "function", + "file": "git2/deprecated.h", + "line": 687, + "lineto": 687, + "args": [ { - "name": "format", - "type": "git_diff_format_t", - "comment": "A git_diff_format_t value to pick the text format." - }, + "name": "remote_name", + "type": "const char *", + "comment": "name to be checked." + } + ], + "argline": "const char *remote_name", + "sig": "const char *", + "return": { + "type": "int", + "comment": " 1 if the reference name is acceptable; 0 if it isn't" + }, + "description": "

Ensure the remote name is well-formed.

\n", + "comments": "", + "group": "remote" + }, + "git_reference_is_valid_name": { + "type": "function", + "file": "git2/deprecated.h", + "line": 741, + "lineto": 741, + "args": [ { - "name": "print_cb", - "type": "git_diff_line_cb", - "comment": "Callback to make per line of diff text." + "name": "refname", + "type": "const char *", + "comment": "name to be checked." + } + ], + "argline": "const char *refname", + "sig": "const char *", + "return": { + "type": "int", + "comment": " 1 if the reference name is acceptable; 0 if it isn't" + }, + "description": "

Ensure the reference name is well-formed.

\n", + "comments": "

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n", + "group": "reference" + }, + "git_oidarray_free": { + "type": "function", + "file": "git2/deprecated.h", + "line": 922, + "lineto": 922, + "args": [{ "name": "array", "type": "git_oidarray *", "comment": null }], + "argline": "git_oidarray *array", + "sig": "git_oidarray *", + "return": { "type": "void", "comment": null }, + "description": "

Free the memory referred to by the git_oidarray. This is an alias of\n git_oidarray_dispose and is preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "oidarray" + }, + "git_strarray_copy": { + "type": "function", + "file": "git2/deprecated.h", + "line": 991, + "lineto": 991, + "args": [ + { "name": "tgt", "type": "git_strarray *", "comment": "target" }, + { "name": "src", "type": "const git_strarray *", "comment": "source" } + ], + "argline": "git_strarray *tgt, const git_strarray *src", + "sig": "git_strarray *::const git_strarray *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n 0 on allocation failure" + }, + "description": "

Copy a string array object from source to target.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "strarray" + }, + "git_strarray_free": { + "type": "function", + "file": "git2/deprecated.h", + "line": 1003, + "lineto": 1003, + "args": [{ "name": "array", "type": "git_strarray *", "comment": null }], + "argline": "git_strarray *array", + "sig": "git_strarray *", + "return": { "type": "void", "comment": null }, + "description": "

Free the memory referred to by the git_strarray. This is an alias of\n git_strarray_dispose and is preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "strarray" + }, + "git_blame_init_options": { + "type": "function", + "file": "git2/deprecated.h", + "line": 1035, + "lineto": 1035, + "args": [ + { "name": "opts", "type": "git_blame_options *", "comment": null }, + { "name": "version", "type": "unsigned int", "comment": null } + ], + "argline": "git_blame_options *opts, unsigned int version", + "sig": "git_blame_options *::unsigned int", + "return": { "type": "int", "comment": null }, + "description": "", + "comments": "

These functions are retained for backward compatibility. The newer versions of these functions should be preferred in all new code.

\n\n

There is no plan to remove these backward compatibility functions at this time.

\n\n

@{

\n", + "group": "blame" + }, + "git_describe_options_init": { + "type": "function", + "file": "git2/describe.h", + "line": 91, + "lineto": 91, + "args": [ + { + "name": "opts", + "type": "git_describe_options *", + "comment": "The `git_describe_options` struct to initialize." }, { - "name": "payload", - "type": "void *", - "comment": "Reference pointer that will be passed to your callback." + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_DESCRIBE_OPTIONS_VERSION`." } ], - "argline": "git_diff *diff, git_diff_format_t format, git_diff_line_cb print_cb, void *payload", - "sig": "git_diff *::git_diff_format_t::git_diff_line_cb::void *", + "argline": "git_describe_options *opts, unsigned int version", + "sig": "git_describe_options *::unsigned int", "return": { "type": "int", - "comment": " 0 on success, non-zero callback return value, or error code" + "comment": " Zero on success; -1 on failure." }, - "description": "

Iterate over a diff generating formatted text output.

\n", - "comments": "

Returning a non-zero value from the callbacks will terminate the iteration and return the non-zero value to the caller.

\n", - "group": "diff", + "description": "

Initialize git_describe_options structure

\n", + "comments": "

Initializes a git_describe_options with default values. Equivalent to creating an instance with GIT_DESCRIBE_OPTIONS_INIT.

\n", + "group": "describe", "examples": { - "diff.c": [ - "ex/HEAD/diff.html#git_diff_print-9" - ], - "log.c": [ - "ex/HEAD/log.html#git_diff_print-29" - ] + "describe.c": ["ex/v1.9.1/describe.html#git_describe_options_init-1"] } }, - "git_diff_to_buf": { + "git_describe_format_options_init": { "type": "function", - "file": "diff.h", - "line": 1075, - "lineto": 1078, + "file": "git2/describe.h", + "line": 141, + "lineto": 141, "args": [ { - "name": "out", - "type": "git_buf *", - "comment": "A pointer to a user-allocated git_buf that will\n contain the diff text" - }, - { - "name": "diff", - "type": "git_diff *", - "comment": "A git_diff generated by one of the above functions." + "name": "opts", + "type": "git_describe_format_options *", + "comment": "The `git_describe_format_options` struct to initialize." }, { - "name": "format", - "type": "git_diff_format_t", - "comment": "A git_diff_format_t value to pick the text format." + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_DESCRIBE_FORMAT_OPTIONS_VERSION`." } ], - "argline": "git_buf *out, git_diff *diff, git_diff_format_t format", - "sig": "git_buf *::git_diff *::git_diff_format_t", + "argline": "git_describe_format_options *opts, unsigned int version", + "sig": "git_describe_format_options *::unsigned int", "return": { "type": "int", - "comment": " 0 on success or error code" + "comment": " Zero on success; -1 on failure." }, - "description": "

Produce the complete formatted text output from a diff into a\n buffer.

\n", - "comments": "", - "group": "diff" + "description": "

Initialize git_describe_format_options structure

\n", + "comments": "

Initializes a git_describe_format_options with default values. Equivalent to creating an instance with GIT_DESCRIBE_FORMAT_OPTIONS_INIT.

\n", + "group": "describe", + "examples": { + "describe.c": [ + "ex/v1.9.1/describe.html#git_describe_format_options_init-2" + ] + } }, - "git_diff_blobs": { + "git_describe_commit": { "type": "function", - "file": "diff.h", - "line": 1115, - "lineto": 1125, + "file": "git2/describe.h", + "line": 159, + "lineto": 162, "args": [ { - "name": "old_blob", - "type": "const git_blob *", - "comment": "Blob for old side of diff, or NULL for empty blob" - }, - { - "name": "old_as_path", - "type": "const char *", - "comment": "Treat old blob as if it had this filename; can be NULL" + "name": "result", + "type": "git_describe_result **", + "comment": "pointer to store the result. You must free this once\n you're done with it." }, { - "name": "new_blob", - "type": "const git_blob *", - "comment": "Blob for new side of diff, or NULL for empty blob" + "name": "committish", + "type": "git_object *", + "comment": "a committish to describe" }, { - "name": "new_as_path", - "type": "const char *", - "comment": "Treat new blob as if it had this filename; can be NULL" - }, + "name": "opts", + "type": "git_describe_options *", + "comment": "the lookup options (or NULL for defaults)" + } + ], + "argline": "git_describe_result **result, git_object *committish, git_describe_options *opts", + "sig": "git_describe_result **::git_object *::git_describe_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Describe a commit

\n", + "comments": "

Perform the describe operation on the given committish object.

\n", + "group": "describe", + "examples": { + "describe.c": ["ex/v1.9.1/describe.html#git_describe_commit-3"] + } + }, + "git_describe_workdir": { + "type": "function", + "file": "git2/describe.h", + "line": 177, + "lineto": 180, + "args": [ { - "name": "options", - "type": "const git_diff_options *", - "comment": "Options for diff, or NULL for default options" + "name": "out", + "type": "git_describe_result **", + "comment": "pointer to store the result. You must free this once\n you're done with it." }, { - "name": "file_cb", - "type": "git_diff_file_cb", - "comment": "Callback for \"file\"; made once if there is a diff; can be NULL" + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to perform the describe" }, { - "name": "binary_cb", - "type": "git_diff_binary_cb", - "comment": "Callback for binary files; can be NULL" - }, + "name": "opts", + "type": "git_describe_options *", + "comment": "the lookup options (or NULL for defaults)" + } + ], + "argline": "git_describe_result **out, git_repository *repo, git_describe_options *opts", + "sig": "git_describe_result **::git_repository *::git_describe_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Describe a commit

\n", + "comments": "

Perform the describe operation on the current commit and the worktree. After performing describe on HEAD, a status is run and the description is considered to be dirty if there are.

\n", + "group": "describe", + "examples": { + "describe.c": ["ex/v1.9.1/describe.html#git_describe_workdir-4"] + } + }, + "git_describe_format": { + "type": "function", + "file": "git2/describe.h", + "line": 191, + "lineto": 194, + "args": [ { - "name": "hunk_cb", - "type": "git_diff_hunk_cb", - "comment": "Callback for each hunk in diff; can be NULL" + "name": "out", + "type": "git_buf *", + "comment": "The buffer to store the result" }, { - "name": "line_cb", - "type": "git_diff_line_cb", - "comment": "Callback for each line in diff; can be NULL" + "name": "result", + "type": "const git_describe_result *", + "comment": "the result from `git_describe_commit()` or\n `git_describe_workdir()`." }, { - "name": "payload", - "type": "void *", - "comment": "Payload passed to each callback function" + "name": "opts", + "type": "const git_describe_format_options *", + "comment": "the formatting options (or NULL for defaults)" } ], - "argline": "const git_blob *old_blob, const char *old_as_path, const git_blob *new_blob, const char *new_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", - "sig": "const git_blob *::const char *::const git_blob *::const char *::const git_diff_options *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", - "return": { - "type": "int", - "comment": " 0 on success, non-zero callback return value, or error code" - }, - "description": "

Directly run a diff on two blobs.

\n", - "comments": "

Compared to a file, a blob lacks some contextual information. As such, the git_diff_file given to the callback will have some fake data; i.e. mode will be 0 and path will be NULL.

\n\n

NULL is allowed for either old_blob or new_blob and will be treated as an empty blob, with the oid set to NULL in the git_diff_file data. Passing NULL for both blobs is a noop; no callbacks will be made at all.

\n\n

We do run a binary content check on the blob content and if either blob looks like binary data, the git_diff_delta binary attribute will be set to 1 and no call to the hunk_cb nor line_cb will be made (unless you pass GIT_DIFF_FORCE_TEXT of course).

\n", - "group": "diff" + "argline": "git_buf *out, const git_describe_result *result, const git_describe_format_options *opts", + "sig": "git_buf *::const git_describe_result *::const git_describe_format_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Print the describe result to a buffer

\n", + "comments": "", + "group": "describe", + "examples": { + "describe.c": ["ex/v1.9.1/describe.html#git_describe_format-5"] + } }, - "git_diff_blob_to_buffer": { + "git_describe_result_free": { "type": "function", - "file": "diff.h", - "line": 1152, - "lineto": 1163, + "file": "git2/describe.h", + "line": 201, + "lineto": 201, "args": [ { - "name": "old_blob", - "type": "const git_blob *", - "comment": "Blob for old side of diff, or NULL for empty blob" - }, - { - "name": "old_as_path", - "type": "const char *", - "comment": "Treat old blob as if it had this filename; can be NULL" - }, - { - "name": "buffer", - "type": "const char *", - "comment": "Raw data for new side of diff, or NULL for empty" - }, - { - "name": "buffer_len", - "type": "size_t", - "comment": "Length of raw data for new side of diff" - }, - { - "name": "buffer_as_path", - "type": "const char *", - "comment": "Treat buffer as if it had this filename; can be NULL" - }, - { - "name": "options", - "type": "const git_diff_options *", - "comment": "Options for diff, or NULL for default options" - }, - { - "name": "file_cb", - "type": "git_diff_file_cb", - "comment": "Callback for \"file\"; made once if there is a diff; can be NULL" - }, - { - "name": "binary_cb", - "type": "git_diff_binary_cb", - "comment": "Callback for binary files; can be NULL" - }, - { - "name": "hunk_cb", - "type": "git_diff_hunk_cb", - "comment": "Callback for each hunk in diff; can be NULL" - }, - { - "name": "line_cb", - "type": "git_diff_line_cb", - "comment": "Callback for each line in diff; can be NULL" - }, - { - "name": "payload", - "type": "void *", - "comment": "Payload passed to each callback function" + "name": "result", + "type": "git_describe_result *", + "comment": "The result to free." } ], - "argline": "const git_blob *old_blob, const char *old_as_path, const char *buffer, size_t buffer_len, const char *buffer_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", - "sig": "const git_blob *::const char *::const char *::size_t::const char *::const git_diff_options *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", - "return": { - "type": "int", - "comment": " 0 on success, non-zero callback return value, or error code" - }, - "description": "

Directly run a diff between a blob and a buffer.

\n", - "comments": "

As with git_diff_blobs, comparing a blob and buffer lacks some context, so the git_diff_file parameters to the callbacks will be faked a la the rules for git_diff_blobs().

\n\n

Passing NULL for old_blob will be treated as an empty blob (i.e. the file_cb will be invoked with GIT_DELTA_ADDED and the diff will be the entire content of the buffer added). Passing NULL to the buffer will do the reverse, with GIT_DELTA_REMOVED and blob content removed.

\n", - "group": "diff" + "argline": "git_describe_result *result", + "sig": "git_describe_result *", + "return": { "type": "void", "comment": null }, + "description": "

Free the describe result.

\n", + "comments": "", + "group": "describe" }, - "git_diff_buffers": { + "git_diff_options_init": { "type": "function", - "file": "diff.h", - "line": 1186, - "lineto": 1198, + "file": "git2/diff.h", + "line": 492, + "lineto": 494, "args": [ { - "name": "old_buffer", - "type": "const void *", - "comment": "Raw data for old side of diff, or NULL for empty" - }, - { - "name": "old_len", - "type": "size_t", - "comment": "Length of the raw data for old side of the diff" - }, - { - "name": "old_as_path", - "type": "const char *", - "comment": "Treat old buffer as if it had this filename; can be NULL" - }, - { - "name": "new_buffer", - "type": "const void *", - "comment": "Raw data for new side of diff, or NULL for empty" - }, - { - "name": "new_len", - "type": "size_t", - "comment": "Length of raw data for new side of diff" - }, - { - "name": "new_as_path", - "type": "const char *", - "comment": "Treat buffer as if it had this filename; can be NULL" - }, - { - "name": "options", - "type": "const git_diff_options *", - "comment": "Options for diff, or NULL for default options" - }, - { - "name": "file_cb", - "type": "git_diff_file_cb", - "comment": "Callback for \"file\"; made once if there is a diff; can be NULL" - }, - { - "name": "binary_cb", - "type": "git_diff_binary_cb", - "comment": "Callback for binary files; can be NULL" - }, - { - "name": "hunk_cb", - "type": "git_diff_hunk_cb", - "comment": "Callback for each hunk in diff; can be NULL" - }, - { - "name": "line_cb", - "type": "git_diff_line_cb", - "comment": "Callback for each line in diff; can be NULL" + "name": "opts", + "type": "git_diff_options *", + "comment": "The `git_diff_options` struct to initialize." }, { - "name": "payload", - "type": "void *", - "comment": "Payload passed to each callback function" + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_DIFF_OPTIONS_VERSION`." } ], - "argline": "const void *old_buffer, size_t old_len, const char *old_as_path, const void *new_buffer, size_t new_len, const char *new_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", - "sig": "const void *::size_t::const char *::const void *::size_t::const char *::const git_diff_options *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", + "argline": "git_diff_options *opts, unsigned int version", + "sig": "git_diff_options *::unsigned int", "return": { "type": "int", - "comment": " 0 on success, non-zero callback return value, or error code" + "comment": " Zero on success; -1 on failure." }, - "description": "

Directly run a diff between two buffers.

\n", - "comments": "

Even more than with git_diff_blobs, comparing two buffer lacks context, so the git_diff_file parameters to the callbacks will be faked a la the rules for git_diff_blobs().

\n", + "description": "

Initialize git_diff_options structure

\n", + "comments": "

Initializes a git_diff_options with default values. Equivalent to creating an instance with GIT_DIFF_OPTIONS_INIT.

\n", "group": "diff" }, - "git_diff_from_buffer": { + "git_diff_find_options_init": { "type": "function", - "file": "diff.h", - "line": 1219, - "lineto": 1222, + "file": "git2/diff.h", + "line": 846, + "lineto": 848, "args": [ { - "name": "out", - "type": "git_diff **", - "comment": "A pointer to a git_diff pointer that will be allocated." - }, - { - "name": "content", - "type": "const char *", - "comment": "The contents of a patch file" + "name": "opts", + "type": "git_diff_find_options *", + "comment": "The `git_diff_find_options` struct to initialize." }, { - "name": "content_len", - "type": "size_t", - "comment": "The length of the patch file contents" + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_DIFF_FIND_OPTIONS_VERSION`." } ], - "argline": "git_diff **out, const char *content, size_t content_len", - "sig": "git_diff **::const char *::size_t", + "argline": "git_diff_find_options *opts, unsigned int version", + "sig": "git_diff_find_options *::unsigned int", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " Zero on success; -1 on failure." }, - "description": "

Read the contents of a git patch file into a git_diff object.

\n", - "comments": "

The diff object produced is similar to the one that would be produced if you actually produced it computationally by comparing two trees, however there may be subtle differences. For example, a patch file likely contains abbreviated object IDs, so the object IDs in a git_diff_delta produced by this function will also be abbreviated.

\n\n

This function will only read patch files created by a git implementation, it will not read unified diffs produced by the diff program, nor any other types of patch files.

\n", + "description": "

Initialize git_diff_find_options structure

\n", + "comments": "

Initializes a git_diff_find_options with default values. Equivalent to creating an instance with GIT_DIFF_FIND_OPTIONS_INIT.

\n", "group": "diff" }, - "git_diff_get_stats": { + "git_diff_free": { "type": "function", - "file": "diff.h", - "line": 1258, - "lineto": 1260, + "file": "git2/diff.h", + "line": 862, + "lineto": 862, "args": [ - { - "name": "out", - "type": "git_diff_stats **", - "comment": "Structure containg the diff statistics." - }, { "name": "diff", "type": "git_diff *", - "comment": "A git_diff generated by one of the above functions." + "comment": "The previously created diff; cannot be used after free." } ], - "argline": "git_diff_stats **out, git_diff *diff", - "sig": "git_diff_stats **::git_diff *", - "return": { - "type": "int", - "comment": " 0 on success; non-zero on error" - }, - "description": "

Accumulate diff statistics for all patches.

\n", + "argline": "git_diff *diff", + "sig": "git_diff *", + "return": { "type": "void", "comment": null }, + "description": "

Deallocate a diff.

\n", "comments": "", "group": "diff", "examples": { - "diff.c": [ - "ex/HEAD/diff.html#git_diff_get_stats-10" + "diff.c": ["ex/v1.9.1/diff.html#git_diff_free-3"], + "log.c": [ + "ex/v1.9.1/log.html#git_diff_free-25", + "ex/v1.9.1/log.html#git_diff_free-26" ] } }, - "git_diff_stats_files_changed": { + "git_diff_tree_to_tree": { "type": "function", - "file": "diff.h", - "line": 1268, - "lineto": 1269, + "file": "git2/diff.h", + "line": 881, + "lineto": 886, "args": [ { - "name": "stats", - "type": "const git_diff_stats *", - "comment": "A `git_diff_stats` generated by one of the above functions." + "name": "diff", + "type": "git_diff **", + "comment": "Output pointer to a git_diff pointer to be allocated." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the trees." + }, + { + "name": "old_tree", + "type": "git_tree *", + "comment": "A git_tree object to diff from, or NULL for empty tree." + }, + { + "name": "new_tree", + "type": "git_tree *", + "comment": "A git_tree object to diff to, or NULL for empty tree." + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." } ], - "argline": "const git_diff_stats *stats", - "sig": "const git_diff_stats *", - "return": { - "type": "size_t", - "comment": " total number of files changed in the diff" - }, - "description": "

Get the total number of files changed in a diff

\n", - "comments": "", - "group": "diff" + "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, git_tree *new_tree, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_tree *::git_tree *::const git_diff_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create a diff with the difference between two tree objects.

\n", + "comments": "

This is equivalent to git diff <old-tree> <new-tree>

\n\n

The first tree will be used for the "old_file" side of the delta and the second tree will be used for the "new_file" side of the delta. You can pass NULL to indicate an empty tree, although it is an error to pass NULL for both the old_tree and new_tree.

\n", + "group": "diff", + "examples": { + "diff.c": ["ex/v1.9.1/diff.html#git_diff_tree_to_tree-4"], + "log.c": [ + "ex/v1.9.1/log.html#git_diff_tree_to_tree-27", + "ex/v1.9.1/log.html#git_diff_tree_to_tree-28" + ] + } }, - "git_diff_stats_insertions": { + "git_diff_tree_to_index": { "type": "function", - "file": "diff.h", - "line": 1277, - "lineto": 1278, + "file": "git2/diff.h", + "line": 908, + "lineto": 913, "args": [ { - "name": "stats", - "type": "const git_diff_stats *", - "comment": "A `git_diff_stats` generated by one of the above functions." - } - ], - "argline": "const git_diff_stats *stats", - "sig": "const git_diff_stats *", - "return": { - "type": "size_t", - "comment": " total number of insertions in the diff" - }, - "description": "

Get the total number of insertions in a diff

\n", - "comments": "", - "group": "diff" - }, - "git_diff_stats_deletions": { - "type": "function", - "file": "diff.h", - "line": 1286, - "lineto": 1287, - "args": [ + "name": "diff", + "type": "git_diff **", + "comment": "Output pointer to a git_diff pointer to be allocated." + }, { - "name": "stats", - "type": "const git_diff_stats *", - "comment": "A `git_diff_stats` generated by one of the above functions." + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the tree and index." + }, + { + "name": "old_tree", + "type": "git_tree *", + "comment": "A git_tree object to diff from, or NULL for empty tree." + }, + { + "name": "index", + "type": "git_index *", + "comment": "The index to diff with; repo index used if NULL." + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." } ], - "argline": "const git_diff_stats *stats", - "sig": "const git_diff_stats *", - "return": { - "type": "size_t", - "comment": " total number of deletions in the diff" - }, - "description": "

Get the total number of deletions in a diff

\n", - "comments": "", - "group": "diff" + "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, git_index *index, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_tree *::git_index *::const git_diff_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create a diff between a tree and repository index.

\n", + "comments": "

This is equivalent to git diff --cached <treeish> or if you pass the HEAD tree, then like git diff --cached.

\n\n

The tree you pass will be used for the "old_file" side of the delta, and the index will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo will be used. In this case, the index will be refreshed from disk (if it has changed) before the diff is generated.

\n", + "group": "diff", + "examples": { "diff.c": ["ex/v1.9.1/diff.html#git_diff_tree_to_index-5"] } }, - "git_diff_stats_to_buf": { + "git_diff_index_to_workdir": { "type": "function", - "file": "diff.h", - "line": 1298, - "lineto": 1302, + "file": "git2/diff.h", + "line": 936, + "lineto": 940, "args": [ { - "name": "out", - "type": "git_buf *", - "comment": "buffer to store the formatted diff statistics in." + "name": "diff", + "type": "git_diff **", + "comment": "Output pointer to a git_diff pointer to be allocated." }, { - "name": "stats", - "type": "const git_diff_stats *", - "comment": "A `git_diff_stats` generated by one of the above functions." + "name": "repo", + "type": "git_repository *", + "comment": "The repository." }, { - "name": "format", - "type": "git_diff_stats_format_t", - "comment": "Formatting option." + "name": "index", + "type": "git_index *", + "comment": "The index to diff from; repo index used if NULL." }, { - "name": "width", - "type": "size_t", - "comment": "Target width for output (only affects GIT_DIFF_STATS_FULL)" + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." } ], - "argline": "git_buf *out, const git_diff_stats *stats, git_diff_stats_format_t format, size_t width", - "sig": "git_buf *::const git_diff_stats *::git_diff_stats_format_t::size_t", - "return": { - "type": "int", - "comment": " 0 on success; non-zero on error" - }, - "description": "

Print diff statistics to a git_buf.

\n", - "comments": "", + "argline": "git_diff **diff, git_repository *repo, git_index *index, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_index *::const git_diff_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create a diff between the repository index and the workdir directory.

\n", + "comments": "

This matches the git diff command. See the note below on git_diff_tree_to_workdir for a discussion of the difference between git diff and git diff HEAD and how to emulate a git diff <treeish> using libgit2.

\n\n

The index will be used for the "old_file" side of the delta, and the working directory will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo will be used. In this case, the index will be refreshed from disk (if it has changed) before the diff is generated.

\n", "group": "diff", "examples": { - "diff.c": [ - "ex/HEAD/diff.html#git_diff_stats_to_buf-11" - ] + "diff.c": ["ex/v1.9.1/diff.html#git_diff_index_to_workdir-6"] } }, - "git_diff_stats_free": { + "git_diff_tree_to_workdir": { "type": "function", - "file": "diff.h", - "line": 1310, - "lineto": 1310, + "file": "git2/diff.h", + "line": 966, + "lineto": 970, "args": [ { - "name": "stats", - "type": "git_diff_stats *", - "comment": "The previously created statistics object;\n cannot be used after free." + "name": "diff", + "type": "git_diff **", + "comment": "A pointer to a git_diff pointer that will be allocated." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the tree." + }, + { + "name": "old_tree", + "type": "git_tree *", + "comment": "A git_tree object to diff from, or NULL for empty tree." + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." } ], - "argline": "git_diff_stats *stats", - "sig": "git_diff_stats *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Deallocate a git_diff_stats.

\n", - "comments": "", + "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_tree *::const git_diff_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create a diff between a tree and the working directory.

\n", + "comments": "

The tree you provide will be used for the "old_file" side of the delta, and the working directory will be used for the "new_file" side.

\n\n

This is not the same as git diff <treeish> or git diff-index <treeish>. Those commands use information from the index, whereas this function strictly returns the differences between the tree and the files in the working directory, regardless of the state of the index. Use git_diff_tree_to_workdir_with_index to emulate those commands.

\n\n

To see difference between this and git_diff_tree_to_workdir_with_index, consider the example of a staged file deletion where the file has then been put back into the working dir and further modified. The tree-to-workdir diff for that file is 'modified', but git diff would show status 'deleted' since there is a staged delete.

\n", "group": "diff", "examples": { - "diff.c": [ - "ex/HEAD/diff.html#git_diff_stats_free-12" - ] + "diff.c": ["ex/v1.9.1/diff.html#git_diff_tree_to_workdir-7"] } }, - "git_diff_format_email": { + "git_diff_tree_to_workdir_with_index": { "type": "function", - "file": "diff.h", - "line": 1362, - "lineto": 1365, + "file": "git2/diff.h", + "line": 986, + "lineto": 990, "args": [ { - "name": "out", - "type": "git_buf *", - "comment": "buffer to store the e-mail patch in" + "name": "diff", + "type": "git_diff **", + "comment": "A pointer to a git_diff pointer that will be allocated." }, { - "name": "diff", - "type": "git_diff *", - "comment": "containing the commit" + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the tree." + }, + { + "name": "old_tree", + "type": "git_tree *", + "comment": "A git_tree object to diff from, or NULL for empty tree." }, { "name": "opts", - "type": "const git_diff_format_email_options *", - "comment": "structure with options to influence content and formatting." + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." } ], - "argline": "git_buf *out, git_diff *diff, const git_diff_format_email_options *opts", - "sig": "git_buf *::git_diff *::const git_diff_format_email_options *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Create an e-mail ready patch from a diff.

\n", - "comments": "", - "group": "diff" + "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_tree *::const git_diff_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create a diff between a tree and the working directory using index data\n to account for staged deletes, tracked files, etc.

\n", + "comments": "

This emulates git diff <tree> by diffing the tree to the index and the index to the working directory and blending the results into a single diff that includes staged deleted, etc.

\n", + "group": "diff", + "examples": { + "diff.c": ["ex/v1.9.1/diff.html#git_diff_tree_to_workdir_with_index-8"] + } }, - "git_diff_commit_as_email": { + "git_diff_index_to_index": { "type": "function", - "file": "diff.h", - "line": 1381, - "lineto": 1388, + "file": "git2/diff.h", + "line": 1005, + "lineto": 1010, "args": [ { - "name": "out", - "type": "git_buf *", - "comment": "buffer to store the e-mail patch in" + "name": "diff", + "type": "git_diff **", + "comment": "Output pointer to a git_diff pointer to be allocated." }, { "name": "repo", "type": "git_repository *", - "comment": "containing the commit" - }, - { - "name": "commit", - "type": "git_commit *", - "comment": "pointer to up commit" - }, - { - "name": "patch_no", - "type": "size_t", - "comment": "patch number of the commit" + "comment": "The repository containing the indexes." }, { - "name": "total_patches", - "type": "size_t", - "comment": "total number of patches in the patch set" + "name": "old_index", + "type": "git_index *", + "comment": "A git_index object to diff from." }, { - "name": "flags", - "type": "git_diff_format_email_flags_t", - "comment": "determines the formatting of the e-mail" + "name": "new_index", + "type": "git_index *", + "comment": "A git_index object to diff to." }, { - "name": "diff_opts", + "name": "opts", "type": "const git_diff_options *", - "comment": "structure with options to influence diff or NULL for defaults." + "comment": "Structure with options to influence diff or NULL for defaults." } ], - "argline": "git_buf *out, git_repository *repo, git_commit *commit, size_t patch_no, size_t total_patches, git_diff_format_email_flags_t flags, const git_diff_options *diff_opts", - "sig": "git_buf *::git_repository *::git_commit *::size_t::size_t::git_diff_format_email_flags_t::const git_diff_options *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Create an e-mail ready patch for a commit.

\n", - "comments": "

Does not support creating patches for merge commits (yet).

\n", + "argline": "git_diff **diff, git_repository *repo, git_index *old_index, git_index *new_index, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_index *::git_index *::const git_diff_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create a diff with the difference between two index objects.

\n", + "comments": "

The first index will be used for the "old_file" side of the delta and the second index will be used for the "new_file" side of the delta.

\n", "group": "diff" }, - "git_diff_format_email_init_options": { + "git_diff_merge": { "type": "function", - "file": "diff.h", - "line": 1399, - "lineto": 1401, + "file": "git2/diff.h", + "line": 1026, + "lineto": 1028, "args": [ { - "name": "opts", - "type": "git_diff_format_email_options *", - "comment": "The `git_diff_format_email_options` struct to initialize" + "name": "onto", + "type": "git_diff *", + "comment": "Diff to merge into." }, { - "name": "version", - "type": "unsigned int", - "comment": "Version of struct; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`" + "name": "from", + "type": "const git_diff *", + "comment": "Diff to merge." } ], - "argline": "git_diff_format_email_options *opts, unsigned int version", - "sig": "git_diff_format_email_options *::unsigned int", - "return": { - "type": "int", - "comment": " Zero on success; -1 on failure." - }, - "description": "

Initializes a git_diff_format_email_options with default values.

\n", - "comments": "

Equivalent to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.

\n", + "argline": "git_diff *onto, const git_diff *from", + "sig": "git_diff *::const git_diff *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Merge one diff into another.

\n", + "comments": "

This merges items from the "from" list into the "onto" list. The resulting diff will have all items that appear in either list. If an item appears in both lists, then it will be "merged" to appear as if the old version was from the "onto" list and the new version is from the "from" list (with the exception that if the item has a pending DELETE in the middle, then it will show as deleted).

\n", "group": "diff" }, - "giterr_last": { - "type": "function", - "file": "errors.h", - "line": 111, - "lineto": 111, - "args": [], - "argline": "", - "sig": "", - "return": { - "type": "const git_error *", - "comment": " A git_error object." - }, - "description": "

Return the last git_error object that was generated for the\n current thread or NULL if no error has occurred.

\n", - "comments": "", - "group": "giterr", - "examples": { - "general.c": [ - "ex/HEAD/general.html#giterr_last-31" - ], - "network/clone.c": [ - "ex/HEAD/network/clone.html#giterr_last-2" - ], - "network/git2.c": [ - "ex/HEAD/network/git2.html#giterr_last-1", - "ex/HEAD/network/git2.html#giterr_last-2" - ] - } - }, - "giterr_clear": { - "type": "function", - "file": "errors.h", - "line": 116, - "lineto": 116, - "args": [], - "argline": "", - "sig": "", - "return": { - "type": "void", - "comment": null - }, - "description": "

Clear the last library error that occurred for this thread.

\n", - "comments": "", - "group": "giterr" - }, - "giterr_set_str": { + "git_diff_find_similar": { "type": "function", - "file": "errors.h", - "line": 134, - "lineto": 134, + "file": "git2/diff.h", + "line": 1042, + "lineto": 1044, "args": [ { - "name": "error_class", - "type": "int", - "comment": "One of the `git_error_t` enum above describing the\n general subsystem that is responsible for the error." + "name": "diff", + "type": "git_diff *", + "comment": "diff to run detection algorithms on" }, { - "name": "string", - "type": "const char *", - "comment": "The formatted error message to keep" + "name": "options", + "type": "const git_diff_find_options *", + "comment": "Control how detection should be run, NULL for defaults" } ], - "argline": "int error_class, const char *string", - "sig": "int::const char *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Set the error message string for this thread.

\n", - "comments": "

This function is public so that custom ODB backends and the like can relay an error message through libgit2. Most regular users of libgit2 will never need to call this function -- actually, calling it in most circumstances (for example, calling from within a callback function) will just end up having the value overwritten by libgit2 internals.

\n\n

This error message is stored in thread-local storage and only applies to the particular thread that this libgit2 call is made from.

\n", - "group": "giterr" + "argline": "git_diff *diff, const git_diff_find_options *options", + "sig": "git_diff *::const git_diff_find_options *", + "return": { "type": "int", "comment": " 0 on success, -1 on failure" }, + "description": "

Transform a diff marking file renames, copies, etc.

\n", + "comments": "

This modifies a diff in place, replacing old entries that look like renames or copies with new entries reflecting those changes. This also will, if requested, break modified files into add/remove pairs if the amount of change is above a threshold.

\n", + "group": "diff", + "examples": { "diff.c": ["ex/v1.9.1/diff.html#git_diff_find_similar-9"] } }, - "giterr_set_oom": { + "git_diff_num_deltas": { "type": "function", - "file": "errors.h", - "line": 145, - "lineto": 145, - "args": [], - "argline": "", - "sig": "", + "file": "git2/diff.h", + "line": 1062, + "lineto": 1062, + "args": [ + { + "name": "diff", + "type": "const git_diff *", + "comment": "A git_diff generated by one of the above functions" + } + ], + "argline": "const git_diff *diff", + "sig": "const git_diff *", "return": { - "type": "void", - "comment": null + "type": "size_t", + "comment": " Count of number of deltas in the list" }, - "description": "

Set the error message to a special value for memory allocation failure.

\n", - "comments": "

The normal giterr_set_str() function attempts to strdup() the string that is passed in. This is not a good idea when the error in question is a memory allocation failure. That circumstance has a special setter function that sets the error string to a known and statically allocated internal value.

\n", - "group": "giterr" + "description": "

Query how many diff records are there in a diff.

\n", + "comments": "", + "group": "diff", + "examples": { "log.c": ["ex/v1.9.1/log.html#git_diff_num_deltas-29"] } }, - "git_filter_list_load": { + "git_diff_num_deltas_of_type": { "type": "function", - "file": "filter.h", - "line": 90, - "lineto": 96, + "file": "git2/diff.h", + "line": 1075, + "lineto": 1076, "args": [ { - "name": "filters", - "type": "git_filter_list **", - "comment": "Output newly created git_filter_list (or NULL)" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "Repository object that contains `path`" - }, - { - "name": "blob", - "type": "git_blob *", - "comment": "The blob to which the filter will be applied (if known)" - }, - { - "name": "path", - "type": "const char *", - "comment": "Relative path of the file to be filtered" - }, - { - "name": "mode", - "type": "git_filter_mode_t", - "comment": "Filtering direction (WT->ODB or ODB->WT)" + "name": "diff", + "type": "const git_diff *", + "comment": "A git_diff generated by one of the above functions" }, { - "name": "flags", - "type": "uint32_t", - "comment": "Combination of `git_filter_flag_t` flags" + "name": "type", + "type": "git_delta_t", + "comment": "A git_delta_t value to filter the count" } ], - "argline": "git_filter_list **filters, git_repository *repo, git_blob *blob, const char *path, git_filter_mode_t mode, uint32_t flags", - "sig": "git_filter_list **::git_repository *::git_blob *::const char *::git_filter_mode_t::uint32_t", + "argline": "const git_diff *diff, git_delta_t type", + "sig": "const git_diff *::git_delta_t", "return": { - "type": "int", - "comment": " 0 on success (which could still return NULL if no filters are\n needed for the requested file), \n<\n0 on error" + "type": "size_t", + "comment": " Count of number of deltas matching delta_t type" }, - "description": "

Load the filter list for a given path.

\n", - "comments": "

This will return 0 (success) but set the output git_filter_list to NULL if no filters are requested for the given file.

\n", - "group": "filter" + "description": "

Query how many diff deltas are there in a diff filtered by type.

\n", + "comments": "

This works just like git_diff_num_deltas() with an extra parameter that is a git_delta_t and returns just the count of how many deltas match that particular type.

\n", + "group": "diff" }, - "git_filter_list_contains": { + "git_diff_get_delta": { "type": "function", - "file": "filter.h", - "line": 110, - "lineto": 112, + "file": "git2/diff.h", + "line": 1095, + "lineto": 1096, "args": [ { - "name": "filters", - "type": "git_filter_list *", - "comment": "A loaded git_filter_list (or NULL)" + "name": "diff", + "type": "const git_diff *", + "comment": "Diff list object" }, + { "name": "idx", "type": "size_t", "comment": "Index into diff list" } + ], + "argline": "const git_diff *diff, size_t idx", + "sig": "const git_diff *::size_t", + "return": { + "type": "const git_diff_delta *", + "comment": " Pointer to git_diff_delta (or NULL if `idx` out of range)" + }, + "description": "

Return the diff delta for an entry in the diff list.

\n", + "comments": "

The git_diff_delta pointer points to internal data and you do not have to release it when you are done with it. It will go away when the * git_diff (or any associated git_patch) goes away.

\n\n

Note that the flags on the delta related to whether it has binary content or not may not be set if there are no attributes set for the file and there has been no reason to load the file data at this point. For now, if you need those flags to be up to date, your only option is to either use git_diff_foreach or create a git_patch.

\n", + "group": "diff" + }, + "git_diff_is_sorted_icase": { + "type": "function", + "file": "git2/diff.h", + "line": 1104, + "lineto": 1104, + "args": [ { - "name": "name", - "type": "const char *", - "comment": "The name of the filter to query" + "name": "diff", + "type": "const git_diff *", + "comment": "diff to check" } ], - "argline": "git_filter_list *filters, const char *name", - "sig": "git_filter_list *::const char *", + "argline": "const git_diff *diff", + "sig": "const git_diff *", "return": { "type": "int", - "comment": " 1 if the filter is in the list, 0 otherwise" + "comment": " 0 if case sensitive, 1 if case is ignored" }, - "description": "

Query the filter list to see if a given filter (by name) will run.\n The built-in filters "crlf" and "ident" can be queried, otherwise this\n is the name of the filter specified by the filter attribute.

\n", - "comments": "

This will return 0 if the given filter is not in the list, or 1 if the filter will be applied.

\n", - "group": "filter" + "description": "

Check if deltas are sorted case sensitively or insensitively.

\n", + "comments": "", + "group": "diff" }, - "git_filter_list_apply_to_data": { + "git_diff_foreach": { "type": "function", - "file": "filter.h", - "line": 134, - "lineto": 137, + "file": "git2/diff.h", + "line": 1132, + "lineto": 1138, "args": [ { - "name": "out", - "type": "git_buf *", - "comment": "Buffer to store the result of the filtering" + "name": "diff", + "type": "git_diff *", + "comment": "A git_diff generated by one of the above functions." }, { - "name": "filters", - "type": "git_filter_list *", - "comment": "A loaded git_filter_list (or NULL)" + "name": "file_cb", + "type": "git_diff_file_cb", + "comment": "Callback function to make per file in the diff." }, { - "name": "in", - "type": "git_buf *", - "comment": "Buffer containing the data to filter" + "name": "binary_cb", + "type": "git_diff_binary_cb", + "comment": "Optional callback to make for binary files." + }, + { + "name": "hunk_cb", + "type": "git_diff_hunk_cb", + "comment": "Optional callback to make per hunk of text diff. This\n callback is called to describe a range of lines in the\n diff. It will not be issued for binary files." + }, + { + "name": "line_cb", + "type": "git_diff_line_cb", + "comment": "Optional callback to make per line of diff text. This\n same callback will be made for context lines, added, and\n removed lines, and even for a deleted trailing newline." + }, + { + "name": "payload", + "type": "void *", + "comment": "Reference pointer that will be passed to your callbacks." } ], - "argline": "git_buf *out, git_filter_list *filters, git_buf *in", - "sig": "git_buf *::git_filter_list *::git_buf *", + "argline": "git_diff *diff, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", + "sig": "git_diff *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", "return": { "type": "int", - "comment": " 0 on success, an error code otherwise" + "comment": " 0 on success, non-zero callback return value, or error code" }, - "description": "

Apply filter list to a data buffer.

\n", - "comments": "

See git2/buffer.h for background on git_buf objects.

\n\n

If the in buffer holds data allocated by libgit2 (i.e. in->asize is not zero), then it will be overwritten when applying the filters. If not, then it will be left untouched.

\n\n

If there are no filters to apply (or filters is NULL), then the out buffer will reference the in buffer data (with asize set to zero) instead of allocating data. This keeps allocations to a minimum, but it means you have to be careful about freeing the in data since out may be pointing to it!

\n", - "group": "filter" + "description": "

Loop over all deltas in a diff issuing callbacks.

\n", + "comments": "

This will iterate through all of the files described in a diff. You should provide a file callback to learn about each file.

\n\n

The "hunk" and "line" callbacks are optional, and the text diff of the files will only be calculated if they are not NULL. Of course, these callbacks will not be invoked for binary files on the diff or for files whose only changed is a file mode change.

\n\n

Returning a non-zero value from any of the callbacks will terminate the iteration and return the value to the user.

\n", + "group": "diff" }, - "git_filter_list_apply_to_file": { + "git_diff_status_char": { "type": "function", - "file": "filter.h", - "line": 148, - "lineto": 152, + "file": "git2/diff.h", + "line": 1151, + "lineto": 1151, "args": [ { - "name": "out", - "type": "git_buf *", - "comment": "buffer into which to store the filtered file" + "name": "status", + "type": "git_delta_t", + "comment": "The git_delta_t value to look up" + } + ], + "argline": "git_delta_t status", + "sig": "git_delta_t", + "return": { + "type": "char", + "comment": " The single character label for that code" + }, + "description": "

Look up the single character abbreviation for a delta status code.

\n", + "comments": "

When you run git diff --name-status it uses single letter codes in the output such as 'A' for added, 'D' for deleted, 'M' for modified, etc. This function converts a git_delta_t value into these letters for your own purposes. GIT_DELTA_UNTRACKED will return a space (i.e. ' ').

\n", + "group": "diff" + }, + "git_diff_print": { + "type": "function", + "file": "git2/diff.h", + "line": 1177, + "lineto": 1181, + "args": [ + { + "name": "diff", + "type": "git_diff *", + "comment": "A git_diff generated by one of the above functions." }, { - "name": "filters", - "type": "git_filter_list *", - "comment": "the list of filters to apply" + "name": "format", + "type": "git_diff_format_t", + "comment": "A git_diff_format_t value to pick the text format." }, { - "name": "repo", - "type": "git_repository *", - "comment": "the repository in which to perform the filtering" + "name": "print_cb", + "type": "git_diff_line_cb", + "comment": "Callback to make per line of diff text." }, { - "name": "path", - "type": "const char *", - "comment": "the path of the file to filter, a relative path will be\n taken as relative to the workdir" + "name": "payload", + "type": "void *", + "comment": "Reference pointer that will be passed to your callback." } ], - "argline": "git_buf *out, git_filter_list *filters, git_repository *repo, const char *path", - "sig": "git_buf *::git_filter_list *::git_repository *::const char *", + "argline": "git_diff *diff, git_diff_format_t format, git_diff_line_cb print_cb, void *payload", + "sig": "git_diff *::git_diff_format_t::git_diff_line_cb::void *", "return": { "type": "int", - "comment": null + "comment": " 0 on success, non-zero callback return value, or error code" }, - "description": "

Apply a filter list to the contents of a file on disk

\n", - "comments": "", - "group": "filter" + "description": "

Iterate over a diff generating formatted text output.

\n", + "comments": "

Returning a non-zero value from the callbacks will terminate the iteration and return the non-zero value to the caller.

\n", + "group": "diff", + "examples": { + "diff.c": ["ex/v1.9.1/diff.html#git_diff_print-10"], + "log.c": ["ex/v1.9.1/log.html#git_diff_print-30"] + } }, - "git_filter_list_apply_to_blob": { + "git_diff_to_buf": { "type": "function", - "file": "filter.h", - "line": 161, - "lineto": 164, + "file": "git2/diff.h", + "line": 1193, + "lineto": 1196, "args": [ { "name": "out", "type": "git_buf *", - "comment": "buffer into which to store the filtered file" + "comment": "A pointer to a user-allocated git_buf that will\n contain the diff text" }, { - "name": "filters", - "type": "git_filter_list *", - "comment": "the list of filters to apply" + "name": "diff", + "type": "git_diff *", + "comment": "A git_diff generated by one of the above functions." }, { - "name": "blob", - "type": "git_blob *", - "comment": "the blob to filter" - } + "name": "format", + "type": "git_diff_format_t", + "comment": "A git_diff_format_t value to pick the text format." + } ], - "argline": "git_buf *out, git_filter_list *filters, git_blob *blob", - "sig": "git_buf *::git_filter_list *::git_blob *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Apply a filter list to the contents of a blob

\n", + "argline": "git_buf *out, git_diff *diff, git_diff_format_t format", + "sig": "git_buf *::git_diff *::git_diff_format_t", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Produce the complete formatted text output from a diff into a\n buffer.

\n", "comments": "", - "group": "filter" + "group": "diff" }, - "git_filter_list_stream_data": { + "git_diff_blobs": { "type": "function", - "file": "filter.h", - "line": 173, - "lineto": 176, + "file": "git2/diff.h", + "line": 1232, + "lineto": 1242, "args": [ { - "name": "filters", - "type": "git_filter_list *", - "comment": "the list of filters to apply" + "name": "old_blob", + "type": "const git_blob *", + "comment": "Blob for old side of diff, or NULL for empty blob" }, { - "name": "data", - "type": "git_buf *", - "comment": "the buffer to filter" + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old blob as if it had this filename; can be NULL" }, { - "name": "target", - "type": "git_writestream *", - "comment": "the stream into which the data will be written" + "name": "new_blob", + "type": "const git_blob *", + "comment": "Blob for new side of diff, or NULL for empty blob" + }, + { + "name": "new_as_path", + "type": "const char *", + "comment": "Treat new blob as if it had this filename; can be NULL" + }, + { + "name": "options", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" + }, + { + "name": "file_cb", + "type": "git_diff_file_cb", + "comment": "Callback for \"file\"; made once if there is a diff; can be NULL" + }, + { + "name": "binary_cb", + "type": "git_diff_binary_cb", + "comment": "Callback for binary files; can be NULL" + }, + { + "name": "hunk_cb", + "type": "git_diff_hunk_cb", + "comment": "Callback for each hunk in diff; can be NULL" + }, + { + "name": "line_cb", + "type": "git_diff_line_cb", + "comment": "Callback for each line in diff; can be NULL" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to each callback function" } ], - "argline": "git_filter_list *filters, git_buf *data, git_writestream *target", - "sig": "git_filter_list *::git_buf *::git_writestream *", + "argline": "const git_blob *old_blob, const char *old_as_path, const git_blob *new_blob, const char *new_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", + "sig": "const git_blob *::const char *::const git_blob *::const char *::const git_diff_options *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", "return": { "type": "int", - "comment": null + "comment": " 0 on success, non-zero callback return value, or error code" }, - "description": "

Apply a filter list to an arbitrary buffer as a stream

\n", - "comments": "", - "group": "filter" + "description": "

Directly run a diff on two blobs.

\n", + "comments": "

Compared to a file, a blob lacks some contextual information. As such, the git_diff_file given to the callback will have some fake data; i.e. mode will be 0 and path will be NULL.

\n\n

NULL is allowed for either old_blob or new_blob and will be treated as an empty blob, with the oid set to NULL in the git_diff_file data. Passing NULL for both blobs is a noop; no callbacks will be made at all.

\n\n

We do run a binary content check on the blob content and if either blob looks like binary data, the git_diff_delta binary attribute will be set to 1 and no call to the hunk_cb nor line_cb will be made (unless you pass GIT_DIFF_FORCE_TEXT of course).

\n", + "group": "diff" }, - "git_filter_list_stream_file": { + "git_diff_blob_to_buffer": { "type": "function", - "file": "filter.h", - "line": 187, - "lineto": 191, + "file": "git2/diff.h", + "line": 1269, + "lineto": 1280, "args": [ { - "name": "filters", - "type": "git_filter_list *", - "comment": "the list of filters to apply" + "name": "old_blob", + "type": "const git_blob *", + "comment": "Blob for old side of diff, or NULL for empty blob" }, { - "name": "repo", - "type": "git_repository *", - "comment": "the repository in which to perform the filtering" + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old blob as if it had this filename; can be NULL" }, { - "name": "path", + "name": "buffer", "type": "const char *", - "comment": "the path of the file to filter, a relative path will be\n taken as relative to the workdir" + "comment": "Raw data for new side of diff, or NULL for empty" }, { - "name": "target", - "type": "git_writestream *", - "comment": "the stream into which the data will be written" + "name": "buffer_len", + "type": "size_t", + "comment": "Length of raw data for new side of diff" + }, + { + "name": "buffer_as_path", + "type": "const char *", + "comment": "Treat buffer as if it had this filename; can be NULL" + }, + { + "name": "options", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" + }, + { + "name": "file_cb", + "type": "git_diff_file_cb", + "comment": "Callback for \"file\"; made once if there is a diff; can be NULL" + }, + { + "name": "binary_cb", + "type": "git_diff_binary_cb", + "comment": "Callback for binary files; can be NULL" + }, + { + "name": "hunk_cb", + "type": "git_diff_hunk_cb", + "comment": "Callback for each hunk in diff; can be NULL" + }, + { + "name": "line_cb", + "type": "git_diff_line_cb", + "comment": "Callback for each line in diff; can be NULL" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to each callback function" } ], - "argline": "git_filter_list *filters, git_repository *repo, const char *path, git_writestream *target", - "sig": "git_filter_list *::git_repository *::const char *::git_writestream *", + "argline": "const git_blob *old_blob, const char *old_as_path, const char *buffer, size_t buffer_len, const char *buffer_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", + "sig": "const git_blob *::const char *::const char *::size_t::const char *::const git_diff_options *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", "return": { "type": "int", - "comment": null + "comment": " 0 on success, non-zero callback return value, or error code" }, - "description": "

Apply a filter list to a file as a stream

\n", - "comments": "", - "group": "filter" + "description": "

Directly run a diff between a blob and a buffer.

\n", + "comments": "

As with git_diff_blobs, comparing a blob and buffer lacks some context, so the git_diff_file parameters to the callbacks will be faked a la the rules for git_diff_blobs().

\n\n

Passing NULL for old_blob will be treated as an empty blob (i.e. the file_cb will be invoked with GIT_DELTA_ADDED and the diff will be the entire content of the buffer added). Passing NULL to the buffer will do the reverse, with GIT_DELTA_REMOVED and blob content removed.

\n", + "group": "diff" }, - "git_filter_list_stream_blob": { + "git_diff_buffers": { "type": "function", - "file": "filter.h", - "line": 200, - "lineto": 203, + "file": "git2/diff.h", + "line": 1303, + "lineto": 1315, "args": [ { - "name": "filters", - "type": "git_filter_list *", - "comment": "the list of filters to apply" + "name": "old_buffer", + "type": "const void *", + "comment": "Raw data for old side of diff, or NULL for empty" }, { - "name": "blob", - "type": "git_blob *", - "comment": "the blob to filter" + "name": "old_len", + "type": "size_t", + "comment": "Length of the raw data for old side of the diff" }, { - "name": "target", - "type": "git_writestream *", - "comment": "the stream into which the data will be written" + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old buffer as if it had this filename; can be NULL" + }, + { + "name": "new_buffer", + "type": "const void *", + "comment": "Raw data for new side of diff, or NULL for empty" + }, + { + "name": "new_len", + "type": "size_t", + "comment": "Length of raw data for new side of diff" + }, + { + "name": "new_as_path", + "type": "const char *", + "comment": "Treat buffer as if it had this filename; can be NULL" + }, + { + "name": "options", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" + }, + { + "name": "file_cb", + "type": "git_diff_file_cb", + "comment": "Callback for \"file\"; made once if there is a diff; can be NULL" + }, + { + "name": "binary_cb", + "type": "git_diff_binary_cb", + "comment": "Callback for binary files; can be NULL" + }, + { + "name": "hunk_cb", + "type": "git_diff_hunk_cb", + "comment": "Callback for each hunk in diff; can be NULL" + }, + { + "name": "line_cb", + "type": "git_diff_line_cb", + "comment": "Callback for each line in diff; can be NULL" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to each callback function" } ], - "argline": "git_filter_list *filters, git_blob *blob, git_writestream *target", - "sig": "git_filter_list *::git_blob *::git_writestream *", + "argline": "const void *old_buffer, size_t old_len, const char *old_as_path, const void *new_buffer, size_t new_len, const char *new_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", + "sig": "const void *::size_t::const char *::const void *::size_t::const char *::const git_diff_options *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", "return": { "type": "int", - "comment": null + "comment": " 0 on success, non-zero callback return value, or error code" }, - "description": "

Apply a filter list to a blob as a stream

\n", - "comments": "", - "group": "filter" + "description": "

Directly run a diff between two buffers.

\n", + "comments": "

Even more than with git_diff_blobs, comparing two buffer lacks context, so the git_diff_file parameters to the callbacks will be faked a la the rules for git_diff_blobs().

\n", + "group": "diff" }, - "git_filter_list_free": { + "git_diff_from_buffer": { "type": "function", - "file": "filter.h", - "line": 210, - "lineto": 210, + "file": "git2/diff.h", + "line": 1355, + "lineto": 1362, "args": [ { - "name": "filters", - "type": "git_filter_list *", - "comment": "A git_filter_list created by `git_filter_list_load`" + "name": "out", + "type": "git_diff **", + "comment": "A pointer to a git_diff pointer that will be allocated." + }, + { + "name": "content", + "type": "const char *", + "comment": "The contents of a patch file" + }, + { + "name": "content_len", + "type": "size_t", + "comment": "The length of the patch file contents" } ], - "argline": "git_filter_list *filters", - "sig": "git_filter_list *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Free a git_filter_list

\n", - "comments": "", - "group": "filter" - }, - "git_libgit2_init": { - "type": "function", - "file": "global.h", - "line": 26, - "lineto": 26, - "args": [], - "argline": "", - "sig": "", - "return": { - "type": "int", - "comment": " the number of initializations of the library, or an error code." - }, - "description": "

Init the global state

\n", - "comments": "

This function must the called before any other libgit2 function in order to set up global state and threading.

\n\n

This function may be called multiple times - it will return the number of times the initialization has been called (including this one) that have not subsequently been shutdown.

\n", - "group": "libgit2", - "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_libgit2_init-8" - ], - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_libgit2_init-10" - ], - "describe.c": [ - "ex/HEAD/describe.html#git_libgit2_init-4" - ], - "diff.c": [ - "ex/HEAD/diff.html#git_libgit2_init-13" - ], - "general.c": [ - "ex/HEAD/general.html#git_libgit2_init-32" - ], - "init.c": [ - "ex/HEAD/init.html#git_libgit2_init-2" - ], - "log.c": [ - "ex/HEAD/log.html#git_libgit2_init-30" - ], - "network/git2.c": [ - "ex/HEAD/network/git2.html#git_libgit2_init-3" - ], - "remote.c": [ - "ex/HEAD/remote.html#git_libgit2_init-2" - ], - "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_libgit2_init-1" - ], - "status.c": [ - "ex/HEAD/status.html#git_libgit2_init-1" - ], - "tag.c": [ - "ex/HEAD/tag.html#git_libgit2_init-3" - ] - } - }, - "git_libgit2_shutdown": { - "type": "function", - "file": "global.h", - "line": 39, - "lineto": 39, - "args": [], - "argline": "", - "sig": "", - "return": { - "type": "int", - "comment": " the number of remaining initializations of the library, or an\n error code." - }, - "description": "

Shutdown the global state

\n", - "comments": "

Clean up the global state and threading context after calling it as many times as git_libgit2_init() was called - it will return the number of remainining initializations that have not been shutdown (after this one).

\n", - "group": "libgit2", + "argline": "git_diff **out, const char *content, size_t content_len", + "sig": "git_diff **::const char *::size_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Read the contents of a git patch file into a git_diff object.

\n", + "comments": "

The diff object produced is similar to the one that would be produced if you actually produced it computationally by comparing two trees, however there may be subtle differences. For example, a patch file likely contains abbreviated object IDs, so the object IDs in a git_diff_delta produced by this function will also be abbreviated.

\n\n

This function will only read patch files created by a git implementation, it will not read unified diffs produced by the diff program, nor any other types of patch files.

\n", + "group": "diff", "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_libgit2_shutdown-9" - ], - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_libgit2_shutdown-11" - ], - "describe.c": [ - "ex/HEAD/describe.html#git_libgit2_shutdown-5" - ], "diff.c": [ - "ex/HEAD/diff.html#git_libgit2_shutdown-14" - ], - "init.c": [ - "ex/HEAD/init.html#git_libgit2_shutdown-3" - ], - "log.c": [ - "ex/HEAD/log.html#git_libgit2_shutdown-31" - ], - "network/git2.c": [ - "ex/HEAD/network/git2.html#git_libgit2_shutdown-4" - ], - "remote.c": [ - "ex/HEAD/remote.html#git_libgit2_shutdown-3" - ], - "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_libgit2_shutdown-2" - ], - "status.c": [ - "ex/HEAD/status.html#git_libgit2_shutdown-2" - ], - "tag.c": [ - "ex/HEAD/tag.html#git_libgit2_shutdown-4" + "ex/v1.9.1/diff.html#git_diff_from_buffer-11", + "ex/v1.9.1/diff.html#git_diff_from_buffer-12" ] } }, - "git_graph_ahead_behind": { + "git_diff_get_stats": { "type": "function", - "file": "graph.h", - "line": 37, - "lineto": 37, + "file": "git2/diff.h", + "line": 1398, + "lineto": 1400, "args": [ { - "name": "ahead", - "type": "size_t *", - "comment": "number of unique from commits in `upstream`" - }, - { - "name": "behind", - "type": "size_t *", - "comment": "number of unique from commits in `local`" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "the repository where the commits exist" - }, - { - "name": "local", - "type": "const git_oid *", - "comment": "the commit for local" + "name": "out", + "type": "git_diff_stats **", + "comment": "Structure containing the diff statistics." }, { - "name": "upstream", - "type": "const git_oid *", - "comment": "the commit for upstream" + "name": "diff", + "type": "git_diff *", + "comment": "A git_diff generated by one of the above functions." } ], - "argline": "size_t *ahead, size_t *behind, git_repository *repo, const git_oid *local, const git_oid *upstream", - "sig": "size_t *::size_t *::git_repository *::const git_oid *::const git_oid *", + "argline": "git_diff_stats **out, git_diff *diff", + "sig": "git_diff_stats **::git_diff *", "return": { "type": "int", - "comment": null + "comment": " 0 on success; non-zero on error" }, - "description": "

Count the number of unique commits between two commit objects

\n", - "comments": "

There is no need for branches containing the commits to have any upstream relationship, but it helps to think of one as a branch and the other as its upstream, the ahead and behind values will be what git would report for the branches.

\n", - "group": "graph" + "description": "

Accumulate diff statistics for all patches.

\n", + "comments": "", + "group": "diff", + "examples": { "diff.c": ["ex/v1.9.1/diff.html#git_diff_get_stats-13"] } }, - "git_graph_descendant_of": { + "git_diff_stats_files_changed": { "type": "function", - "file": "graph.h", - "line": 48, - "lineto": 51, + "file": "git2/diff.h", + "line": 1408, + "lineto": 1409, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": null - }, - { - "name": "commit", - "type": "const git_oid *", - "comment": "a previously loaded commit." - }, - { - "name": "ancestor", - "type": "const git_oid *", - "comment": "a potential ancestor commit." + "name": "stats", + "type": "const git_diff_stats *", + "comment": "A `git_diff_stats` generated by one of the above functions." } ], - "argline": "git_repository *repo, const git_oid *commit, const git_oid *ancestor", - "sig": "git_repository *::const git_oid *::const git_oid *", + "argline": "const git_diff_stats *stats", + "sig": "const git_diff_stats *", "return": { - "type": "int", - "comment": " 1 if the given commit is a descendant of the potential ancestor,\n 0 if not, error code otherwise." + "type": "size_t", + "comment": " total number of files changed in the diff" }, - "description": "

Determine if a commit is the descendant of another commit.

\n", + "description": "

Get the total number of files changed in a diff

\n", "comments": "", - "group": "graph" + "group": "diff" }, - "git_ignore_add_rule": { + "git_diff_stats_insertions": { "type": "function", - "file": "ignore.h", - "line": 37, - "lineto": 39, + "file": "git2/diff.h", + "line": 1417, + "lineto": 1418, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": "The repository to add ignore rules to." - }, - { - "name": "rules", - "type": "const char *", - "comment": "Text of rules, a la the contents of a .gitignore file.\n It is okay to have multiple rules in the text; if so,\n each rule should be terminated with a newline." + "name": "stats", + "type": "const git_diff_stats *", + "comment": "A `git_diff_stats` generated by one of the above functions." } ], - "argline": "git_repository *repo, const char *rules", - "sig": "git_repository *::const char *", + "argline": "const git_diff_stats *stats", + "sig": "const git_diff_stats *", "return": { - "type": "int", - "comment": " 0 on success" + "type": "size_t", + "comment": " total number of insertions in the diff" }, - "description": "

Add ignore rules for a repository.

\n", - "comments": "

Excludesfile rules (i.e. .gitignore rules) are generally read from .gitignore files in the repository tree or from a shared system file only if a "core.excludesfile" config value is set. The library also keeps a set of per-repository internal ignores that can be configured in-memory and will not persist. This function allows you to add to that internal rules list.

\n\n

Example usage:

\n\n
 error = git_ignore_add_rule(myrepo, "*.c/ with space");\n
\n\n

This would add three rules to the ignores.

\n", - "group": "ignore" + "description": "

Get the total number of insertions in a diff

\n", + "comments": "", + "group": "diff" }, - "git_ignore_clear_internal_rules": { + "git_diff_stats_deletions": { "type": "function", - "file": "ignore.h", - "line": 52, - "lineto": 53, + "file": "git2/diff.h", + "line": 1426, + "lineto": 1427, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": "The repository to remove ignore rules from." + "name": "stats", + "type": "const git_diff_stats *", + "comment": "A `git_diff_stats` generated by one of the above functions." } ], - "argline": "git_repository *repo", - "sig": "git_repository *", + "argline": "const git_diff_stats *stats", + "sig": "const git_diff_stats *", "return": { - "type": "int", - "comment": " 0 on success" + "type": "size_t", + "comment": " total number of deletions in the diff" }, - "description": "

Clear ignore rules that were explicitly added.

\n", - "comments": "

Resets to the default internal ignore rules. This will not turn off rules in .gitignore files that actually exist in the filesystem.

\n\n

The default internal ignores ignore ".", ".." and ".git" entries.

\n", - "group": "ignore" + "description": "

Get the total number of deletions in a diff

\n", + "comments": "", + "group": "diff" }, - "git_ignore_path_is_ignored": { + "git_diff_stats_to_buf": { "type": "function", - "file": "ignore.h", - "line": 71, - "lineto": 74, + "file": "git2/diff.h", + "line": 1438, + "lineto": 1442, "args": [ { - "name": "ignored", - "type": "int *", - "comment": "boolean returning 0 if the file is not ignored, 1 if it is" + "name": "out", + "type": "git_buf *", + "comment": "buffer to store the formatted diff statistics in." }, { - "name": "repo", - "type": "git_repository *", - "comment": "a repository object" + "name": "stats", + "type": "const git_diff_stats *", + "comment": "A `git_diff_stats` generated by one of the above functions." }, { - "name": "path", - "type": "const char *", - "comment": "the file to check ignores for, relative to the repo's workdir." + "name": "format", + "type": "git_diff_stats_format_t", + "comment": "Formatting option." + }, + { + "name": "width", + "type": "size_t", + "comment": "Target width for output (only affects GIT_DIFF_STATS_FULL)" } ], - "argline": "int *ignored, git_repository *repo, const char *path", - "sig": "int *::git_repository *::const char *", + "argline": "git_buf *out, const git_diff_stats *stats, git_diff_stats_format_t format, size_t width", + "sig": "git_buf *::const git_diff_stats *::git_diff_stats_format_t::size_t", "return": { "type": "int", - "comment": " 0 if ignore rules could be processed for the file (regardless\n of whether it exists or not), or an error \n<\n 0 if they could not." + "comment": " 0 on success; non-zero on error" }, - "description": "

Test if the ignore rules apply to a given path.

\n", - "comments": "

This function checks the ignore rules to see if they would apply to the given file. This indicates if the file would be ignored regardless of whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git add ." on the directory containing the file, would it be added or not?

\n", - "group": "ignore" + "description": "

Print diff statistics to a git_buf.

\n", + "comments": "", + "group": "diff", + "examples": { "diff.c": ["ex/v1.9.1/diff.html#git_diff_stats_to_buf-14"] } }, - "git_index_open": { + "git_diff_stats_free": { "type": "function", - "file": "index.h", - "line": 203, - "lineto": 203, + "file": "git2/diff.h", + "line": 1450, + "lineto": 1450, "args": [ { - "name": "out", - "type": "git_index **", - "comment": "the pointer for the new index" - }, - { - "name": "index_path", - "type": "const char *", - "comment": "the path to the index file in disk" + "name": "stats", + "type": "git_diff_stats *", + "comment": "The previously created statistics object;\n cannot be used after free." } ], - "argline": "git_index **out, const char *index_path", - "sig": "git_index **::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Create a new bare Git index object as a memory representation\n of the Git index file in 'index_path', without a repository\n to back it.

\n", - "comments": "

Since there is no ODB or working directory behind this index, any Index methods which rely on these (e.g. index_add_bypath) will fail with the GIT_ERROR error code.

\n\n

If you need to access the index of an actual repository, use the git_repository_index wrapper.

\n\n

The index must be freed once it's no longer in use.

\n", - "group": "index" + "argline": "git_diff_stats *stats", + "sig": "git_diff_stats *", + "return": { "type": "void", "comment": null }, + "description": "

Deallocate a git_diff_stats.

\n", + "comments": "", + "group": "diff", + "examples": { "diff.c": ["ex/v1.9.1/diff.html#git_diff_stats_free-15"] } }, - "git_index_new": { + "git_diff_patchid_options_init": { "type": "function", - "file": "index.h", - "line": 216, - "lineto": 216, + "file": "git2/diff.h", + "line": 1479, + "lineto": 1481, "args": [ { - "name": "out", - "type": "git_index **", - "comment": "the pointer for the new index" + "name": "opts", + "type": "git_diff_patchid_options *", + "comment": "The `git_diff_patchid_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_DIFF_PATCHID_OPTIONS_VERSION`." } ], - "argline": "git_index **out", - "sig": "git_index **", + "argline": "git_diff_patchid_options *opts, unsigned int version", + "sig": "git_diff_patchid_options *::unsigned int", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " Zero on success; -1 on failure." }, - "description": "

Create an in-memory index object.

\n", - "comments": "

This index object cannot be read/written to the filesystem, but may be used to perform in-memory index operations.

\n\n

The index must be freed once it's no longer in use.

\n", - "group": "index" + "description": "

Initialize git_diff_patchid_options structure

\n", + "comments": "

Initializes a git_diff_patchid_options with default values. Equivalent to creating an instance with GIT_DIFF_PATCHID_OPTIONS_INIT.

\n", + "group": "diff" }, - "git_index_free": { + "git_diff_patchid": { "type": "function", - "file": "index.h", - "line": 223, - "lineto": 223, + "file": "git2/diff.h", + "line": 1502, + "lineto": 1502, "args": [ { - "name": "index", - "type": "git_index *", - "comment": "an existing index object" + "name": "out", + "type": "git_oid *", + "comment": "Pointer where the calculated patch ID should be stored" + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "The diff to calculate the ID for" + }, + { + "name": "opts", + "type": "git_diff_patchid_options *", + "comment": "Options for how to calculate the patch ID. This is\n intended for future changes, as currently no options are\n available." } ], - "argline": "git_index *index", - "sig": "git_index *", + "argline": "git_oid *out, git_diff *diff, git_diff_patchid_options *opts", + "sig": "git_oid *::git_diff *::git_diff_patchid_options *", "return": { - "type": "void", - "comment": null + "type": "int", + "comment": " 0 on success, an error code otherwise." }, - "description": "

Free an existing index object.

\n", - "comments": "", - "group": "index", - "examples": { - "general.c": [ - "ex/HEAD/general.html#git_index_free-33" - ], - "init.c": [ - "ex/HEAD/init.html#git_index_free-4" - ] - } + "description": "

Calculate the patch ID for the given patch.

\n", + "comments": "

Calculate a stable patch ID for the given patch by summing the hash of the file diffs, ignoring whitespace and line numbers. This can be used to derive whether two diffs are the same with a high probability.

\n\n

Currently, this function only calculates stable patch IDs, as defined in git-patch-id(1), and should in fact generate the same IDs as the upstream git project does.

\n", + "group": "diff" }, - "git_index_owner": { + "git_email_create_from_commit": { "type": "function", - "file": "index.h", - "line": 231, - "lineto": 231, + "file": "git2/email.h", + "line": 99, + "lineto": 102, "args": [ { - "name": "index", - "type": "const git_index *", - "comment": "The index" + "name": "out", + "type": "git_buf *", + "comment": "buffer to store the e-mail patch in" + }, + { + "name": "commit", + "type": "git_commit *", + "comment": "commit to create a patch for" + }, + { + "name": "opts", + "type": "const git_email_create_options *", + "comment": "email creation options" } ], - "argline": "const git_index *index", - "sig": "const git_index *", - "return": { - "type": "git_repository *", - "comment": " A pointer to the repository" - }, - "description": "

Get the repository this index relates to

\n", + "argline": "git_buf *out, git_commit *commit, const git_email_create_options *opts", + "sig": "git_buf *::git_commit *::const git_email_create_options *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a diff for a commit in mbox format for sending via email.\n The commit must not be a merge commit.

\n", "comments": "", - "group": "index" + "group": "email" }, - "git_index_caps": { + "git_error_last": { "type": "function", - "file": "index.h", - "line": 239, - "lineto": 239, - "args": [ - { - "name": "index", - "type": "const git_index *", - "comment": "An existing index object" - } - ], - "argline": "const git_index *index", - "sig": "const git_index *", + "file": "git2/errors.h", + "line": 149, + "lineto": 149, + "args": [], + "argline": "", + "sig": "", "return": { - "type": "int", - "comment": " A combination of GIT_INDEXCAP values" + "type": "const git_error *", + "comment": " A pointer to a `git_error` object that describes the error." }, - "description": "

Read index capabilities flags.

\n", - "comments": "", - "group": "index" + "description": "

Return the last git_error object that was generated for the\n current thread.

\n", + "comments": "

This function will never return NULL.

\n\n

Callers should not rely on this to determine whether an error has occurred. For error checking, callers should examine the return codes of libgit2 functions.

\n\n

This call can only reliably report error messages when an error has occurred. (It may contain stale information if it is called after a different function that succeeds.)

\n\n

The memory for this object is managed by libgit2. It should not be freed.

\n", + "group": "error", + "examples": { + "checkout.c": [ + "ex/v1.9.1/checkout.html#git_error_last-11", + "ex/v1.9.1/checkout.html#git_error_last-12", + "ex/v1.9.1/checkout.html#git_error_last-13", + "ex/v1.9.1/checkout.html#git_error_last-14" + ], + "commit.c": ["ex/v1.9.1/commit.html#git_error_last-2"], + "config.c": [ + "ex/v1.9.1/config.html#git_error_last-6", + "ex/v1.9.1/config.html#git_error_last-7", + "ex/v1.9.1/config.html#git_error_last-8" + ], + "general.c": ["ex/v1.9.1/general.html#git_error_last-33"], + "merge.c": [ + "ex/v1.9.1/merge.html#git_error_last-8", + "ex/v1.9.1/merge.html#git_error_last-9" + ] + } }, - "git_index_set_caps": { + "git_filter_list_load": { "type": "function", - "file": "index.h", - "line": 252, - "lineto": 252, + "file": "git2/filter.h", + "line": 138, + "lineto": 144, "args": [ { - "name": "index", - "type": "git_index *", - "comment": "An existing index object" + "name": "filters", + "type": "git_filter_list **", + "comment": "Output newly created git_filter_list (or NULL)" }, { - "name": "caps", - "type": "int", - "comment": "A combination of GIT_INDEXCAP values" + "name": "repo", + "type": "git_repository *", + "comment": "Repository object that contains `path`" + }, + { + "name": "blob", + "type": "git_blob *", + "comment": "The blob to which the filter will be applied (if known)" + }, + { + "name": "path", + "type": "const char *", + "comment": "Relative path of the file to be filtered" + }, + { + "name": "mode", + "type": "git_filter_mode_t", + "comment": "Filtering direction (WT->ODB or ODB->WT)" + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Combination of `git_filter_flag_t` flags" } ], - "argline": "git_index *index, int caps", - "sig": "git_index *::int", + "argline": "git_filter_list **filters, git_repository *repo, git_blob *blob, const char *path, git_filter_mode_t mode, uint32_t flags", + "sig": "git_filter_list **::git_repository *::git_blob *::const char *::git_filter_mode_t::uint32_t", "return": { "type": "int", - "comment": " 0 on success, -1 on failure" + "comment": " 0 on success (which could still return NULL if no filters are\n needed for the requested file), \n<\n0 on error" }, - "description": "

Set index capabilities flags.

\n", - "comments": "

If you pass GIT_INDEXCAP_FROM_OWNER for the caps, then the capabilities will be read from the config of the owner object, looking at core.ignorecase, core.filemode, core.symlinks.

\n", - "group": "index" + "description": "

Load the filter list for a given path.

\n", + "comments": "

This will return 0 (success) but set the output git_filter_list to NULL if no filters are requested for the given file.

\n", + "group": "filter" }, - "git_index_version": { + "git_filter_list_load_ext": { "type": "function", - "file": "index.h", - "line": 264, - "lineto": 264, + "file": "git2/filter.h", + "line": 161, + "lineto": 167, "args": [ { - "name": "index", - "type": "git_index *", - "comment": "An existing index object" + "name": "filters", + "type": "git_filter_list **", + "comment": "Output newly created git_filter_list (or NULL)" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository object that contains `path`" + }, + { + "name": "blob", + "type": "git_blob *", + "comment": "The blob to which the filter will be applied (if known)" + }, + { + "name": "path", + "type": "const char *", + "comment": "Relative path of the file to be filtered" + }, + { + "name": "mode", + "type": "git_filter_mode_t", + "comment": "Filtering direction (WT->ODB or ODB->WT)" + }, + { + "name": "opts", + "type": "git_filter_options *", + "comment": "The `git_filter_options` to use when loading filters" } ], - "argline": "git_index *index", - "sig": "git_index *", + "argline": "git_filter_list **filters, git_repository *repo, git_blob *blob, const char *path, git_filter_mode_t mode, git_filter_options *opts", + "sig": "git_filter_list **::git_repository *::git_blob *::const char *::git_filter_mode_t::git_filter_options *", "return": { - "type": "unsigned int", - "comment": " the index version" + "type": "int", + "comment": " 0 on success (which could still return NULL if no filters are\n needed for the requested file), \n<\n0 on error" }, - "description": "

Get index on-disk version.

\n", - "comments": "

Valid return values are 2, 3, or 4. If 3 is returned, an index with version 2 may be written instead, if the extension data in version 3 is not necessary.

\n", - "group": "index" + "description": "

Load the filter list for a given path.

\n", + "comments": "

This will return 0 (success) but set the output git_filter_list to NULL if no filters are requested for the given file.

\n", + "group": "filter" }, - "git_index_set_version": { + "git_filter_list_contains": { "type": "function", - "file": "index.h", - "line": 277, - "lineto": 277, + "file": "git2/filter.h", + "line": 181, + "lineto": 183, "args": [ { - "name": "index", - "type": "git_index *", - "comment": "An existing index object" + "name": "filters", + "type": "git_filter_list *", + "comment": "A loaded git_filter_list (or NULL)" }, { - "name": "version", - "type": "unsigned int", - "comment": "The new version number" + "name": "name", + "type": "const char *", + "comment": "The name of the filter to query" } ], - "argline": "git_index *index, unsigned int version", - "sig": "git_index *::unsigned int", + "argline": "git_filter_list *filters, const char *name", + "sig": "git_filter_list *::const char *", "return": { "type": "int", - "comment": " 0 on success, -1 on failure" + "comment": " 1 if the filter is in the list, 0 otherwise" }, - "description": "

Set index on-disk version.

\n", - "comments": "

Valid values are 2, 3, or 4. If 2 is given, git_index_write may write an index with version 3 instead, if necessary to accurately represent the index.

\n", - "group": "index" + "description": "

Query the filter list to see if a given filter (by name) will run.\n The built-in filters "crlf" and "ident" can be queried, otherwise this\n is the name of the filter specified by the filter attribute.

\n", + "comments": "

This will return 0 if the given filter is not in the list, or 1 if the filter will be applied.

\n", + "group": "filter" }, - "git_index_read": { + "git_filter_list_apply_to_buffer": { "type": "function", - "file": "index.h", - "line": 296, - "lineto": 296, + "file": "git2/filter.h", + "line": 194, + "lineto": 198, "args": [ { - "name": "index", - "type": "git_index *", - "comment": "an existing index object" + "name": "out", + "type": "git_buf *", + "comment": "Buffer to store the result of the filtering" }, { - "name": "force", - "type": "int", - "comment": "if true, always reload, vs. only read if file has changed" + "name": "filters", + "type": "git_filter_list *", + "comment": "A loaded git_filter_list (or NULL)" + }, + { + "name": "in", + "type": "const char *", + "comment": "Buffer containing the data to filter" + }, + { + "name": "in_len", + "type": "size_t", + "comment": "The length of the input buffer" } ], - "argline": "git_index *index, int force", - "sig": "git_index *::int", + "argline": "git_buf *out, git_filter_list *filters, const char *in, size_t in_len", + "sig": "git_buf *::git_filter_list *::const char *::size_t", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, an error code otherwise" }, - "description": "

Update the contents of an existing index object in memory by reading\n from the hard disk.

\n", - "comments": "

If force is true, this performs a "hard" read that discards in-memory changes and always reloads the on-disk index data. If there is no on-disk version, the index will be cleared.

\n\n

If force is false, this does a "soft" read that reloads the index data from disk only if it has changed since the last time it was loaded. Purely in-memory index data will be untouched. Be aware: if there are changes on disk, unwritten in-memory changes are discarded.

\n", - "group": "index" + "description": "

Apply filter list to a data buffer.

\n", + "comments": "", + "group": "filter" }, - "git_index_write": { + "git_filter_list_apply_to_file": { "type": "function", - "file": "index.h", - "line": 305, - "lineto": 305, + "file": "git2/filter.h", + "line": 210, + "lineto": 214, "args": [ { - "name": "index", - "type": "git_index *", - "comment": "an existing index object" + "name": "out", + "type": "git_buf *", + "comment": "buffer into which to store the filtered file" + }, + { + "name": "filters", + "type": "git_filter_list *", + "comment": "the list of filters to apply" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to perform the filtering" + }, + { + "name": "path", + "type": "const char *", + "comment": "the path of the file to filter, a relative path will be\n taken as relative to the workdir" } ], - "argline": "git_index *index", - "sig": "git_index *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Write an existing index object from memory back to disk\n using an atomic file lock.

\n", + "argline": "git_buf *out, git_filter_list *filters, git_repository *repo, const char *path", + "sig": "git_buf *::git_filter_list *::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Apply a filter list to the contents of a file on disk

\n", "comments": "", - "group": "index" + "group": "filter" }, - "git_index_path": { + "git_filter_list_apply_to_blob": { "type": "function", - "file": "index.h", - "line": 313, - "lineto": 313, + "file": "git2/filter.h", + "line": 224, + "lineto": 227, "args": [ { - "name": "index", - "type": "const git_index *", - "comment": "an existing index object" + "name": "out", + "type": "git_buf *", + "comment": "buffer into which to store the filtered file" + }, + { + "name": "filters", + "type": "git_filter_list *", + "comment": "the list of filters to apply" + }, + { + "name": "blob", + "type": "git_blob *", + "comment": "the blob to filter" } ], - "argline": "const git_index *index", - "sig": "const git_index *", - "return": { - "type": "const char *", - "comment": " path to index file or NULL for in-memory index" - }, - "description": "

Get the full path to the index file on disk.

\n", + "argline": "git_buf *out, git_filter_list *filters, git_blob *blob", + "sig": "git_buf *::git_filter_list *::git_blob *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Apply a filter list to the contents of a blob

\n", "comments": "", - "group": "index" + "group": "filter" }, - "git_index_checksum": { + "git_filter_list_stream_buffer": { "type": "function", - "file": "index.h", - "line": 325, - "lineto": 325, + "file": "git2/filter.h", + "line": 238, + "lineto": 242, "args": [ { - "name": "index", - "type": "git_index *", - "comment": "an existing index object" - } - ], - "argline": "git_index *index", - "sig": "git_index *", - "return": { - "type": "const git_oid *", - "comment": " a pointer to the checksum of the index" - }, - "description": "

Get the checksum of the index

\n", - "comments": "

This checksum is the SHA-1 hash over the index file (except the last 20 bytes which are the checksum itself). In cases where the index does not exist on-disk, it will be zeroed out.

\n", - "group": "index" - }, - "git_index_read_tree": { - "type": "function", - "file": "index.h", - "line": 336, - "lineto": 336, - "args": [ + "name": "filters", + "type": "git_filter_list *", + "comment": "the list of filters to apply" + }, { - "name": "index", - "type": "git_index *", - "comment": "an existing index object" + "name": "buffer", + "type": "const char *", + "comment": "the buffer to filter" }, { - "name": "tree", - "type": "const git_tree *", - "comment": "tree to read" + "name": "len", + "type": "size_t", + "comment": "the size of the buffer" + }, + { + "name": "target", + "type": "git_writestream *", + "comment": "the stream into which the data will be written" } ], - "argline": "git_index *index, const git_tree *tree", - "sig": "git_index *::const git_tree *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Read a tree into the index file with stats

\n", - "comments": "

The current index contents will be replaced by the specified tree.

\n", - "group": "index" + "argline": "git_filter_list *filters, const char *buffer, size_t len, git_writestream *target", + "sig": "git_filter_list *::const char *::size_t::git_writestream *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Apply a filter list to an arbitrary buffer as a stream

\n", + "comments": "", + "group": "filter" }, - "git_index_write_tree": { + "git_filter_list_stream_file": { "type": "function", - "file": "index.h", - "line": 357, - "lineto": 357, + "file": "git2/filter.h", + "line": 254, + "lineto": 258, "args": [ { - "name": "out", - "type": "git_oid *", - "comment": "Pointer where to store the OID of the written tree" + "name": "filters", + "type": "git_filter_list *", + "comment": "the list of filters to apply" }, { - "name": "index", - "type": "git_index *", - "comment": "Index to write" + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to perform the filtering" + }, + { + "name": "path", + "type": "const char *", + "comment": "the path of the file to filter, a relative path will be\n taken as relative to the workdir" + }, + { + "name": "target", + "type": "git_writestream *", + "comment": "the stream into which the data will be written" } ], - "argline": "git_oid *out, git_index *index", - "sig": "git_oid *::git_index *", - "return": { - "type": "int", - "comment": " 0 on success, GIT_EUNMERGED when the index is not clean\n or an error code" - }, - "description": "

Write the index as a tree

\n", - "comments": "

This method will scan the index and write a representation of its current state back to disk; it recursively creates tree objects for each of the subtrees stored in the index, but only returns the OID of the root tree. This is the OID that can be used e.g. to create a commit.

\n\n

The index instance cannot be bare, and needs to be associated to an existing repository.

\n\n

The index must not contain any file in conflict.

\n", - "group": "index", - "examples": { - "init.c": [ - "ex/HEAD/init.html#git_index_write_tree-5" - ] - } + "argline": "git_filter_list *filters, git_repository *repo, const char *path, git_writestream *target", + "sig": "git_filter_list *::git_repository *::const char *::git_writestream *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Apply a filter list to a file as a stream

\n", + "comments": "", + "group": "filter" }, - "git_index_write_tree_to": { + "git_filter_list_stream_blob": { "type": "function", - "file": "index.h", - "line": 374, - "lineto": 374, + "file": "git2/filter.h", + "line": 268, + "lineto": 271, "args": [ { - "name": "out", - "type": "git_oid *", - "comment": "Pointer where to store OID of the the written tree" + "name": "filters", + "type": "git_filter_list *", + "comment": "the list of filters to apply" }, { - "name": "index", - "type": "git_index *", - "comment": "Index to write" + "name": "blob", + "type": "git_blob *", + "comment": "the blob to filter" }, { - "name": "repo", - "type": "git_repository *", - "comment": "Repository where to write the tree" + "name": "target", + "type": "git_writestream *", + "comment": "the stream into which the data will be written" } ], - "argline": "git_oid *out, git_index *index, git_repository *repo", - "sig": "git_oid *::git_index *::git_repository *", - "return": { - "type": "int", - "comment": " 0 on success, GIT_EUNMERGED when the index is not clean\n or an error code" - }, - "description": "

Write the index as a tree to the given repository

\n", - "comments": "

This method will do the same as git_index_write_tree, but letting the user choose the repository where the tree will be written.

\n\n

The index must not contain any file in conflict.

\n", - "group": "index" + "argline": "git_filter_list *filters, git_blob *blob, git_writestream *target", + "sig": "git_filter_list *::git_blob *::git_writestream *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Apply a filter list to a blob as a stream

\n", + "comments": "", + "group": "filter" }, - "git_index_entrycount": { + "git_filter_list_free": { "type": "function", - "file": "index.h", - "line": 393, - "lineto": 393, + "file": "git2/filter.h", + "line": 278, + "lineto": 278, "args": [ { - "name": "index", - "type": "const git_index *", - "comment": "an existing index object" + "name": "filters", + "type": "git_filter_list *", + "comment": "A git_filter_list created by `git_filter_list_load`" } ], - "argline": "const git_index *index", - "sig": "const git_index *", + "argline": "git_filter_list *filters", + "sig": "git_filter_list *", + "return": { "type": "void", "comment": null }, + "description": "

Free a git_filter_list

\n", + "comments": "", + "group": "filter" + }, + "git_libgit2_init": { + "type": "function", + "file": "git2/global.h", + "line": 32, + "lineto": 32, + "args": [], + "argline": "", + "sig": "", "return": { - "type": "size_t", - "comment": " integer of count of current entries" + "type": "int", + "comment": " the number of initializations of the library, or an error code." }, - "description": "

Get the count of entries currently in the index

\n", - "comments": "", - "group": "index", + "description": "

Init the global state

\n", + "comments": "

This function must be called before any other libgit2 function in order to set up global state and threading.

\n\n

This function may be called multiple times - it will return the number of times the initialization has been called (including this one) that have not subsequently been shutdown.

\n", + "group": "libgit2", "examples": { - "general.c": [ - "ex/HEAD/general.html#git_index_entrycount-34" - ] + "general.c": ["ex/v1.9.1/general.html#git_libgit2_init-34"] } }, - "git_index_clear": { + "git_libgit2_shutdown": { "type": "function", - "file": "index.h", - "line": 404, - "lineto": 404, - "args": [ - { - "name": "index", - "type": "git_index *", - "comment": "an existing index object" - } - ], - "argline": "git_index *index", - "sig": "git_index *", + "file": "git2/global.h", + "line": 45, + "lineto": 45, + "args": [], + "argline": "", + "sig": "", "return": { "type": "int", - "comment": " 0 on success, error code \n<\n 0 on failure" + "comment": " the number of remaining initializations of the library, or an\n error code." }, - "description": "

Clear the contents (all the entries) of an index object.

\n", - "comments": "

This clears the index object in memory; changes must be explicitly written to disk for them to take effect persistently.

\n", - "group": "index" + "description": "

Shutdown the global state

\n", + "comments": "

Clean up the global state and threading context after calling it as many times as git_libgit2_init() was called - it will return the number of remainining initializations that have not been shutdown (after this one).

\n", + "group": "libgit2" }, - "git_index_get_byindex": { + "git_graph_ahead_behind": { "type": "function", - "file": "index.h", - "line": 417, - "lineto": 418, + "file": "git2/graph.h", + "line": 38, + "lineto": 38, "args": [ { - "name": "index", - "type": "git_index *", - "comment": "an existing index object" + "name": "ahead", + "type": "size_t *", + "comment": "number of unique from commits in `upstream`" }, { - "name": "n", - "type": "size_t", - "comment": "the position of the entry" - } - ], - "argline": "git_index *index, size_t n", - "sig": "git_index *::size_t", - "return": { - "type": "const git_index_entry *", - "comment": " a pointer to the entry; NULL if out of bounds" - }, - "description": "

Get a pointer to one of the entries in the index

\n", - "comments": "

The entry is not modifiable and should not be freed. Because the git_index_entry struct is a publicly defined struct, you should be able to make your own permanent copy of the data if necessary.

\n", - "group": "index", - "examples": { - "general.c": [ - "ex/HEAD/general.html#git_index_get_byindex-35" - ] - } - }, - "git_index_get_bypath": { - "type": "function", - "file": "index.h", - "line": 432, - "lineto": 433, - "args": [ + "name": "behind", + "type": "size_t *", + "comment": "number of unique from commits in `local`" + }, { - "name": "index", - "type": "git_index *", - "comment": "an existing index object" + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" }, { - "name": "path", - "type": "const char *", - "comment": "path to search" + "name": "local", + "type": "const git_oid *", + "comment": "the commit for local" }, { - "name": "stage", - "type": "int", - "comment": "stage to search" + "name": "upstream", + "type": "const git_oid *", + "comment": "the commit for upstream" } ], - "argline": "git_index *index, const char *path, int stage", - "sig": "git_index *::const char *::int", - "return": { - "type": "const git_index_entry *", - "comment": " a pointer to the entry; NULL if it was not found" - }, - "description": "

Get a pointer to one of the entries in the index

\n", - "comments": "

The entry is not modifiable and should not be freed. Because the git_index_entry struct is a publicly defined struct, you should be able to make your own permanent copy of the data if necessary.

\n", - "group": "index" + "argline": "size_t *ahead, size_t *behind, git_repository *repo, const git_oid *local, const git_oid *upstream", + "sig": "size_t *::size_t *::git_repository *::const git_oid *::const git_oid *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Count the number of unique commits between two commit objects

\n", + "comments": "

There is no need for branches containing the commits to have any upstream relationship, but it helps to think of one as a branch and the other as its upstream, the ahead and behind values will be what git would report for the branches.

\n", + "group": "graph" }, - "git_index_remove": { + "git_graph_descendant_of": { "type": "function", - "file": "index.h", - "line": 443, - "lineto": 443, + "file": "git2/graph.h", + "line": 53, + "lineto": 56, "args": [ { - "name": "index", - "type": "git_index *", - "comment": "an existing index object" + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" }, { - "name": "path", - "type": "const char *", - "comment": "path to search" + "name": "commit", + "type": "const git_oid *", + "comment": "a previously loaded commit" }, { - "name": "stage", - "type": "int", - "comment": "stage to search" + "name": "ancestor", + "type": "const git_oid *", + "comment": "a potential ancestor commit" } ], - "argline": "git_index *index, const char *path, int stage", - "sig": "git_index *::const char *::int", + "argline": "git_repository *repo, const git_oid *commit, const git_oid *ancestor", + "sig": "git_repository *::const git_oid *::const git_oid *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 1 if the given commit is a descendant of the potential ancestor,\n 0 if not, error code otherwise." }, - "description": "

Remove an entry from the index

\n", - "comments": "", - "group": "index" + "description": "

Determine if a commit is the descendant of another commit.

\n", + "comments": "

Note that a commit is not considered a descendant of itself, in contrast to git merge-base --is-ancestor.

\n", + "group": "graph" }, - "git_index_remove_directory": { + "git_graph_reachable_from_any": { "type": "function", - "file": "index.h", - "line": 453, - "lineto": 454, + "file": "git2/graph.h", + "line": 69, + "lineto": 73, "args": [ { - "name": "index", - "type": "git_index *", - "comment": "an existing index object" + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" }, { - "name": "dir", - "type": "const char *", - "comment": "container directory path" + "name": "commit", + "type": "const git_oid *", + "comment": "a previously loaded commit" }, { - "name": "stage", - "type": "int", - "comment": "stage to search" + "name": "descendant_array", + "type": "const git_oid []", + "comment": "oids of the commits" + }, + { + "name": "length", + "type": "size_t", + "comment": "the number of commits in the provided `descendant_array`" } ], - "argline": "git_index *index, const char *dir, int stage", - "sig": "git_index *::const char *::int", + "argline": "git_repository *repo, const git_oid *commit, const git_oid [] descendant_array, size_t length", + "sig": "git_repository *::const git_oid *::const git_oid []::size_t", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 1 if the given commit is an ancestor of any of the given potential\n descendants, 0 if not, error code otherwise." }, - "description": "

Remove all entries from the index under a given directory

\n", + "description": "

Determine if a commit is reachable from any of a list of commits by\n following parent edges.

\n", "comments": "", - "group": "index" + "group": "graph" }, - "git_index_add": { + "git_ignore_add_rule": { "type": "function", - "file": "index.h", - "line": 470, - "lineto": 470, + "file": "git2/ignore.h", + "line": 46, + "lineto": 48, "args": [ { - "name": "index", - "type": "git_index *", - "comment": "an existing index object" + "name": "repo", + "type": "git_repository *", + "comment": "The repository to add ignore rules to." }, { - "name": "source_entry", - "type": "const git_index_entry *", - "comment": "new entry object" + "name": "rules", + "type": "const char *", + "comment": "Text of rules, the contents to add on a .gitignore file.\n It is okay to have multiple rules in the text; if so,\n each rule should be terminated with a newline." } ], - "argline": "git_index *index, const git_index_entry *source_entry", - "sig": "git_index *::const git_index_entry *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Add or update an index entry from an in-memory struct

\n", - "comments": "

If a previous index entry exists that has the same path and stage as the given 'source_entry', it will be replaced. Otherwise, the 'source_entry' will be added.

\n\n

A full copy (including the 'path' string) of the given 'source_entry' will be inserted on the index.

\n", - "group": "index" + "argline": "git_repository *repo, const char *rules", + "sig": "git_repository *::const char *", + "return": { "type": "int", "comment": " 0 on success" }, + "description": "

Add ignore rules for a repository.

\n", + "comments": "

Excludesfile rules (i.e. .gitignore rules) are generally read from .gitignore files in the repository tree or from a shared system file only if a "core.excludesfile" config value is set. The library also keeps a set of per-repository internal ignores that can be configured in-memory and will not persist. This function allows you to add to that internal rules list.

\n\n

Example usage:

\n\n
 error = git_ignore_add_rule(myrepo, "*.c/ with space");\n
\n\n

This would add three rules to the ignores.

\n", + "group": "ignore" }, - "git_index_entry_stage": { + "git_ignore_clear_internal_rules": { "type": "function", - "file": "index.h", - "line": 482, - "lineto": 482, + "file": "git2/ignore.h", + "line": 61, + "lineto": 62, "args": [ { - "name": "entry", - "type": "const git_index_entry *", - "comment": "The entry" + "name": "repo", + "type": "git_repository *", + "comment": "The repository to remove ignore rules from." } ], - "argline": "const git_index_entry *entry", - "sig": "const git_index_entry *", - "return": { - "type": "int", - "comment": " the stage number" - }, - "description": "

Return the stage number from a git index entry

\n", - "comments": "

This entry is calculated from the entry's flag attribute like this:

\n\n
(entry->flags & GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT\n
\n", - "group": "index" + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { "type": "int", "comment": " 0 on success" }, + "description": "

Clear ignore rules that were explicitly added.

\n", + "comments": "

Resets to the default internal ignore rules. This will not turn off rules in .gitignore files that actually exist in the filesystem.

\n\n

The default internal ignores ignore ".", ".." and ".git" entries.

\n", + "group": "ignore" }, - "git_index_entry_is_conflict": { + "git_ignore_path_is_ignored": { "type": "function", - "file": "index.h", - "line": 491, - "lineto": 491, + "file": "git2/ignore.h", + "line": 80, + "lineto": 83, "args": [ { - "name": "entry", - "type": "const git_index_entry *", - "comment": "The entry" + "name": "ignored", + "type": "int *", + "comment": "boolean returning 0 if the file is not ignored, 1 if it is" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "a repository object" + }, + { + "name": "path", + "type": "const char *", + "comment": "the file to check ignores for, relative to the repo's workdir." } ], - "argline": "const git_index_entry *entry", - "sig": "const git_index_entry *", + "argline": "int *ignored, git_repository *repo, const char *path", + "sig": "int *::git_repository *::const char *", "return": { "type": "int", - "comment": " 1 if the entry is a conflict entry, 0 otherwise" + "comment": " 0 if ignore rules could be processed for the file (regardless\n of whether it exists or not), or an error \n<\n 0 if they could not." }, - "description": "

Return whether the given index entry is a conflict (has a high stage\n entry). This is simply shorthand for git_index_entry_stage > 0.

\n", - "comments": "", - "group": "index" + "description": "

Test if the ignore rules apply to a given path.

\n", + "comments": "

This function checks the ignore rules to see if they would apply to the given file. This indicates if the file would be ignored regardless of whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git check-ignore --no-index" on the given file, would it be shown or not?

\n", + "group": "ignore" }, - "git_index_add_bypath": { + "git_index_open": { "type": "function", - "file": "index.h", - "line": 522, - "lineto": 522, + "file": "git2/index.h", + "line": 278, + "lineto": 278, "args": [ { - "name": "index", - "type": "git_index *", - "comment": "an existing index object" + "name": "index_out", + "type": "git_index **", + "comment": "the pointer for the new index" }, { - "name": "path", + "name": "index_path", "type": "const char *", - "comment": "filename to add" + "comment": "the path to the index file in disk" } ], - "argline": "git_index *index, const char *path", - "sig": "git_index *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Add or update an index entry from a file on disk

\n", - "comments": "

The file path must be relative to the repository's working folder and must be readable.

\n\n

This method will fail in bare index instances.

\n\n

This forces the file to be added to the index, not looking at gitignore rules. Those rules can be evaluated through the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this file will no longer be marked as conflicting. The data about the conflict will be moved to the "resolve undo" (REUC) section.

\n", + "argline": "git_index **index_out, const char *index_path", + "sig": "git_index **::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a new bare Git index object as a memory representation\n of the Git index file in 'index_path', without a repository\n to back it.

\n", + "comments": "

Since there is no ODB or working directory behind this index, any Index methods which rely on these (e.g. index_add_bypath) will fail with the GIT_ERROR error code.

\n\n

If you need to access the index of an actual repository, use the git_repository_index wrapper.

\n\n

The index must be freed once it's no longer in use.

\n", "group": "index" }, - "git_index_add_frombuffer": { + "git_index_new": { "type": "function", - "file": "index.h", - "line": 551, - "lineto": 554, + "file": "git2/index.h", + "line": 291, + "lineto": 291, + "args": [ + { + "name": "index_out", + "type": "git_index **", + "comment": "the pointer for the new index" + } + ], + "argline": "git_index **index_out", + "sig": "git_index **", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create an in-memory index object.

\n", + "comments": "

This index object cannot be read/written to the filesystem, but may be used to perform in-memory index operations.

\n\n

The index must be freed once it's no longer in use.

\n", + "group": "index" + }, + "git_index_free": { + "type": "function", + "file": "git2/index.h", + "line": 300, + "lineto": 300, "args": [ { "name": "index", "type": "git_index *", "comment": "an existing index object" - }, - { - "name": "entry", - "type": "const git_index_entry *", - "comment": "filename to add" - }, - { - "name": "buffer", - "type": "const void *", - "comment": "data to be written into the blob" - }, - { - "name": "len", - "type": "size_t", - "comment": "length of the data" } ], - "argline": "git_index *index, const git_index_entry *entry, const void *buffer, size_t len", - "sig": "git_index *::const git_index_entry *::const void *::size_t", + "argline": "git_index *index", + "sig": "git_index *", + "return": { "type": "void", "comment": null }, + "description": "

Free an existing index object.

\n", + "comments": "", + "group": "index", + "examples": { + "add.c": ["ex/v1.9.1/add.html#git_index_free-1"], + "commit.c": ["ex/v1.9.1/commit.html#git_index_free-3"], + "general.c": ["ex/v1.9.1/general.html#git_index_free-35"], + "init.c": ["ex/v1.9.1/init.html#git_index_free-2"], + "ls-files.c": ["ex/v1.9.1/ls-files.html#git_index_free-1"] + } + }, + "git_index_owner": { + "type": "function", + "file": "git2/index.h", + "line": 308, + "lineto": 308, + "args": [ + { "name": "index", "type": "const git_index *", "comment": "The index" } + ], + "argline": "const git_index *index", + "sig": "const git_index *", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "git_repository *", + "comment": " A pointer to the repository" }, - "description": "

Add or update an index entry from a buffer in memory

\n", - "comments": "

This method will create a blob in the repository that owns the index and then add the index entry to the index. The path of the entry represents the position of the blob relative to the repository's root folder.

\n\n

If a previous index entry exists that has the same path as the given 'entry', it will be replaced. Otherwise, the 'entry' will be added. The id and the file_size of the 'entry' are updated with the real value of the blob.

\n\n

This forces the file to be added to the index, not looking at gitignore rules. Those rules can be evaluated through the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this file will no longer be marked as conflicting. The data about the conflict will be moved to the "resolve undo" (REUC) section.

\n", + "description": "

Get the repository this index relates to

\n", + "comments": "", "group": "index" }, - "git_index_remove_bypath": { + "git_index_caps": { "type": "function", - "file": "index.h", - "line": 570, - "lineto": 570, + "file": "git2/index.h", + "line": 316, + "lineto": 316, "args": [ { "name": "index", - "type": "git_index *", - "comment": "an existing index object" - }, - { - "name": "path", - "type": "const char *", - "comment": "filename to remove" + "type": "const git_index *", + "comment": "An existing index object" } ], - "argline": "git_index *index, const char *path", - "sig": "git_index *::const char *", + "argline": "const git_index *index", + "sig": "const git_index *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " A combination of GIT_INDEX_CAPABILITY values" }, - "description": "

Remove an index entry corresponding to a file on disk

\n", - "comments": "

The file path must be relative to the repository's working folder. It may exist.

\n\n

If this file currently is the result of a merge conflict, this file will no longer be marked as conflicting. The data about the conflict will be moved to the "resolve undo" (REUC) section.

\n", + "description": "

Read index capabilities flags.

\n", + "comments": "", "group": "index" }, - "git_index_add_all": { + "git_index_set_caps": { "type": "function", - "file": "index.h", - "line": 617, - "lineto": 622, + "file": "git2/index.h", + "line": 329, + "lineto": 329, "args": [ { "name": "index", "type": "git_index *", - "comment": "an existing index object" - }, - { - "name": "pathspec", - "type": "const git_strarray *", - "comment": "array of path patterns" - }, - { - "name": "flags", - "type": "unsigned int", - "comment": "combination of git_index_add_option_t flags" - }, - { - "name": "callback", - "type": "git_index_matched_path_cb", - "comment": "notification callback for each added/updated path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan." + "comment": "An existing index object" }, { - "name": "payload", - "type": "void *", - "comment": "payload passed through to callback function" + "name": "caps", + "type": "int", + "comment": "A combination of GIT_INDEX_CAPABILITY values" } ], - "argline": "git_index *index, const git_strarray *pathspec, unsigned int flags, git_index_matched_path_cb callback, void *payload", - "sig": "git_index *::const git_strarray *::unsigned int::git_index_matched_path_cb::void *", - "return": { - "type": "int", - "comment": " 0 on success, negative callback return value, or error code" - }, - "description": "

Add or update index entries matching files in the working directory.

\n", - "comments": "

This method will fail in bare index instances.

\n\n

The pathspec is a list of file names or shell glob patterns that will matched against files in the repository's working directory. Each file that matches will be added to the index (either updating an existing entry or adding a new entry). You can disable glob expansion and force exact matching with the GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH flag.

\n\n

Files that are ignored will be skipped (unlike git_index_add_bypath). If a file is already tracked in the index, then it will be updated even if it is ignored. Pass the GIT_INDEX_ADD_FORCE flag to skip the checking of ignore rules.

\n\n

To emulate git add -A and generate an error if the pathspec contains the exact path of an ignored file (when not using FORCE), add the GIT_INDEX_ADD_CHECK_PATHSPEC flag. This checks that each entry in the pathspec that is an exact match to a filename on disk is either not ignored or already in the index. If this check fails, the function will return GIT_EINVALIDSPEC.

\n\n

To emulate git add -A with the "dry-run" option, just use a callback function that always returns a positive value. See below for details.

\n\n

If any files are currently the result of a merge conflict, those files will no longer be marked as conflicting. The data about the conflicts will be moved to the "resolve undo" (REUC) section.

\n\n

If you provide a callback function, it will be invoked on each matching item in the working directory immediately before it is added to / updated in the index. Returning zero will add the item to the index, greater than zero will skip the item, and less than zero will abort the scan and return that value to the caller.

\n", + "argline": "git_index *index, int caps", + "sig": "git_index *::int", + "return": { "type": "int", "comment": " 0 on success, -1 on failure" }, + "description": "

Set index capabilities flags.

\n", + "comments": "

If you pass GIT_INDEX_CAPABILITY_FROM_OWNER for the caps, then capabilities will be read from the config of the owner object, looking at core.ignorecase, core.filemode, core.symlinks.

\n", "group": "index" }, - "git_index_remove_all": { + "git_index_version": { "type": "function", - "file": "index.h", - "line": 639, - "lineto": 643, + "file": "git2/index.h", + "line": 341, + "lineto": 341, "args": [ { "name": "index", "type": "git_index *", "comment": "An existing index object" - }, - { - "name": "pathspec", - "type": "const git_strarray *", - "comment": "array of path patterns" - }, - { - "name": "callback", - "type": "git_index_matched_path_cb", - "comment": "notification callback for each removed path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan." - }, - { - "name": "payload", - "type": "void *", - "comment": "payload passed through to callback function" } ], - "argline": "git_index *index, const git_strarray *pathspec, git_index_matched_path_cb callback, void *payload", - "sig": "git_index *::const git_strarray *::git_index_matched_path_cb::void *", - "return": { - "type": "int", - "comment": " 0 on success, negative callback return value, or error code" - }, - "description": "

Remove all matching index entries.

\n", - "comments": "

If you provide a callback function, it will be invoked on each matching item in the index immediately before it is removed. Return 0 to remove the item, > 0 to skip the item, and < 0 to abort the scan.

\n", + "argline": "git_index *index", + "sig": "git_index *", + "return": { "type": "unsigned int", "comment": " the index version" }, + "description": "

Get index on-disk version.

\n", + "comments": "

Valid return values are 2, 3, or 4. If 3 is returned, an index with version 2 may be written instead, if the extension data in version 3 is not necessary.

\n", "group": "index" }, - "git_index_update_all": { + "git_index_set_version": { "type": "function", - "file": "index.h", - "line": 668, - "lineto": 672, + "file": "git2/index.h", + "line": 354, + "lineto": 354, "args": [ { "name": "index", @@ -8405,6289 +8740,6368 @@ "comment": "An existing index object" }, { - "name": "pathspec", - "type": "const git_strarray *", - "comment": "array of path patterns" - }, - { - "name": "callback", - "type": "git_index_matched_path_cb", - "comment": "notification callback for each updated path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan." - }, - { - "name": "payload", - "type": "void *", - "comment": "payload passed through to callback function" + "name": "version", + "type": "unsigned int", + "comment": "The new version number" } ], - "argline": "git_index *index, const git_strarray *pathspec, git_index_matched_path_cb callback, void *payload", - "sig": "git_index *::const git_strarray *::git_index_matched_path_cb::void *", - "return": { - "type": "int", - "comment": " 0 on success, negative callback return value, or error code" - }, - "description": "

Update all index entries to match the working directory

\n", - "comments": "

This method will fail in bare index instances.

\n\n

This scans the existing index entries and synchronizes them with the working directory, deleting them if the corresponding working directory file no longer exists otherwise updating the information (including adding the latest version of file to the ODB if needed).

\n\n

If you provide a callback function, it will be invoked on each matching item in the index immediately before it is updated (either refreshed or removed depending on working directory state). Return 0 to proceed with updating the item, > 0 to skip the item, and < 0 to abort the scan.

\n", + "argline": "git_index *index, unsigned int version", + "sig": "git_index *::unsigned int", + "return": { "type": "int", "comment": " 0 on success, -1 on failure" }, + "description": "

Set index on-disk version.

\n", + "comments": "

Valid values are 2, 3, or 4. If 2 is given, git_index_write may write an index with version 3 instead, if necessary to accurately represent the index.

\n", "group": "index" }, - "git_index_find": { + "git_index_read": { "type": "function", - "file": "index.h", - "line": 683, - "lineto": 683, + "file": "git2/index.h", + "line": 373, + "lineto": 373, "args": [ - { - "name": "at_pos", - "type": "size_t *", - "comment": "the address to which the position of the index entry is written (optional)" - }, { "name": "index", "type": "git_index *", "comment": "an existing index object" }, { - "name": "path", - "type": "const char *", - "comment": "path to search" + "name": "force", + "type": "int", + "comment": "if true, always reload, vs. only read if file has changed" } ], - "argline": "size_t *at_pos, git_index *index, const char *path", - "sig": "size_t *::git_index *::const char *", - "return": { - "type": "int", - "comment": " a zero-based position in the index if found; GIT_ENOTFOUND otherwise" - }, - "description": "

Find the first position of any entries which point to given\n path in the Git index.

\n", - "comments": "", + "argline": "git_index *index, int force", + "sig": "git_index *::int", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Update the contents of an existing index object in memory by reading\n from the hard disk.

\n", + "comments": "

If force is true, this performs a "hard" read that discards in-memory changes and always reloads the on-disk index data. If there is no on-disk version, the index will be cleared.

\n\n

If force is false, this does a "soft" read that reloads the index data from disk only if it has changed since the last time it was loaded. Purely in-memory index data will be untouched. Be aware: if there are changes on disk, unwritten in-memory changes are discarded.

\n", "group": "index" }, - "git_index_find_prefix": { + "git_index_write": { "type": "function", - "file": "index.h", - "line": 694, - "lineto": 694, + "file": "git2/index.h", + "line": 382, + "lineto": 382, "args": [ - { - "name": "at_pos", - "type": "size_t *", - "comment": "the address to which the position of the index entry is written (optional)" - }, { "name": "index", "type": "git_index *", "comment": "an existing index object" - }, + } + ], + "argline": "git_index *index", + "sig": "git_index *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Write an existing index object from memory back to disk\n using an atomic file lock.

\n", + "comments": "", + "group": "index", + "examples": { + "add.c": ["ex/v1.9.1/add.html#git_index_write-2"], + "commit.c": ["ex/v1.9.1/commit.html#git_index_write-4"] + } + }, + "git_index_path": { + "type": "function", + "file": "git2/index.h", + "line": 390, + "lineto": 390, + "args": [ { - "name": "prefix", - "type": "const char *", - "comment": "the prefix to search for" + "name": "index", + "type": "const git_index *", + "comment": "an existing index object" } ], - "argline": "size_t *at_pos, git_index *index, const char *prefix", - "sig": "size_t *::git_index *::const char *", + "argline": "const git_index *index", + "sig": "const git_index *", "return": { - "type": "int", - "comment": " 0 with valid value in at_pos; an error code otherwise" + "type": "const char *", + "comment": " path to index file or NULL for in-memory index" }, - "description": "

Find the first position of any entries matching a prefix. To find the first position\n of a path inside a given folder, suffix the prefix with a '/'.

\n", + "description": "

Get the full path to the index file on disk.

\n", "comments": "", "group": "index" }, - "git_index_conflict_add": { + "git_index_checksum": { "type": "function", - "file": "index.h", - "line": 719, - "lineto": 723, + "file": "git2/index.h", + "line": 404, + "lineto": 404, "args": [ { "name": "index", "type": "git_index *", "comment": "an existing index object" - }, - { - "name": "ancestor_entry", - "type": "const git_index_entry *", - "comment": "the entry data for the ancestor of the conflict" - }, - { - "name": "our_entry", - "type": "const git_index_entry *", - "comment": "the entry data for our side of the merge conflict" - }, - { - "name": "their_entry", - "type": "const git_index_entry *", - "comment": "the entry data for their side of the merge conflict" } ], - "argline": "git_index *index, const git_index_entry *ancestor_entry, const git_index_entry *our_entry, const git_index_entry *their_entry", - "sig": "git_index *::const git_index_entry *::const git_index_entry *::const git_index_entry *", + "argline": "git_index *index", + "sig": "git_index *", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "const git_oid *", + "comment": " a pointer to the checksum of the index" }, - "description": "

Add or update index entries to represent a conflict. Any staged\n entries that exist at the given paths will be removed.

\n", - "comments": "

The entries are the entries from the tree included in the merge. Any entry may be null to indicate that that file was not present in the trees during the merge. For example, ancestor_entry may be NULL to indicate that a file was added in both branches and must be resolved.

\n", + "description": "

Get the checksum of the index

\n", + "comments": "

This checksum is the SHA-1 hash over the index file (except the last 20 bytes which are the checksum itself). In cases where the index does not exist on-disk, it will be zeroed out.

\n", "group": "index" }, - "git_index_conflict_get": { + "git_index_read_tree": { "type": "function", - "file": "index.h", - "line": 739, - "lineto": 744, + "file": "git2/index.h", + "line": 416, + "lineto": 416, "args": [ - { - "name": "ancestor_out", - "type": "const git_index_entry **", - "comment": "Pointer to store the ancestor entry" - }, - { - "name": "our_out", - "type": "const git_index_entry **", - "comment": "Pointer to store the our entry" - }, - { - "name": "their_out", - "type": "const git_index_entry **", - "comment": "Pointer to store the their entry" - }, { "name": "index", "type": "git_index *", "comment": "an existing index object" }, { - "name": "path", - "type": "const char *", - "comment": "path to search" + "name": "tree", + "type": "const git_tree *", + "comment": "tree to read" } ], - "argline": "const git_index_entry **ancestor_out, const git_index_entry **our_out, const git_index_entry **their_out, git_index *index, const char *path", - "sig": "const git_index_entry **::const git_index_entry **::const git_index_entry **::git_index *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Get the index entries that represent a conflict of a single file.

\n", - "comments": "

The entries are not modifiable and should not be freed. Because the git_index_entry struct is a publicly defined struct, you should be able to make your own permanent copy of the data if necessary.

\n", + "argline": "git_index *index, const git_tree *tree", + "sig": "git_index *::const git_tree *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Read a tree into the index file with stats

\n", + "comments": "

The current index contents will be replaced by the specified tree.

\n", "group": "index" }, - "git_index_conflict_remove": { + "git_index_write_tree": { "type": "function", - "file": "index.h", - "line": 753, - "lineto": 753, + "file": "git2/index.h", + "line": 437, + "lineto": 437, "args": [ { - "name": "index", - "type": "git_index *", - "comment": "an existing index object" + "name": "out", + "type": "git_oid *", + "comment": "Pointer where to store the OID of the written tree" }, - { - "name": "path", - "type": "const char *", - "comment": "path to remove conflicts for" - } + { "name": "index", "type": "git_index *", "comment": "Index to write" } ], - "argline": "git_index *index, const char *path", - "sig": "git_index *::const char *", + "argline": "git_oid *out, git_index *index", + "sig": "git_oid *::git_index *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, GIT_EUNMERGED when the index is not clean\n or an error code" }, - "description": "

Removes the index entries that represent a conflict of a single file.

\n", - "comments": "", - "group": "index" + "description": "

Write the index as a tree

\n", + "comments": "

This method will scan the index and write a representation of its current state back to disk; it recursively creates tree objects for each of the subtrees stored in the index, but only returns the OID of the root tree. This is the OID that can be used e.g. to create a commit.

\n\n

The index instance cannot be bare, and needs to be associated to an existing repository.

\n\n

The index must not contain any file in conflict.

\n", + "group": "index", + "examples": { + "commit.c": ["ex/v1.9.1/commit.html#git_index_write_tree-5"], + "init.c": ["ex/v1.9.1/init.html#git_index_write_tree-3"], + "merge.c": ["ex/v1.9.1/merge.html#git_index_write_tree-10"] + } }, - "git_index_conflict_cleanup": { + "git_index_write_tree_to": { "type": "function", - "file": "index.h", - "line": 761, - "lineto": 761, + "file": "git2/index.h", + "line": 454, + "lineto": 454, "args": [ { - "name": "index", - "type": "git_index *", - "comment": "an existing index object" + "name": "out", + "type": "git_oid *", + "comment": "Pointer where to store OID of the written tree" + }, + { "name": "index", "type": "git_index *", "comment": "Index to write" }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to write the tree" } ], - "argline": "git_index *index", - "sig": "git_index *", + "argline": "git_oid *out, git_index *index, git_repository *repo", + "sig": "git_oid *::git_index *::git_repository *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, GIT_EUNMERGED when the index is not clean\n or an error code" }, - "description": "

Remove all conflicts in the index (entries with a stage greater than 0).

\n", - "comments": "", + "description": "

Write the index as a tree to the given repository

\n", + "comments": "

This method will do the same as git_index_write_tree, but letting the user choose the repository where the tree will be written.

\n\n

The index must not contain any file in conflict.

\n", "group": "index" }, - "git_index_has_conflicts": { + "git_index_entrycount": { "type": "function", - "file": "index.h", - "line": 768, - "lineto": 768, + "file": "git2/index.h", + "line": 473, + "lineto": 473, "args": [ { "name": "index", "type": "const git_index *", - "comment": null + "comment": "an existing index object" } ], "argline": "const git_index *index", "sig": "const git_index *", "return": { - "type": "int", - "comment": " 1 if at least one conflict is found, 0 otherwise." + "type": "size_t", + "comment": " integer of count of current entries" }, - "description": "

Determine if the index contains entries representing file conflicts.

\n", + "description": "

Get the count of entries currently in the index

\n", "comments": "", - "group": "index" + "group": "index", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_index_entrycount-36"], + "ls-files.c": ["ex/v1.9.1/ls-files.html#git_index_entrycount-2"] + } }, - "git_index_conflict_iterator_new": { + "git_index_clear": { "type": "function", - "file": "index.h", - "line": 779, - "lineto": 781, + "file": "git2/index.h", + "line": 484, + "lineto": 484, "args": [ - { - "name": "iterator_out", - "type": "git_index_conflict_iterator **", - "comment": "The newly created conflict iterator" - }, { "name": "index", "type": "git_index *", - "comment": "The index to scan" + "comment": "an existing index object" } ], - "argline": "git_index_conflict_iterator **iterator_out, git_index *index", - "sig": "git_index_conflict_iterator **::git_index *", + "argline": "git_index *index", + "sig": "git_index *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, error code \n<\n 0 on failure" }, - "description": "

Create an iterator for the conflicts in the index.

\n", - "comments": "

The index must not be modified while iterating; the results are undefined.

\n", + "description": "

Clear the contents (all the entries) of an index object.

\n", + "comments": "

This clears the index object in memory; changes must be explicitly written to disk for them to take effect persistently.

\n", "group": "index" }, - "git_index_conflict_next": { + "git_index_get_byindex": { "type": "function", - "file": "index.h", - "line": 793, - "lineto": 797, + "file": "git2/index.h", + "line": 497, + "lineto": 498, "args": [ { - "name": "ancestor_out", - "type": "const git_index_entry **", - "comment": "Pointer to store the ancestor side of the conflict" - }, - { - "name": "our_out", - "type": "const git_index_entry **", - "comment": "Pointer to store our side of the conflict" - }, - { - "name": "their_out", - "type": "const git_index_entry **", - "comment": "Pointer to store their side of the conflict" + "name": "index", + "type": "git_index *", + "comment": "an existing index object" }, { - "name": "iterator", - "type": "git_index_conflict_iterator *", - "comment": null + "name": "n", + "type": "size_t", + "comment": "the position of the entry" } ], - "argline": "const git_index_entry **ancestor_out, const git_index_entry **our_out, const git_index_entry **their_out, git_index_conflict_iterator *iterator", - "sig": "const git_index_entry **::const git_index_entry **::const git_index_entry **::git_index_conflict_iterator *", + "argline": "git_index *index, size_t n", + "sig": "git_index *::size_t", "return": { - "type": "int", - "comment": " 0 (no error), GIT_ITEROVER (iteration is done) or an error code\n (negative value)" + "type": "const git_index_entry *", + "comment": " a pointer to the entry; NULL if out of bounds" }, - "description": "

Returns the current conflict (ancestor, ours and theirs entry) and\n advance the iterator internally to the next value.

\n", - "comments": "", - "group": "index" + "description": "

Get a pointer to one of the entries in the index

\n", + "comments": "

The entry is not modifiable and should not be freed. Because the git_index_entry struct is a publicly defined struct, you should be able to make your own permanent copy of the data if necessary.

\n", + "group": "index", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_index_get_byindex-37"], + "ls-files.c": ["ex/v1.9.1/ls-files.html#git_index_get_byindex-3"] + } }, - "git_index_conflict_iterator_free": { + "git_index_get_bypath": { "type": "function", - "file": "index.h", - "line": 804, - "lineto": 805, + "file": "git2/index.h", + "line": 512, + "lineto": 513, "args": [ { - "name": "iterator", - "type": "git_index_conflict_iterator *", - "comment": "pointer to the iterator" - } + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { "name": "path", "type": "const char *", "comment": "path to search" }, + { "name": "stage", "type": "int", "comment": "stage to search" } ], - "argline": "git_index_conflict_iterator *iterator", - "sig": "git_index_conflict_iterator *", + "argline": "git_index *index, const char *path, int stage", + "sig": "git_index *::const char *::int", "return": { - "type": "void", - "comment": null + "type": "const git_index_entry *", + "comment": " a pointer to the entry; NULL if it was not found" }, - "description": "

Frees a git_index_conflict_iterator.

\n", + "description": "

Get a pointer to one of the entries in the index

\n", + "comments": "

The entry is not modifiable and should not be freed. Because the git_index_entry struct is a publicly defined struct, you should be able to make your own permanent copy of the data if necessary.

\n", + "group": "index", + "examples": { + "ls-files.c": ["ex/v1.9.1/ls-files.html#git_index_get_bypath-4"] + } + }, + "git_index_remove": { + "type": "function", + "file": "git2/index.h", + "line": 523, + "lineto": 523, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { "name": "path", "type": "const char *", "comment": "path to search" }, + { "name": "stage", "type": "int", "comment": "stage to search" } + ], + "argline": "git_index *index, const char *path, int stage", + "sig": "git_index *::const char *::int", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Remove an entry from the index

\n", "comments": "", "group": "index" }, - "git_indexer_new": { + "git_index_remove_directory": { "type": "function", - "file": "indexer.h", - "line": 30, - "lineto": 36, + "file": "git2/index.h", + "line": 533, + "lineto": 534, "args": [ { - "name": "out", - "type": "git_indexer **", - "comment": "where to store the indexer instance" + "name": "index", + "type": "git_index *", + "comment": "an existing index object" }, { - "name": "path", + "name": "dir", "type": "const char *", - "comment": "to the directory where the packfile should be stored" - }, - { - "name": "mode", - "type": "unsigned int", - "comment": "permissions to use creating packfile or 0 for defaults" - }, - { - "name": "odb", - "type": "git_odb *", - "comment": "object database from which to read base objects when\n fixing thin packs. Pass NULL if no thin pack is expected (an error\n will be returned if there are bases missing)" + "comment": "container directory path" }, + { "name": "stage", "type": "int", "comment": "stage to search" } + ], + "argline": "git_index *index, const char *dir, int stage", + "sig": "git_index *::const char *::int", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Remove all entries from the index under a given directory

\n", + "comments": "", + "group": "index" + }, + "git_index_add": { + "type": "function", + "file": "git2/index.h", + "line": 550, + "lineto": 550, + "args": [ { - "name": "progress_cb", - "type": "git_transfer_progress_cb", - "comment": "function to call with progress information" + "name": "index", + "type": "git_index *", + "comment": "an existing index object" }, { - "name": "progress_cb_payload", - "type": "void *", - "comment": "payload for the progress callback" + "name": "source_entry", + "type": "const git_index_entry *", + "comment": "new entry object" } ], - "argline": "git_indexer **out, const char *path, unsigned int mode, git_odb *odb, git_transfer_progress_cb progress_cb, void *progress_cb_payload", - "sig": "git_indexer **::const char *::unsigned int::git_odb *::git_transfer_progress_cb::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Create a new indexer instance

\n", - "comments": "", - "group": "indexer", - "examples": { - "network/index-pack.c": [ - "ex/HEAD/network/index-pack.html#git_indexer_new-1" - ] - } + "argline": "git_index *index, const git_index_entry *source_entry", + "sig": "git_index *::const git_index_entry *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Add or update an index entry from an in-memory struct

\n", + "comments": "

If a previous index entry exists that has the same path and stage as the given 'source_entry', it will be replaced. Otherwise, the 'source_entry' will be added.

\n\n

A full copy (including the 'path' string) of the given 'source_entry' will be inserted on the index.

\n", + "group": "index" }, - "git_indexer_append": { + "git_index_entry_stage": { "type": "function", - "file": "indexer.h", - "line": 46, - "lineto": 46, + "file": "git2/index.h", + "line": 562, + "lineto": 562, "args": [ { - "name": "idx", - "type": "git_indexer *", - "comment": "the indexer" - }, - { - "name": "data", - "type": "const void *", - "comment": "the data to add" - }, - { - "name": "size", - "type": "size_t", - "comment": "the size of the data in bytes" - }, + "name": "entry", + "type": "const git_index_entry *", + "comment": "The entry" + } + ], + "argline": "const git_index_entry *entry", + "sig": "const git_index_entry *", + "return": { "type": "int", "comment": " the stage number" }, + "description": "

Return the stage number from a git index entry

\n", + "comments": "

This entry is calculated from the entry's flag attribute like this:

\n\n
(entry->flags & GIT_INDEX_ENTRY_STAGEMASK) >> GIT_INDEX_ENTRY_STAGESHIFT\n
\n", + "group": "index" + }, + "git_index_entry_is_conflict": { + "type": "function", + "file": "git2/index.h", + "line": 571, + "lineto": 571, + "args": [ { - "name": "stats", - "type": "git_transfer_progress *", - "comment": "stat storage" + "name": "entry", + "type": "const git_index_entry *", + "comment": "The entry" } ], - "argline": "git_indexer *idx, const void *data, size_t size, git_transfer_progress *stats", - "sig": "git_indexer *::const void *::size_t::git_transfer_progress *", + "argline": "const git_index_entry *entry", + "sig": "const git_index_entry *", "return": { "type": "int", - "comment": null + "comment": " 1 if the entry is a conflict entry, 0 otherwise" }, - "description": "

Add data to the indexer

\n", + "description": "

Return whether the given index entry is a conflict (has a high stage\n entry). This is simply shorthand for git_index_entry_stage > 0.

\n", "comments": "", - "group": "indexer", - "examples": { - "network/index-pack.c": [ - "ex/HEAD/network/index-pack.html#git_indexer_append-2" - ] - } + "group": "index" }, - "git_indexer_commit": { + "git_index_iterator_new": { "type": "function", - "file": "indexer.h", - "line": 55, - "lineto": 55, + "file": "git2/index.h", + "line": 592, + "lineto": 594, "args": [ { - "name": "idx", - "type": "git_indexer *", - "comment": "the indexer" + "name": "iterator_out", + "type": "git_index_iterator **", + "comment": "The newly created iterator" }, { - "name": "stats", - "type": "git_transfer_progress *", - "comment": null + "name": "index", + "type": "git_index *", + "comment": "The index to iterate" } ], - "argline": "git_indexer *idx, git_transfer_progress *stats", - "sig": "git_indexer *::git_transfer_progress *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Finalize the pack and index

\n", - "comments": "

Resolve any pending deltas and write out the index file

\n", - "group": "indexer", - "examples": { - "network/index-pack.c": [ - "ex/HEAD/network/index-pack.html#git_indexer_commit-3" - ] - } + "argline": "git_index_iterator **iterator_out, git_index *index", + "sig": "git_index_iterator **::git_index *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create an iterator that will return every entry contained in the\n index at the time of creation. Entries are returned in order,\n sorted by path. This iterator is backed by a snapshot that allows\n callers to modify the index while iterating without affecting the\n iterator.

\n", + "comments": "", + "group": "index" }, - "git_indexer_hash": { + "git_index_iterator_next": { "type": "function", - "file": "indexer.h", - "line": 65, - "lineto": 65, + "file": "git2/index.h", + "line": 603, + "lineto": 605, "args": [ { - "name": "idx", - "type": "const git_indexer *", - "comment": "the indexer instance" + "name": "out", + "type": "const git_index_entry **", + "comment": "Pointer to store the index entry in" + }, + { + "name": "iterator", + "type": "git_index_iterator *", + "comment": "The iterator" } ], - "argline": "const git_indexer *idx", - "sig": "const git_indexer *", + "argline": "const git_index_entry **out, git_index_iterator *iterator", + "sig": "const git_index_entry **::git_index_iterator *", "return": { - "type": "const git_oid *", - "comment": null + "type": "int", + "comment": " 0, GIT_ITEROVER on iteration completion or an error code" }, - "description": "

Get the packfile's hash

\n", - "comments": "

A packfile's name is derived from the sorted hashing of all object names. This is only correct after the index has been finalized.

\n", - "group": "indexer", - "examples": { - "network/index-pack.c": [ - "ex/HEAD/network/index-pack.html#git_indexer_hash-4" - ] - } + "description": "

Return the next index entry in-order from the iterator.

\n", + "comments": "", + "group": "index" }, - "git_indexer_free": { + "git_index_iterator_free": { "type": "function", - "file": "indexer.h", - "line": 72, - "lineto": 72, + "file": "git2/index.h", + "line": 612, + "lineto": 612, "args": [ { - "name": "idx", - "type": "git_indexer *", - "comment": "the indexer to free" + "name": "iterator", + "type": "git_index_iterator *", + "comment": "The iterator to free" } ], - "argline": "git_indexer *idx", - "sig": "git_indexer *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Free the indexer and its resources

\n", + "argline": "git_index_iterator *iterator", + "sig": "git_index_iterator *", + "return": { "type": "void", "comment": null }, + "description": "

Free the index iterator

\n", "comments": "", - "group": "indexer", - "examples": { - "network/index-pack.c": [ - "ex/HEAD/network/index-pack.html#git_indexer_free-5" - ] - } + "group": "index" }, - "git_merge_file_init_input": { + "git_index_add_bypath": { "type": "function", - "file": "merge.h", - "line": 60, - "lineto": 62, + "file": "git2/index.h", + "line": 643, + "lineto": 643, "args": [ { - "name": "opts", - "type": "git_merge_file_input *", - "comment": "the `git_merge_file_input` instance to initialize." + "name": "index", + "type": "git_index *", + "comment": "an existing index object" }, - { - "name": "version", - "type": "unsigned int", - "comment": "the version of the struct; you should pass\n `GIT_MERGE_FILE_INPUT_VERSION` here." - } + { "name": "path", "type": "const char *", "comment": "filename to add" } ], - "argline": "git_merge_file_input *opts, unsigned int version", - "sig": "git_merge_file_input *::unsigned int", - "return": { - "type": "int", - "comment": " Zero on success; -1 on failure." - }, - "description": "

Initializes a git_merge_file_input with default values. Equivalent to\n creating an instance with GIT_MERGE_FILE_INPUT_INIT.

\n", - "comments": "", - "group": "merge" + "argline": "git_index *index, const char *path", + "sig": "git_index *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Add or update an index entry from a file on disk

\n", + "comments": "

The file path must be relative to the repository's working folder and must be readable.

\n\n

This method will fail in bare index instances.

\n\n

This forces the file to be added to the index, not looking at gitignore rules. Those rules can be evaluated through the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this file will no longer be marked as conflicting. The data about the conflict will be moved to the "resolve undo" (REUC) section.

\n", + "group": "index" }, - "git_merge_file_init_options": { + "git_index_add_from_buffer": { "type": "function", - "file": "merge.h", - "line": 208, - "lineto": 210, + "file": "git2/index.h", + "line": 671, + "lineto": 674, "args": [ { - "name": "opts", - "type": "git_merge_file_options *", - "comment": "the `git_merge_file_options` instance to initialize." + "name": "index", + "type": "git_index *", + "comment": "an existing index object" }, { - "name": "version", - "type": "unsigned int", - "comment": "the version of the struct; you should pass\n `GIT_MERGE_FILE_OPTIONS_VERSION` here." - } + "name": "entry", + "type": "const git_index_entry *", + "comment": "filename to add" + }, + { + "name": "buffer", + "type": "const void *", + "comment": "data to be written into the blob" + }, + { "name": "len", "type": "size_t", "comment": "length of the data" } ], - "argline": "git_merge_file_options *opts, unsigned int version", - "sig": "git_merge_file_options *::unsigned int", - "return": { - "type": "int", - "comment": " Zero on success; -1 on failure." - }, - "description": "

Initializes a git_merge_file_options with default values. Equivalent to\n creating an instance with GIT_MERGE_FILE_OPTIONS_INIT.

\n", - "comments": "", - "group": "merge" + "argline": "git_index *index, const git_index_entry *entry, const void *buffer, size_t len", + "sig": "git_index *::const git_index_entry *::const void *::size_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Add or update an index entry from a buffer in memory

\n", + "comments": "

This method will create a blob in the repository that owns the index and then add the index entry to the index. The path of the entry represents the position of the blob relative to the repository's root folder.

\n\n

If a previous index entry exists that has the same path as the given 'entry', it will be replaced. Otherwise, the 'entry' will be added.

\n\n

This forces the file to be added to the index, not looking at gitignore rules. Those rules can be evaluated through the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this file will no longer be marked as conflicting. The data about the conflict will be moved to the "resolve undo" (REUC) section.

\n", + "group": "index" }, - "git_merge_init_options": { + "git_index_remove_bypath": { "type": "function", - "file": "merge.h", - "line": 305, - "lineto": 307, + "file": "git2/index.h", + "line": 690, + "lineto": 690, "args": [ { - "name": "opts", - "type": "git_merge_options *", - "comment": "the `git_merge_options` instance to initialize." + "name": "index", + "type": "git_index *", + "comment": "an existing index object" }, { - "name": "version", - "type": "unsigned int", - "comment": "the version of the struct; you should pass\n `GIT_MERGE_OPTIONS_VERSION` here." + "name": "path", + "type": "const char *", + "comment": "filename to remove" } ], - "argline": "git_merge_options *opts, unsigned int version", - "sig": "git_merge_options *::unsigned int", - "return": { - "type": "int", - "comment": " Zero on success; -1 on failure." - }, - "description": "

Initializes a git_merge_options with default values. Equivalent to\n creating an instance with GIT_MERGE_OPTIONS_INIT.

\n", - "comments": "", - "group": "merge" + "argline": "git_index *index, const char *path", + "sig": "git_index *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Remove an index entry corresponding to a file on disk

\n", + "comments": "

The file path must be relative to the repository's working folder. It may exist.

\n\n

If this file currently is the result of a merge conflict, this file will no longer be marked as conflicting. The data about the conflict will be moved to the "resolve undo" (REUC) section.

\n", + "group": "index" }, - "git_merge_analysis": { + "git_index_add_all": { "type": "function", - "file": "merge.h", - "line": 376, - "lineto": 381, + "file": "git2/index.h", + "line": 738, + "lineto": 743, "args": [ { - "name": "analysis_out", - "type": "git_merge_analysis_t *", - "comment": "analysis enumeration that the result is written into" + "name": "index", + "type": "git_index *", + "comment": "an existing index object" }, { - "name": "preference_out", - "type": "git_merge_preference_t *", - "comment": null + "name": "pathspec", + "type": "const git_strarray *", + "comment": "array of path patterns" }, { - "name": "repo", - "type": "git_repository *", - "comment": "the repository to merge" + "name": "flags", + "type": "unsigned int", + "comment": "combination of git_index_add_option_t flags" }, { - "name": "their_heads", - "type": "const git_annotated_commit **", - "comment": "the heads to merge into" + "name": "callback", + "type": "git_index_matched_path_cb", + "comment": "notification callback for each added/updated path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan." }, { - "name": "their_heads_len", - "type": "size_t", - "comment": "the number of heads to merge" + "name": "payload", + "type": "void *", + "comment": "payload passed through to callback function" } ], - "argline": "git_merge_analysis_t *analysis_out, git_merge_preference_t *preference_out, git_repository *repo, const git_annotated_commit **their_heads, size_t their_heads_len", - "sig": "git_merge_analysis_t *::git_merge_preference_t *::git_repository *::const git_annotated_commit **::size_t", + "argline": "git_index *index, const git_strarray *pathspec, unsigned int flags, git_index_matched_path_cb callback, void *payload", + "sig": "git_index *::const git_strarray *::unsigned int::git_index_matched_path_cb::void *", "return": { "type": "int", - "comment": " 0 on success or error code" + "comment": " 0 on success, negative callback return value, or error code" }, - "description": "

Analyzes the given branch(es) and determines the opportunities for\n merging them into the HEAD of the repository.

\n", - "comments": "", - "group": "merge" + "description": "

Add or update index entries matching files in the working directory.

\n", + "comments": "

This method will fail in bare index instances.

\n\n

The pathspec is a list of file names or shell glob patterns that will be matched against files in the repository's working directory. Each file that matches will be added to the index (either updating an existing entry or adding a new entry). You can disable glob expansion and force exact matching with the GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH flag.

\n\n

Files that are ignored will be skipped (unlike git_index_add_bypath). If a file is already tracked in the index, then it will be updated even if it is ignored. Pass the GIT_INDEX_ADD_FORCE flag to skip the checking of ignore rules.

\n\n

To emulate git add -A and generate an error if the pathspec contains the exact path of an ignored file (when not using FORCE), add the GIT_INDEX_ADD_CHECK_PATHSPEC flag. This checks that each entry in the pathspec that is an exact match to a filename on disk is either not ignored or already in the index. If this check fails, the function will return GIT_EINVALIDSPEC.

\n\n

To emulate git add -A with the "dry-run" option, just use a callback function that always returns a positive value. See below for details.

\n\n

If any files are currently the result of a merge conflict, those files will no longer be marked as conflicting. The data about the conflicts will be moved to the "resolve undo" (REUC) section.

\n\n

If you provide a callback function, it will be invoked on each matching item in the working directory immediately before it is added to / updated in the index. Returning zero will add the item to the index, greater than zero will skip the item, and less than zero will abort the scan and return that value to the caller.

\n", + "group": "index", + "examples": { "add.c": ["ex/v1.9.1/add.html#git_index_add_all-3"] } }, - "git_merge_base": { + "git_index_remove_all": { "type": "function", - "file": "merge.h", - "line": 392, - "lineto": 396, + "file": "git2/index.h", + "line": 760, + "lineto": 764, "args": [ { - "name": "out", - "type": "git_oid *", - "comment": "the OID of a merge base between 'one' and 'two'" + "name": "index", + "type": "git_index *", + "comment": "An existing index object" }, { - "name": "repo", - "type": "git_repository *", - "comment": "the repository where the commits exist" + "name": "pathspec", + "type": "const git_strarray *", + "comment": "array of path patterns" }, { - "name": "one", - "type": "const git_oid *", - "comment": "one of the commits" + "name": "callback", + "type": "git_index_matched_path_cb", + "comment": "notification callback for each removed path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan." }, { - "name": "two", - "type": "const git_oid *", - "comment": "the other commit" + "name": "payload", + "type": "void *", + "comment": "payload passed through to callback function" } ], - "argline": "git_oid *out, git_repository *repo, const git_oid *one, const git_oid *two", - "sig": "git_oid *::git_repository *::const git_oid *::const git_oid *", + "argline": "git_index *index, const git_strarray *pathspec, git_index_matched_path_cb callback, void *payload", + "sig": "git_index *::const git_strarray *::git_index_matched_path_cb::void *", "return": { "type": "int", - "comment": " 0 on success, GIT_ENOTFOUND if not found or error code" + "comment": " 0 on success, negative callback return value, or error code" }, - "description": "

Find a merge base between two commits

\n", - "comments": "", - "group": "merge", - "examples": { - "log.c": [ - "ex/HEAD/log.html#git_merge_base-32" - ], - "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_merge_base-3" - ] - } + "description": "

Remove all matching index entries.

\n", + "comments": "

If you provide a callback function, it will be invoked on each matching item in the index immediately before it is removed. Return 0 to remove the item, > 0 to skip the item, and < 0 to abort the scan.

\n", + "group": "index" }, - "git_merge_bases": { + "git_index_update_all": { "type": "function", - "file": "merge.h", - "line": 407, - "lineto": 411, + "file": "git2/index.h", + "line": 789, + "lineto": 793, "args": [ { - "name": "out", - "type": "git_oidarray *", - "comment": "array in which to store the resulting ids" + "name": "index", + "type": "git_index *", + "comment": "An existing index object" }, { - "name": "repo", - "type": "git_repository *", - "comment": "the repository where the commits exist" + "name": "pathspec", + "type": "const git_strarray *", + "comment": "array of path patterns" }, { - "name": "one", - "type": "const git_oid *", - "comment": "one of the commits" + "name": "callback", + "type": "git_index_matched_path_cb", + "comment": "notification callback for each updated path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan." }, { - "name": "two", - "type": "const git_oid *", - "comment": "the other commit" + "name": "payload", + "type": "void *", + "comment": "payload passed through to callback function" } ], - "argline": "git_oidarray *out, git_repository *repo, const git_oid *one, const git_oid *two", - "sig": "git_oidarray *::git_repository *::const git_oid *::const git_oid *", + "argline": "git_index *index, const git_strarray *pathspec, git_index_matched_path_cb callback, void *payload", + "sig": "git_index *::const git_strarray *::git_index_matched_path_cb::void *", "return": { "type": "int", - "comment": " 0 on success, GIT_ENOTFOUND if not found or error code" + "comment": " 0 on success, negative callback return value, or error code" }, - "description": "

Find merge bases between two commits

\n", - "comments": "", - "group": "merge" + "description": "

Update all index entries to match the working directory

\n", + "comments": "

This method will fail in bare index instances.

\n\n

This scans the existing index entries and synchronizes them with the working directory, deleting them if the corresponding working directory file no longer exists otherwise updating the information (including adding the latest version of file to the ODB if needed).

\n\n

If you provide a callback function, it will be invoked on each matching item in the index immediately before it is updated (either refreshed or removed depending on working directory state). Return 0 to proceed with updating the item, > 0 to skip the item, and < 0 to abort the scan.

\n", + "group": "index", + "examples": { "add.c": ["ex/v1.9.1/add.html#git_index_update_all-4"] } }, - "git_merge_base_many": { + "git_index_find": { "type": "function", - "file": "merge.h", - "line": 422, - "lineto": 426, + "file": "git2/index.h", + "line": 804, + "lineto": 804, "args": [ { - "name": "out", - "type": "git_oid *", - "comment": "the OID of a merge base considering all the commits" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "the repository where the commits exist" + "name": "at_pos", + "type": "size_t *", + "comment": "the address to which the position of the index entry is written (optional)" }, { - "name": "length", - "type": "size_t", - "comment": "The number of commits in the provided `input_array`" + "name": "index", + "type": "git_index *", + "comment": "an existing index object" }, - { - "name": "input_array", - "type": "const git_oid []", - "comment": "oids of the commits" - } + { "name": "path", "type": "const char *", "comment": "path to search" } ], - "argline": "git_oid *out, git_repository *repo, size_t length, const git_oid [] input_array", - "sig": "git_oid *::git_repository *::size_t::const git_oid []", - "return": { - "type": "int", - "comment": " Zero on success; GIT_ENOTFOUND or -1 on failure." - }, - "description": "

Find a merge base given a list of commits

\n", + "argline": "size_t *at_pos, git_index *index, const char *path", + "sig": "size_t *::git_index *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Find the first position of any entries which point to given\n path in the Git index.

\n", "comments": "", - "group": "merge" + "group": "index" }, - "git_merge_bases_many": { + "git_index_find_prefix": { "type": "function", - "file": "merge.h", - "line": 437, - "lineto": 441, + "file": "git2/index.h", + "line": 815, + "lineto": 815, "args": [ { - "name": "out", - "type": "git_oidarray *", - "comment": "array in which to store the resulting ids" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "the repository where the commits exist" + "name": "at_pos", + "type": "size_t *", + "comment": "the address to which the position of the index entry is written (optional)" }, { - "name": "length", - "type": "size_t", - "comment": "The number of commits in the provided `input_array`" + "name": "index", + "type": "git_index *", + "comment": "an existing index object" }, { - "name": "input_array", - "type": "const git_oid []", - "comment": "oids of the commits" + "name": "prefix", + "type": "const char *", + "comment": "the prefix to search for" } ], - "argline": "git_oidarray *out, git_repository *repo, size_t length, const git_oid [] input_array", - "sig": "git_oidarray *::git_repository *::size_t::const git_oid []", - "return": { - "type": "int", - "comment": " Zero on success; GIT_ENOTFOUND or -1 on failure." - }, - "description": "

Find all merge bases given a list of commits

\n", + "argline": "size_t *at_pos, git_index *index, const char *prefix", + "sig": "size_t *::git_index *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Find the first position of any entries matching a prefix. To find the first position\n of a path inside a given folder, suffix the prefix with a '/'.

\n", "comments": "", - "group": "merge" + "group": "index" }, - "git_merge_base_octopus": { + "git_index_conflict_add": { "type": "function", - "file": "merge.h", - "line": 452, - "lineto": 456, + "file": "git2/index.h", + "line": 840, + "lineto": 844, "args": [ { - "name": "out", - "type": "git_oid *", - "comment": "the OID of a merge base considering all the commits" + "name": "index", + "type": "git_index *", + "comment": "an existing index object" }, { - "name": "repo", - "type": "git_repository *", - "comment": "the repository where the commits exist" + "name": "ancestor_entry", + "type": "const git_index_entry *", + "comment": "the entry data for the ancestor of the conflict" }, { - "name": "length", - "type": "size_t", - "comment": "The number of commits in the provided `input_array`" + "name": "our_entry", + "type": "const git_index_entry *", + "comment": "the entry data for our side of the merge conflict" }, { - "name": "input_array", - "type": "const git_oid []", - "comment": "oids of the commits" + "name": "their_entry", + "type": "const git_index_entry *", + "comment": "the entry data for their side of the merge conflict" } ], - "argline": "git_oid *out, git_repository *repo, size_t length, const git_oid [] input_array", - "sig": "git_oid *::git_repository *::size_t::const git_oid []", - "return": { - "type": "int", - "comment": " Zero on success; GIT_ENOTFOUND or -1 on failure." - }, - "description": "

Find a merge base in preparation for an octopus merge

\n", - "comments": "", - "group": "merge" + "argline": "git_index *index, const git_index_entry *ancestor_entry, const git_index_entry *our_entry, const git_index_entry *their_entry", + "sig": "git_index *::const git_index_entry *::const git_index_entry *::const git_index_entry *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Add or update index entries to represent a conflict. Any staged\n entries that exist at the given paths will be removed.

\n", + "comments": "

The entries are the entries from the tree included in the merge. Any entry may be null to indicate that that file was not present in the trees during the merge. For example, ancestor_entry may be NULL to indicate that a file was added in both branches and must be resolved.

\n", + "group": "index" }, - "git_merge_file": { + "git_index_conflict_get": { "type": "function", - "file": "merge.h", - "line": 474, - "lineto": 479, + "file": "git2/index.h", + "line": 860, + "lineto": 865, "args": [ { - "name": "out", - "type": "git_merge_file_result *", - "comment": "The git_merge_file_result to be filled in" + "name": "ancestor_out", + "type": "const git_index_entry **", + "comment": "Pointer to store the ancestor entry" }, { - "name": "ancestor", - "type": "const git_merge_file_input *", - "comment": "The contents of the ancestor file" + "name": "our_out", + "type": "const git_index_entry **", + "comment": "Pointer to store the our entry" }, { - "name": "ours", - "type": "const git_merge_file_input *", - "comment": "The contents of the file in \"our\" side" + "name": "their_out", + "type": "const git_index_entry **", + "comment": "Pointer to store the their entry" }, { - "name": "theirs", - "type": "const git_merge_file_input *", - "comment": "The contents of the file in \"their\" side" + "name": "index", + "type": "git_index *", + "comment": "an existing index object" }, - { - "name": "opts", - "type": "const git_merge_file_options *", - "comment": "The merge file options or `NULL` for defaults" - } + { "name": "path", "type": "const char *", "comment": "path to search" } ], - "argline": "git_merge_file_result *out, const git_merge_file_input *ancestor, const git_merge_file_input *ours, const git_merge_file_input *theirs, const git_merge_file_options *opts", - "sig": "git_merge_file_result *::const git_merge_file_input *::const git_merge_file_input *::const git_merge_file_input *::const git_merge_file_options *", - "return": { - "type": "int", - "comment": " 0 on success or error code" - }, - "description": "

Merge two files as they exist in the in-memory data structures, using\n the given common ancestor as the baseline, producing a\n git_merge_file_result that reflects the merge result. The\n git_merge_file_result must be freed with git_merge_file_result_free.

\n", - "comments": "

Note that this function does not reference a repository and any configuration must be passed as git_merge_file_options.

\n", - "group": "merge" + "argline": "const git_index_entry **ancestor_out, const git_index_entry **our_out, const git_index_entry **their_out, git_index *index, const char *path", + "sig": "const git_index_entry **::const git_index_entry **::const git_index_entry **::git_index *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the index entries that represent a conflict of a single file.

\n", + "comments": "

The entries are not modifiable and should not be freed. Because the git_index_entry struct is a publicly defined struct, you should be able to make your own permanent copy of the data if necessary.

\n", + "group": "index" }, - "git_merge_file_from_index": { + "git_index_conflict_remove": { "type": "function", - "file": "merge.h", - "line": 495, - "lineto": 501, + "file": "git2/index.h", + "line": 874, + "lineto": 874, "args": [ { - "name": "out", - "type": "git_merge_file_result *", - "comment": "The git_merge_file_result to be filled in" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "The repository" - }, - { - "name": "ancestor", - "type": "const git_index_entry *", - "comment": "The index entry for the ancestor file (stage level 1)" - }, - { - "name": "ours", - "type": "const git_index_entry *", - "comment": "The index entry for our file (stage level 2)" - }, - { - "name": "theirs", - "type": "const git_index_entry *", - "comment": "The index entry for their file (stage level 3)" + "name": "index", + "type": "git_index *", + "comment": "an existing index object" }, { - "name": "opts", - "type": "const git_merge_file_options *", - "comment": "The merge file options or NULL" + "name": "path", + "type": "const char *", + "comment": "path to remove conflicts for" } ], - "argline": "git_merge_file_result *out, git_repository *repo, const git_index_entry *ancestor, const git_index_entry *ours, const git_index_entry *theirs, const git_merge_file_options *opts", - "sig": "git_merge_file_result *::git_repository *::const git_index_entry *::const git_index_entry *::const git_index_entry *::const git_merge_file_options *", - "return": { - "type": "int", - "comment": " 0 on success or error code" - }, - "description": "

Merge two files as they exist in the index, using the given common\n ancestor as the baseline, producing a git_merge_file_result that\n reflects the merge result. The git_merge_file_result must be freed with\n git_merge_file_result_free.

\n", + "argline": "git_index *index, const char *path", + "sig": "git_index *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Removes the index entries that represent a conflict of a single file.

\n", "comments": "", - "group": "merge" + "group": "index" }, - "git_merge_file_result_free": { + "git_index_conflict_cleanup": { "type": "function", - "file": "merge.h", - "line": 508, - "lineto": 508, + "file": "git2/index.h", + "line": 882, + "lineto": 882, "args": [ { - "name": "result", - "type": "git_merge_file_result *", - "comment": "The result to free or `NULL`" + "name": "index", + "type": "git_index *", + "comment": "an existing index object" } ], - "argline": "git_merge_file_result *result", - "sig": "git_merge_file_result *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Frees a git_merge_file_result.

\n", + "argline": "git_index *index", + "sig": "git_index *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Remove all conflicts in the index (entries with a stage greater than 0).

\n", "comments": "", - "group": "merge" + "group": "index" }, - "git_merge_trees": { + "git_index_has_conflicts": { "type": "function", - "file": "merge.h", - "line": 526, - "lineto": 532, + "file": "git2/index.h", + "line": 890, + "lineto": 890, "args": [ { - "name": "out", - "type": "git_index **", - "comment": "pointer to store the index result in" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "repository that contains the given trees" - }, - { - "name": "ancestor_tree", - "type": "const git_tree *", - "comment": "the common ancestor between the trees (or null if none)" - }, - { - "name": "our_tree", - "type": "const git_tree *", - "comment": "the tree that reflects the destination tree" - }, - { - "name": "their_tree", - "type": "const git_tree *", - "comment": "the tree to merge in to `our_tree`" - }, - { - "name": "opts", - "type": "const git_merge_options *", - "comment": "the merge tree options (or null for defaults)" + "name": "index", + "type": "const git_index *", + "comment": "An existing index object." } ], - "argline": "git_index **out, git_repository *repo, const git_tree *ancestor_tree, const git_tree *our_tree, const git_tree *their_tree, const git_merge_options *opts", - "sig": "git_index **::git_repository *::const git_tree *::const git_tree *::const git_tree *::const git_merge_options *", + "argline": "const git_index *index", + "sig": "const git_index *", "return": { "type": "int", - "comment": " 0 on success or error code" + "comment": " 1 if at least one conflict is found, 0 otherwise." }, - "description": "

Merge two trees, producing a git_index that reflects the result of\n the merge. The index may be written as-is to the working directory\n or checked out. If the index is to be converted to a tree, the caller\n should resolve any conflicts that arose as part of the merge.

\n", - "comments": "

The returned index must be freed explicitly with git_index_free.

\n", - "group": "merge" + "description": "

Determine if the index contains entries representing file conflicts.

\n", + "comments": "", + "group": "index", + "examples": { + "merge.c": ["ex/v1.9.1/merge.html#git_index_has_conflicts-11"] + } }, - "git_merge_commits": { + "git_index_conflict_iterator_new": { "type": "function", - "file": "merge.h", - "line": 549, - "lineto": 554, + "file": "git2/index.h", + "line": 901, + "lineto": 903, "args": [ { - "name": "out", - "type": "git_index **", - "comment": "pointer to store the index result in" + "name": "iterator_out", + "type": "git_index_conflict_iterator **", + "comment": "The newly created conflict iterator" }, { - "name": "repo", - "type": "git_repository *", - "comment": "repository that contains the given trees" + "name": "index", + "type": "git_index *", + "comment": "The index to scan" + } + ], + "argline": "git_index_conflict_iterator **iterator_out, git_index *index", + "sig": "git_index_conflict_iterator **::git_index *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create an iterator for the conflicts in the index.

\n", + "comments": "

The index must not be modified while iterating; the results are undefined.

\n", + "group": "index", + "examples": { + "merge.c": ["ex/v1.9.1/merge.html#git_index_conflict_iterator_new-12"] + } + }, + "git_index_conflict_next": { + "type": "function", + "file": "git2/index.h", + "line": 916, + "lineto": 920, + "args": [ + { + "name": "ancestor_out", + "type": "const git_index_entry **", + "comment": "Pointer to store the ancestor side of the conflict" }, { - "name": "our_commit", - "type": "const git_commit *", - "comment": "the commit that reflects the destination tree" + "name": "our_out", + "type": "const git_index_entry **", + "comment": "Pointer to store our side of the conflict" }, { - "name": "their_commit", - "type": "const git_commit *", - "comment": "the commit to merge in to `our_commit`" + "name": "their_out", + "type": "const git_index_entry **", + "comment": "Pointer to store their side of the conflict" }, { - "name": "opts", - "type": "const git_merge_options *", - "comment": "the merge tree options (or null for defaults)" + "name": "iterator", + "type": "git_index_conflict_iterator *", + "comment": "The conflict iterator." } ], - "argline": "git_index **out, git_repository *repo, const git_commit *our_commit, const git_commit *their_commit, const git_merge_options *opts", - "sig": "git_index **::git_repository *::const git_commit *::const git_commit *::const git_merge_options *", + "argline": "const git_index_entry **ancestor_out, const git_index_entry **our_out, const git_index_entry **their_out, git_index_conflict_iterator *iterator", + "sig": "const git_index_entry **::const git_index_entry **::const git_index_entry **::git_index_conflict_iterator *", "return": { "type": "int", - "comment": " 0 on success or error code" + "comment": " 0 (no error), GIT_ITEROVER (iteration is done) or an error code\n (negative value)" }, - "description": "

Merge two commits, producing a git_index that reflects the result of\n the merge. The index may be written as-is to the working directory\n or checked out. If the index is to be converted to a tree, the caller\n should resolve any conflicts that arose as part of the merge.

\n", - "comments": "

The returned index must be freed explicitly with git_index_free.

\n", - "group": "merge" + "description": "

Returns the current conflict (ancestor, ours and theirs entry) and\n advance the iterator internally to the next value.

\n", + "comments": "", + "group": "index", + "examples": { + "merge.c": ["ex/v1.9.1/merge.html#git_index_conflict_next-13"] + } }, - "git_merge": { + "git_index_conflict_iterator_free": { "type": "function", - "file": "merge.h", - "line": 574, - "lineto": 579, + "file": "git2/index.h", + "line": 927, + "lineto": 928, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": "the repository to merge" - }, - { - "name": "their_heads", - "type": "const git_annotated_commit **", - "comment": "the heads to merge into" - }, - { - "name": "their_heads_len", - "type": "size_t", - "comment": "the number of heads to merge" - }, + "name": "iterator", + "type": "git_index_conflict_iterator *", + "comment": "pointer to the iterator" + } + ], + "argline": "git_index_conflict_iterator *iterator", + "sig": "git_index_conflict_iterator *", + "return": { "type": "void", "comment": null }, + "description": "

Frees a git_index_conflict_iterator.

\n", + "comments": "", + "group": "index", + "examples": { + "merge.c": ["ex/v1.9.1/merge.html#git_index_conflict_iterator_free-14"] + } + }, + "git_indexer_options_init": { + "type": "function", + "file": "git2/indexer.h", + "line": 116, + "lineto": 118, + "args": [ { - "name": "merge_opts", - "type": "const git_merge_options *", - "comment": "merge options" + "name": "opts", + "type": "git_indexer_options *", + "comment": "the `git_indexer_options` struct to initialize." }, { - "name": "checkout_opts", - "type": "const git_checkout_options *", - "comment": "checkout options" + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_INDEXER_OPTIONS_VERSION`" } ], - "argline": "git_repository *repo, const git_annotated_commit **their_heads, size_t their_heads_len, const git_merge_options *merge_opts, const git_checkout_options *checkout_opts", - "sig": "git_repository *::const git_annotated_commit **::size_t::const git_merge_options *::const git_checkout_options *", + "argline": "git_indexer_options *opts, unsigned int version", + "sig": "git_indexer_options *::unsigned int", "return": { "type": "int", - "comment": " 0 on success or error code" + "comment": " Zero on success; -1 on failure." }, - "description": "

Merges the given commit(s) into HEAD, writing the results into the working\n directory. Any changes are staged for commit and any conflicts are written\n to the index. Callers should inspect the repository's index after this\n completes, resolve any conflicts and prepare a commit.

\n", - "comments": "

For compatibility with git, the repository is put into a merging state. Once the commit is done (or if the uses wishes to abort), you should clear this state by calling git_repository_state_cleanup().

\n", - "group": "merge" + "description": "

Initializes a git_indexer_options with default values. Equivalent to\n creating an instance with GIT_INDEXER_OPTIONS_INIT.

\n", + "comments": "", + "group": "indexer" }, - "git_message_prettify": { + "git_indexer_new": { "type": "function", - "file": "message.h", - "line": 39, - "lineto": 39, + "file": "git2/indexer.h", + "line": 147, + "lineto": 152, "args": [ { "name": "out", - "type": "git_buf *", - "comment": "The user-allocated git_buf which will be filled with the\n cleaned up message." + "type": "git_indexer **", + "comment": "where to store the indexer instance" }, { - "name": "message", + "name": "path", "type": "const char *", - "comment": "The message to be prettified." + "comment": "to the directory where the packfile should be stored" }, { - "name": "strip_comments", - "type": "int", - "comment": "Non-zero to remove comment lines, 0 to leave them in." + "name": "mode", + "type": "unsigned int", + "comment": "permissions to use creating packfile or 0 for defaults" }, { - "name": "comment_char", - "type": "char", - "comment": "Comment character. Lines starting with this character\n are considered to be comments and removed if `strip_comments` is non-zero." + "name": "odb", + "type": "git_odb *", + "comment": "object database from which to read base objects when\n fixing thin packs. Pass NULL if no thin pack is expected (an error\n will be returned if there are bases missing)" + }, + { + "name": "opts", + "type": "git_indexer_options *", + "comment": "Optional structure containing additional options. See\n `git_indexer_options` above." } ], - "argline": "git_buf *out, const char *message, int strip_comments, char comment_char", - "sig": "git_buf *::const char *::int::char", - "return": { - "type": "int", - "comment": " 0 or an error code." - }, - "description": "

Clean up message from excess whitespace and make sure that the last line\n ends with a '

\n\n

'.

\n", - "comments": "

Optionally, can remove lines starting with a "#".

\n", - "group": "message" + "argline": "git_indexer **out, const char *path, unsigned int mode, git_odb *odb, git_indexer_options *opts", + "sig": "git_indexer **::const char *::unsigned int::git_odb *::git_indexer_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create a new indexer instance

\n", + "comments": "", + "group": "indexer" }, - "git_note_iterator_new": { + "git_indexer_append": { "type": "function", - "file": "notes.h", - "line": 49, - "lineto": 52, + "file": "git2/indexer.h", + "line": 164, + "lineto": 164, "args": [ + { "name": "idx", "type": "git_indexer *", "comment": "the indexer" }, { - "name": "out", - "type": "git_note_iterator **", - "comment": "pointer to the iterator" + "name": "data", + "type": "const void *", + "comment": "the data to add" }, { - "name": "repo", - "type": "git_repository *", - "comment": "repository where to look up the note" + "name": "size", + "type": "size_t", + "comment": "the size of the data in bytes" }, { - "name": "notes_ref", - "type": "const char *", - "comment": "canonical name of the reference to use (optional); defaults to\n \"refs/notes/commits\"" + "name": "stats", + "type": "git_indexer_progress *", + "comment": "stat storage" } ], - "argline": "git_note_iterator **out, git_repository *repo, const char *notes_ref", - "sig": "git_note_iterator **::git_repository *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Creates a new iterator for notes

\n", - "comments": "

The iterator must be freed manually by the user.

\n", - "group": "note" + "argline": "git_indexer *idx, const void *data, size_t size, git_indexer_progress *stats", + "sig": "git_indexer *::const void *::size_t::git_indexer_progress *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Add data to the indexer

\n", + "comments": "", + "group": "indexer" }, - "git_note_iterator_free": { + "git_indexer_commit": { "type": "function", - "file": "notes.h", - "line": 59, - "lineto": 59, + "file": "git2/indexer.h", + "line": 175, + "lineto": 175, "args": [ + { "name": "idx", "type": "git_indexer *", "comment": "the indexer" }, { - "name": "it", - "type": "git_note_iterator *", - "comment": "pointer to the iterator" + "name": "stats", + "type": "git_indexer_progress *", + "comment": "Stat storage." } ], - "argline": "git_note_iterator *it", - "sig": "git_note_iterator *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Frees an git_note_iterator

\n", - "comments": "", - "group": "note" + "argline": "git_indexer *idx, git_indexer_progress *stats", + "sig": "git_indexer *::git_indexer_progress *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Finalize the pack and index

\n", + "comments": "

Resolve any pending deltas and write out the index file

\n", + "group": "indexer" }, - "git_note_next": { + "git_indexer_hash": { "type": "function", - "file": "notes.h", - "line": 72, - "lineto": 75, + "file": "git2/indexer.h", + "line": 188, + "lineto": 188, "args": [ { - "name": "note_id", - "type": "git_oid *", - "comment": "id of blob containing the message" - }, - { - "name": "annotated_id", - "type": "git_oid *", - "comment": "id of the git object being annotated" - }, - { - "name": "it", - "type": "git_note_iterator *", - "comment": "pointer to the iterator" + "name": "idx", + "type": "const git_indexer *", + "comment": "the indexer instance" } ], - "argline": "git_oid *note_id, git_oid *annotated_id, git_note_iterator *it", - "sig": "git_oid *::git_oid *::git_note_iterator *", + "argline": "const git_indexer *idx", + "sig": "const git_indexer *", "return": { - "type": "int", - "comment": " 0 (no error), GIT_ITEROVER (iteration is done) or an error code\n (negative value)" + "type": "const git_oid *", + "comment": " the packfile's hash" }, - "description": "

Return the current item (note_id and annotated_id) and advance the iterator\n internally to the next value

\n", - "comments": "", - "group": "note" + "description": "

Get the packfile's hash

\n", + "comments": "

A packfile's name is derived from the sorted hashing of all object names. This is only correct after the index has been finalized.

\n", + "group": "indexer" }, - "git_note_read": { + "git_indexer_name": { "type": "function", - "file": "notes.h", - "line": 91, - "lineto": 95, + "file": "git2/indexer.h", + "line": 200, + "lineto": 200, "args": [ { - "name": "out", - "type": "git_note **", - "comment": "pointer to the read note; NULL in case of error" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "repository where to look up the note" - }, - { - "name": "notes_ref", - "type": "const char *", - "comment": "canonical name of the reference to use (optional); defaults to\n \"refs/notes/commits\"" - }, - { - "name": "oid", - "type": "const git_oid *", - "comment": "OID of the git object to read the note from" + "name": "idx", + "type": "const git_indexer *", + "comment": "the indexer instance" } ], - "argline": "git_note **out, git_repository *repo, const char *notes_ref, const git_oid *oid", - "sig": "git_note **::git_repository *::const char *::const git_oid *", + "argline": "const git_indexer *idx", + "sig": "const git_indexer *", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "const char *", + "comment": " a NUL terminated string for the packfile name" }, - "description": "

Read the note for an object

\n", - "comments": "

The note must be freed manually by the user.

\n", - "group": "note" + "description": "

Get the unique name for the resulting packfile.

\n", + "comments": "

The packfile's name is derived from the packfile's content. This is only correct after the index has been finalized.

\n", + "group": "indexer" }, - "git_note_author": { + "git_indexer_free": { "type": "function", - "file": "notes.h", - "line": 103, - "lineto": 103, + "file": "git2/indexer.h", + "line": 207, + "lineto": 207, "args": [ { - "name": "note", - "type": "const git_note *", - "comment": "the note" + "name": "idx", + "type": "git_indexer *", + "comment": "the indexer to free" } ], - "argline": "const git_note *note", - "sig": "const git_note *", - "return": { - "type": "const git_signature *", - "comment": " the author" - }, - "description": "

Get the note author

\n", + "argline": "git_indexer *idx", + "sig": "git_indexer *", + "return": { "type": "void", "comment": null }, + "description": "

Free the indexer and its resources

\n", "comments": "", - "group": "note" + "group": "indexer" }, - "git_note_committer": { + "git_mailmap_new": { "type": "function", - "file": "notes.h", - "line": 111, - "lineto": 111, + "file": "git2/mailmap.h", + "line": 37, + "lineto": 37, "args": [ { - "name": "note", - "type": "const git_note *", - "comment": "the note" + "name": "out", + "type": "git_mailmap **", + "comment": "pointer to store the new mailmap" } ], - "argline": "const git_note *note", - "sig": "const git_note *", - "return": { - "type": "const git_signature *", - "comment": " the committer" - }, - "description": "

Get the note committer

\n", - "comments": "", - "group": "note" + "argline": "git_mailmap **out", + "sig": "git_mailmap **", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Allocate a new mailmap object.

\n", + "comments": "

This object is empty, so you'll have to add a mailmap file before you can do anything with it. The mailmap must be freed with 'git_mailmap_free'.

\n", + "group": "mailmap" }, - "git_note_message": { + "git_mailmap_free": { "type": "function", - "file": "notes.h", - "line": 120, - "lineto": 120, + "file": "git2/mailmap.h", + "line": 44, + "lineto": 44, "args": [ { - "name": "note", - "type": "const git_note *", - "comment": "the note" + "name": "mm", + "type": "git_mailmap *", + "comment": "the mailmap to free" } ], - "argline": "const git_note *note", - "sig": "const git_note *", - "return": { - "type": "const char *", - "comment": " the note message" - }, - "description": "

Get the note message

\n", + "argline": "git_mailmap *mm", + "sig": "git_mailmap *", + "return": { "type": "void", "comment": null }, + "description": "

Free the mailmap and its associated memory.

\n", "comments": "", - "group": "note" + "group": "mailmap" }, - "git_note_id": { + "git_mailmap_add_entry": { "type": "function", - "file": "notes.h", - "line": 129, - "lineto": 129, + "file": "git2/mailmap.h", + "line": 57, + "lineto": 59, "args": [ { - "name": "note", - "type": "const git_note *", - "comment": "the note" + "name": "mm", + "type": "git_mailmap *", + "comment": "mailmap to add the entry to" + }, + { + "name": "real_name", + "type": "const char *", + "comment": "the real name to use, or NULL" + }, + { + "name": "real_email", + "type": "const char *", + "comment": "the real email to use, or NULL" + }, + { + "name": "replace_name", + "type": "const char *", + "comment": "the name to replace, or NULL" + }, + { + "name": "replace_email", + "type": "const char *", + "comment": "the email to replace" } ], - "argline": "const git_note *note", - "sig": "const git_note *", - "return": { - "type": "const git_oid *", - "comment": " the note object's id" - }, - "description": "

Get the note object's id

\n", + "argline": "git_mailmap *mm, const char *real_name, const char *real_email, const char *replace_name, const char *replace_email", + "sig": "git_mailmap *::const char *::const char *::const char *::const char *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Add a single entry to the given mailmap object. If the entry already exists,\n it will be replaced with the new entry.

\n", "comments": "", - "group": "note" + "group": "mailmap" }, - "git_note_create": { + "git_mailmap_from_buffer": { "type": "function", - "file": "notes.h", - "line": 146, - "lineto": 154, + "file": "git2/mailmap.h", + "line": 69, + "lineto": 70, "args": [ { "name": "out", - "type": "git_oid *", - "comment": "pointer to store the OID (optional); NULL in case of error" + "type": "git_mailmap **", + "comment": "pointer to store the new mailmap" }, { - "name": "repo", - "type": "git_repository *", - "comment": "repository where to store the note" + "name": "buf", + "type": "const char *", + "comment": "buffer to parse the mailmap from" }, { - "name": "notes_ref", - "type": "const char *", - "comment": "canonical name of the reference to use (optional);\n\t\t\t\t\tdefaults to \"refs/notes/commits\"" + "name": "len", + "type": "size_t", + "comment": "the length of the input buffer" + } + ], + "argline": "git_mailmap **out, const char *buf, size_t len", + "sig": "git_mailmap **::const char *::size_t", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Create a new mailmap instance containing a single mailmap file

\n", + "comments": "", + "group": "mailmap" + }, + "git_mailmap_from_repository": { + "type": "function", + "file": "git2/mailmap.h", + "line": 86, + "lineto": 87, + "args": [ + { + "name": "out", + "type": "git_mailmap **", + "comment": "pointer to store the new mailmap" }, { - "name": "author", - "type": "const git_signature *", - "comment": "signature of the notes commit author" + "name": "repo", + "type": "git_repository *", + "comment": "repository to load mailmap information from" + } + ], + "argline": "git_mailmap **out, git_repository *repo", + "sig": "git_mailmap **::git_repository *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Create a new mailmap instance from a repository, loading mailmap files based\n on the repository's configuration.

\n", + "comments": "

Mailmaps are loaded in the following order: 1. '.mailmap' in the root of the repository's working directory, if present. 2. The blob object identified by the 'mailmap.blob' config entry, if set. [NOTE: 'mailmap.blob' defaults to 'HEAD:.mailmap' in bare repositories] 3. The path in the 'mailmap.file' config entry, if set.

\n", + "group": "mailmap" + }, + "git_mailmap_resolve": { + "type": "function", + "file": "git2/mailmap.h", + "line": 101, + "lineto": 103, + "args": [ + { + "name": "real_name", + "type": "const char **", + "comment": "pointer to store the real name" }, { - "name": "committer", - "type": "const git_signature *", - "comment": "signature of the notes commit committer" + "name": "real_email", + "type": "const char **", + "comment": "pointer to store the real email" }, { - "name": "oid", - "type": "const git_oid *", - "comment": "OID of the git object to decorate" + "name": "mm", + "type": "const git_mailmap *", + "comment": "the mailmap to perform a lookup with (may be NULL)" }, { - "name": "note", + "name": "name", "type": "const char *", - "comment": "Content of the note to add for object oid" + "comment": "the name to look up" }, { - "name": "force", - "type": "int", - "comment": "Overwrite existing note" + "name": "email", + "type": "const char *", + "comment": "the email to look up" } ], - "argline": "git_oid *out, git_repository *repo, const char *notes_ref, const git_signature *author, const git_signature *committer, const git_oid *oid, const char *note, int force", - "sig": "git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const git_oid *::const char *::int", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Add a note for an object

\n", - "comments": "", - "group": "note" + "argline": "const char **real_name, const char **real_email, const git_mailmap *mm, const char *name, const char *email", + "sig": "const char **::const char **::const git_mailmap *::const char *::const char *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Resolve a name and email to the corresponding real name and email.

\n", + "comments": "

The lifetime of the strings are tied to mm, name, and email parameters.

\n", + "group": "mailmap" }, - "git_note_remove": { + "git_mailmap_resolve_signature": { "type": "function", - "file": "notes.h", - "line": 169, - "lineto": 174, + "file": "git2/mailmap.h", + "line": 115, + "lineto": 116, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": "repository where the note lives" + "name": "out", + "type": "git_signature **", + "comment": "new signature" }, { - "name": "notes_ref", - "type": "const char *", - "comment": "canonical name of the reference to use (optional);\n\t\t\t\t\tdefaults to \"refs/notes/commits\"" + "name": "mm", + "type": "const git_mailmap *", + "comment": "mailmap to resolve with" }, { - "name": "author", + "name": "sig", "type": "const git_signature *", - "comment": "signature of the notes commit author" - }, + "comment": "signature to resolve" + } + ], + "argline": "git_signature **out, const git_mailmap *mm, const git_signature *sig", + "sig": "git_signature **::const git_mailmap *::const git_signature *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Resolve a signature to use real names and emails with a mailmap.

\n", + "comments": "

Call git_signature_free() to free the data.

\n", + "group": "mailmap" + }, + "git_merge_file_input_init": { + "type": "function", + "file": "git2/merge.h", + "line": 66, + "lineto": 68, + "args": [ { - "name": "committer", - "type": "const git_signature *", - "comment": "signature of the notes commit committer" + "name": "opts", + "type": "git_merge_file_input *", + "comment": "the `git_merge_file_input` instance to initialize." }, { - "name": "oid", - "type": "const git_oid *", - "comment": "OID of the git object to remove the note from" + "name": "version", + "type": "unsigned int", + "comment": "the version of the struct; you should pass\n `GIT_MERGE_FILE_INPUT_VERSION` here." } ], - "argline": "git_repository *repo, const char *notes_ref, const git_signature *author, const git_signature *committer, const git_oid *oid", - "sig": "git_repository *::const char *::const git_signature *::const git_signature *::const git_oid *", + "argline": "git_merge_file_input *opts, unsigned int version", + "sig": "git_merge_file_input *::unsigned int", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " Zero on success; -1 on failure." }, - "description": "

Remove the note for an object

\n", + "description": "

Initializes a git_merge_file_input with default values. Equivalent to\n creating an instance with GIT_MERGE_FILE_INPUT_INIT.

\n", "comments": "", - "group": "note" + "group": "merge" }, - "git_note_free": { + "git_merge_file_options_init": { "type": "function", - "file": "notes.h", - "line": 181, - "lineto": 181, + "file": "git2/merge.h", + "line": 243, + "lineto": 243, "args": [ { - "name": "note", - "type": "git_note *", - "comment": "git_note object" + "name": "opts", + "type": "git_merge_file_options *", + "comment": "The `git_merge_file_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_MERGE_FILE_OPTIONS_VERSION`." } ], - "argline": "git_note *note", - "sig": "git_note *", + "argline": "git_merge_file_options *opts, unsigned int version", + "sig": "git_merge_file_options *::unsigned int", "return": { - "type": "void", - "comment": null + "type": "int", + "comment": " Zero on success; -1 on failure." }, - "description": "

Free a git_note object

\n", - "comments": "", - "group": "note" + "description": "

Initialize git_merge_file_options structure

\n", + "comments": "

Initializes a git_merge_file_options with default values. Equivalent to creating an instance with GIT_MERGE_FILE_OPTIONS_INIT.

\n", + "group": "merge" }, - "git_note_foreach": { + "git_merge_options_init": { "type": "function", - "file": "notes.h", - "line": 209, - "lineto": 213, + "file": "git2/merge.h", + "line": 342, + "lineto": 342, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": "Repository where to find the notes." - }, - { - "name": "notes_ref", - "type": "const char *", - "comment": "Reference to read from (optional); defaults to\n \"refs/notes/commits\"." - }, - { - "name": "note_cb", - "type": "git_note_foreach_cb", - "comment": "Callback to invoke per found annotation. Return non-zero\n to stop looping." + "name": "opts", + "type": "git_merge_options *", + "comment": "The `git_merge_options` struct to initialize." }, { - "name": "payload", - "type": "void *", - "comment": "Extra parameter to callback function." + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_MERGE_OPTIONS_VERSION`." } ], - "argline": "git_repository *repo, const char *notes_ref, git_note_foreach_cb note_cb, void *payload", - "sig": "git_repository *::const char *::git_note_foreach_cb::void *", + "argline": "git_merge_options *opts, unsigned int version", + "sig": "git_merge_options *::unsigned int", "return": { "type": "int", - "comment": " 0 on success, non-zero callback return value, or error code" + "comment": " Zero on success; -1 on failure." }, - "description": "

Loop over all the notes within a specified namespace\n and issue a callback for each one.

\n", - "comments": "", - "group": "note" + "description": "

Initialize git_merge_options structure

\n", + "comments": "

Initializes a git_merge_options with default values. Equivalent to creating an instance with GIT_MERGE_OPTIONS_INIT.

\n", + "group": "merge" }, - "git_object_lookup": { + "git_merge_analysis": { "type": "function", - "file": "object.h", - "line": 42, - "lineto": 46, + "file": "git2/merge.h", + "line": 412, + "lineto": 417, "args": [ { - "name": "object", - "type": "git_object **", - "comment": "pointer to the looked-up object" + "name": "analysis_out", + "type": "git_merge_analysis_t *", + "comment": "analysis enumeration that the result is written into" + }, + { + "name": "preference_out", + "type": "git_merge_preference_t *", + "comment": "One of the `git_merge_preference_t` flag." }, { "name": "repo", "type": "git_repository *", - "comment": "the repository to look up the object" + "comment": "the repository to merge" }, { - "name": "id", - "type": "const git_oid *", - "comment": "the unique identifier for the object" - }, + "name": "their_heads", + "type": "const git_annotated_commit **", + "comment": "the heads to merge into" + }, { - "name": "type", - "type": "git_otype", - "comment": "the type of the object" + "name": "their_heads_len", + "type": "size_t", + "comment": "the number of heads to merge" } ], - "argline": "git_object **object, git_repository *repo, const git_oid *id, git_otype type", - "sig": "git_object **::git_repository *::const git_oid *::git_otype", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Lookup a reference to one of the objects in a repository.

\n", - "comments": "

The generated reference is owned by the repository and should be closed with the git_object_free method instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object in the odb; the method will fail otherwise. The special value 'GIT_OBJ_ANY' may be passed to let the method guess the object's type.

\n", - "group": "object", - "examples": { - "log.c": [ - "ex/HEAD/log.html#git_object_lookup-33" - ] - } + "argline": "git_merge_analysis_t *analysis_out, git_merge_preference_t *preference_out, git_repository *repo, const git_annotated_commit **their_heads, size_t their_heads_len", + "sig": "git_merge_analysis_t *::git_merge_preference_t *::git_repository *::const git_annotated_commit **::size_t", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Analyzes the given branch(es) and determines the opportunities for\n merging them into the HEAD of the repository.

\n", + "comments": "", + "group": "merge", + "examples": { "merge.c": ["ex/v1.9.1/merge.html#git_merge_analysis-15"] } }, - "git_object_lookup_prefix": { + "git_merge_analysis_for_ref": { "type": "function", - "file": "object.h", - "line": 75, - "lineto": 80, + "file": "git2/merge.h", + "line": 431, + "lineto": 437, "args": [ { - "name": "object_out", - "type": "git_object **", - "comment": "pointer where to store the looked-up object" + "name": "analysis_out", + "type": "git_merge_analysis_t *", + "comment": "analysis enumeration that the result is written into" + }, + { + "name": "preference_out", + "type": "git_merge_preference_t *", + "comment": "One of the `git_merge_preference_t` flag." }, { "name": "repo", "type": "git_repository *", - "comment": "the repository to look up the object" + "comment": "the repository to merge" }, { - "name": "id", - "type": "const git_oid *", - "comment": "a short identifier for the object" + "name": "our_ref", + "type": "git_reference *", + "comment": "the reference to perform the analysis from" }, { - "name": "len", + "name": "their_heads", + "type": "const git_annotated_commit **", + "comment": "the heads to merge into" + }, + { + "name": "their_heads_len", "type": "size_t", - "comment": "the length of the short identifier" + "comment": "the number of heads to merge" + } + ], + "argline": "git_merge_analysis_t *analysis_out, git_merge_preference_t *preference_out, git_repository *repo, git_reference *our_ref, const git_annotated_commit **their_heads, size_t their_heads_len", + "sig": "git_merge_analysis_t *::git_merge_preference_t *::git_repository *::git_reference *::const git_annotated_commit **::size_t", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Analyzes the given branch(es) and determines the opportunities for\n merging them into a reference.

\n", + "comments": "", + "group": "merge" + }, + "git_merge_base": { + "type": "function", + "file": "git2/merge.h", + "line": 448, + "lineto": 452, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "the OID of a merge base between 'one' and 'two'" }, { - "name": "type", - "type": "git_otype", - "comment": "the type of the object" + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" + }, + { + "name": "one", + "type": "const git_oid *", + "comment": "one of the commits" + }, + { + "name": "two", + "type": "const git_oid *", + "comment": "the other commit" } ], - "argline": "git_object **object_out, git_repository *repo, const git_oid *id, size_t len, git_otype type", - "sig": "git_object **::git_repository *::const git_oid *::size_t::git_otype", + "argline": "git_oid *out, git_repository *repo, const git_oid *one, const git_oid *two", + "sig": "git_oid *::git_repository *::const git_oid *::const git_oid *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, GIT_ENOTFOUND if not found or error code" }, - "description": "

Lookup a reference to one of the objects in a repository,\n given a prefix of its identifier (short id).

\n", - "comments": "

The object obtained will be so that its identifier matches the first 'len' hexadecimal characters (packets of 4 bits) of the given 'id'. 'len' must be at least GIT_OID_MINPREFIXLEN, and long enough to identify a unique object matching the prefix; otherwise the method will fail.

\n\n

The generated reference is owned by the repository and should be closed with the git_object_free method instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object in the odb; the method will fail otherwise. The special value 'GIT_OBJ_ANY' may be passed to let the method guess the object's type.

\n", - "group": "object" + "description": "

Find a merge base between two commits

\n", + "comments": "", + "group": "merge", + "examples": { + "log.c": ["ex/v1.9.1/log.html#git_merge_base-31"], + "rev-parse.c": ["ex/v1.9.1/rev-parse.html#git_merge_base-1"] + } }, - "git_object_lookup_bypath": { + "git_merge_bases": { "type": "function", - "file": "object.h", - "line": 93, - "lineto": 97, + "file": "git2/merge.h", + "line": 463, + "lineto": 467, "args": [ { "name": "out", - "type": "git_object **", - "comment": "buffer that receives a pointer to the object (which must be freed\n by the caller)" + "type": "git_oidarray *", + "comment": "array in which to store the resulting ids" }, { - "name": "treeish", - "type": "const git_object *", - "comment": "root object that can be peeled to a tree" + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" }, { - "name": "path", - "type": "const char *", - "comment": "relative path from the root object to the desired object" + "name": "one", + "type": "const git_oid *", + "comment": "one of the commits" }, { - "name": "type", - "type": "git_otype", - "comment": "type of object desired" + "name": "two", + "type": "const git_oid *", + "comment": "the other commit" } ], - "argline": "git_object **out, const git_object *treeish, const char *path, git_otype type", - "sig": "git_object **::const git_object *::const char *::git_otype", + "argline": "git_oidarray *out, git_repository *repo, const git_oid *one, const git_oid *two", + "sig": "git_oidarray *::git_repository *::const git_oid *::const git_oid *", "return": { "type": "int", - "comment": " 0 on success, or an error code" + "comment": " 0 on success, GIT_ENOTFOUND if not found or error code" }, - "description": "

Lookup an object that represents a tree entry.

\n", + "description": "

Find merge bases between two commits

\n", "comments": "", - "group": "object" + "group": "merge" }, - "git_object_id": { + "git_merge_base_many": { "type": "function", - "file": "object.h", - "line": 105, - "lineto": 105, + "file": "git2/merge.h", + "line": 478, + "lineto": 482, "args": [ { - "name": "obj", - "type": "const git_object *", - "comment": "the repository object" + "name": "out", + "type": "git_oid *", + "comment": "the OID of a merge base considering all the commits" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" + }, + { + "name": "length", + "type": "size_t", + "comment": "The number of commits in the provided `input_array`" + }, + { + "name": "input_array", + "type": "const git_oid []", + "comment": "oids of the commits" } ], - "argline": "const git_object *obj", - "sig": "const git_object *", + "argline": "git_oid *out, git_repository *repo, size_t length, const git_oid [] input_array", + "sig": "git_oid *::git_repository *::size_t::const git_oid []", "return": { - "type": "const git_oid *", - "comment": " the SHA1 id" + "type": "int", + "comment": " Zero on success; GIT_ENOTFOUND or -1 on failure." }, - "description": "

Get the id (SHA1) of a repository object

\n", + "description": "

Find a merge base given a list of commits

\n", "comments": "", - "group": "object", - "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_object_id-10", - "ex/HEAD/blame.html#git_object_id-11", - "ex/HEAD/blame.html#git_object_id-12", - "ex/HEAD/blame.html#git_object_id-13" - ], - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_object_id-12", - "ex/HEAD/cat-file.html#git_object_id-13" - ], - "log.c": [ - "ex/HEAD/log.html#git_object_id-34", - "ex/HEAD/log.html#git_object_id-35", - "ex/HEAD/log.html#git_object_id-36", - "ex/HEAD/log.html#git_object_id-37" - ], - "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_object_id-4", - "ex/HEAD/rev-parse.html#git_object_id-5", - "ex/HEAD/rev-parse.html#git_object_id-6", - "ex/HEAD/rev-parse.html#git_object_id-7", - "ex/HEAD/rev-parse.html#git_object_id-8" - ] - } + "group": "merge" }, - "git_object_short_id": { + "git_merge_bases_many": { "type": "function", - "file": "object.h", - "line": 119, - "lineto": 119, + "file": "git2/merge.h", + "line": 524, + "lineto": 528, "args": [ { "name": "out", - "type": "git_buf *", - "comment": "Buffer to write string into" + "type": "git_oidarray *", + "comment": "array in which to store the resulting ids" }, { - "name": "obj", - "type": "const git_object *", - "comment": "The object to get an ID for" + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" + }, + { + "name": "length", + "type": "size_t", + "comment": "The number of commits in the provided `input_array`" + }, + { + "name": "input_array", + "type": "const git_oid []", + "comment": "oids of the commits" } ], - "argline": "git_buf *out, const git_object *obj", - "sig": "git_buf *::const git_object *", + "argline": "git_oidarray *out, git_repository *repo, size_t length, const git_oid [] input_array", + "sig": "git_oidarray *::git_repository *::size_t::const git_oid []", "return": { "type": "int", - "comment": " 0 on success, \n<\n0 for error" + "comment": " Zero on success; GIT_ENOTFOUND or -1 on failure." }, - "description": "

Get a short abbreviated OID string for the object

\n", - "comments": "

This starts at the "core.abbrev" length (default 7 characters) and iteratively extends to a longer string if that length is ambiguous. The result will be unambiguous (at least until new objects are added to the repository).

\n", - "group": "object", - "examples": { - "tag.c": [ - "ex/HEAD/tag.html#git_object_short_id-5" - ] - } + "description": "

Find all merge bases given a list of commits

\n", + "comments": "

This behaves similar to git merge-base.

\n\n

Given three commits a, b, and c, merge_base_many will compute a hypothetical commit m, which is a merge between b and c.

\n\n

For example, with the following topology: text o---o---o---o---C / / o---o---o---B / / ---2---1---o---o---o---A

\n\n

the result of merge_base_many given a, b, and c is 1. This is because the equivalent topology with the imaginary merge commit m between b and c is: text o---o---o---o---o / \\ / o---o---o---o---M / / ---2---1---o---o---o---A

\n\n

and the result of merge_base_many given a and m is 1.

\n\n

If you're looking to recieve the common ancestor between all the given commits, use merge_base_octopus.

\n", + "group": "merge" }, - "git_object_type": { + "git_merge_base_octopus": { "type": "function", - "file": "object.h", - "line": 127, - "lineto": 127, + "file": "git2/merge.h", + "line": 539, + "lineto": 543, "args": [ { - "name": "obj", - "type": "const git_object *", - "comment": "the repository object" + "name": "out", + "type": "git_oid *", + "comment": "the OID of a merge base considering all the commits" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" + }, + { + "name": "length", + "type": "size_t", + "comment": "The number of commits in the provided `input_array`" + }, + { + "name": "input_array", + "type": "const git_oid []", + "comment": "oids of the commits" } ], - "argline": "const git_object *obj", - "sig": "const git_object *", + "argline": "git_oid *out, git_repository *repo, size_t length, const git_oid [] input_array", + "sig": "git_oid *::git_repository *::size_t::const git_oid []", "return": { - "type": "git_otype", - "comment": " the object's type" + "type": "int", + "comment": " Zero on success; GIT_ENOTFOUND or -1 on failure." }, - "description": "

Get the object type of an object

\n", + "description": "

Find a merge base in preparation for an octopus merge

\n", "comments": "", - "group": "object", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_object_type-14", - "ex/HEAD/cat-file.html#git_object_type-15", - "ex/HEAD/cat-file.html#git_object_type-16" - ], - "tag.c": [ - "ex/HEAD/tag.html#git_object_type-6" - ] - } + "group": "merge" }, - "git_object_owner": { + "git_merge_file": { "type": "function", - "file": "object.h", - "line": 141, - "lineto": 141, + "file": "git2/merge.h", + "line": 561, + "lineto": 566, "args": [ { - "name": "obj", - "type": "const git_object *", - "comment": "the object" - } - ], - "argline": "const git_object *obj", - "sig": "const git_object *", - "return": { - "type": "git_repository *", - "comment": " the repository who owns this object" - }, - "description": "

Get the repository that owns this object

\n", - "comments": "

Freeing or calling git_repository_close on the returned pointer will invalidate the actual object.

\n\n

Any other operation may be run on the repository without affecting the object.

\n", - "group": "object" - }, - "git_object_free": { - "type": "function", - "file": "object.h", - "line": 158, - "lineto": 158, - "args": [ + "name": "out", + "type": "git_merge_file_result *", + "comment": "The git_merge_file_result to be filled in" + }, { - "name": "object", - "type": "git_object *", - "comment": "the object to close" - } - ], - "argline": "git_object *object", - "sig": "git_object *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Close an open object

\n", - "comments": "

This method instructs the library to close an existing object; note that git_objects are owned and cached by the repository so the object may or may not be freed after this library call, depending on how aggressive is the caching mechanism used by the repository.

\n\n

IMPORTANT: It is necessary to call this method when you stop using an object. Failure to do so will cause a memory leak.

\n", - "group": "object", - "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_object_free-14", - "ex/HEAD/blame.html#git_object_free-15", - "ex/HEAD/blame.html#git_object_free-16", - "ex/HEAD/blame.html#git_object_free-17" - ], - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_object_free-17" - ], - "general.c": [ - "ex/HEAD/general.html#git_object_free-36" - ], - "log.c": [ - "ex/HEAD/log.html#git_object_free-38" - ], - "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_object_free-9", - "ex/HEAD/rev-parse.html#git_object_free-10", - "ex/HEAD/rev-parse.html#git_object_free-11" - ], - "tag.c": [ - "ex/HEAD/tag.html#git_object_free-7", - "ex/HEAD/tag.html#git_object_free-8", - "ex/HEAD/tag.html#git_object_free-9", - "ex/HEAD/tag.html#git_object_free-10" - ] - } - }, - "git_object_type2string": { - "type": "function", - "file": "object.h", - "line": 169, - "lineto": 169, - "args": [ + "name": "ancestor", + "type": "const git_merge_file_input *", + "comment": "The contents of the ancestor file" + }, { - "name": "type", - "type": "git_otype", - "comment": "object type to convert." + "name": "ours", + "type": "const git_merge_file_input *", + "comment": "The contents of the file in \"our\" side" + }, + { + "name": "theirs", + "type": "const git_merge_file_input *", + "comment": "The contents of the file in \"their\" side" + }, + { + "name": "opts", + "type": "const git_merge_file_options *", + "comment": "The merge file options or `NULL` for defaults" } ], - "argline": "git_otype type", - "sig": "git_otype", - "return": { - "type": "const char *", - "comment": " the corresponding string representation." - }, - "description": "

Convert an object type to its string representation.

\n", - "comments": "

The result is a pointer to a string in static memory and should not be free()'ed.

\n", - "group": "object", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_object_type2string-18", - "ex/HEAD/cat-file.html#git_object_type2string-19", - "ex/HEAD/cat-file.html#git_object_type2string-20", - "ex/HEAD/cat-file.html#git_object_type2string-21" - ], - "general.c": [ - "ex/HEAD/general.html#git_object_type2string-37", - "ex/HEAD/general.html#git_object_type2string-38" - ] - } + "argline": "git_merge_file_result *out, const git_merge_file_input *ancestor, const git_merge_file_input *ours, const git_merge_file_input *theirs, const git_merge_file_options *opts", + "sig": "git_merge_file_result *::const git_merge_file_input *::const git_merge_file_input *::const git_merge_file_input *::const git_merge_file_options *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Merge two files as they exist in the in-memory data structures, using\n the given common ancestor as the baseline, producing a\n git_merge_file_result that reflects the merge result. The\n git_merge_file_result must be freed with git_merge_file_result_free.

\n", + "comments": "

Note that this function does not reference a repository and any configuration must be passed as git_merge_file_options.

\n", + "group": "merge" }, - "git_object_string2type": { + "git_merge_file_from_index": { "type": "function", - "file": "object.h", - "line": 177, - "lineto": 177, + "file": "git2/merge.h", + "line": 582, + "lineto": 588, "args": [ { - "name": "str", - "type": "const char *", - "comment": "the string to convert." + "name": "out", + "type": "git_merge_file_result *", + "comment": "The git_merge_file_result to be filled in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository" + }, + { + "name": "ancestor", + "type": "const git_index_entry *", + "comment": "The index entry for the ancestor file (stage level 1)" + }, + { + "name": "ours", + "type": "const git_index_entry *", + "comment": "The index entry for our file (stage level 2)" + }, + { + "name": "theirs", + "type": "const git_index_entry *", + "comment": "The index entry for their file (stage level 3)" + }, + { + "name": "opts", + "type": "const git_merge_file_options *", + "comment": "The merge file options or NULL" } ], - "argline": "const char *str", - "sig": "const char *", - "return": { - "type": "git_otype", - "comment": " the corresponding git_otype." - }, - "description": "

Convert a string object type representation to it's git_otype.

\n", + "argline": "git_merge_file_result *out, git_repository *repo, const git_index_entry *ancestor, const git_index_entry *ours, const git_index_entry *theirs, const git_merge_file_options *opts", + "sig": "git_merge_file_result *::git_repository *::const git_index_entry *::const git_index_entry *::const git_index_entry *::const git_merge_file_options *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Merge two files as they exist in the index, using the given common\n ancestor as the baseline, producing a git_merge_file_result that\n reflects the merge result. The git_merge_file_result must be freed with\n git_merge_file_result_free.

\n", "comments": "", - "group": "object" + "group": "merge" }, - "git_object_typeisloose": { + "git_merge_file_result_free": { "type": "function", - "file": "object.h", - "line": 186, - "lineto": 186, + "file": "git2/merge.h", + "line": 595, + "lineto": 595, "args": [ { - "name": "type", - "type": "git_otype", - "comment": "object type to test." + "name": "result", + "type": "git_merge_file_result *", + "comment": "The result to free or `NULL`" } ], - "argline": "git_otype type", - "sig": "git_otype", - "return": { - "type": "int", - "comment": " true if the type represents a valid loose object type,\n false otherwise." - }, - "description": "

Determine if the given git_otype is a valid loose object type.

\n", + "argline": "git_merge_file_result *result", + "sig": "git_merge_file_result *", + "return": { "type": "void", "comment": null }, + "description": "

Frees a git_merge_file_result.

\n", "comments": "", - "group": "object" + "group": "merge" }, - "git_object__size": { + "git_merge_trees": { "type": "function", - "file": "object.h", - "line": 200, - "lineto": 200, + "file": "git2/merge.h", + "line": 613, + "lineto": 619, "args": [ { - "name": "type", - "type": "git_otype", - "comment": "object type to get its size" + "name": "out", + "type": "git_index **", + "comment": "pointer to store the index result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository that contains the given trees" + }, + { + "name": "ancestor_tree", + "type": "const git_tree *", + "comment": "the common ancestor between the trees (or null if none)" + }, + { + "name": "our_tree", + "type": "const git_tree *", + "comment": "the tree that reflects the destination tree" + }, + { + "name": "their_tree", + "type": "const git_tree *", + "comment": "the tree to merge in to `our_tree`" + }, + { + "name": "opts", + "type": "const git_merge_options *", + "comment": "the merge tree options (or null for defaults)" } ], - "argline": "git_otype type", - "sig": "git_otype", - "return": { - "type": "size_t", - "comment": " size in bytes of the object" - }, - "description": "

Get the size in bytes for the structure which\n acts as an in-memory representation of any given\n object type.

\n", - "comments": "

For all the core types, this would the equivalent of calling sizeof(git_commit) if the core types were not opaque on the external API.

\n", - "group": "object" + "argline": "git_index **out, git_repository *repo, const git_tree *ancestor_tree, const git_tree *our_tree, const git_tree *their_tree, const git_merge_options *opts", + "sig": "git_index **::git_repository *::const git_tree *::const git_tree *::const git_tree *::const git_merge_options *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Merge two trees, producing a git_index that reflects the result of\n the merge. The index may be written as-is to the working directory\n or checked out. If the index is to be converted to a tree, the caller\n should resolve any conflicts that arose as part of the merge.

\n", + "comments": "

The returned index must be freed explicitly with git_index_free.

\n", + "group": "merge" }, - "git_object_peel": { + "git_merge_commits": { "type": "function", - "file": "object.h", - "line": 225, - "lineto": 228, + "file": "git2/merge.h", + "line": 636, + "lineto": 641, "args": [ { - "name": "peeled", - "type": "git_object **", - "comment": "Pointer to the peeled git_object" + "name": "out", + "type": "git_index **", + "comment": "pointer to store the index result in" }, { - "name": "object", - "type": "const git_object *", - "comment": "The object to be processed" + "name": "repo", + "type": "git_repository *", + "comment": "repository that contains the given trees" }, { - "name": "target_type", - "type": "git_otype", - "comment": "The type of the requested object (a GIT_OBJ_ value)" + "name": "our_commit", + "type": "const git_commit *", + "comment": "the commit that reflects the destination tree" + }, + { + "name": "their_commit", + "type": "const git_commit *", + "comment": "the commit to merge in to `our_commit`" + }, + { + "name": "opts", + "type": "const git_merge_options *", + "comment": "the merge tree options (or null for defaults)" } ], - "argline": "git_object **peeled, const git_object *object, git_otype target_type", - "sig": "git_object **::const git_object *::git_otype", - "return": { - "type": "int", - "comment": " 0 on success, GIT_EINVALIDSPEC, GIT_EPEEL, or an error code" - }, - "description": "

Recursively peel an object until an object of the specified type is met.

\n", - "comments": "

If the query cannot be satisfied due to the object model, GIT_EINVALIDSPEC will be returned (e.g. trying to peel a blob to a tree).

\n\n

If you pass GIT_OBJ_ANY as the target type, then the object will be peeled until the type changes. A tag will be peeled until the referenced object is no longer a tag, and a commit will be peeled to a tree. Any other object type will return GIT_EINVALIDSPEC.

\n\n

If peeling a tag we discover an object which cannot be peeled to the target type due to the object model, GIT_EPEEL will be returned.

\n\n

You must free the returned object.

\n", - "group": "object" + "argline": "git_index **out, git_repository *repo, const git_commit *our_commit, const git_commit *their_commit, const git_merge_options *opts", + "sig": "git_index **::git_repository *::const git_commit *::const git_commit *::const git_merge_options *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Merge two commits, producing a git_index that reflects the result of\n the merge. The index may be written as-is to the working directory\n or checked out. If the index is to be converted to a tree, the caller\n should resolve any conflicts that arose as part of the merge.

\n", + "comments": "

The returned index must be freed explicitly with git_index_free.

\n", + "group": "merge" }, - "git_object_dup": { + "git_merge": { "type": "function", - "file": "object.h", - "line": 237, - "lineto": 237, + "file": "git2/merge.h", + "line": 661, + "lineto": 666, "args": [ { - "name": "dest", - "type": "git_object **", - "comment": "Pointer to store the copy of the object" + "name": "repo", + "type": "git_repository *", + "comment": "the repository to merge" }, { - "name": "source", - "type": "git_object *", - "comment": "Original object to copy" - } - ], - "argline": "git_object **dest, git_object *source", - "sig": "git_object **::git_object *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Create an in-memory copy of a Git object. The copy must be\n explicitly free'd or it will leak.

\n", - "comments": "", - "group": "object" - }, - "git_odb_new": { - "type": "function", - "file": "odb.h", - "line": 39, - "lineto": 39, - "args": [ + "name": "their_heads", + "type": "const git_annotated_commit **", + "comment": "the heads to merge into" + }, { - "name": "out", - "type": "git_odb **", - "comment": "location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed." + "name": "their_heads_len", + "type": "size_t", + "comment": "the number of heads to merge" + }, + { + "name": "merge_opts", + "type": "const git_merge_options *", + "comment": "merge options" + }, + { + "name": "checkout_opts", + "type": "const git_checkout_options *", + "comment": "checkout options" } ], - "argline": "git_odb **out", - "sig": "git_odb **", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Create a new object database with no backends.

\n", - "comments": "

Before the ODB can be used for read/writing, a custom database backend must be manually added using git_odb_add_backend()

\n", - "group": "odb" + "argline": "git_repository *repo, const git_annotated_commit **their_heads, size_t their_heads_len, const git_merge_options *merge_opts, const git_checkout_options *checkout_opts", + "sig": "git_repository *::const git_annotated_commit **::size_t::const git_merge_options *::const git_checkout_options *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Merges the given commit(s) into HEAD, writing the results into the working\n directory. Any changes are staged for commit and any conflicts are written\n to the index. Callers should inspect the repository's index after this\n completes, resolve any conflicts and prepare a commit.

\n", + "comments": "

For compatibility with git, the repository is put into a merging state. Once the commit is done (or if the user wishes to abort), you should clear this state by calling git_repository_state_cleanup().

\n", + "group": "merge", + "examples": { "merge.c": ["ex/v1.9.1/merge.html#git_merge-16"] } }, - "git_odb_open": { + "git_message_prettify": { "type": "function", - "file": "odb.h", - "line": 57, - "lineto": 57, + "file": "git2/message.h", + "line": 38, + "lineto": 38, "args": [ { "name": "out", - "type": "git_odb **", - "comment": "location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed." + "type": "git_buf *", + "comment": "The user-allocated git_buf which will be filled with the\n cleaned up message." }, { - "name": "objects_dir", + "name": "message", "type": "const char *", - "comment": "path of the backends' \"objects\" directory." + "comment": "The message to be prettified." + }, + { + "name": "strip_comments", + "type": "int", + "comment": "Non-zero to remove comment lines, 0 to leave them in." + }, + { + "name": "comment_char", + "type": "char", + "comment": "Comment character. Lines starting with this character\n are considered to be comments and removed if `strip_comments` is non-zero." } ], - "argline": "git_odb **out, const char *objects_dir", - "sig": "git_odb **::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Create a new object database and automatically add\n the two default backends:

\n", - "comments": "
- git_odb_backend_loose: read and write loose object files      from disk, assuming `objects_dir` as the Objects folder\n\n- git_odb_backend_pack: read objects from packfiles,        assuming `objects_dir` as the Objects folder which      contains a 'pack/' folder with the corresponding data\n
\n", - "group": "odb" + "argline": "git_buf *out, const char *message, int strip_comments, char comment_char", + "sig": "git_buf *::const char *::int::char", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Clean up excess whitespace and make sure there is a trailing newline in the message.

\n", + "comments": "

Optionally, it can remove lines which start with the comment character.

\n", + "group": "message" }, - "git_odb_add_disk_alternate": { + "git_message_trailers": { "type": "function", - "file": "odb.h", - "line": 74, - "lineto": 74, + "file": "git2/message.h", + "line": 73, + "lineto": 73, "args": [ { - "name": "odb", - "type": "git_odb *", - "comment": "database to add the backend to" + "name": "arr", + "type": "git_message_trailer_array *", + "comment": "A pre-allocated git_message_trailer_array struct to be filled in\n with any trailers found during parsing." }, { - "name": "path", + "name": "message", "type": "const char *", - "comment": "path to the objects folder for the alternate" + "comment": "The message to be parsed" } ], - "argline": "git_odb *odb, const char *path", - "sig": "git_odb *::const char *", + "argline": "git_message_trailer_array *arr, const char *message", + "sig": "git_message_trailer_array *::const char *", "return": { "type": "int", - "comment": " 0 on success; error code otherwise" + "comment": " 0 on success, or non-zero on error." }, - "description": "

Add an on-disk alternate to an existing Object DB.

\n", - "comments": "

Note that the added path must point to an objects, not to a full repository, to use it as an alternate store.

\n\n

Alternate backends are always checked for objects after all the main backends have been exhausted.

\n\n

Writing is disabled on alternate backends.

\n", - "group": "odb" + "description": "

Parse trailers out of a message, filling the array pointed to by +arr+.

\n", + "comments": "

Trailers are key/value pairs in the last paragraph of a message, not including any patches or conflicts that may be present.

\n", + "group": "message" }, - "git_odb_free": { + "git_message_trailer_array_free": { "type": "function", - "file": "odb.h", + "file": "git2/message.h", "line": 81, "lineto": 81, "args": [ { - "name": "db", - "type": "git_odb *", - "comment": "database pointer to close. If NULL no action is taken." + "name": "arr", + "type": "git_message_trailer_array *", + "comment": "The trailer to free." } ], - "argline": "git_odb *db", - "sig": "git_odb *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Close an open object database.

\n", + "argline": "git_message_trailer_array *arr", + "sig": "git_message_trailer_array *", + "return": { "type": "void", "comment": null }, + "description": "

Clean's up any allocated memory in the git_message_trailer_array filled by\n a call to git_message_trailers.

\n", "comments": "", - "group": "odb", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_odb_free-22" - ], - "general.c": [ - "ex/HEAD/general.html#git_odb_free-39" - ] - } + "group": "message" }, - "git_odb_read": { + "git_note_iterator_free": { "type": "function", - "file": "odb.h", - "line": 100, - "lineto": 100, + "file": "git2/notes.h", + "line": 75, + "lineto": 75, "args": [ { - "name": "out", - "type": "git_odb_object **", - "comment": "pointer where to store the read object" + "name": "it", + "type": "git_note_iterator *", + "comment": "pointer to the iterator" + } + ], + "argline": "git_note_iterator *it", + "sig": "git_note_iterator *", + "return": { "type": "void", "comment": null }, + "description": "

Frees an git_note_iterator

\n", + "comments": "", + "group": "note" + }, + "git_note_next": { + "type": "function", + "file": "git2/notes.h", + "line": 88, + "lineto": 91, + "args": [ + { + "name": "note_id", + "type": "git_oid *", + "comment": "id of blob containing the message" }, { - "name": "db", - "type": "git_odb *", - "comment": "database to search for the object in." + "name": "annotated_id", + "type": "git_oid *", + "comment": "id of the git object being annotated" }, { - "name": "id", - "type": "const git_oid *", - "comment": "identity of the object to read." + "name": "it", + "type": "git_note_iterator *", + "comment": "pointer to the iterator" } ], - "argline": "git_odb_object **out, git_odb *db, const git_oid *id", - "sig": "git_odb_object **::git_odb *::const git_oid *", + "argline": "git_oid *note_id, git_oid *annotated_id, git_note_iterator *it", + "sig": "git_oid *::git_oid *::git_note_iterator *", "return": { "type": "int", - "comment": " - 0 if the object was read;\n - GIT_ENOTFOUND if the object is not in the database." + "comment": " 0 (no error), GIT_ITEROVER (iteration is done) or an error code\n (negative value)" }, - "description": "

Read an object from the database.

\n", - "comments": "

This method queries all available ODB backends trying to read the given OID.

\n\n

The returned object is reference counted and internally cached, so it should be closed by the user once it's no longer in use.

\n", - "group": "odb", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_odb_read-23" - ], - "general.c": [ - "ex/HEAD/general.html#git_odb_read-40" - ] - } + "description": "

Return the current item (note_id and annotated_id) and advance the iterator\n internally to the next value

\n", + "comments": "", + "group": "note" }, - "git_odb_read_prefix": { + "git_object_lookup": { "type": "function", - "file": "odb.h", - "line": 129, - "lineto": 129, + "file": "git2/object.h", + "line": 45, + "lineto": 49, "args": [ { - "name": "out", - "type": "git_odb_object **", - "comment": "pointer where to store the read object" + "name": "object", + "type": "git_object **", + "comment": "pointer to the looked-up object" }, { - "name": "db", - "type": "git_odb *", - "comment": "database to search for the object in." + "name": "repo", + "type": "git_repository *", + "comment": "the repository to look up the object" }, { - "name": "short_id", + "name": "id", "type": "const git_oid *", - "comment": "a prefix of the id of the object to read." + "comment": "the unique identifier for the object" }, { - "name": "len", - "type": "size_t", - "comment": "the length of the prefix" + "name": "type", + "type": "git_object_t", + "comment": "the type of the object" } ], - "argline": "git_odb_object **out, git_odb *db, const git_oid *short_id, size_t len", - "sig": "git_odb_object **::git_odb *::const git_oid *::size_t", - "return": { - "type": "int", - "comment": " - 0 if the object was read;\n - GIT_ENOTFOUND if the object is not in the database.\n - GIT_EAMBIGUOUS if the prefix is ambiguous (several objects match the prefix)" - }, - "description": "

Read an object from the database, given a prefix\n of its identifier.

\n", - "comments": "

This method queries all available ODB backends trying to match the 'len' first hexadecimal characters of the 'short_id'. The remaining (GIT_OID_HEXSZ-len)*4 bits of 'short_id' must be 0s. 'len' must be at least GIT_OID_MINPREFIXLEN, and the prefix must be long enough to identify a unique object in all the backends; the method will fail otherwise.

\n\n

The returned object is reference counted and internally cached, so it should be closed by the user once it's no longer in use.

\n", - "group": "odb" + "argline": "git_object **object, git_repository *repo, const git_oid *id, git_object_t type", + "sig": "git_object **::git_repository *::const git_oid *::git_object_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a reference to one of the objects in a repository.

\n", + "comments": "

The generated reference is owned by the repository and should be closed with the git_object_free method instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object in the odb; the method will fail otherwise. The special value 'GIT_OBJECT_ANY' may be passed to let the method guess the object's type.

\n", + "group": "object", + "examples": { + "log.c": ["ex/v1.9.1/log.html#git_object_lookup-32"], + "merge.c": ["ex/v1.9.1/merge.html#git_object_lookup-17"] + } }, - "git_odb_read_header": { + "git_object_lookup_prefix": { "type": "function", - "file": "odb.h", - "line": 149, - "lineto": 149, + "file": "git2/object.h", + "line": 78, + "lineto": 83, "args": [ { - "name": "len_out", - "type": "size_t *", - "comment": "pointer where to store the length" - }, - { - "name": "type_out", - "type": "git_otype *", - "comment": "pointer where to store the type" + "name": "object_out", + "type": "git_object **", + "comment": "pointer where to store the looked-up object" }, { - "name": "db", - "type": "git_odb *", - "comment": "database to search for the object in." + "name": "repo", + "type": "git_repository *", + "comment": "the repository to look up the object" }, { "name": "id", "type": "const git_oid *", - "comment": "identity of the object to read." + "comment": "a short identifier for the object" + }, + { + "name": "len", + "type": "size_t", + "comment": "the length of the short identifier" + }, + { + "name": "type", + "type": "git_object_t", + "comment": "the type of the object" } ], - "argline": "size_t *len_out, git_otype *type_out, git_odb *db, const git_oid *id", - "sig": "size_t *::git_otype *::git_odb *::const git_oid *", - "return": { - "type": "int", - "comment": " - 0 if the object was read;\n - GIT_ENOTFOUND if the object is not in the database." - }, - "description": "

Read the header of an object from the database, without\n reading its full contents.

\n", - "comments": "

The header includes the length and the type of an object.

\n\n

Note that most backends do not support reading only the header of an object, so the whole object will be read and then the header will be returned.

\n", - "group": "odb" + "argline": "git_object **object_out, git_repository *repo, const git_oid *id, size_t len, git_object_t type", + "sig": "git_object **::git_repository *::const git_oid *::size_t::git_object_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a reference to one of the objects in a repository,\n given a prefix of its identifier (short id).

\n", + "comments": "

The object obtained will be so that its identifier matches the first 'len' hexadecimal characters (packets of 4 bits) of the given id. len must be at least GIT_OID_MINPREFIXLEN, and long enough to identify a unique object matching the prefix; otherwise the method will fail.

\n\n

The generated reference is owned by the repository and should be closed with the git_object_free method instead of free'd manually.

\n\n

The type parameter must match the type of the object in the odb; the method will fail otherwise. The special value GIT_OBJECT_ANY may be passed to let the method guess the object's type.

\n", + "group": "object" }, - "git_odb_exists": { + "git_object_lookup_bypath": { "type": "function", - "file": "odb.h", - "line": 160, - "lineto": 160, + "file": "git2/object.h", + "line": 96, + "lineto": 100, "args": [ { - "name": "db", - "type": "git_odb *", - "comment": "database to be searched for the given object." + "name": "out", + "type": "git_object **", + "comment": "buffer that receives a pointer to the object (which must be freed\n by the caller)" }, { - "name": "id", - "type": "const git_oid *", - "comment": "the object to search for." - } - ], - "argline": "git_odb *db, const git_oid *id", - "sig": "git_odb *::const git_oid *", - "return": { - "type": "int", - "comment": " - 1, if the object was found\n - 0, otherwise" - }, - "description": "

Determine if the given object can be found in the object database.

\n", - "comments": "", - "group": "odb" - }, - "git_odb_exists_prefix": { - "type": "function", - "file": "odb.h", - "line": 173, - "lineto": 174, - "args": [ - { - "name": "out", - "type": "git_oid *", - "comment": "The full OID of the found object if just one is found." - }, - { - "name": "db", - "type": "git_odb *", - "comment": "The database to be searched for the given object." + "name": "treeish", + "type": "const git_object *", + "comment": "root object that can be peeled to a tree" }, { - "name": "short_id", - "type": "const git_oid *", - "comment": "A prefix of the id of the object to read." + "name": "path", + "type": "const char *", + "comment": "relative path from the root object to the desired object" }, { - "name": "len", - "type": "size_t", - "comment": "The length of the prefix." + "name": "type", + "type": "git_object_t", + "comment": "type of object desired" } ], - "argline": "git_oid *out, git_odb *db, const git_oid *short_id, size_t len", - "sig": "git_oid *::git_odb *::const git_oid *::size_t", - "return": { - "type": "int", - "comment": " 0 if found, GIT_ENOTFOUND if not found, GIT_EAMBIGUOUS if multiple\n matches were found, other value \n<\n 0 if there was a read error." - }, - "description": "

Determine if an object can be found in the object database by an\n abbreviated object ID.

\n", + "argline": "git_object **out, const git_object *treeish, const char *path, git_object_t type", + "sig": "git_object **::const git_object *::const char *::git_object_t", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Lookup an object that represents a tree entry.

\n", "comments": "", - "group": "odb" + "group": "object" }, - "git_odb_expand_ids": { + "git_object_id": { "type": "function", - "file": "odb.h", - "line": 215, - "lineto": 218, + "file": "git2/object.h", + "line": 108, + "lineto": 108, "args": [ { - "name": "db", - "type": "git_odb *", - "comment": "The database to be searched for the given objects." - }, + "name": "obj", + "type": "const git_object *", + "comment": "the repository object" + } + ], + "argline": "const git_object *obj", + "sig": "const git_object *", + "return": { "type": "const git_oid *", "comment": " the SHA1 id" }, + "description": "

Get the id (SHA1) of a repository object

\n", + "comments": "", + "group": "object", + "examples": { + "blame.c": [ + "ex/v1.9.1/blame.html#git_object_id-7", + "ex/v1.9.1/blame.html#git_object_id-8", + "ex/v1.9.1/blame.html#git_object_id-9", + "ex/v1.9.1/blame.html#git_object_id-10" + ], + "cat-file.c": [ + "ex/v1.9.1/cat-file.html#git_object_id-10", + "ex/v1.9.1/cat-file.html#git_object_id-11" + ], + "log.c": [ + "ex/v1.9.1/log.html#git_object_id-33", + "ex/v1.9.1/log.html#git_object_id-34", + "ex/v1.9.1/log.html#git_object_id-35", + "ex/v1.9.1/log.html#git_object_id-36" + ], + "rev-parse.c": [ + "ex/v1.9.1/rev-parse.html#git_object_id-2", + "ex/v1.9.1/rev-parse.html#git_object_id-3", + "ex/v1.9.1/rev-parse.html#git_object_id-4", + "ex/v1.9.1/rev-parse.html#git_object_id-5", + "ex/v1.9.1/rev-parse.html#git_object_id-6" + ] + } + }, + "git_object_short_id": { + "type": "function", + "file": "git2/object.h", + "line": 122, + "lineto": 122, + "args": [ { - "name": "ids", - "type": "git_odb_expand_id *", - "comment": "An array of short object IDs to search for" + "name": "out", + "type": "git_buf *", + "comment": "Buffer to write string into" }, { - "name": "count", - "type": "size_t", - "comment": "The length of the `ids` array" + "name": "obj", + "type": "const git_object *", + "comment": "The object to get an ID for" } ], - "argline": "git_odb *db, git_odb_expand_id *ids, size_t count", - "sig": "git_odb *::git_odb_expand_id *::size_t", - "return": { - "type": "int", - "comment": " 0 on success or an error code on failure" - }, - "description": "

Determine if one or more objects can be found in the object database\n by their abbreviated object ID and type. The given array will be\n updated in place: for each abbreviated ID that is unique in the\n database, and of the given type (if specified), the full object ID,\n object ID length (GIT_OID_HEXSZ) and type will be written back to\n the array. For IDs that are not found (or are ambiguous), the\n array entry will be zeroed.

\n", - "comments": "

Note that since this function operates on multiple objects, the underlying database will not be asked to be reloaded if an object is not found (which is unlike other object database operations.)

\n", - "group": "odb" + "argline": "git_buf *out, const git_object *obj", + "sig": "git_buf *::const git_object *", + "return": { "type": "int", "comment": " 0 on success, \n<\n0 for error" }, + "description": "

Get a short abbreviated OID string for the object

\n", + "comments": "

This starts at the "core.abbrev" length (default 7 characters) and iteratively extends to a longer string if that length is ambiguous. The result will be unambiguous (at least until new objects are added to the repository).

\n", + "group": "object", + "examples": { "tag.c": ["ex/v1.9.1/tag.html#git_object_short_id-3"] } }, - "git_odb_refresh": { + "git_object_type": { "type": "function", - "file": "odb.h", - "line": 238, - "lineto": 238, + "file": "git2/object.h", + "line": 130, + "lineto": 130, "args": [ { - "name": "db", - "type": "struct git_odb *", - "comment": "database to refresh" + "name": "obj", + "type": "const git_object *", + "comment": "the repository object" } ], - "argline": "struct git_odb *db", - "sig": "struct git_odb *", + "argline": "const git_object *obj", + "sig": "const git_object *", + "return": { "type": "git_object_t", "comment": " the object's type" }, + "description": "

Get the object type of an object

\n", + "comments": "", + "group": "object", + "examples": { + "cat-file.c": [ + "ex/v1.9.1/cat-file.html#git_object_type-12", + "ex/v1.9.1/cat-file.html#git_object_type-13", + "ex/v1.9.1/cat-file.html#git_object_type-14" + ], + "tag.c": ["ex/v1.9.1/tag.html#git_object_type-4"] + } + }, + "git_object_owner": { + "type": "function", + "file": "git2/object.h", + "line": 144, + "lineto": 144, + "args": [ + { "name": "obj", "type": "const git_object *", "comment": "the object" } + ], + "argline": "const git_object *obj", + "sig": "const git_object *", "return": { - "type": "int", - "comment": " 0 on success, error code otherwise" + "type": "git_repository *", + "comment": " the repository who owns this object" }, - "description": "

Refresh the object database to load newly added files.

\n", - "comments": "

If the object databases have changed on disk while the library is running, this function will force a reload of the underlying indexes.

\n\n

Use this function when you're confident that an external application has tampered with the ODB.

\n\n

NOTE that it is not necessary to call this function at all. The library will automatically attempt to refresh the ODB when a lookup fails, to see if the looked up object exists on disk but hasn't been loaded yet.

\n", - "group": "odb" + "description": "

Get the repository that owns this object

\n", + "comments": "

Freeing or calling git_repository_close on the returned pointer will invalidate the actual object.

\n\n

Any other operation may be run on the repository without affecting the object.

\n", + "group": "object" }, - "git_odb_foreach": { + "git_object_free": { "type": "function", - "file": "odb.h", - "line": 253, - "lineto": 253, + "file": "git2/object.h", + "line": 161, + "lineto": 161, "args": [ { - "name": "db", - "type": "git_odb *", - "comment": "database to use" - }, - { - "name": "cb", - "type": "git_odb_foreach_cb", - "comment": "the callback to call for each object" - }, - { - "name": "payload", - "type": "void *", - "comment": "data to pass to the callback" + "name": "object", + "type": "git_object *", + "comment": "the object to close" } ], - "argline": "git_odb *db, git_odb_foreach_cb cb, void *payload", - "sig": "git_odb *::git_odb_foreach_cb::void *", - "return": { - "type": "int", - "comment": " 0 on success, non-zero callback return value, or error code" - }, - "description": "

List all objects available in the database

\n", - "comments": "

The callback will be called for each object available in the database. Note that the objects are likely to be returned in the index order, which would make accessing the objects in that order inefficient. Return a non-zero value from the callback to stop looping.

\n", - "group": "odb" + "argline": "git_object *object", + "sig": "git_object *", + "return": { "type": "void", "comment": null }, + "description": "

Close an open object

\n", + "comments": "

This method instructs the library to close an existing object; note that git_objects are owned and cached by the repository so the object may or may not be freed after this library call, depending on how aggressive is the caching mechanism used by the repository.

\n\n

IMPORTANT: It is necessary to call this method when you stop using an object. Failure to do so will cause a memory leak.

\n", + "group": "object", + "examples": { + "blame.c": [ + "ex/v1.9.1/blame.html#git_object_free-11", + "ex/v1.9.1/blame.html#git_object_free-12", + "ex/v1.9.1/blame.html#git_object_free-13", + "ex/v1.9.1/blame.html#git_object_free-14" + ], + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_object_free-15"], + "commit.c": ["ex/v1.9.1/commit.html#git_object_free-6"], + "general.c": ["ex/v1.9.1/general.html#git_object_free-38"], + "log.c": ["ex/v1.9.1/log.html#git_object_free-37"], + "merge.c": ["ex/v1.9.1/merge.html#git_object_free-18"], + "rev-parse.c": [ + "ex/v1.9.1/rev-parse.html#git_object_free-7", + "ex/v1.9.1/rev-parse.html#git_object_free-8", + "ex/v1.9.1/rev-parse.html#git_object_free-9" + ], + "tag.c": [ + "ex/v1.9.1/tag.html#git_object_free-5", + "ex/v1.9.1/tag.html#git_object_free-6", + "ex/v1.9.1/tag.html#git_object_free-7", + "ex/v1.9.1/tag.html#git_object_free-8" + ] + } }, - "git_odb_write": { + "git_object_type2string": { "type": "function", - "file": "odb.h", - "line": 273, - "lineto": 273, + "file": "git2/object.h", + "line": 172, + "lineto": 172, "args": [ - { - "name": "out", - "type": "git_oid *", - "comment": "pointer to store the OID result of the write" - }, - { - "name": "odb", - "type": "git_odb *", - "comment": "object database where to store the object" - }, - { - "name": "data", - "type": "const void *", - "comment": "buffer with the data to store" - }, - { - "name": "len", - "type": "size_t", - "comment": "size of the buffer" - }, { "name": "type", - "type": "git_otype", - "comment": "type of the data to store" + "type": "git_object_t", + "comment": "object type to convert." } ], - "argline": "git_oid *out, git_odb *odb, const void *data, size_t len, git_otype type", - "sig": "git_oid *::git_odb *::const void *::size_t::git_otype", + "argline": "git_object_t type", + "sig": "git_object_t", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "const char *", + "comment": " the corresponding string representation." }, - "description": "

Write an object directly into the ODB

\n", - "comments": "

This method writes a full object straight into the ODB. For most cases, it is preferred to write objects through a write stream, which is both faster and less memory intensive, specially for big objects.

\n\n

This method is provided for compatibility with custom backends which are not able to support streaming writes

\n", - "group": "odb", + "description": "

Convert an object type to its string representation.

\n", + "comments": "

The result is a pointer to a string in static memory and should not be free()'ed.

\n", + "group": "object", "examples": { + "cat-file.c": [ + "ex/v1.9.1/cat-file.html#git_object_type2string-16", + "ex/v1.9.1/cat-file.html#git_object_type2string-17", + "ex/v1.9.1/cat-file.html#git_object_type2string-18", + "ex/v1.9.1/cat-file.html#git_object_type2string-19" + ], "general.c": [ - "ex/HEAD/general.html#git_odb_write-41" + "ex/v1.9.1/general.html#git_object_type2string-39", + "ex/v1.9.1/general.html#git_object_type2string-40" ] } }, - "git_odb_open_wstream": { + "git_object_string2type": { "type": "function", - "file": "odb.h", - "line": 296, - "lineto": 296, + "file": "git2/object.h", + "line": 180, + "lineto": 180, "args": [ { - "name": "out", - "type": "git_odb_stream **", - "comment": "pointer where to store the stream" - }, - { - "name": "db", - "type": "git_odb *", - "comment": "object database where the stream will write" - }, - { - "name": "size", - "type": "git_off_t", - "comment": "final size of the object that will be written" - }, - { - "name": "type", - "type": "git_otype", - "comment": "type of the object that will be written" + "name": "str", + "type": "const char *", + "comment": "the string to convert." } ], - "argline": "git_odb_stream **out, git_odb *db, git_off_t size, git_otype type", - "sig": "git_odb_stream **::git_odb *::git_off_t::git_otype", + "argline": "const char *str", + "sig": "const char *", "return": { - "type": "int", - "comment": " 0 if the stream was created; error code otherwise" + "type": "git_object_t", + "comment": " the corresponding git_object_t." }, - "description": "

Open a stream to write an object into the ODB

\n", - "comments": "

The type and final length of the object must be specified when opening the stream.

\n\n

The returned stream will be of type GIT_STREAM_WRONLY, and it won't be effective until git_odb_stream_finalize_write is called and returns without an error

\n\n

The stream must always be freed when done with git_odb_stream_free or will leak memory.

\n", - "group": "odb" + "description": "

Convert a string object type representation to it's git_object_t.

\n", + "comments": "", + "group": "object" }, - "git_odb_stream_write": { + "git_object_typeisloose": { "type": "function", - "file": "odb.h", - "line": 309, - "lineto": 309, + "file": "git2/object.h", + "line": 189, + "lineto": 189, "args": [ { - "name": "stream", - "type": "git_odb_stream *", - "comment": "the stream" + "name": "type", + "type": "git_object_t", + "comment": "object type to test." + } + ], + "argline": "git_object_t type", + "sig": "git_object_t", + "return": { + "type": "int", + "comment": " true if the type represents a valid loose object type,\n false otherwise." + }, + "description": "

Determine if the given git_object_t is a valid loose object type.

\n", + "comments": "", + "group": "object" + }, + "git_object_peel": { + "type": "function", + "file": "git2/object.h", + "line": 214, + "lineto": 217, + "args": [ + { + "name": "peeled", + "type": "git_object **", + "comment": "Pointer to the peeled git_object" }, { - "name": "buffer", - "type": "const char *", - "comment": "the data to write" + "name": "object", + "type": "const git_object *", + "comment": "The object to be processed" }, { - "name": "len", - "type": "size_t", - "comment": "the buffer's length" + "name": "target_type", + "type": "git_object_t", + "comment": "The type of the requested object (a GIT_OBJECT_ value)" } ], - "argline": "git_odb_stream *stream, const char *buffer, size_t len", - "sig": "git_odb_stream *::const char *::size_t", + "argline": "git_object **peeled, const git_object *object, git_object_t target_type", + "sig": "git_object **::const git_object *::git_object_t", "return": { "type": "int", - "comment": " 0 if the write succeeded; error code otherwise" + "comment": " 0 on success, GIT_EINVALIDSPEC, GIT_EPEEL, or an error code" }, - "description": "

Write to an odb stream

\n", - "comments": "

This method will fail if the total number of received bytes exceeds the size declared with git_odb_open_wstream()

\n", - "group": "odb" + "description": "

Recursively peel an object until an object of the specified type is met.

\n", + "comments": "

If the query cannot be satisfied due to the object model, GIT_EINVALIDSPEC will be returned (e.g. trying to peel a blob to a tree).

\n\n

If you pass GIT_OBJECT_ANY as the target type, then the object will be peeled until the type changes. A tag will be peeled until the referenced object is no longer a tag, and a commit will be peeled to a tree. Any other object type will return GIT_EINVALIDSPEC.

\n\n

If peeling a tag we discover an object which cannot be peeled to the target type due to the object model, GIT_EPEEL will be returned.

\n\n

You must free the returned object.

\n", + "group": "object" }, - "git_odb_stream_finalize_write": { + "git_object_dup": { "type": "function", - "file": "odb.h", - "line": 324, - "lineto": 324, + "file": "git2/object.h", + "line": 227, + "lineto": 227, "args": [ { - "name": "out", - "type": "git_oid *", - "comment": "pointer to store the resulting object's id" + "name": "dest", + "type": "git_object **", + "comment": "Pointer to store the copy of the object" }, { - "name": "stream", - "type": "git_odb_stream *", - "comment": "the stream" + "name": "source", + "type": "git_object *", + "comment": "Original object to copy" } ], - "argline": "git_oid *out, git_odb_stream *stream", - "sig": "git_oid *::git_odb_stream *", - "return": { - "type": "int", - "comment": " 0 on success; an error code otherwise" - }, - "description": "

Finish writing to an odb stream

\n", - "comments": "

The object will take its final name and will be available to the odb.

\n\n

This method will fail if the total number of received bytes differs from the size declared with git_odb_open_wstream()

\n", - "group": "odb" + "argline": "git_object **dest, git_object *source", + "sig": "git_object **::git_object *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create an in-memory copy of a Git object. The copy must be\n explicitly free'd or it will leak.

\n", + "comments": "", + "group": "object" }, - "git_odb_stream_read": { + "git_object_rawcontent_is_valid": { "type": "function", - "file": "odb.h", - "line": 331, - "lineto": 331, + "file": "git2/object.h", + "line": 270, + "lineto": 274, "args": [ { - "name": "stream", - "type": "git_odb_stream *", - "comment": null + "name": "valid", + "type": "int *", + "comment": "Output pointer to set with validity of the object content" }, { - "name": "buffer", - "type": "char *", - "comment": null + "name": "buf", + "type": "const char *", + "comment": "The contents to validate" }, { "name": "len", "type": "size_t", - "comment": null + "comment": "The length of the buffer" + }, + { + "name": "object_type", + "type": "git_object_t", + "comment": "The type of the object in the buffer" } ], - "argline": "git_odb_stream *stream, char *buffer, size_t len", - "sig": "git_odb_stream *::char *::size_t", + "argline": "int *valid, const char *buf, size_t len, git_object_t object_type", + "sig": "int *::const char *::size_t::git_object_t", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Analyzes a buffer of raw object content and determines its validity.\n Tree, commit, and tag objects will be parsed and ensured that they\n are valid, parseable content. (Blobs are always valid by definition.)\n An error message will be set with an informative message if the object\n is not valid.

\n", + "comments": "", + "group": "object" + }, + "git_odb_new": { + "type": "function", + "file": "git2/odb.h", + "line": 102, + "lineto": 102, + "args": [ + { + "name": "odb", + "type": "git_odb **", + "comment": "location to store the database pointer, if opened." + } + ], + "argline": "git_odb **odb", + "sig": "git_odb **", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a new object database with no backends.

\n", + "comments": "

Before the ODB can be used for read/writing, a custom database backend must be manually added using git_odb_add_backend()

\n", + "group": "odb" + }, + "git_odb_open": { + "type": "function", + "file": "git2/odb.h", + "line": 120, + "lineto": 120, + "args": [ + { + "name": "odb_out", + "type": "git_odb **", + "comment": "location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed." + }, + { + "name": "objects_dir", + "type": "const char *", + "comment": "path of the backends' \"objects\" directory." + } + ], + "argline": "git_odb **odb_out, const char *objects_dir", + "sig": "git_odb **::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a new object database and automatically add\n the two default backends:

\n", + "comments": "
- git_odb_backend_loose: read and write loose object files      from disk, assuming `objects_dir` as the Objects folder\n\n- git_odb_backend_pack: read objects from packfiles,        assuming `objects_dir` as the Objects folder which      contains a 'pack/' folder with the corresponding data\n
\n", + "group": "odb" + }, + "git_odb_add_disk_alternate": { + "type": "function", + "file": "git2/odb.h", + "line": 138, + "lineto": 138, + "args": [ + { + "name": "odb", + "type": "git_odb *", + "comment": "database to add the backend to" + }, + { + "name": "path", + "type": "const char *", + "comment": "path to the objects folder for the alternate" + } + ], + "argline": "git_odb *odb, const char *path", + "sig": "git_odb *::const char *", "return": { "type": "int", - "comment": null + "comment": " 0 on success, error code otherwise" }, - "description": "

Read from an odb stream

\n", - "comments": "

Most backends don't implement streaming reads

\n", + "description": "

Add an on-disk alternate to an existing Object DB.

\n", + "comments": "

Note that the added path must point to an objects, not to a full repository, to use it as an alternate store.

\n\n

Alternate backends are always checked for objects after all the main backends have been exhausted.

\n\n

Writing is disabled on alternate backends.

\n", "group": "odb" }, - "git_odb_stream_free": { + "git_odb_free": { "type": "function", - "file": "odb.h", - "line": 338, - "lineto": 338, + "file": "git2/odb.h", + "line": 145, + "lineto": 145, "args": [ { - "name": "stream", - "type": "git_odb_stream *", - "comment": "the stream to free" + "name": "db", + "type": "git_odb *", + "comment": "database pointer to close. If NULL no action is taken." } ], - "argline": "git_odb_stream *stream", - "sig": "git_odb_stream *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Free an odb stream

\n", + "argline": "git_odb *db", + "sig": "git_odb *", + "return": { "type": "void", "comment": null }, + "description": "

Close an open object database.

\n", "comments": "", - "group": "odb" + "group": "odb", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_odb_free-20"], + "general.c": ["ex/v1.9.1/general.html#git_odb_free-41"] + } }, - "git_odb_open_rstream": { + "git_odb_read": { "type": "function", - "file": "odb.h", - "line": 364, - "lineto": 364, + "file": "git2/odb.h", + "line": 163, + "lineto": 163, "args": [ { - "name": "out", - "type": "git_odb_stream **", - "comment": "pointer where to store the stream" + "name": "obj", + "type": "git_odb_object **", + "comment": "pointer where to store the read object" }, { "name": "db", "type": "git_odb *", - "comment": "object database where the stream will read from" + "comment": "database to search for the object in." }, { - "name": "oid", + "name": "id", "type": "const git_oid *", - "comment": "oid of the object the stream will read from" + "comment": "identity of the object to read." } ], - "argline": "git_odb_stream **out, git_odb *db, const git_oid *oid", - "sig": "git_odb_stream **::git_odb *::const git_oid *", + "argline": "git_odb_object **obj, git_odb *db, const git_oid *id", + "sig": "git_odb_object **::git_odb *::const git_oid *", "return": { "type": "int", - "comment": " 0 if the stream was created; error code otherwise" + "comment": " 0 if the object was read, GIT_ENOTFOUND if the object is\n not in the database." }, - "description": "

Open a stream to read an object from the ODB

\n", - "comments": "

Note that most backends do not support streaming reads because they store their objects as compressed/delta'ed blobs.

\n\n

It's recommended to use git_odb_read instead, which is assured to work on all backends.

\n\n

The returned stream will be of type GIT_STREAM_RDONLY and will have the following methods:

\n\n
    - stream->read: read `n` bytes from the stream      - stream->free: free the stream\n
\n\n

The stream must always be free'd or will leak memory.

\n", - "group": "odb" + "description": "

Read an object from the database.

\n", + "comments": "

This method queries all available ODB backends trying to read the given OID.

\n\n

The returned object is reference counted and internally cached, so it should be closed by the user once it's no longer in use.

\n", + "group": "odb", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_odb_read-21"], + "general.c": ["ex/v1.9.1/general.html#git_odb_read-42"] + } }, - "git_odb_write_pack": { + "git_odb_read_prefix": { "type": "function", - "file": "odb.h", - "line": 384, - "lineto": 388, + "file": "git2/odb.h", + "line": 191, + "lineto": 191, "args": [ { - "name": "out", - "type": "git_odb_writepack **", - "comment": "pointer to the writepack functions" + "name": "obj", + "type": "git_odb_object **", + "comment": "pointer where to store the read object" }, { "name": "db", "type": "git_odb *", - "comment": "object database where the stream will read from" + "comment": "database to search for the object in." }, { - "name": "progress_cb", - "type": "git_transfer_progress_cb", - "comment": "function to call with progress information.\n Be aware that this is called inline with network and indexing operations,\n so performance may be affected." + "name": "short_id", + "type": "const git_oid *", + "comment": "a prefix of the id of the object to read." }, { - "name": "progress_payload", - "type": "void *", - "comment": "payload for the progress callback" + "name": "len", + "type": "size_t", + "comment": "the length of the prefix" } ], - "argline": "git_odb_writepack **out, git_odb *db, git_transfer_progress_cb progress_cb, void *progress_payload", - "sig": "git_odb_writepack **::git_odb *::git_transfer_progress_cb::void *", + "argline": "git_odb_object **obj, git_odb *db, const git_oid *short_id, size_t len", + "sig": "git_odb_object **::git_odb *::const git_oid *::size_t", "return": { "type": "int", - "comment": null + "comment": " 0 if the object was read, GIT_ENOTFOUND if the object is not in the\n database. GIT_EAMBIGUOUS if the prefix is ambiguous\n (several objects match the prefix)" }, - "description": "

Open a stream for writing a pack file to the ODB.

\n", - "comments": "

If the ODB layer understands pack files, then the given packfile will likely be streamed directly to disk (and a corresponding index created). If the ODB layer does not understand pack files, the objects will be stored in whatever format the ODB layer uses.

\n", + "description": "

Read an object from the database, given a prefix\n of its identifier.

\n", + "comments": "

This method queries all available ODB backends trying to match the 'len' first hexadecimal characters of the 'short_id'. The remaining (GIT_OID_SHA1_HEXSIZE-len)*4 bits of 'short_id' must be 0s. 'len' must be at least GIT_OID_MINPREFIXLEN, and the prefix must be long enough to identify a unique object in all the backends; the method will fail otherwise.

\n\n

The returned object is reference counted and internally cached, so it should be closed by the user once it's no longer in use.

\n", "group": "odb" }, - "git_odb_hash": { + "git_odb_read_header": { "type": "function", - "file": "odb.h", - "line": 402, - "lineto": 402, + "file": "git2/odb.h", + "line": 210, + "lineto": 210, "args": [ { - "name": "out", - "type": "git_oid *", - "comment": "the resulting object-ID." + "name": "len_out", + "type": "size_t *", + "comment": "pointer where to store the length" }, { - "name": "data", - "type": "const void *", - "comment": "data to hash" + "name": "type_out", + "type": "git_object_t *", + "comment": "pointer where to store the type" }, { - "name": "len", - "type": "size_t", - "comment": "size of the data" + "name": "db", + "type": "git_odb *", + "comment": "database to search for the object in." }, { - "name": "type", - "type": "git_otype", - "comment": "of the data to hash" + "name": "id", + "type": "const git_oid *", + "comment": "identity of the object to read." } ], - "argline": "git_oid *out, const void *data, size_t len, git_otype type", - "sig": "git_oid *::const void *::size_t::git_otype", + "argline": "size_t *len_out, git_object_t *type_out, git_odb *db, const git_oid *id", + "sig": "size_t *::git_object_t *::git_odb *::const git_oid *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 if the object was read, GIT_ENOTFOUND if the object is not\n in the database." }, - "description": "

Determine the object-ID (sha1 hash) of a data buffer

\n", - "comments": "

The resulting SHA-1 OID will be the identifier for the data buffer as if the data buffer it were to written to the ODB.

\n", + "description": "

Read the header of an object from the database, without\n reading its full contents.

\n", + "comments": "

The header includes the length and the type of an object.

\n\n

Note that most backends do not support reading only the header of an object, so the whole object will be read and then the header will be returned.

\n", "group": "odb" }, - "git_odb_hashfile": { + "git_odb_exists": { "type": "function", - "file": "odb.h", - "line": 417, - "lineto": 417, + "file": "git2/odb.h", + "line": 219, + "lineto": 219, "args": [ { - "name": "out", - "type": "git_oid *", - "comment": "oid structure the result is written into." - }, - { - "name": "path", - "type": "const char *", - "comment": "file to read and determine object id for" + "name": "db", + "type": "git_odb *", + "comment": "database to be searched for the given object." }, { - "name": "type", - "type": "git_otype", - "comment": "the type of the object that will be hashed" + "name": "id", + "type": "const git_oid *", + "comment": "the object to search for." } ], - "argline": "git_oid *out, const char *path, git_otype type", - "sig": "git_oid *::const char *::git_otype", + "argline": "git_odb *db, const git_oid *id", + "sig": "git_odb *::const git_oid *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 1 if the object was found, 0 otherwise" }, - "description": "

Read a file from disk and fill a git_oid with the object id\n that the file would have if it were written to the Object\n Database as an object of the given type (w/o applying filters).\n Similar functionality to git.git's git hash-object without\n the -w flag, however, with the --no-filters flag.\n If you need filters, see git_repository_hashfile.

\n", + "description": "

Determine if the given object can be found in the object database.

\n", "comments": "", "group": "odb" }, - "git_odb_object_dup": { + "git_odb_exists_ext": { "type": "function", - "file": "odb.h", - "line": 431, - "lineto": 431, + "file": "git2/odb.h", + "line": 230, + "lineto": 230, "args": [ { - "name": "dest", - "type": "git_odb_object **", - "comment": "pointer where to store the copy" + "name": "db", + "type": "git_odb *", + "comment": "database to be searched for the given object." }, { - "name": "source", - "type": "git_odb_object *", - "comment": "object to copy" + "name": "id", + "type": "const git_oid *", + "comment": "the object to search for." + }, + { + "name": "flags", + "type": "unsigned int", + "comment": "flags affecting the lookup (see `git_odb_lookup_flags_t`)" } ], - "argline": "git_odb_object **dest, git_odb_object *source", - "sig": "git_odb_object **::git_odb_object *", + "argline": "git_odb *db, const git_oid *id, unsigned int flags", + "sig": "git_odb *::const git_oid *::unsigned int", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 1 if the object was found, 0 otherwise" }, - "description": "

Create a copy of an odb_object

\n", - "comments": "

The returned copy must be manually freed with git_odb_object_free. Note that because of an implementation detail, the returned copy will be the same pointer as source: the object is internally refcounted, so the copy still needs to be freed twice.

\n", + "description": "

Determine if the given object can be found in the object database, with\n extended options.

\n", + "comments": "", "group": "odb" }, - "git_odb_object_free": { + "git_odb_exists_prefix": { "type": "function", - "file": "odb.h", - "line": 441, - "lineto": 441, + "file": "git2/odb.h", + "line": 243, + "lineto": 244, "args": [ { - "name": "object", - "type": "git_odb_object *", - "comment": "object to close" - } - ], - "argline": "git_odb_object *object", - "sig": "git_odb_object *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Close an ODB object

\n", - "comments": "

This method must always be called once a git_odb_object is no longer needed, otherwise memory will leak.

\n", - "group": "odb", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_odb_object_free-24" - ], - "general.c": [ - "ex/HEAD/general.html#git_odb_object_free-42" - ] - } - }, - "git_odb_object_id": { - "type": "function", - "file": "odb.h", - "line": 451, - "lineto": 451, - "args": [ + "name": "out", + "type": "git_oid *", + "comment": "The full OID of the found object if just one is found." + }, { - "name": "object", - "type": "git_odb_object *", - "comment": "the object" + "name": "db", + "type": "git_odb *", + "comment": "The database to be searched for the given object." + }, + { + "name": "short_id", + "type": "const git_oid *", + "comment": "A prefix of the id of the object to read." + }, + { + "name": "len", + "type": "size_t", + "comment": "The length of the prefix." } ], - "argline": "git_odb_object *object", - "sig": "git_odb_object *", + "argline": "git_oid *out, git_odb *db, const git_oid *short_id, size_t len", + "sig": "git_oid *::git_odb *::const git_oid *::size_t", "return": { - "type": "const git_oid *", - "comment": " a pointer to the OID" + "type": "int", + "comment": " 0 if found, GIT_ENOTFOUND if not found, GIT_EAMBIGUOUS if multiple\n matches were found, other value \n<\n 0 if there was a read error." }, - "description": "

Return the OID of an ODB object

\n", - "comments": "

This is the OID from which the object was read from

\n", + "description": "

Determine if an object can be found in the object database by an\n abbreviated object ID.

\n", + "comments": "", "group": "odb" }, - "git_odb_object_data": { + "git_odb_expand_ids": { "type": "function", - "file": "odb.h", - "line": 464, - "lineto": 464, + "file": "git2/odb.h", + "line": 286, + "lineto": 289, "args": [ { - "name": "object", - "type": "git_odb_object *", - "comment": "the object" + "name": "db", + "type": "git_odb *", + "comment": "The database to be searched for the given objects." + }, + { + "name": "ids", + "type": "git_odb_expand_id *", + "comment": "An array of short object IDs to search for" + }, + { + "name": "count", + "type": "size_t", + "comment": "The length of the `ids` array" } ], - "argline": "git_odb_object *object", - "sig": "git_odb_object *", + "argline": "git_odb *db, git_odb_expand_id *ids, size_t count", + "sig": "git_odb *::git_odb_expand_id *::size_t", "return": { - "type": "const void *", - "comment": " a pointer to the data" + "type": "int", + "comment": " 0 on success or an error code on failure" }, - "description": "

Return the data of an ODB object

\n", - "comments": "

This is the uncompressed, raw data as read from the ODB, without the leading header.

\n\n

This pointer is owned by the object and shall not be free'd.

\n", - "group": "odb", - "examples": { - "general.c": [ - "ex/HEAD/general.html#git_odb_object_data-43" - ] - } + "description": "

Determine if one or more objects can be found in the object database\n by their abbreviated object ID and type.

\n", + "comments": "

The given array will be updated in place: for each abbreviated ID that is unique in the database, and of the given type (if specified), the full object ID, object ID length (GIT_OID_SHA1_HEXSIZE) and type will be written back to the array. For IDs that are not found (or are ambiguous), the array entry will be zeroed.

\n\n

Note that since this function operates on multiple objects, the underlying database will not be asked to be reloaded if an object is not found (which is unlike other object database operations.)

\n", + "group": "odb" }, - "git_odb_object_size": { + "git_odb_refresh": { "type": "function", - "file": "odb.h", - "line": 475, - "lineto": 475, + "file": "git2/odb.h", + "line": 309, + "lineto": 309, "args": [ - { - "name": "object", - "type": "git_odb_object *", - "comment": "the object" - } + { "name": "db", "type": "git_odb *", "comment": "database to refresh" } ], - "argline": "git_odb_object *object", - "sig": "git_odb_object *", + "argline": "git_odb *db", + "sig": "git_odb *", "return": { - "type": "size_t", - "comment": " the size" + "type": "int", + "comment": " 0 on success, error code otherwise" }, - "description": "

Return the size of an ODB object

\n", - "comments": "

This is the real size of the data buffer, not the actual size of the object.

\n", - "group": "odb", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_odb_object_size-25" - ], - "general.c": [ - "ex/HEAD/general.html#git_odb_object_size-44" - ] - } + "description": "

Refresh the object database to load newly added files.

\n", + "comments": "

If the object databases have changed on disk while the library is running, this function will force a reload of the underlying indexes.

\n\n

Use this function when you're confident that an external application has tampered with the ODB.

\n\n

NOTE that it is not necessary to call this function at all. The library will automatically attempt to refresh the ODB when a lookup fails, to see if the looked up object exists on disk but hasn't been loaded yet.

\n", + "group": "odb" }, - "git_odb_object_type": { + "git_odb_foreach": { "type": "function", - "file": "odb.h", - "line": 483, - "lineto": 483, + "file": "git2/odb.h", + "line": 324, + "lineto": 327, "args": [ + { "name": "db", "type": "git_odb *", "comment": "database to use" }, { - "name": "object", - "type": "git_odb_object *", - "comment": "the object" + "name": "cb", + "type": "git_odb_foreach_cb", + "comment": "the callback to call for each object" + }, + { + "name": "payload", + "type": "void *", + "comment": "data to pass to the callback" } ], - "argline": "git_odb_object *object", - "sig": "git_odb_object *", + "argline": "git_odb *db, git_odb_foreach_cb cb, void *payload", + "sig": "git_odb *::git_odb_foreach_cb::void *", "return": { - "type": "git_otype", - "comment": " the type" + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" }, - "description": "

Return the type of an ODB object

\n", - "comments": "", - "group": "odb", - "examples": { - "general.c": [ - "ex/HEAD/general.html#git_odb_object_type-45" - ] - } + "description": "

List all objects available in the database

\n", + "comments": "

The callback will be called for each object available in the database. Note that the objects are likely to be returned in the index order, which would make accessing the objects in that order inefficient. Return a non-zero value from the callback to stop looping.

\n", + "group": "odb" }, - "git_odb_add_backend": { + "git_odb_write": { "type": "function", - "file": "odb.h", - "line": 498, - "lineto": 498, + "file": "git2/odb.h", + "line": 347, + "lineto": 347, "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "pointer to store the OID result of the write" + }, { "name": "odb", "type": "git_odb *", - "comment": "database to add the backend to" + "comment": "object database where to store the object" }, { - "name": "backend", - "type": "git_odb_backend *", - "comment": "pointer to a git_odb_backend instance" + "name": "data", + "type": "const void *", + "comment": "`const unsigned char *` buffer with the data to store" }, + { "name": "len", "type": "size_t", "comment": "size of the buffer" }, { - "name": "priority", - "type": "int", - "comment": "Value for ordering the backends queue" + "name": "type", + "type": "git_object_t", + "comment": "type of the data to store" } ], - "argline": "git_odb *odb, git_odb_backend *backend, int priority", - "sig": "git_odb *::git_odb_backend *::int", - "return": { - "type": "int", - "comment": " 0 on success; error code otherwise" - }, - "description": "

Add a custom backend to an existing Object DB

\n", - "comments": "

The backends are checked in relative ordering, based on the value of the priority parameter.

\n\n

Read for more information.

\n", - "group": "odb" + "argline": "git_oid *out, git_odb *odb, const void *data, size_t len, git_object_t type", + "sig": "git_oid *::git_odb *::const void *::size_t::git_object_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Write an object directly into the ODB

\n", + "comments": "

This method writes a full object straight into the ODB. For most cases, it is preferred to write objects through a write stream, which is both faster and less memory intensive, specially for big objects.

\n\n

This method is provided for compatibility with custom backends which are not able to support streaming writes

\n", + "group": "odb", + "examples": { "general.c": ["ex/v1.9.1/general.html#git_odb_write-43"] } }, - "git_odb_add_alternate": { + "git_odb_open_wstream": { "type": "function", - "file": "odb.h", - "line": 519, - "lineto": 519, + "file": "git2/odb.h", + "line": 370, + "lineto": 370, "args": [ { - "name": "odb", + "name": "out", + "type": "git_odb_stream **", + "comment": "pointer where to store the stream" + }, + { + "name": "db", "type": "git_odb *", - "comment": "database to add the backend to" + "comment": "object database where the stream will write" }, { - "name": "backend", - "type": "git_odb_backend *", - "comment": "pointer to a git_odb_backend instance" + "name": "size", + "type": "git_object_size_t", + "comment": "final size of the object that will be written" }, { - "name": "priority", - "type": "int", - "comment": "Value for ordering the backends queue" + "name": "type", + "type": "git_object_t", + "comment": "type of the object that will be written" } ], - "argline": "git_odb *odb, git_odb_backend *backend, int priority", - "sig": "git_odb *::git_odb_backend *::int", + "argline": "git_odb_stream **out, git_odb *db, git_object_size_t size, git_object_t type", + "sig": "git_odb_stream **::git_odb *::git_object_size_t::git_object_t", "return": { "type": "int", - "comment": " 0 on success; error code otherwise" + "comment": " 0 if the stream was created; error code otherwise" }, - "description": "

Add a custom backend to an existing Object DB; this\n backend will work as an alternate.

\n", - "comments": "

Alternate backends are always checked for objects after all the main backends have been exhausted.

\n\n

The backends are checked in relative ordering, based on the value of the priority parameter.

\n\n

Writing is disabled on alternate backends.

\n\n

Read for more information.

\n", + "description": "

Open a stream to write an object into the ODB

\n", + "comments": "

The type and final length of the object must be specified when opening the stream.

\n\n

The returned stream will be of type GIT_STREAM_WRONLY, and it won't be effective until git_odb_stream_finalize_write is called and returns without an error

\n\n

The stream must always be freed when done with git_odb_stream_free or will leak memory.

\n", "group": "odb" }, - "git_odb_num_backends": { + "git_odb_stream_write": { "type": "function", - "file": "odb.h", - "line": 527, - "lineto": 527, + "file": "git2/odb.h", + "line": 383, + "lineto": 383, "args": [ { - "name": "odb", - "type": "git_odb *", - "comment": "object database" - } + "name": "stream", + "type": "git_odb_stream *", + "comment": "the stream" + }, + { + "name": "buffer", + "type": "const char *", + "comment": "the data to write" + }, + { "name": "len", "type": "size_t", "comment": "the buffer's length" } ], - "argline": "git_odb *odb", - "sig": "git_odb *", + "argline": "git_odb_stream *stream, const char *buffer, size_t len", + "sig": "git_odb_stream *::const char *::size_t", "return": { - "type": "size_t", - "comment": " number of backends in the ODB" + "type": "int", + "comment": " 0 if the write succeeded, error code otherwise" }, - "description": "

Get the number of ODB backend objects

\n", - "comments": "", + "description": "

Write to an odb stream

\n", + "comments": "

This method will fail if the total number of received bytes exceeds the size declared with git_odb_open_wstream()

\n", "group": "odb" }, - "git_odb_get_backend": { + "git_odb_stream_finalize_write": { "type": "function", - "file": "odb.h", - "line": 537, - "lineto": 537, + "file": "git2/odb.h", + "line": 398, + "lineto": 398, "args": [ { "name": "out", - "type": "git_odb_backend **", - "comment": "output pointer to ODB backend at pos" - }, - { - "name": "odb", - "type": "git_odb *", - "comment": "object database" + "type": "git_oid *", + "comment": "pointer to store the resulting object's id" }, { - "name": "pos", - "type": "size_t", - "comment": "index into object database backend list" + "name": "stream", + "type": "git_odb_stream *", + "comment": "the stream" } ], - "argline": "git_odb_backend **out, git_odb *odb, size_t pos", - "sig": "git_odb_backend **::git_odb *::size_t", + "argline": "git_oid *out, git_odb_stream *stream", + "sig": "git_oid *::git_odb_stream *", "return": { "type": "int", - "comment": " 0 on success; GIT_ENOTFOUND if pos is invalid; other errors \n<\n 0" + "comment": " 0 on success, an error code otherwise" }, - "description": "

Lookup an ODB backend object by index

\n", - "comments": "", + "description": "

Finish writing to an odb stream

\n", + "comments": "

The object will take its final name and will be available to the odb.

\n\n

This method will fail if the total number of received bytes differs from the size declared with git_odb_open_wstream()

\n", "group": "odb" }, - "git_odb_backend_pack": { + "git_odb_stream_read": { "type": "function", - "file": "odb_backend.h", - "line": 34, - "lineto": 34, + "file": "git2/odb.h", + "line": 410, + "lineto": 410, "args": [ { - "name": "out", - "type": "git_odb_backend **", - "comment": "location to store the odb backend pointer" + "name": "stream", + "type": "git_odb_stream *", + "comment": "the stream" }, { - "name": "objects_dir", - "type": "const char *", - "comment": "the Git repository's objects directory" - } + "name": "buffer", + "type": "char *", + "comment": "a user-allocated buffer to store the data in." + }, + { "name": "len", "type": "size_t", "comment": "the buffer's length" } ], - "argline": "git_odb_backend **out, const char *objects_dir", - "sig": "git_odb_backend **::const char *", + "argline": "git_odb_stream *stream, char *buffer, size_t len", + "sig": "git_odb_stream *::char *::size_t", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " the number of bytes read if succeeded, error code otherwise" }, - "description": "

Create a backend for the packfiles.

\n", + "description": "

Read from an odb stream

\n", + "comments": "

Most backends don't implement streaming reads

\n", + "group": "odb" + }, + "git_odb_stream_free": { + "type": "function", + "file": "git2/odb.h", + "line": 417, + "lineto": 417, + "args": [ + { + "name": "stream", + "type": "git_odb_stream *", + "comment": "the stream to free" + } + ], + "argline": "git_odb_stream *stream", + "sig": "git_odb_stream *", + "return": { "type": "void", "comment": null }, + "description": "

Free an odb stream

\n", "comments": "", "group": "odb" }, - "git_odb_backend_loose": { + "git_odb_open_rstream": { "type": "function", - "file": "odb_backend.h", - "line": 48, - "lineto": 54, + "file": "git2/odb.h", + "line": 445, + "lineto": 450, "args": [ { "name": "out", - "type": "git_odb_backend **", - "comment": "location to store the odb backend pointer" - }, - { - "name": "objects_dir", - "type": "const char *", - "comment": "the Git repository's objects directory" + "type": "git_odb_stream **", + "comment": "pointer where to store the stream" }, { - "name": "compression_level", - "type": "int", - "comment": "zlib compression level to use" + "name": "len", + "type": "size_t *", + "comment": "pointer where to store the length of the object" }, { - "name": "do_fsync", - "type": "int", - "comment": "whether to do an fsync() after writing (currently ignored)" + "name": "type", + "type": "git_object_t *", + "comment": "pointer where to store the type of the object" }, { - "name": "dir_mode", - "type": "unsigned int", - "comment": "permissions to use creating a directory or 0 for defaults" + "name": "db", + "type": "git_odb *", + "comment": "object database where the stream will read from" }, { - "name": "file_mode", - "type": "unsigned int", - "comment": "permissions to use creating a file or 0 for defaults" + "name": "oid", + "type": "const git_oid *", + "comment": "oid of the object the stream will read from" } ], - "argline": "git_odb_backend **out, const char *objects_dir, int compression_level, int do_fsync, unsigned int dir_mode, unsigned int file_mode", - "sig": "git_odb_backend **::const char *::int::int::unsigned int::unsigned int", + "argline": "git_odb_stream **out, size_t *len, git_object_t *type, git_odb *db, const git_oid *oid", + "sig": "git_odb_stream **::size_t *::git_object_t *::git_odb *::const git_oid *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 if the stream was created, error code otherwise" }, - "description": "

Create a backend for loose objects

\n", - "comments": "", + "description": "

Open a stream to read an object from the ODB

\n", + "comments": "

Note that most backends do not support streaming reads because they store their objects as compressed/delta'ed blobs.

\n\n

It's recommended to use git_odb_read instead, which is assured to work on all backends.

\n\n

The returned stream will be of type GIT_STREAM_RDONLY and will have the following methods:

\n\n
    - stream->read: read `n` bytes from the stream      - stream->free: free the stream\n
\n\n

The stream must always be free'd or will leak memory.

\n", "group": "odb" }, - "git_odb_backend_one_pack": { + "git_odb_write_pack": { "type": "function", - "file": "odb_backend.h", - "line": 67, - "lineto": 67, + "file": "git2/odb.h", + "line": 471, + "lineto": 475, "args": [ { "name": "out", - "type": "git_odb_backend **", - "comment": "location to store the odb backend pointer" + "type": "git_odb_writepack **", + "comment": "pointer to the writepack functions" }, { - "name": "index_file", - "type": "const char *", - "comment": "path to the packfile's .idx file" + "name": "db", + "type": "git_odb *", + "comment": "object database where the stream will read from" + }, + { + "name": "progress_cb", + "type": "git_indexer_progress_cb", + "comment": "function to call with progress information.\n Be aware that this is called inline with network and indexing operations,\n so performance may be affected." + }, + { + "name": "progress_payload", + "type": "void *", + "comment": "payload for the progress callback" } ], - "argline": "git_odb_backend **out, const char *index_file", - "sig": "git_odb_backend **::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Create a backend out of a single packfile

\n", - "comments": "

This can be useful for inspecting the contents of a single packfile.

\n", + "argline": "git_odb_writepack **out, git_odb *db, git_indexer_progress_cb progress_cb, void *progress_payload", + "sig": "git_odb_writepack **::git_odb *::git_indexer_progress_cb::void *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Open a stream for writing a pack file to the ODB.

\n", + "comments": "

If the ODB layer understands pack files, then the given packfile will likely be streamed directly to disk (and a corresponding index created). If the ODB layer does not understand pack files, the objects will be stored in whatever format the ODB layer uses.

\n", "group": "odb" }, - "git_oid_fromstr": { + "git_odb_write_multi_pack_index": { "type": "function", - "file": "oid.h", - "line": 47, - "lineto": 47, + "file": "git2/odb.h", + "line": 489, + "lineto": 490, "args": [ { - "name": "out", - "type": "git_oid *", - "comment": "oid structure the result is written into." - }, - { - "name": "str", - "type": "const char *", - "comment": "input hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (40 bytes)." + "name": "db", + "type": "git_odb *", + "comment": "object database where the `multi-pack-index` file will be written." } ], - "argline": "git_oid *out, const char *str", - "sig": "git_oid *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Parse a hex formatted object id into a git_oid.

\n", - "comments": "", - "group": "oid", - "examples": { - "general.c": [ - "ex/HEAD/general.html#git_oid_fromstr-46", - "ex/HEAD/general.html#git_oid_fromstr-47", - "ex/HEAD/general.html#git_oid_fromstr-48", - "ex/HEAD/general.html#git_oid_fromstr-49", - "ex/HEAD/general.html#git_oid_fromstr-50", - "ex/HEAD/general.html#git_oid_fromstr-51", - "ex/HEAD/general.html#git_oid_fromstr-52", - "ex/HEAD/general.html#git_oid_fromstr-53" - ] - } + "argline": "git_odb *db", + "sig": "git_odb *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Write a multi-pack-index file from all the .pack files in the ODB.

\n", + "comments": "

If the ODB layer understands pack files, then this will create a file called multi-pack-index next to the .pack and .idx files, which will contain an index of all objects stored in .pack files. This will allow for O(log n) lookup for n objects (regardless of how many packfiles there exist).

\n", + "group": "odb" }, - "git_oid_fromstrp": { + "git_odb_hash": { "type": "function", - "file": "oid.h", - "line": 56, - "lineto": 56, + "file": "git2/odb.h", + "line": 539, + "lineto": 539, "args": [ { - "name": "out", + "name": "oid", "type": "git_oid *", - "comment": "oid structure the result is written into." + "comment": "the resulting object-ID." }, + { "name": "data", "type": "const void *", "comment": "data to hash" }, + { "name": "len", "type": "size_t", "comment": "size of the data" }, { - "name": "str", - "type": "const char *", - "comment": "input hex string; must be null-terminated." + "name": "object_type", + "type": "git_object_t", + "comment": "of the data to hash" } ], - "argline": "git_oid *out, const char *str", - "sig": "git_oid *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Parse a hex formatted null-terminated string into a git_oid.

\n", - "comments": "", - "group": "oid" + "argline": "git_oid *oid, const void *data, size_t len, git_object_t object_type", + "sig": "git_oid *::const void *::size_t::git_object_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Determine the object-ID (sha1 or sha256 hash) of a data buffer

\n", + "comments": "

The resulting OID will be the identifier for the data buffer as if the data buffer it were to written to the ODB.

\n", + "group": "odb" }, - "git_oid_fromstrn": { + "git_odb_hashfile": { "type": "function", - "file": "oid.h", - "line": 69, - "lineto": 69, + "file": "git2/odb.h", + "line": 554, + "lineto": 554, "args": [ { - "name": "out", + "name": "oid", "type": "git_oid *", "comment": "oid structure the result is written into." }, { - "name": "str", + "name": "path", "type": "const char *", - "comment": "input hex string of at least size `length`" + "comment": "file to read and determine object id for" }, { - "name": "length", - "type": "size_t", - "comment": "length of the input string" + "name": "object_type", + "type": "git_object_t", + "comment": "of the data to hash" } ], - "argline": "git_oid *out, const char *str, size_t length", - "sig": "git_oid *::const char *::size_t", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Parse N characters of a hex formatted object id into a git_oid.

\n", - "comments": "

If N is odd, the last byte's high nibble will be read in and the low nibble set to zero.

\n", - "group": "oid" + "argline": "git_oid *oid, const char *path, git_object_t object_type", + "sig": "git_oid *::const char *::git_object_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Read a file from disk and fill a git_oid with the object id\n that the file would have if it were written to the Object\n Database as an object of the given type (w/o applying filters).\n Similar functionality to git.git's git hash-object without\n the -w flag, however, with the --no-filters flag.\n If you need filters, see git_repository_hashfile.

\n", + "comments": "", + "group": "odb" }, - "git_oid_fromraw": { + "git_odb_object_dup": { "type": "function", - "file": "oid.h", - "line": 77, - "lineto": 77, + "file": "git2/odb.h", + "line": 570, + "lineto": 570, "args": [ { - "name": "out", - "type": "git_oid *", - "comment": "oid structure the result is written into." + "name": "dest", + "type": "git_odb_object **", + "comment": "pointer where to store the copy" }, { - "name": "raw", - "type": "const unsigned char *", - "comment": "the raw input bytes to be copied." + "name": "source", + "type": "git_odb_object *", + "comment": "object to copy" } ], - "argline": "git_oid *out, const unsigned char *raw", - "sig": "git_oid *::const unsigned char *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Copy an already raw oid into a git_oid structure.

\n", - "comments": "", - "group": "oid" + "argline": "git_odb_object **dest, git_odb_object *source", + "sig": "git_odb_object **::git_odb_object *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a copy of an odb_object

\n", + "comments": "

The returned copy must be manually freed with git_odb_object_free. Note that because of an implementation detail, the returned copy will be the same pointer as source: the object is internally refcounted, so the copy still needs to be freed twice.

\n", + "group": "odb" }, - "git_oid_fmt": { + "git_odb_object_free": { "type": "function", - "file": "oid.h", - "line": 89, - "lineto": 89, + "file": "git2/odb.h", + "line": 580, + "lineto": 580, "args": [ { - "name": "out", - "type": "char *", - "comment": "output hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (40 bytes). Only the\n\t\toid digits are written; a '\n\\\n0' terminator must be added\n\t\tby the caller if it is required." - }, - { - "name": "id", - "type": "const git_oid *", - "comment": "oid structure to format." + "name": "object", + "type": "git_odb_object *", + "comment": "object to close" } ], - "argline": "char *out, const git_oid *id", - "sig": "char *::const git_oid *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Format a git_oid into a hex string.

\n", - "comments": "", - "group": "oid", + "argline": "git_odb_object *object", + "sig": "git_odb_object *", + "return": { "type": "void", "comment": null }, + "description": "

Close an ODB object

\n", + "comments": "

This method must always be called once a git_odb_object is no longer needed, otherwise memory will leak.

\n", + "group": "odb", "examples": { - "general.c": [ - "ex/HEAD/general.html#git_oid_fmt-54", - "ex/HEAD/general.html#git_oid_fmt-55", - "ex/HEAD/general.html#git_oid_fmt-56", - "ex/HEAD/general.html#git_oid_fmt-57", - "ex/HEAD/general.html#git_oid_fmt-58", - "ex/HEAD/general.html#git_oid_fmt-59" - ], - "network/fetch.c": [ - "ex/HEAD/network/fetch.html#git_oid_fmt-1", - "ex/HEAD/network/fetch.html#git_oid_fmt-2" - ], - "network/index-pack.c": [ - "ex/HEAD/network/index-pack.html#git_oid_fmt-6" - ], - "network/ls-remote.c": [ - "ex/HEAD/network/ls-remote.html#git_oid_fmt-1" - ] + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_odb_object_free-22"], + "general.c": ["ex/v1.9.1/general.html#git_odb_object_free-44"] } }, - "git_oid_nfmt": { + "git_odb_object_id": { "type": "function", - "file": "oid.h", - "line": 100, - "lineto": 100, + "file": "git2/odb.h", + "line": 590, + "lineto": 590, "args": [ { - "name": "out", - "type": "char *", - "comment": "output hex string; you say how many bytes to write.\n\t\tIf the number of bytes is > GIT_OID_HEXSZ, extra bytes\n\t\twill be zeroed; if not, a '\n\\\n0' terminator is NOT added." - }, - { - "name": "n", - "type": "size_t", - "comment": "number of characters to write into out string" - }, - { - "name": "id", - "type": "const git_oid *", - "comment": "oid structure to format." + "name": "object", + "type": "git_odb_object *", + "comment": "the object" } ], - "argline": "char *out, size_t n, const git_oid *id", - "sig": "char *::size_t::const git_oid *", + "argline": "git_odb_object *object", + "sig": "git_odb_object *", "return": { - "type": "void", - "comment": null + "type": "const git_oid *", + "comment": " a pointer to the OID" }, - "description": "

Format a git_oid into a partial hex string.

\n", - "comments": "", - "group": "oid" + "description": "

Return the OID of an ODB object

\n", + "comments": "

This is the OID from which the object was read from

\n", + "group": "odb" }, - "git_oid_pathfmt": { + "git_odb_object_data": { "type": "function", - "file": "oid.h", - "line": 115, - "lineto": 115, + "file": "git2/odb.h", + "line": 603, + "lineto": 603, "args": [ { - "name": "out", - "type": "char *", - "comment": "output hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (41 bytes). Only the\n\t\toid digits are written; a '\n\\\n0' terminator must be added\n\t\tby the caller if it is required." - }, - { - "name": "id", - "type": "const git_oid *", - "comment": "oid structure to format." + "name": "object", + "type": "git_odb_object *", + "comment": "the object" } ], - "argline": "char *out, const git_oid *id", - "sig": "char *::const git_oid *", + "argline": "git_odb_object *object", + "sig": "git_odb_object *", "return": { - "type": "void", - "comment": null + "type": "const void *", + "comment": " \n\n `const unsigned char *` a pointer to the data" }, - "description": "

Format a git_oid into a loose-object path string.

\n", - "comments": "

The resulting string is "aa/...", where "aa" is the first two hex digits of the oid and "..." is the remaining 38 digits.

\n", - "group": "oid" + "description": "

Return the data of an ODB object

\n", + "comments": "

This is the uncompressed, raw data as read from the ODB, without the leading header.

\n\n

This pointer is owned by the object and shall not be free'd.

\n", + "group": "odb", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_odb_object_data-45"] + } }, - "git_oid_tostr_s": { + "git_odb_object_size": { "type": "function", - "file": "oid.h", - "line": 128, - "lineto": 128, + "file": "git2/odb.h", + "line": 614, + "lineto": 614, "args": [ { - "name": "oid", - "type": "const git_oid *", - "comment": "The oid structure to format" + "name": "object", + "type": "git_odb_object *", + "comment": "the object" } ], - "argline": "const git_oid *oid", - "sig": "const git_oid *", - "return": { - "type": "char *", - "comment": " the c-string" - }, - "description": "

Format a git_oid into a statically allocated c-string.

\n", - "comments": "

The c-string is owned by the library and should not be freed by the user. If libgit2 is built with thread support, the string will be stored in TLS (i.e. one buffer per thread) to allow for concurrent calls of the function.

\n", - "group": "oid" + "argline": "git_odb_object *object", + "sig": "git_odb_object *", + "return": { "type": "size_t", "comment": " the size" }, + "description": "

Return the size of an ODB object

\n", + "comments": "

This is the real size of the data buffer, not the actual size of the object.

\n", + "group": "odb", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_odb_object_size-23"], + "general.c": ["ex/v1.9.1/general.html#git_odb_object_size-46"] + } }, - "git_oid_tostr": { + "git_odb_object_type": { "type": "function", - "file": "oid.h", - "line": 147, - "lineto": 147, + "file": "git2/odb.h", + "line": 622, + "lineto": 622, "args": [ { - "name": "out", - "type": "char *", - "comment": "the buffer into which the oid string is output." - }, - { - "name": "n", - "type": "size_t", - "comment": "the size of the out buffer." - }, - { - "name": "id", - "type": "const git_oid *", - "comment": "the oid structure to format." + "name": "object", + "type": "git_odb_object *", + "comment": "the object" } ], - "argline": "char *out, size_t n, const git_oid *id", - "sig": "char *::size_t::const git_oid *", - "return": { - "type": "char *", - "comment": " the out buffer pointer, assuming no input parameter\n\t\t\terrors, otherwise a pointer to an empty string." - }, - "description": "

Format a git_oid into a buffer as a hex format c-string.

\n", - "comments": "

If the buffer is smaller than GIT_OID_HEXSZ+1, then the resulting oid c-string will be truncated to n-1 characters (but will still be NUL-byte terminated).

\n\n

If there are any input parameter errors (out == NULL, n == 0, oid == NULL), then a pointer to an empty string is returned, so that the return value can always be printed.

\n", - "group": "oid", + "argline": "git_odb_object *object", + "sig": "git_odb_object *", + "return": { "type": "git_object_t", "comment": " the type" }, + "description": "

Return the type of an ODB object

\n", + "comments": "", + "group": "odb", "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_oid_tostr-18", - "ex/HEAD/blame.html#git_oid_tostr-19" - ], - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_oid_tostr-26", - "ex/HEAD/cat-file.html#git_oid_tostr-27", - "ex/HEAD/cat-file.html#git_oid_tostr-28", - "ex/HEAD/cat-file.html#git_oid_tostr-29", - "ex/HEAD/cat-file.html#git_oid_tostr-30" - ], - "log.c": [ - "ex/HEAD/log.html#git_oid_tostr-39", - "ex/HEAD/log.html#git_oid_tostr-40" - ], - "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_oid_tostr-12", - "ex/HEAD/rev-parse.html#git_oid_tostr-13", - "ex/HEAD/rev-parse.html#git_oid_tostr-14", - "ex/HEAD/rev-parse.html#git_oid_tostr-15" - ] + "general.c": ["ex/v1.9.1/general.html#git_odb_object_type-47"] } }, - "git_oid_cpy": { + "git_odb_add_backend": { "type": "function", - "file": "oid.h", - "line": 155, - "lineto": 155, + "file": "git2/odb.h", + "line": 637, + "lineto": 637, "args": [ { - "name": "out", - "type": "git_oid *", - "comment": "oid structure the result is written into." + "name": "odb", + "type": "git_odb *", + "comment": "database to add the backend to" }, { - "name": "src", - "type": "const git_oid *", - "comment": "oid structure to copy from." + "name": "backend", + "type": "git_odb_backend *", + "comment": "pointer to a git_odb_backend instance" + }, + { + "name": "priority", + "type": "int", + "comment": "Value for ordering the backends queue" } ], - "argline": "git_oid *out, const git_oid *src", - "sig": "git_oid *::const git_oid *", + "argline": "git_odb *odb, git_odb_backend *backend, int priority", + "sig": "git_odb *::git_odb_backend *::int", "return": { - "type": "void", - "comment": null + "type": "int", + "comment": " 0 on success, error code otherwise" }, - "description": "

Copy an oid from one structure to another.

\n", - "comments": "", - "group": "oid", - "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_oid_cpy-20", - "ex/HEAD/blame.html#git_oid_cpy-21", - "ex/HEAD/blame.html#git_oid_cpy-22" - ] - } + "description": "

Add a custom backend to an existing Object DB

\n", + "comments": "

The backends are checked in relative ordering, based on the value of the priority parameter.

\n\n

Read for more information.

\n", + "group": "odb" }, - "git_oid_cmp": { + "git_odb_add_alternate": { "type": "function", - "file": "oid.h", - "line": 164, - "lineto": 164, + "file": "git2/odb.h", + "line": 658, + "lineto": 658, "args": [ { - "name": "a", - "type": "const git_oid *", - "comment": "first oid structure." + "name": "odb", + "type": "git_odb *", + "comment": "database to add the backend to" }, { - "name": "b", - "type": "const git_oid *", - "comment": "second oid structure." + "name": "backend", + "type": "git_odb_backend *", + "comment": "pointer to a git_odb_backend instance" + }, + { + "name": "priority", + "type": "int", + "comment": "Value for ordering the backends queue" } ], - "argline": "const git_oid *a, const git_oid *b", - "sig": "const git_oid *::const git_oid *", + "argline": "git_odb *odb, git_odb_backend *backend, int priority", + "sig": "git_odb *::git_odb_backend *::int", "return": { "type": "int", - "comment": " \n<\n0, 0, >0 if a \n<\n b, a == b, a > b." + "comment": " 0 on success, error code otherwise" }, - "description": "

Compare two oid structures.

\n", - "comments": "", - "group": "oid" + "description": "

Add a custom backend to an existing Object DB; this\n backend will work as an alternate.

\n", + "comments": "

Alternate backends are always checked for objects after all the main backends have been exhausted.

\n\n

The backends are checked in relative ordering, based on the value of the priority parameter.

\n\n

Writing is disabled on alternate backends.

\n\n

Read for more information.

\n", + "group": "odb" }, - "git_oid_equal": { + "git_odb_num_backends": { "type": "function", - "file": "oid.h", - "line": 173, - "lineto": 173, + "file": "git2/odb.h", + "line": 666, + "lineto": 666, "args": [ - { - "name": "a", - "type": "const git_oid *", - "comment": "first oid structure." - }, - { - "name": "b", - "type": "const git_oid *", - "comment": "second oid structure." - } + { "name": "odb", "type": "git_odb *", "comment": "object database" } ], - "argline": "const git_oid *a, const git_oid *b", - "sig": "const git_oid *::const git_oid *", + "argline": "git_odb *odb", + "sig": "git_odb *", "return": { - "type": "int", - "comment": " true if equal, false otherwise" + "type": "size_t", + "comment": " number of backends in the ODB" }, - "description": "

Compare two oid structures for equality

\n", + "description": "

Get the number of ODB backend objects

\n", "comments": "", - "group": "oid" + "group": "odb" }, - "git_oid_ncmp": { + "git_odb_get_backend": { "type": "function", - "file": "oid.h", - "line": 184, - "lineto": 184, + "file": "git2/odb.h", + "line": 676, + "lineto": 676, "args": [ { - "name": "a", - "type": "const git_oid *", - "comment": "first oid structure." - }, - { - "name": "b", - "type": "const git_oid *", - "comment": "second oid structure." + "name": "out", + "type": "git_odb_backend **", + "comment": "output pointer to ODB backend at pos" }, + { "name": "odb", "type": "git_odb *", "comment": "object database" }, { - "name": "len", + "name": "pos", "type": "size_t", - "comment": "the number of hex chars to compare" + "comment": "index into object database backend list" } ], - "argline": "const git_oid *a, const git_oid *b, size_t len", - "sig": "const git_oid *::const git_oid *::size_t", + "argline": "git_odb_backend **out, git_odb *odb, size_t pos", + "sig": "git_odb_backend **::git_odb *::size_t", "return": { "type": "int", - "comment": " 0 in case of a match" + "comment": " 0 on success, GIT_ENOTFOUND if pos is invalid, other errors \n<\n 0" }, - "description": "

Compare the first 'len' hexadecimal characters (packets of 4 bits)\n of two oid structures.

\n", + "description": "

Lookup an ODB backend object by index

\n", "comments": "", - "group": "oid" + "group": "odb" }, - "git_oid_streq": { + "git_odb_set_commit_graph": { "type": "function", - "file": "oid.h", - "line": 193, - "lineto": 193, + "file": "git2/odb.h", + "line": 691, + "lineto": 691, "args": [ + { "name": "odb", "type": "git_odb *", "comment": "object database" }, { - "name": "id", - "type": "const git_oid *", - "comment": "oid structure." - }, - { - "name": "str", - "type": "const char *", - "comment": "input hex string of an object id." + "name": "cgraph", + "type": "git_commit_graph *", + "comment": "the git commit-graph" } ], - "argline": "const git_oid *id, const char *str", - "sig": "const git_oid *::const char *", + "argline": "git_odb *odb, git_commit_graph *cgraph", + "sig": "git_odb *::git_commit_graph *", "return": { "type": "int", - "comment": " 0 in case of a match, -1 otherwise." + "comment": " 0 on success; error code otherwise" }, - "description": "

Check if an oid equals an hex formatted object id.

\n", - "comments": "", - "group": "oid" + "description": "

Set the git commit-graph for the ODB.

\n", + "comments": "

After a successful call, the ownership of the cgraph parameter will be transferred to libgit2, and the caller should not free it.

\n\n

The commit-graph can also be unset by explicitly passing NULL as the cgraph parameter.

\n", + "group": "odb" }, - "git_oid_strcmp": { + "git_odb_backend_pack": { "type": "function", - "file": "oid.h", - "line": 203, - "lineto": 203, + "file": "git2/odb_backend.h", + "line": 142, + "lineto": 144, "args": [ { - "name": "id", - "type": "const git_oid *", - "comment": "oid structure." + "name": "out", + "type": "git_odb_backend **", + "comment": "location to store the odb backend pointer" }, { - "name": "str", + "name": "objects_dir", "type": "const char *", - "comment": "input hex string of an object id." + "comment": "the Git repository's objects directory" } ], - "argline": "const git_oid *id, const char *str", - "sig": "const git_oid *::const char *", - "return": { - "type": "int", - "comment": " -1 if str is not valid, \n<\n0 if id sorts before str,\n 0 if id matches str, >0 if id sorts after str." - }, - "description": "

Compare an oid to an hex formatted object id.

\n", + "argline": "git_odb_backend **out, const char *objects_dir", + "sig": "git_odb_backend **::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a backend for a directory containing packfiles.

\n", "comments": "", - "group": "oid" + "group": "odb" }, - "git_oid_iszero": { + "git_odb_backend_one_pack": { "type": "function", - "file": "oid.h", - "line": 210, - "lineto": 210, + "file": "git2/odb_backend.h", + "line": 156, + "lineto": 158, "args": [ { - "name": "id", - "type": "const git_oid *", - "comment": null + "name": "out", + "type": "git_odb_backend **", + "comment": "location to store the odb backend pointer" + }, + { + "name": "index_file", + "type": "const char *", + "comment": "path to the packfile's .idx file" } ], - "argline": "const git_oid *id", - "sig": "const git_oid *", - "return": { - "type": "int", - "comment": " 1 if all zeros, 0 otherwise." - }, - "description": "

Check is an oid is all zeros.

\n", - "comments": "", - "group": "oid", - "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_oid_iszero-23" - ], - "network/fetch.c": [ - "ex/HEAD/network/fetch.html#git_oid_iszero-3" - ] - } + "argline": "git_odb_backend **out, const char *index_file", + "sig": "git_odb_backend **::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a backend out of a single packfile

\n", + "comments": "

This can be useful for inspecting the contents of a single packfile.

\n", + "group": "odb" }, - "git_oid_shorten_new": { + "git_odb_backend_loose": { "type": "function", - "file": "oid.h", - "line": 231, - "lineto": 231, + "file": "git2/odb_backend.h", + "line": 171, + "lineto": 177, "args": [ { - "name": "min_length", - "type": "size_t", - "comment": "The minimal length for all identifiers,\n\t\twhich will be used even if shorter OIDs would still\n\t\tbe unique." + "name": "out", + "type": "git_odb_backend **", + "comment": "location to store the odb backend pointer" + }, + { + "name": "objects_dir", + "type": "const char *", + "comment": "the Git repository's objects directory" + }, + { + "name": "compression_level", + "type": "int", + "comment": "zlib compression level (0-9), or -1 for the default" + }, + { + "name": "do_fsync", + "type": "int", + "comment": "if non-zero, perform an fsync on write" + }, + { + "name": "dir_mode", + "type": "unsigned int", + "comment": "permission to use when creating directories, or 0 for default" + }, + { + "name": "file_mode", + "type": "unsigned int", + "comment": "permission to use when creating directories, or 0 for default" } ], - "argline": "size_t min_length", - "sig": "size_t", - "return": { - "type": "git_oid_shorten *", - "comment": " a `git_oid_shorten` instance, NULL if OOM" - }, - "description": "

Create a new OID shortener.

\n", - "comments": "

The OID shortener is used to process a list of OIDs in text form and return the shortest length that would uniquely identify all of them.

\n\n

E.g. look at the result of git log --abbrev.

\n", - "group": "oid" + "argline": "git_odb_backend **out, const char *objects_dir, int compression_level, int do_fsync, unsigned int dir_mode, unsigned int file_mode", + "sig": "git_odb_backend **::const char *::int::int::unsigned int::unsigned int", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a backend for loose objects

\n", + "comments": "", + "group": "odb" }, - "git_oid_shorten_add": { + "git_oid_fromstr": { "type": "function", - "file": "oid.h", - "line": 257, - "lineto": 257, + "file": "git2/oid.h", + "line": 137, + "lineto": 137, "args": [ { - "name": "os", - "type": "git_oid_shorten *", - "comment": "a `git_oid_shorten` instance" + "name": "out", + "type": "git_oid *", + "comment": "oid structure the result is written into." }, { - "name": "text_id", + "name": "str", "type": "const char *", - "comment": "an OID in text form" + "comment": "input hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (40 bytes for sha1,\n\t\t256 bytes for sha256)." } ], - "argline": "git_oid_shorten *os, const char *text_id", - "sig": "git_oid_shorten *::const char *", - "return": { - "type": "int", - "comment": " the minimal length to uniquely identify all OIDs\n\t\tadded so far to the set; or an error code (\n<\n0) if an\n\t\terror occurs." - }, - "description": "

Add a new OID to set of shortened OIDs and calculate\n the minimal length to uniquely identify all the OIDs in\n the set.

\n", - "comments": "

The OID is expected to be a 40-char hexadecimal string. The OID is owned by the user and will not be modified or freed.

\n\n

For performance reasons, there is a hard-limit of how many OIDs can be added to a single set (around ~32000, assuming a mostly randomized distribution), which should be enough for any kind of program, and keeps the algorithm fast and memory-efficient.

\n\n

Attempting to add more than those OIDs will result in a GITERR_INVALID error

\n", - "group": "oid" + "argline": "git_oid *out, const char *str", + "sig": "git_oid *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Parse a hex formatted object id into a git_oid.

\n", + "comments": "

The appropriate number of bytes for the given object ID type will be read from the string - 40 bytes for SHA1, 64 bytes for SHA256. The given string need not be NUL terminated.

\n", + "group": "oid", + "examples": { + "general.c": [ + "ex/v1.9.1/general.html#git_oid_fromstr-48", + "ex/v1.9.1/general.html#git_oid_fromstr-49", + "ex/v1.9.1/general.html#git_oid_fromstr-50", + "ex/v1.9.1/general.html#git_oid_fromstr-51", + "ex/v1.9.1/general.html#git_oid_fromstr-52", + "ex/v1.9.1/general.html#git_oid_fromstr-53", + "ex/v1.9.1/general.html#git_oid_fromstr-54", + "ex/v1.9.1/general.html#git_oid_fromstr-55", + "ex/v1.9.1/general.html#git_oid_fromstr-56", + "ex/v1.9.1/general.html#git_oid_fromstr-57", + "ex/v1.9.1/general.html#git_oid_fromstr-58", + "ex/v1.9.1/general.html#git_oid_fromstr-59", + "ex/v1.9.1/general.html#git_oid_fromstr-60", + "ex/v1.9.1/general.html#git_oid_fromstr-61", + "ex/v1.9.1/general.html#git_oid_fromstr-62", + "ex/v1.9.1/general.html#git_oid_fromstr-63" + ] + } }, - "git_oid_shorten_free": { + "git_oid_fromstrp": { "type": "function", - "file": "oid.h", - "line": 264, - "lineto": 264, + "file": "git2/oid.h", + "line": 146, + "lineto": 146, "args": [ { - "name": "os", - "type": "git_oid_shorten *", - "comment": "a `git_oid_shorten` instance" + "name": "out", + "type": "git_oid *", + "comment": "oid structure the result is written into." + }, + { + "name": "str", + "type": "const char *", + "comment": "input hex string; must be null-terminated." } ], - "argline": "git_oid_shorten *os", - "sig": "git_oid_shorten *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Free an OID shortener instance

\n", + "argline": "git_oid *out, const char *str", + "sig": "git_oid *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Parse a hex formatted NUL-terminated string into a git_oid.

\n", "comments": "", "group": "oid" }, - "git_oidarray_free": { + "git_oid_fromstrn": { "type": "function", - "file": "oidarray.h", - "line": 34, - "lineto": 34, + "file": "git2/oid.h", + "line": 159, + "lineto": 159, "args": [ { - "name": "array", - "type": "git_oidarray *", - "comment": "git_oidarray from which to free oid data" + "name": "out", + "type": "git_oid *", + "comment": "oid structure the result is written into." + }, + { + "name": "str", + "type": "const char *", + "comment": "input hex string of at least size `length`" + }, + { + "name": "length", + "type": "size_t", + "comment": "length of the input string" } ], - "argline": "git_oidarray *array", - "sig": "git_oidarray *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Free the OID array

\n", - "comments": "

This method must (and must only) be called on git_oidarray objects where the array is allocated by the library. Not doing so, will result in a memory leak.

\n\n

This does not free the git_oidarray itself, since the library will never allocate that object directly itself (it is more commonly embedded inside another struct or created on the stack).

\n", - "group": "oidarray" + "argline": "git_oid *out, const char *str, size_t length", + "sig": "git_oid *::const char *::size_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Parse N characters of a hex formatted object id into a git_oid.

\n", + "comments": "

If N is odd, the last byte's high nibble will be read in and the low nibble set to zero.

\n", + "group": "oid" }, - "git_packbuilder_new": { + "git_oid_fromraw": { "type": "function", - "file": "pack.h", - "line": 64, - "lineto": 64, + "file": "git2/oid.h", + "line": 168, + "lineto": 168, "args": [ { "name": "out", - "type": "git_packbuilder **", - "comment": "The new packbuilder object" + "type": "git_oid *", + "comment": "oid structure the result is written into." }, { - "name": "repo", - "type": "git_repository *", - "comment": "The repository" + "name": "raw", + "type": "const unsigned char *", + "comment": "the raw input bytes to be copied." } ], - "argline": "git_packbuilder **out, git_repository *repo", - "sig": "git_packbuilder **::git_repository *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Initialize a new packbuilder

\n", + "argline": "git_oid *out, const unsigned char *raw", + "sig": "git_oid *::const unsigned char *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Copy an already raw oid into a git_oid structure.

\n", "comments": "", - "group": "packbuilder" + "group": "oid" }, - "git_packbuilder_set_threads": { + "git_oid_fmt": { "type": "function", - "file": "pack.h", - "line": 77, - "lineto": 77, + "file": "git2/oid.h", + "line": 184, + "lineto": 184, "args": [ { - "name": "pb", - "type": "git_packbuilder *", - "comment": "The packbuilder" + "name": "out", + "type": "char *", + "comment": "output hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (40 bytes for SHA1,\n\t\t64 bytes for SHA256). Only the oid digits are written;\n\t\ta '\n\\\n0' terminator must be added by the caller if it is\n\t\trequired." }, { - "name": "n", - "type": "unsigned int", - "comment": "Number of threads to spawn" + "name": "id", + "type": "const git_oid *", + "comment": "oid structure to format." } ], - "argline": "git_packbuilder *pb, unsigned int n", - "sig": "git_packbuilder *::unsigned int", - "return": { - "type": "unsigned int", - "comment": " number of actual threads to be used" - }, - "description": "

Set number of threads to spawn

\n", - "comments": "

By default, libgit2 won't spawn any threads at all; when set to 0, libgit2 will autodetect the number of CPUs.

\n", - "group": "packbuilder" + "argline": "char *out, const git_oid *id", + "sig": "char *::const git_oid *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Format a git_oid into a hex string.

\n", + "comments": "", + "group": "oid", + "examples": { + "fetch.c": [ + "ex/v1.9.1/fetch.html#git_oid_fmt-1", + "ex/v1.9.1/fetch.html#git_oid_fmt-2" + ], + "general.c": [ + "ex/v1.9.1/general.html#git_oid_fmt-64", + "ex/v1.9.1/general.html#git_oid_fmt-65", + "ex/v1.9.1/general.html#git_oid_fmt-66", + "ex/v1.9.1/general.html#git_oid_fmt-67", + "ex/v1.9.1/general.html#git_oid_fmt-68" + ], + "ls-remote.c": ["ex/v1.9.1/ls-remote.html#git_oid_fmt-1"] + } }, - "git_packbuilder_insert": { + "git_oid_nfmt": { "type": "function", - "file": "pack.h", - "line": 91, - "lineto": 91, + "file": "git2/oid.h", + "line": 196, + "lineto": 196, "args": [ { - "name": "pb", - "type": "git_packbuilder *", - "comment": "The packbuilder" + "name": "out", + "type": "char *", + "comment": "output hex string; you say how many bytes to write.\n\t\tIf the number of bytes is > GIT_OID_SHA1_HEXSIZE, extra bytes\n\t\twill be zeroed; if not, a '\n\\\n0' terminator is NOT added." }, { - "name": "id", - "type": "const git_oid *", - "comment": "The oid of the commit" + "name": "n", + "type": "size_t", + "comment": "number of characters to write into out string" }, { - "name": "name", - "type": "const char *", - "comment": "The name; might be NULL" + "name": "id", + "type": "const git_oid *", + "comment": "oid structure to format." } ], - "argline": "git_packbuilder *pb, const git_oid *id, const char *name", - "sig": "git_packbuilder *::const git_oid *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Insert a single object

\n", - "comments": "

For an optimal pack it's mandatory to insert objects in recency order, commits followed by trees and blobs.

\n", - "group": "packbuilder" + "argline": "char *out, size_t n, const git_oid *id", + "sig": "char *::size_t::const git_oid *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Format a git_oid into a partial hex string.

\n", + "comments": "", + "group": "oid" }, - "git_packbuilder_insert_tree": { + "git_oid_pathfmt": { "type": "function", - "file": "pack.h", - "line": 103, - "lineto": 103, + "file": "git2/oid.h", + "line": 213, + "lineto": 213, "args": [ { - "name": "pb", - "type": "git_packbuilder *", - "comment": "The packbuilder" + "name": "out", + "type": "char *", + "comment": "output hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (41 bytes for SHA1,\n\t\t65 bytes for SHA256). Only the oid digits are written;\n\t\ta '\n\\\n0' terminator must be added by the caller if it\n\t\tis required." }, { "name": "id", "type": "const git_oid *", - "comment": "The oid of the root tree" + "comment": "oid structure to format." } ], - "argline": "git_packbuilder *pb, const git_oid *id", - "sig": "git_packbuilder *::const git_oid *", + "argline": "char *out, const git_oid *id", + "sig": "char *::const git_oid *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, non-zero callback return value, or error code" }, - "description": "

Insert a root tree object

\n", - "comments": "

This will add the tree as well as all referenced trees and blobs.

\n", - "group": "packbuilder" + "description": "

Format a git_oid into a loose-object path string.

\n", + "comments": "

The resulting string is "aa/...", where "aa" is the first two hex digits of the oid and "..." is the remaining 38 digits.

\n", + "group": "oid" }, - "git_packbuilder_insert_commit": { + "git_oid_tostr_s": { "type": "function", - "file": "pack.h", - "line": 115, - "lineto": 115, + "file": "git2/oid.h", + "line": 226, + "lineto": 226, "args": [ { - "name": "pb", - "type": "git_packbuilder *", - "comment": "The packbuilder" - }, - { - "name": "id", + "name": "oid", "type": "const git_oid *", - "comment": "The oid of the commit" + "comment": "The oid structure to format" } ], - "argline": "git_packbuilder *pb, const git_oid *id", - "sig": "git_packbuilder *::const git_oid *", + "argline": "const git_oid *oid", + "sig": "const git_oid *", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "char *", + "comment": " the c-string or NULL on failure" }, - "description": "

Insert a commit object

\n", - "comments": "

This will add a commit as well as the completed referenced tree.

\n", - "group": "packbuilder" + "description": "

Format a git_oid into a statically allocated c-string.

\n", + "comments": "

The c-string is owned by the library and should not be freed by the user. If libgit2 is built with thread support, the string will be stored in TLS (i.e. one buffer per thread) to allow for concurrent calls of the function.

\n", + "group": "oid", + "examples": { + "merge.c": [ + "ex/v1.9.1/merge.html#git_oid_tostr_s-19", + "ex/v1.9.1/merge.html#git_oid_tostr_s-20" + ] + } }, - "git_packbuilder_insert_walk": { + "git_oid_tostr": { "type": "function", - "file": "pack.h", - "line": 128, - "lineto": 128, + "file": "git2/oid.h", + "line": 247, + "lineto": 247, "args": [ { - "name": "pb", - "type": "git_packbuilder *", - "comment": "the packbuilder" + "name": "out", + "type": "char *", + "comment": "the buffer into which the oid string is output." }, { - "name": "walk", - "type": "git_revwalk *", - "comment": "the revwalk to use to fill the packbuilder" + "name": "n", + "type": "size_t", + "comment": "the size of the out buffer." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the oid structure to format." } ], - "argline": "git_packbuilder *pb, git_revwalk *walk", - "sig": "git_packbuilder *::git_revwalk *", + "argline": "char *out, size_t n, const git_oid *id", + "sig": "char *::size_t::const git_oid *", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "char *", + "comment": " the out buffer pointer, assuming no input parameter\n\t\t\terrors, otherwise a pointer to an empty string." }, - "description": "

Insert objects as given by the walk

\n", - "comments": "

Those commits and all objects they reference will be inserted into the packbuilder.

\n", - "group": "packbuilder" + "description": "

Format a git_oid into a buffer as a hex format c-string.

\n", + "comments": "

If the buffer is smaller than the size of a hex-formatted oid string plus an additional byte (GIT_OID_SHA_HEXSIZE + 1 for SHA1 or GIT_OID_SHA256_HEXSIZE + 1 for SHA256), then the resulting oid c-string will be truncated to n-1 characters (but will still be NUL-byte terminated).

\n\n

If there are any input parameter errors (out == NULL, n == 0, oid == NULL), then a pointer to an empty string is returned, so that the return value can always be printed.

\n", + "group": "oid", + "examples": { + "blame.c": [ + "ex/v1.9.1/blame.html#git_oid_tostr-15", + "ex/v1.9.1/blame.html#git_oid_tostr-16" + ], + "cat-file.c": [ + "ex/v1.9.1/cat-file.html#git_oid_tostr-24", + "ex/v1.9.1/cat-file.html#git_oid_tostr-25", + "ex/v1.9.1/cat-file.html#git_oid_tostr-26", + "ex/v1.9.1/cat-file.html#git_oid_tostr-27", + "ex/v1.9.1/cat-file.html#git_oid_tostr-28" + ], + "log.c": [ + "ex/v1.9.1/log.html#git_oid_tostr-38", + "ex/v1.9.1/log.html#git_oid_tostr-39" + ], + "rev-parse.c": [ + "ex/v1.9.1/rev-parse.html#git_oid_tostr-10", + "ex/v1.9.1/rev-parse.html#git_oid_tostr-11", + "ex/v1.9.1/rev-parse.html#git_oid_tostr-12", + "ex/v1.9.1/rev-parse.html#git_oid_tostr-13" + ] + } }, - "git_packbuilder_insert_recur": { + "git_oid_cpy": { "type": "function", - "file": "pack.h", - "line": 140, - "lineto": 140, + "file": "git2/oid.h", + "line": 256, + "lineto": 256, "args": [ { - "name": "pb", - "type": "git_packbuilder *", - "comment": "the packbuilder" + "name": "out", + "type": "git_oid *", + "comment": "oid structure the result is written into." }, { - "name": "id", + "name": "src", "type": "const git_oid *", - "comment": "the id of the root object to insert" - }, - { - "name": "name", - "type": "const char *", - "comment": "optional name for the object" + "comment": "oid structure to copy from." } ], - "argline": "git_packbuilder *pb, const git_oid *id, const char *name", - "sig": "git_packbuilder *::const git_oid *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Recursively insert an object and its referenced objects

\n", - "comments": "

Insert the object as well as any object it references.

\n", - "group": "packbuilder" + "argline": "git_oid *out, const git_oid *src", + "sig": "git_oid *::const git_oid *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Copy an oid from one structure to another.

\n", + "comments": "", + "group": "oid", + "examples": { + "blame.c": [ + "ex/v1.9.1/blame.html#git_oid_cpy-17", + "ex/v1.9.1/blame.html#git_oid_cpy-18", + "ex/v1.9.1/blame.html#git_oid_cpy-19" + ] + } }, - "git_packbuilder_write": { + "git_oid_cmp": { "type": "function", - "file": "pack.h", - "line": 164, - "lineto": 169, + "file": "git2/oid.h", + "line": 265, + "lineto": 265, "args": [ { - "name": "pb", - "type": "git_packbuilder *", - "comment": "The packbuilder" - }, - { - "name": "path", - "type": "const char *", - "comment": "to the directory where the packfile and index should be stored" - }, - { - "name": "mode", - "type": "unsigned int", - "comment": "permissions to use creating a packfile or 0 for defaults" - }, - { - "name": "progress_cb", - "type": "git_transfer_progress_cb", - "comment": "function to call with progress information from the indexer (optional)" + "name": "a", + "type": "const git_oid *", + "comment": "first oid structure." }, { - "name": "progress_cb_payload", - "type": "void *", - "comment": "payload for the progress callback (optional)" + "name": "b", + "type": "const git_oid *", + "comment": "second oid structure." } ], - "argline": "git_packbuilder *pb, const char *path, unsigned int mode, git_transfer_progress_cb progress_cb, void *progress_cb_payload", - "sig": "git_packbuilder *::const char *::unsigned int::git_transfer_progress_cb::void *", + "argline": "const git_oid *a, const git_oid *b", + "sig": "const git_oid *::const git_oid *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " \n<\n0, 0, >0 if a \n<\n b, a == b, a > b." }, - "description": "

Write the new pack and corresponding index file to path.

\n", + "description": "

Compare two oid structures.

\n", "comments": "", - "group": "packbuilder" + "group": "oid" }, - "git_packbuilder_hash": { + "git_oid_equal": { "type": "function", - "file": "pack.h", - "line": 179, - "lineto": 179, + "file": "git2/oid.h", + "line": 274, + "lineto": 274, "args": [ { - "name": "pb", - "type": "git_packbuilder *", - "comment": "The packbuilder object" - } - ], - "argline": "git_packbuilder *pb", - "sig": "git_packbuilder *", - "return": { - "type": "const git_oid *", - "comment": null - }, - "description": "

Get the packfile's hash

\n", - "comments": "

A packfile's name is derived from the sorted hashing of all object names. This is only correct after the packfile has been written.

\n", - "group": "packbuilder" - }, - "git_packbuilder_foreach": { - "type": "function", - "file": "pack.h", - "line": 191, - "lineto": 191, - "args": [ - { - "name": "pb", - "type": "git_packbuilder *", - "comment": "the packbuilder" - }, - { - "name": "cb", - "type": "git_packbuilder_foreach_cb", - "comment": "the callback to call with each packed object's buffer" + "name": "a", + "type": "const git_oid *", + "comment": "first oid structure." }, { - "name": "payload", - "type": "void *", - "comment": "the callback's data" + "name": "b", + "type": "const git_oid *", + "comment": "second oid structure." } ], - "argline": "git_packbuilder *pb, git_packbuilder_foreach_cb cb, void *payload", - "sig": "git_packbuilder *::git_packbuilder_foreach_cb::void *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Create the new pack and pass each object to the callback

\n", + "argline": "const git_oid *a, const git_oid *b", + "sig": "const git_oid *::const git_oid *", + "return": { "type": "int", "comment": " true if equal, false otherwise" }, + "description": "

Compare two oid structures for equality

\n", "comments": "", - "group": "packbuilder" + "group": "oid" }, - "git_packbuilder_object_count": { + "git_oid_ncmp": { "type": "function", - "file": "pack.h", - "line": 199, - "lineto": 199, + "file": "git2/oid.h", + "line": 285, + "lineto": 285, "args": [ { - "name": "pb", - "type": "git_packbuilder *", - "comment": "the packbuilder" + "name": "a", + "type": "const git_oid *", + "comment": "first oid structure." + }, + { + "name": "b", + "type": "const git_oid *", + "comment": "second oid structure." + }, + { + "name": "len", + "type": "size_t", + "comment": "the number of hex chars to compare" } ], - "argline": "git_packbuilder *pb", - "sig": "git_packbuilder *", - "return": { - "type": "size_t", - "comment": " the number of objects in the packfile" - }, - "description": "

Get the total number of objects the packbuilder will write out

\n", + "argline": "const git_oid *a, const git_oid *b, size_t len", + "sig": "const git_oid *::const git_oid *::size_t", + "return": { "type": "int", "comment": " 0 in case of a match" }, + "description": "

Compare the first 'len' hexadecimal characters (packets of 4 bits)\n of two oid structures.

\n", "comments": "", - "group": "packbuilder" + "group": "oid" }, - "git_packbuilder_written": { + "git_oid_streq": { "type": "function", - "file": "pack.h", - "line": 207, - "lineto": 207, + "file": "git2/oid.h", + "line": 294, + "lineto": 294, "args": [ { - "name": "pb", - "type": "git_packbuilder *", - "comment": "the packbuilder" + "name": "id", + "type": "const git_oid *", + "comment": "oid structure." + }, + { + "name": "str", + "type": "const char *", + "comment": "input hex string of an object id." } ], - "argline": "git_packbuilder *pb", - "sig": "git_packbuilder *", + "argline": "const git_oid *id, const char *str", + "sig": "const git_oid *::const char *", "return": { - "type": "size_t", - "comment": " the number of objects which have already been written" + "type": "int", + "comment": " 0 in case of a match, -1 otherwise." }, - "description": "

Get the number of objects the packbuilder has already written out

\n", + "description": "

Check if an oid equals an hex formatted object id.

\n", "comments": "", - "group": "packbuilder" + "group": "oid" }, - "git_packbuilder_set_callbacks": { + "git_oid_strcmp": { "type": "function", - "file": "pack.h", - "line": 226, - "lineto": 229, + "file": "git2/oid.h", + "line": 304, + "lineto": 304, "args": [ { - "name": "pb", - "type": "git_packbuilder *", - "comment": "The packbuilder object" - }, - { - "name": "progress_cb", - "type": "git_packbuilder_progress", - "comment": "Function to call with progress information during\n pack building. Be aware that this is called inline with pack building\n operations, so performance may be affected." + "name": "id", + "type": "const git_oid *", + "comment": "oid structure." }, { - "name": "progress_cb_payload", - "type": "void *", - "comment": "Payload for progress callback." + "name": "str", + "type": "const char *", + "comment": "input hex string of an object id." } ], - "argline": "git_packbuilder *pb, git_packbuilder_progress progress_cb, void *progress_cb_payload", - "sig": "git_packbuilder *::git_packbuilder_progress::void *", + "argline": "const git_oid *id, const char *str", + "sig": "const git_oid *::const char *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " -1 if str is not valid, \n<\n0 if id sorts before str,\n 0 if id matches str, >0 if id sorts after str." }, - "description": "

Set the callbacks for a packbuilder

\n", + "description": "

Compare an oid to an hex formatted object id.

\n", "comments": "", - "group": "packbuilder" + "group": "oid" }, - "git_packbuilder_free": { + "git_oid_is_zero": { "type": "function", - "file": "pack.h", - "line": 236, - "lineto": 236, + "file": "git2/oid.h", + "line": 312, + "lineto": 312, "args": [ { - "name": "pb", - "type": "git_packbuilder *", - "comment": "The packbuilder" + "name": "id", + "type": "const git_oid *", + "comment": "the object ID to check" } ], - "argline": "git_packbuilder *pb", - "sig": "git_packbuilder *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Free the packbuilder and all associated data

\n", + "argline": "const git_oid *id", + "sig": "const git_oid *", + "return": { "type": "int", "comment": " 1 if all zeros, 0 otherwise." }, + "description": "

Check is an oid is all zeros.

\n", "comments": "", - "group": "packbuilder" + "group": "oid", + "examples": { + "blame.c": ["ex/v1.9.1/blame.html#git_oid_is_zero-20"], + "fetch.c": ["ex/v1.9.1/fetch.html#git_oid_is_zero-3"] + } }, - "git_patch_from_diff": { + "git_oid_shorten_new": { "type": "function", - "file": "patch.h", - "line": 51, - "lineto": 52, + "file": "git2/oid.h", + "line": 333, + "lineto": 333, "args": [ { - "name": "out", - "type": "git_patch **", - "comment": "Output parameter for the delta patch object" - }, - { - "name": "diff", - "type": "git_diff *", - "comment": "Diff list object" - }, - { - "name": "idx", + "name": "min_length", "type": "size_t", - "comment": "Index into diff list" + "comment": "The minimal length for all identifiers,\n\t\twhich will be used even if shorter OIDs would still\n\t\tbe unique." } ], - "argline": "git_patch **out, git_diff *diff, size_t idx", - "sig": "git_patch **::git_diff *::size_t", + "argline": "size_t min_length", + "sig": "size_t", "return": { - "type": "int", - "comment": " 0 on success, other value \n<\n 0 on error" + "type": "git_oid_shorten *", + "comment": " a `git_oid_shorten` instance, NULL if OOM" }, - "description": "

Return a patch for an entry in the diff list.

\n", - "comments": "

The git_patch is a newly created object contains the text diffs for the delta. You have to call git_patch_free() when you are done with it. You can use the patch object to loop over all the hunks and lines in the diff of the one delta.

\n\n

For an unchanged file or a binary file, no git_patch will be created, the output will be set to NULL, and the binary flag will be set true in the git_diff_delta structure.

\n\n

It is okay to pass NULL for either of the output parameters; if you pass NULL for the git_patch, then the text diff will not be calculated.

\n", - "group": "patch" + "description": "

Create a new OID shortener.

\n", + "comments": "

The OID shortener is used to process a list of OIDs in text form and return the shortest length that would uniquely identify all of them.

\n\n

E.g. look at the result of git log --abbrev.

\n", + "group": "oid" }, - "git_patch_from_blobs": { + "git_oid_shorten_add": { "type": "function", - "file": "patch.h", - "line": 70, - "lineto": 76, + "file": "git2/oid.h", + "line": 359, + "lineto": 359, "args": [ { - "name": "out", - "type": "git_patch **", - "comment": "The generated patch; NULL on error" - }, - { - "name": "old_blob", - "type": "const git_blob *", - "comment": "Blob for old side of diff, or NULL for empty blob" - }, - { - "name": "old_as_path", - "type": "const char *", - "comment": "Treat old blob as if it had this filename; can be NULL" - }, - { - "name": "new_blob", - "type": "const git_blob *", - "comment": "Blob for new side of diff, or NULL for empty blob" + "name": "os", + "type": "git_oid_shorten *", + "comment": "a `git_oid_shorten` instance" }, { - "name": "new_as_path", + "name": "text_id", "type": "const char *", - "comment": "Treat new blob as if it had this filename; can be NULL" - }, - { - "name": "opts", - "type": "const git_diff_options *", - "comment": "Options for diff, or NULL for default options" + "comment": "an OID in text form" } ], - "argline": "git_patch **out, const git_blob *old_blob, const char *old_as_path, const git_blob *new_blob, const char *new_as_path, const git_diff_options *opts", - "sig": "git_patch **::const git_blob *::const char *::const git_blob *::const char *::const git_diff_options *", + "argline": "git_oid_shorten *os, const char *text_id", + "sig": "git_oid_shorten *::const char *", "return": { "type": "int", - "comment": " 0 on success or error code \n<\n 0" + "comment": " the minimal length to uniquely identify all OIDs\n\t\tadded so far to the set; or an error code (\n<\n0) if an\n\t\terror occurs." }, - "description": "

Directly generate a patch from the difference between two blobs.

\n", - "comments": "

This is just like git_diff_blobs() except it generates a patch object for the difference instead of directly making callbacks. You can use the standard git_patch accessor functions to read the patch data, and you must call git_patch_free() on the patch when done.

\n", - "group": "patch" + "description": "

Add a new OID to set of shortened OIDs and calculate\n the minimal length to uniquely identify all the OIDs in\n the set.

\n", + "comments": "

The OID is expected to be a 40-char hexadecimal string. The OID is owned by the user and will not be modified or freed.

\n\n

For performance reasons, there is a hard-limit of how many OIDs can be added to a single set (around ~32000, assuming a mostly randomized distribution), which should be enough for any kind of program, and keeps the algorithm fast and memory-efficient.

\n\n

Attempting to add more than those OIDs will result in a GIT_ERROR_INVALID error

\n", + "group": "oid" }, - "git_patch_from_blob_and_buffer": { + "git_oid_shorten_free": { "type": "function", - "file": "patch.h", - "line": 95, - "lineto": 102, + "file": "git2/oid.h", + "line": 366, + "lineto": 366, "args": [ { - "name": "out", - "type": "git_patch **", - "comment": "The generated patch; NULL on error" - }, - { - "name": "old_blob", - "type": "const git_blob *", - "comment": "Blob for old side of diff, or NULL for empty blob" - }, + "name": "os", + "type": "git_oid_shorten *", + "comment": "a `git_oid_shorten` instance" + } + ], + "argline": "git_oid_shorten *os", + "sig": "git_oid_shorten *", + "return": { "type": "void", "comment": null }, + "description": "

Free an OID shortener instance

\n", + "comments": "", + "group": "oid" + }, + "git_oidarray_dispose": { + "type": "function", + "file": "git2/oidarray.h", + "line": 38, + "lineto": 38, + "args": [ { - "name": "old_as_path", - "type": "const char *", - "comment": "Treat old blob as if it had this filename; can be NULL" - }, + "name": "array", + "type": "git_oidarray *", + "comment": "git_oidarray from which to free oid data" + } + ], + "argline": "git_oidarray *array", + "sig": "git_oidarray *", + "return": { "type": "void", "comment": null }, + "description": "

Free the object IDs contained in an oid_array. This method should\n be called on git_oidarray objects that were provided by the\n library. Not doing so will result in a memory leak.

\n", + "comments": "

This does not free the git_oidarray itself, since the library will never allocate that object directly itself.

\n", + "group": "oidarray" + }, + "git_packbuilder_new": { + "type": "function", + "file": "git2/pack.h", + "line": 65, + "lineto": 65, + "args": [ { - "name": "buffer", - "type": "const char *", - "comment": "Raw data for new side of diff, or NULL for empty" + "name": "out", + "type": "git_packbuilder **", + "comment": "The new packbuilder object" }, { - "name": "buffer_len", - "type": "size_t", - "comment": "Length of raw data for new side of diff" - }, + "name": "repo", + "type": "git_repository *", + "comment": "The repository" + } + ], + "argline": "git_packbuilder **out, git_repository *repo", + "sig": "git_packbuilder **::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Initialize a new packbuilder

\n", + "comments": "", + "group": "packbuilder" + }, + "git_packbuilder_set_threads": { + "type": "function", + "file": "git2/pack.h", + "line": 78, + "lineto": 78, + "args": [ { - "name": "buffer_as_path", - "type": "const char *", - "comment": "Treat buffer as if it had this filename; can be NULL" + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" }, { - "name": "opts", - "type": "const git_diff_options *", - "comment": "Options for diff, or NULL for default options" + "name": "n", + "type": "unsigned int", + "comment": "Number of threads to spawn" } ], - "argline": "git_patch **out, const git_blob *old_blob, const char *old_as_path, const char *buffer, size_t buffer_len, const char *buffer_as_path, const git_diff_options *opts", - "sig": "git_patch **::const git_blob *::const char *::const char *::size_t::const char *::const git_diff_options *", + "argline": "git_packbuilder *pb, unsigned int n", + "sig": "git_packbuilder *::unsigned int", "return": { - "type": "int", - "comment": " 0 on success or error code \n<\n 0" + "type": "unsigned int", + "comment": " number of actual threads to be used" }, - "description": "

Directly generate a patch from the difference between a blob and a buffer.

\n", - "comments": "

This is just like git_diff_blob_to_buffer() except it generates a patch object for the difference instead of directly making callbacks. You can use the standard git_patch accessor functions to read the patch data, and you must call git_patch_free() on the patch when done.

\n", - "group": "patch" + "description": "

Set number of threads to spawn

\n", + "comments": "

By default, libgit2 won't spawn any threads at all; when set to 0, libgit2 will autodetect the number of CPUs.

\n", + "group": "packbuilder" }, - "git_patch_from_buffers": { + "git_packbuilder_insert": { "type": "function", - "file": "patch.h", - "line": 122, - "lineto": 130, + "file": "git2/pack.h", + "line": 92, + "lineto": 92, "args": [ { - "name": "out", - "type": "git_patch **", - "comment": "The generated patch; NULL on error" - }, - { - "name": "old_buffer", - "type": "const void *", - "comment": "Raw data for old side of diff, or NULL for empty" + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" }, { - "name": "old_len", - "type": "size_t", - "comment": "Length of the raw data for old side of the diff" + "name": "id", + "type": "const git_oid *", + "comment": "The oid of the commit" }, { - "name": "old_as_path", + "name": "name", "type": "const char *", - "comment": "Treat old buffer as if it had this filename; can be NULL" - }, + "comment": "The name; might be NULL" + } + ], + "argline": "git_packbuilder *pb, const git_oid *id, const char *name", + "sig": "git_packbuilder *::const git_oid *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Insert a single object

\n", + "comments": "

For an optimal pack it's mandatory to insert objects in recency order, commits followed by trees and blobs.

\n", + "group": "packbuilder" + }, + "git_packbuilder_insert_tree": { + "type": "function", + "file": "git2/pack.h", + "line": 104, + "lineto": 104, + "args": [ { - "name": "new_buffer", - "type": "const char *", - "comment": "Raw data for new side of diff, or NULL for empty" + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" }, { - "name": "new_len", - "type": "size_t", - "comment": "Length of raw data for new side of diff" - }, + "name": "id", + "type": "const git_oid *", + "comment": "The oid of the root tree" + } + ], + "argline": "git_packbuilder *pb, const git_oid *id", + "sig": "git_packbuilder *::const git_oid *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Insert a root tree object

\n", + "comments": "

This will add the tree as well as all referenced trees and blobs.

\n", + "group": "packbuilder" + }, + "git_packbuilder_insert_commit": { + "type": "function", + "file": "git2/pack.h", + "line": 116, + "lineto": 116, + "args": [ { - "name": "new_as_path", - "type": "const char *", - "comment": "Treat buffer as if it had this filename; can be NULL" + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" }, { - "name": "opts", - "type": "const git_diff_options *", - "comment": "Options for diff, or NULL for default options" + "name": "id", + "type": "const git_oid *", + "comment": "The oid of the commit" } ], - "argline": "git_patch **out, const void *old_buffer, size_t old_len, const char *old_as_path, const char *new_buffer, size_t new_len, const char *new_as_path, const git_diff_options *opts", - "sig": "git_patch **::const void *::size_t::const char *::const char *::size_t::const char *::const git_diff_options *", - "return": { - "type": "int", - "comment": " 0 on success or error code \n<\n 0" - }, - "description": "

Directly generate a patch from the difference between two buffers.

\n", - "comments": "

This is just like git_diff_buffers() except it generates a patch object for the difference instead of directly making callbacks. You can use the standard git_patch accessor functions to read the patch data, and you must call git_patch_free() on the patch when done.

\n", - "group": "patch" + "argline": "git_packbuilder *pb, const git_oid *id", + "sig": "git_packbuilder *::const git_oid *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Insert a commit object

\n", + "comments": "

This will add a commit as well as the completed referenced tree.

\n", + "group": "packbuilder" }, - "git_patch_free": { + "git_packbuilder_insert_walk": { "type": "function", - "file": "patch.h", - "line": 135, - "lineto": 135, + "file": "git2/pack.h", + "line": 129, + "lineto": 129, "args": [ { - "name": "patch", - "type": "git_patch *", - "comment": null + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder" + }, + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the revwalk to use to fill the packbuilder" } ], - "argline": "git_patch *patch", - "sig": "git_patch *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Free a git_patch object.

\n", - "comments": "", - "group": "patch" + "argline": "git_packbuilder *pb, git_revwalk *walk", + "sig": "git_packbuilder *::git_revwalk *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Insert objects as given by the walk

\n", + "comments": "

Those commits and all objects they reference will be inserted into the packbuilder.

\n", + "group": "packbuilder" }, - "git_patch_get_delta": { + "git_packbuilder_insert_recur": { "type": "function", - "file": "patch.h", + "file": "git2/pack.h", "line": 141, "lineto": 141, "args": [ { - "name": "patch", - "type": "const git_patch *", - "comment": null + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the id of the root object to insert" + }, + { + "name": "name", + "type": "const char *", + "comment": "optional name for the object" } ], - "argline": "const git_patch *patch", - "sig": "const git_patch *", - "return": { - "type": "const git_diff_delta *", - "comment": null - }, - "description": "

Get the delta associated with a patch. This delta points to internal\n data and you do not have to release it when you are done with it.

\n", - "comments": "", - "group": "patch" + "argline": "git_packbuilder *pb, const git_oid *id, const char *name", + "sig": "git_packbuilder *::const git_oid *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Recursively insert an object and its referenced objects

\n", + "comments": "

Insert the object as well as any object it references.

\n", + "group": "packbuilder" }, - "git_patch_num_hunks": { + "git_packbuilder_write_buf": { "type": "function", - "file": "patch.h", - "line": 146, - "lineto": 146, + "file": "git2/pack.h", + "line": 153, + "lineto": 153, "args": [ { - "name": "patch", - "type": "const git_patch *", - "comment": null + "name": "buf", + "type": "git_buf *", + "comment": "Buffer where to write the packfile" + }, + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" } ], - "argline": "const git_patch *patch", - "sig": "const git_patch *", - "return": { - "type": "size_t", - "comment": null - }, - "description": "

Get the number of hunks in a patch

\n", - "comments": "", - "group": "patch" + "argline": "git_buf *buf, git_packbuilder *pb", + "sig": "git_buf *::git_packbuilder *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Write the contents of the packfile to an in-memory buffer

\n", + "comments": "

The contents of the buffer will become a valid packfile, even though there will be no attached index

\n", + "group": "packbuilder" }, - "git_patch_line_stats": { + "git_packbuilder_write": { "type": "function", - "file": "patch.h", - "line": 164, - "lineto": 168, + "file": "git2/pack.h", + "line": 166, + "lineto": 171, "args": [ { - "name": "total_context", - "type": "size_t *", - "comment": "Count of context lines in output, can be NULL." + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" }, { - "name": "total_additions", - "type": "size_t *", - "comment": "Count of addition lines in output, can be NULL." + "name": "path", + "type": "const char *", + "comment": "Path to the directory where the packfile and index should be stored, or NULL for default location" }, { - "name": "total_deletions", - "type": "size_t *", - "comment": "Count of deletion lines in output, can be NULL." + "name": "mode", + "type": "unsigned int", + "comment": "permissions to use creating a packfile or 0 for defaults" }, { - "name": "patch", - "type": "const git_patch *", - "comment": "The git_patch object" + "name": "progress_cb", + "type": "git_indexer_progress_cb", + "comment": "function to call with progress information from the indexer (optional)" + }, + { + "name": "progress_cb_payload", + "type": "void *", + "comment": "payload for the progress callback (optional)" } ], - "argline": "size_t *total_context, size_t *total_additions, size_t *total_deletions, const git_patch *patch", - "sig": "size_t *::size_t *::size_t *::const git_patch *", - "return": { - "type": "int", - "comment": " 0 on success, \n<\n0 on error" - }, - "description": "

Get line counts of each type in a patch.

\n", - "comments": "

This helps imitate a diff --numstat type of output. For that purpose, you only need the total_additions and total_deletions values, but we include the total_context line count in case you want the total number of lines of diff output that will be generated.

\n\n

All outputs are optional. Pass NULL if you don't need a particular count.

\n", - "group": "patch" + "argline": "git_packbuilder *pb, const char *path, unsigned int mode, git_indexer_progress_cb progress_cb, void *progress_cb_payload", + "sig": "git_packbuilder *::const char *::unsigned int::git_indexer_progress_cb::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Write the new pack and corresponding index file to path.

\n", + "comments": "", + "group": "packbuilder" }, - "git_patch_get_hunk": { + "git_packbuilder_hash": { "type": "function", - "file": "patch.h", - "line": 183, - "lineto": 187, + "file": "git2/pack.h", + "line": 184, + "lineto": 184, "args": [ { - "name": "out", - "type": "const git_diff_hunk **", - "comment": "Output pointer to git_diff_hunk of hunk" - }, - { - "name": "lines_in_hunk", - "type": "size_t *", - "comment": "Output count of total lines in this hunk" - }, - { - "name": "patch", - "type": "git_patch *", - "comment": "Input pointer to patch object" - }, - { - "name": "hunk_idx", - "type": "size_t", - "comment": "Input index of hunk to get information about" + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder object" } ], - "argline": "const git_diff_hunk **out, size_t *lines_in_hunk, git_patch *patch, size_t hunk_idx", - "sig": "const git_diff_hunk **::size_t *::git_patch *::size_t", - "return": { - "type": "int", - "comment": " 0 on success, GIT_ENOTFOUND if hunk_idx out of range, \n<\n0 on error" - }, - "description": "

Get the information about a hunk in a patch

\n", - "comments": "

Given a patch and a hunk index into the patch, this returns detailed information about that hunk. Any of the output pointers can be passed as NULL if you don't care about that particular piece of information.

\n", - "group": "patch" + "argline": "git_packbuilder *pb", + "sig": "git_packbuilder *", + "return": { "type": "const git_oid *", "comment": " 0 or an error code" }, + "description": "

Get the packfile's hash

\n", + "comments": "

A packfile's name is derived from the sorted hashing of all object names. This is only correct after the packfile has been written.

\n", + "group": "packbuilder" }, - "git_patch_num_lines_in_hunk": { + "git_packbuilder_name": { "type": "function", - "file": "patch.h", + "file": "git2/pack.h", "line": 196, - "lineto": 198, + "lineto": 196, "args": [ { - "name": "patch", - "type": "const git_patch *", - "comment": "The git_patch object" - }, - { - "name": "hunk_idx", - "type": "size_t", - "comment": "Index of the hunk" + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder instance" } ], - "argline": "const git_patch *patch, size_t hunk_idx", - "sig": "const git_patch *::size_t", + "argline": "git_packbuilder *pb", + "sig": "git_packbuilder *", "return": { - "type": "int", - "comment": " Number of lines in hunk or GIT_ENOTFOUND if invalid hunk index" + "type": "const char *", + "comment": " a NUL terminated string for the packfile name" }, - "description": "

Get the number of lines in a hunk.

\n", - "comments": "", - "group": "patch" + "description": "

Get the unique name for the resulting packfile.

\n", + "comments": "

The packfile's name is derived from the packfile's content. This is only correct after the packfile has been written.

\n", + "group": "packbuilder" }, - "git_patch_get_line_in_hunk": { + "git_packbuilder_foreach": { "type": "function", - "file": "patch.h", - "line": 214, + "file": "git2/pack.h", + "line": 218, "lineto": 218, "args": [ { - "name": "out", - "type": "const git_diff_line **", - "comment": "The git_diff_line data for this line" + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder" }, { - "name": "patch", - "type": "git_patch *", - "comment": "The patch to look in" + "name": "cb", + "type": "git_packbuilder_foreach_cb", + "comment": "the callback to call with each packed object's buffer" }, { - "name": "hunk_idx", - "type": "size_t", - "comment": "The index of the hunk" - }, + "name": "payload", + "type": "void *", + "comment": "the callback's data" + } + ], + "argline": "git_packbuilder *pb, git_packbuilder_foreach_cb cb, void *payload", + "sig": "git_packbuilder *::git_packbuilder_foreach_cb::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create the new pack and pass each object to the callback

\n", + "comments": "", + "group": "packbuilder" + }, + "git_packbuilder_object_count": { + "type": "function", + "file": "git2/pack.h", + "line": 226, + "lineto": 226, + "args": [ { - "name": "line_of_hunk", - "type": "size_t", - "comment": "The index of the line in the hunk" + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder" } ], - "argline": "const git_diff_line **out, git_patch *patch, size_t hunk_idx, size_t line_of_hunk", - "sig": "const git_diff_line **::git_patch *::size_t::size_t", + "argline": "git_packbuilder *pb", + "sig": "git_packbuilder *", "return": { - "type": "int", - "comment": " 0 on success, \n<\n0 on failure" + "type": "size_t", + "comment": " the number of objects in the packfile" }, - "description": "

Get data about a line in a hunk of a patch.

\n", - "comments": "

Given a patch, a hunk index, and a line index in the hunk, this will return a lot of details about that line. If you pass a hunk index larger than the number of hunks or a line index larger than the number of lines in the hunk, this will return -1.

\n", - "group": "patch" + "description": "

Get the total number of objects the packbuilder will write out

\n", + "comments": "", + "group": "packbuilder" }, - "git_patch_size": { + "git_packbuilder_written": { "type": "function", - "file": "patch.h", - "line": 236, - "lineto": 240, + "file": "git2/pack.h", + "line": 234, + "lineto": 234, "args": [ { - "name": "patch", - "type": "git_patch *", - "comment": "A git_patch representing changes to one file" - }, - { - "name": "include_context", - "type": "int", - "comment": "Include context lines in size if non-zero" - }, - { - "name": "include_hunk_headers", - "type": "int", - "comment": "Include hunk header lines if non-zero" - }, - { - "name": "include_file_headers", - "type": "int", - "comment": "Include file header lines if non-zero" + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder" } ], - "argline": "git_patch *patch, int include_context, int include_hunk_headers, int include_file_headers", - "sig": "git_patch *::int::int::int", + "argline": "git_packbuilder *pb", + "sig": "git_packbuilder *", "return": { "type": "size_t", - "comment": " The number of bytes of data" + "comment": " the number of objects which have already been written" }, - "description": "

Look up size of patch diff data in bytes

\n", - "comments": "

This returns the raw size of the patch data. This only includes the actual data from the lines of the diff, not the file or hunk headers.

\n\n

If you pass include_context as true (non-zero), this will be the size of all of the diff output; if you pass it as false (zero), this will only include the actual changed lines (as if context_lines was 0).

\n", - "group": "patch" + "description": "

Get the number of objects the packbuilder has already written out

\n", + "comments": "", + "group": "packbuilder" }, - "git_patch_print": { + "git_packbuilder_set_callbacks": { "type": "function", - "file": "patch.h", - "line": 254, - "lineto": 257, + "file": "git2/pack.h", + "line": 264, + "lineto": 267, "args": [ { - "name": "patch", - "type": "git_patch *", - "comment": "A git_patch representing changes to one file" + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder object" }, { - "name": "print_cb", - "type": "git_diff_line_cb", - "comment": "Callback function to output lines of the patch. Will be\n called for file headers, hunk headers, and diff lines." + "name": "progress_cb", + "type": "git_packbuilder_progress", + "comment": "Function to call with progress information during\n pack building. Be aware that this is called inline with pack building\n operations, so performance may be affected.\n When progress_cb returns an error, the pack building process will be\n aborted and the error will be returned from the invoked function.\n `pb` must then be freed." }, { - "name": "payload", + "name": "progress_cb_payload", "type": "void *", - "comment": "Reference pointer that will be passed to your callbacks." + "comment": "Payload for progress callback." } ], - "argline": "git_patch *patch, git_diff_line_cb print_cb, void *payload", - "sig": "git_patch *::git_diff_line_cb::void *", - "return": { - "type": "int", - "comment": " 0 on success, non-zero callback return value, or error code" - }, - "description": "

Serialize the patch to text via callback.

\n", - "comments": "

Returning a non-zero value from the callback will terminate the iteration and return that value to the caller.

\n", - "group": "patch" + "argline": "git_packbuilder *pb, git_packbuilder_progress progress_cb, void *progress_cb_payload", + "sig": "git_packbuilder *::git_packbuilder_progress::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Set the callbacks for a packbuilder

\n", + "comments": "", + "group": "packbuilder" }, - "git_patch_to_buf": { + "git_packbuilder_free": { "type": "function", - "file": "patch.h", - "line": 266, - "lineto": 268, + "file": "git2/pack.h", + "line": 274, + "lineto": 274, "args": [ { - "name": "out", - "type": "git_buf *", - "comment": "The git_buf to be filled in" - }, - { - "name": "patch", - "type": "git_patch *", - "comment": "A git_patch representing changes to one file" + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" } ], - "argline": "git_buf *out, git_patch *patch", - "sig": "git_buf *::git_patch *", + "argline": "git_packbuilder *pb", + "sig": "git_packbuilder *", + "return": { "type": "void", "comment": null }, + "description": "

Free the packbuilder and all associated data

\n", + "comments": "", + "group": "packbuilder" + }, + "git_patch_owner": { + "type": "function", + "file": "git2/patch.h", + "line": 37, + "lineto": 37, + "args": [ + { "name": "patch", "type": "const git_patch *", "comment": "the patch" } + ], + "argline": "const git_patch *patch", + "sig": "const git_patch *", "return": { - "type": "int", - "comment": " 0 on success, \n<\n0 on failure." + "type": "git_repository *", + "comment": " a pointer to the repository" }, - "description": "

Get the content of a patch as a single diff text.

\n", + "description": "

Get the repository associated with this patch. May be NULL.

\n", "comments": "", "group": "patch" }, - "git_pathspec_new": { + "git_patch_from_diff": { "type": "function", - "file": "pathspec.h", - "line": 65, - "lineto": 66, + "file": "git2/patch.h", + "line": 59, + "lineto": 60, "args": [ { "name": "out", - "type": "git_pathspec **", - "comment": "Output of the compiled pathspec" + "type": "git_patch **", + "comment": "Output parameter for the delta patch object" }, - { - "name": "pathspec", - "type": "const git_strarray *", - "comment": "A git_strarray of the paths to match" - } + { "name": "diff", "type": "git_diff *", "comment": "Diff list object" }, + { "name": "idx", "type": "size_t", "comment": "Index into diff list" } ], - "argline": "git_pathspec **out, const git_strarray *pathspec", - "sig": "git_pathspec **::const git_strarray *", + "argline": "git_patch **out, git_diff *diff, size_t idx", + "sig": "git_patch **::git_diff *::size_t", "return": { "type": "int", - "comment": " 0 on success, \n<\n0 on failure" + "comment": " 0 on success, other value \n<\n 0 on error" }, - "description": "

Compile a pathspec

\n", - "comments": "", - "group": "pathspec", - "examples": { - "log.c": [ - "ex/HEAD/log.html#git_pathspec_new-41" - ] - } + "description": "

Return a patch for an entry in the diff list.

\n", + "comments": "

The git_patch is a newly created object contains the text diffs for the delta. You have to call git_patch_free() when you are done with it. You can use the patch object to loop over all the hunks and lines in the diff of the one delta.

\n\n

For an unchanged file or a binary file, no git_patch will be created, the output will be set to NULL, and the binary flag will be set true in the git_diff_delta structure.

\n\n

It is okay to pass NULL for either of the output parameters; if you pass NULL for the git_patch, then the text diff will not be calculated.

\n", + "group": "patch" }, - "git_pathspec_free": { + "git_patch_from_blobs": { "type": "function", - "file": "pathspec.h", - "line": 73, - "lineto": 73, + "file": "git2/patch.h", + "line": 78, + "lineto": 84, "args": [ { - "name": "ps", - "type": "git_pathspec *", - "comment": "The compiled pathspec" - } - ], - "argline": "git_pathspec *ps", - "sig": "git_pathspec *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Free a pathspec

\n", - "comments": "", - "group": "pathspec", - "examples": { - "log.c": [ - "ex/HEAD/log.html#git_pathspec_free-42" - ] - } - }, - "git_pathspec_matches_path": { - "type": "function", - "file": "pathspec.h", - "line": 88, - "lineto": 89, - "args": [ + "name": "out", + "type": "git_patch **", + "comment": "The generated patch; NULL on error" + }, { - "name": "ps", - "type": "const git_pathspec *", - "comment": "The compiled pathspec" + "name": "old_blob", + "type": "const git_blob *", + "comment": "Blob for old side of diff, or NULL for empty blob" }, { - "name": "flags", - "type": "uint32_t", - "comment": "Combination of git_pathspec_flag_t options to control match" + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old blob as if it had this filename; can be NULL" }, { - "name": "path", + "name": "new_blob", + "type": "const git_blob *", + "comment": "Blob for new side of diff, or NULL for empty blob" + }, + { + "name": "new_as_path", "type": "const char *", - "comment": "The pathname to attempt to match" + "comment": "Treat new blob as if it had this filename; can be NULL" + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" } ], - "argline": "const git_pathspec *ps, uint32_t flags, const char *path", - "sig": "const git_pathspec *::uint32_t::const char *", + "argline": "git_patch **out, const git_blob *old_blob, const char *old_as_path, const git_blob *new_blob, const char *new_as_path, const git_diff_options *opts", + "sig": "git_patch **::const git_blob *::const char *::const git_blob *::const char *::const git_diff_options *", "return": { "type": "int", - "comment": " 1 is path matches spec, 0 if it does not" + "comment": " 0 on success or error code \n<\n 0" }, - "description": "

Try to match a path against a pathspec

\n", - "comments": "

Unlike most of the other pathspec matching functions, this will not fall back on the native case-sensitivity for your platform. You must explicitly pass flags to control case sensitivity or else this will fall back on being case sensitive.

\n", - "group": "pathspec" + "description": "

Directly generate a patch from the difference between two blobs.

\n", + "comments": "

This is just like git_diff_blobs() except it generates a patch object for the difference instead of directly making callbacks. You can use the standard git_patch accessor functions to read the patch data, and you must call git_patch_free() on the patch when done.

\n", + "group": "patch" }, - "git_pathspec_match_workdir": { + "git_patch_from_blob_and_buffer": { "type": "function", - "file": "pathspec.h", - "line": 113, - "lineto": 117, + "file": "git2/patch.h", + "line": 103, + "lineto": 110, "args": [ { "name": "out", - "type": "git_pathspec_match_list **", - "comment": "Output list of matches; pass NULL to just get return value" + "type": "git_patch **", + "comment": "The generated patch; NULL on error" }, { - "name": "repo", - "type": "git_repository *", - "comment": "The repository in which to match; bare repo is an error" + "name": "old_blob", + "type": "const git_blob *", + "comment": "Blob for old side of diff, or NULL for empty blob" }, { - "name": "flags", - "type": "uint32_t", - "comment": "Combination of git_pathspec_flag_t options to control match" + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old blob as if it had this filename; can be NULL" }, { - "name": "ps", - "type": "git_pathspec *", - "comment": "Pathspec to be matched" + "name": "buffer", + "type": "const void *", + "comment": "Raw data for new side of diff, or NULL for empty" + }, + { + "name": "buffer_len", + "type": "size_t", + "comment": "Length of raw data for new side of diff" + }, + { + "name": "buffer_as_path", + "type": "const char *", + "comment": "Treat buffer as if it had this filename; can be NULL" + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" } ], - "argline": "git_pathspec_match_list **out, git_repository *repo, uint32_t flags, git_pathspec *ps", - "sig": "git_pathspec_match_list **::git_repository *::uint32_t::git_pathspec *", + "argline": "git_patch **out, const git_blob *old_blob, const char *old_as_path, const void *buffer, size_t buffer_len, const char *buffer_as_path, const git_diff_options *opts", + "sig": "git_patch **::const git_blob *::const char *::const void *::size_t::const char *::const git_diff_options *", "return": { "type": "int", - "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag was given" + "comment": " 0 on success or error code \n<\n 0" }, - "description": "

Match a pathspec against the working directory of a repository.

\n", - "comments": "

This matches the pathspec against the current files in the working directory of the repository. It is an error to invoke this on a bare repo. This handles git ignores (i.e. ignored files will not be considered to match the pathspec unless the file is tracked in the index).

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", - "group": "pathspec" + "description": "

Directly generate a patch from the difference between a blob and a buffer.

\n", + "comments": "

This is just like git_diff_blob_to_buffer() except it generates a patch object for the difference instead of directly making callbacks. You can use the standard git_patch accessor functions to read the patch data, and you must call git_patch_free() on the patch when done.

\n", + "group": "patch" }, - "git_pathspec_match_index": { + "git_patch_from_buffers": { "type": "function", - "file": "pathspec.h", - "line": 142, - "lineto": 146, + "file": "git2/patch.h", + "line": 130, + "lineto": 138, "args": [ { "name": "out", - "type": "git_pathspec_match_list **", - "comment": "Output list of matches; pass NULL to just get return value" + "type": "git_patch **", + "comment": "The generated patch; NULL on error" }, { - "name": "index", - "type": "git_index *", - "comment": "The index to match against" + "name": "old_buffer", + "type": "const void *", + "comment": "Raw data for old side of diff, or NULL for empty" }, { - "name": "flags", - "type": "uint32_t", - "comment": "Combination of git_pathspec_flag_t options to control match" + "name": "old_len", + "type": "size_t", + "comment": "Length of the raw data for old side of the diff" }, { - "name": "ps", - "type": "git_pathspec *", - "comment": "Pathspec to be matched" - } - ], - "argline": "git_pathspec_match_list **out, git_index *index, uint32_t flags, git_pathspec *ps", - "sig": "git_pathspec_match_list **::git_index *::uint32_t::git_pathspec *", - "return": { - "type": "int", - "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used" - }, - "description": "

Match a pathspec against entries in an index.

\n", - "comments": "

This matches the pathspec against the files in the repository index.

\n\n

NOTE: At the moment, the case sensitivity of this match is controlled by the current case-sensitivity of the index object itself and the USE_CASE and IGNORE_CASE flags will have no effect. This behavior will be corrected in a future release.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", - "group": "pathspec" - }, - "git_pathspec_match_tree": { - "type": "function", - "file": "pathspec.h", - "line": 166, - "lineto": 170, - "args": [ + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old buffer as if it had this filename; can be NULL" + }, { - "name": "out", - "type": "git_pathspec_match_list **", - "comment": "Output list of matches; pass NULL to just get return value" + "name": "new_buffer", + "type": "const void *", + "comment": "Raw data for new side of diff, or NULL for empty" }, { - "name": "tree", - "type": "git_tree *", - "comment": "The root-level tree to match against" + "name": "new_len", + "type": "size_t", + "comment": "Length of raw data for new side of diff" }, { - "name": "flags", - "type": "uint32_t", - "comment": "Combination of git_pathspec_flag_t options to control match" + "name": "new_as_path", + "type": "const char *", + "comment": "Treat buffer as if it had this filename; can be NULL" }, { - "name": "ps", - "type": "git_pathspec *", - "comment": "Pathspec to be matched" + "name": "opts", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" } ], - "argline": "git_pathspec_match_list **out, git_tree *tree, uint32_t flags, git_pathspec *ps", - "sig": "git_pathspec_match_list **::git_tree *::uint32_t::git_pathspec *", + "argline": "git_patch **out, const void *old_buffer, size_t old_len, const char *old_as_path, const void *new_buffer, size_t new_len, const char *new_as_path, const git_diff_options *opts", + "sig": "git_patch **::const void *::size_t::const char *::const void *::size_t::const char *::const git_diff_options *", "return": { "type": "int", - "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used" + "comment": " 0 on success or error code \n<\n 0" }, - "description": "

Match a pathspec against files in a tree.

\n", - "comments": "

This matches the pathspec against the files in the given tree.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", - "group": "pathspec", + "description": "

Directly generate a patch from the difference between two buffers.

\n", + "comments": "

This is just like git_diff_buffers() except it generates a patch object for the difference instead of directly making callbacks. You can use the standard git_patch accessor functions to read the patch data, and you must call git_patch_free() on the patch when done.

\n", + "group": "patch", "examples": { - "log.c": [ - "ex/HEAD/log.html#git_pathspec_match_tree-43" - ] + "diff.c": ["ex/v1.9.1/diff.html#git_patch_from_buffers-16"] } }, - "git_pathspec_match_diff": { + "git_patch_free": { "type": "function", - "file": "pathspec.h", - "line": 190, - "lineto": 194, + "file": "git2/patch.h", + "line": 145, + "lineto": 145, "args": [ { - "name": "out", - "type": "git_pathspec_match_list **", - "comment": "Output list of matches; pass NULL to just get return value" - }, + "name": "patch", + "type": "git_patch *", + "comment": "The patch to free." + } + ], + "argline": "git_patch *patch", + "sig": "git_patch *", + "return": { "type": "void", "comment": null }, + "description": "

Free a git_patch object.

\n", + "comments": "", + "group": "patch", + "examples": { "diff.c": ["ex/v1.9.1/diff.html#git_patch_free-17"] } + }, + "git_patch_get_delta": { + "type": "function", + "file": "git2/patch.h", + "line": 154, + "lineto": 154, + "args": [ { - "name": "diff", - "type": "git_diff *", - "comment": "A generated diff list" - }, - { - "name": "flags", - "type": "uint32_t", - "comment": "Combination of git_pathspec_flag_t options to control match" - }, - { - "name": "ps", - "type": "git_pathspec *", - "comment": "Pathspec to be matched" - } - ], - "argline": "git_pathspec_match_list **out, git_diff *diff, uint32_t flags, git_pathspec *ps", - "sig": "git_pathspec_match_list **::git_diff *::uint32_t::git_pathspec *", - "return": { - "type": "int", - "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used" - }, - "description": "

Match a pathspec against files in a diff list.

\n", - "comments": "

This matches the pathspec against the files in the given diff list.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", - "group": "pathspec" - }, - "git_pathspec_match_list_free": { - "type": "function", - "file": "pathspec.h", - "line": 201, - "lineto": 201, - "args": [ - { - "name": "m", - "type": "git_pathspec_match_list *", - "comment": "The git_pathspec_match_list to be freed" + "name": "patch", + "type": "const git_patch *", + "comment": "The patch in which to get the delta." } ], - "argline": "git_pathspec_match_list *m", - "sig": "git_pathspec_match_list *", + "argline": "const git_patch *patch", + "sig": "const git_patch *", "return": { - "type": "void", - "comment": null + "type": "const git_diff_delta *", + "comment": " The delta associated with the patch." }, - "description": "

Free memory associates with a git_pathspec_match_list

\n", + "description": "

Get the delta associated with a patch. This delta points to internal\n data and you do not have to release it when you are done with it.

\n", "comments": "", - "group": "pathspec" + "group": "patch" }, - "git_pathspec_match_list_entrycount": { + "git_patch_num_hunks": { "type": "function", - "file": "pathspec.h", - "line": 209, - "lineto": 210, + "file": "git2/patch.h", + "line": 162, + "lineto": 162, "args": [ { - "name": "m", - "type": "const git_pathspec_match_list *", - "comment": "The git_pathspec_match_list object" + "name": "patch", + "type": "const git_patch *", + "comment": "The patch in which to get the number of hunks." } ], - "argline": "const git_pathspec_match_list *m", - "sig": "const git_pathspec_match_list *", + "argline": "const git_patch *patch", + "sig": "const git_patch *", "return": { "type": "size_t", - "comment": " Number of items in match list" + "comment": " The number of hunks of the patch." }, - "description": "

Get the number of items in a match list.

\n", + "description": "

Get the number of hunks in a patch

\n", "comments": "", - "group": "pathspec" + "group": "patch" }, - "git_pathspec_match_list_entry": { + "git_patch_line_stats": { "type": "function", - "file": "pathspec.h", - "line": 222, - "lineto": 223, + "file": "git2/patch.h", + "line": 180, + "lineto": 184, "args": [ { - "name": "m", - "type": "const git_pathspec_match_list *", - "comment": "The git_pathspec_match_list object" + "name": "total_context", + "type": "size_t *", + "comment": "Count of context lines in output, can be NULL." }, { - "name": "pos", - "type": "size_t", - "comment": "The index into the list" - } - ], - "argline": "const git_pathspec_match_list *m, size_t pos", - "sig": "const git_pathspec_match_list *::size_t", - "return": { - "type": "const char *", - "comment": " The filename of the match" - }, - "description": "

Get a matching filename by position.

\n", - "comments": "

This routine cannot be used if the match list was generated by git_pathspec_match_diff. If so, it will always return NULL.

\n", - "group": "pathspec" - }, - "git_pathspec_match_list_diff_entry": { - "type": "function", - "file": "pathspec.h", - "line": 235, - "lineto": 236, - "args": [ + "name": "total_additions", + "type": "size_t *", + "comment": "Count of addition lines in output, can be NULL." + }, { - "name": "m", - "type": "const git_pathspec_match_list *", - "comment": "The git_pathspec_match_list object" + "name": "total_deletions", + "type": "size_t *", + "comment": "Count of deletion lines in output, can be NULL." }, { - "name": "pos", - "type": "size_t", - "comment": "The index into the list" + "name": "patch", + "type": "const git_patch *", + "comment": "The git_patch object" } ], - "argline": "const git_pathspec_match_list *m, size_t pos", - "sig": "const git_pathspec_match_list *::size_t", - "return": { - "type": "const git_diff_delta *", - "comment": " The filename of the match" - }, - "description": "

Get a matching diff delta by position.

\n", - "comments": "

This routine can only be used if the match list was generated by git_pathspec_match_diff. Otherwise it will always return NULL.

\n", - "group": "pathspec" + "argline": "size_t *total_context, size_t *total_additions, size_t *total_deletions, const git_patch *patch", + "sig": "size_t *::size_t *::size_t *::const git_patch *", + "return": { "type": "int", "comment": " 0 on success, \n<\n0 on error" }, + "description": "

Get line counts of each type in a patch.

\n", + "comments": "

This helps imitate a diff --numstat type of output. For that purpose, you only need the total_additions and total_deletions values, but we include the total_context line count in case you want the total number of lines of diff output that will be generated.

\n\n

All outputs are optional. Pass NULL if you don't need a particular count.

\n", + "group": "patch" }, - "git_pathspec_match_list_failed_entrycount": { + "git_patch_get_hunk": { "type": "function", - "file": "pathspec.h", - "line": 247, - "lineto": 248, + "file": "git2/patch.h", + "line": 199, + "lineto": 203, "args": [ { - "name": "m", - "type": "const git_pathspec_match_list *", - "comment": "The git_pathspec_match_list object" - } - ], - "argline": "const git_pathspec_match_list *m", - "sig": "const git_pathspec_match_list *", - "return": { - "type": "size_t", - "comment": " Number of items in original pathspec that had no matches" - }, - "description": "

Get the number of pathspec items that did not match.

\n", - "comments": "

This will be zero unless you passed GIT_PATHSPEC_FIND_FAILURES when generating the git_pathspec_match_list.

\n", - "group": "pathspec" - }, - "git_pathspec_match_list_failed_entry": { - "type": "function", - "file": "pathspec.h", - "line": 259, - "lineto": 260, - "args": [ + "name": "out", + "type": "const git_diff_hunk **", + "comment": "Output pointer to git_diff_hunk of hunk" + }, { - "name": "m", - "type": "const git_pathspec_match_list *", - "comment": "The git_pathspec_match_list object" + "name": "lines_in_hunk", + "type": "size_t *", + "comment": "Output count of total lines in this hunk" }, { - "name": "pos", + "name": "patch", + "type": "git_patch *", + "comment": "Input pointer to patch object" + }, + { + "name": "hunk_idx", "type": "size_t", - "comment": "The index into the failed items" + "comment": "Input index of hunk to get information about" } ], - "argline": "const git_pathspec_match_list *m, size_t pos", - "sig": "const git_pathspec_match_list *::size_t", + "argline": "const git_diff_hunk **out, size_t *lines_in_hunk, git_patch *patch, size_t hunk_idx", + "sig": "const git_diff_hunk **::size_t *::git_patch *::size_t", "return": { - "type": "const char *", - "comment": " The pathspec pattern that didn't match anything" + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if hunk_idx out of range, \n<\n0 on error" }, - "description": "

Get an original pathspec string that had no matches.

\n", - "comments": "

This will be return NULL for positions out of range.

\n", - "group": "pathspec" + "description": "

Get the information about a hunk in a patch

\n", + "comments": "

Given a patch and a hunk index into the patch, this returns detailed information about that hunk. Any of the output pointers can be passed as NULL if you don't care about that particular piece of information.

\n", + "group": "patch" }, - "git_proxy_init_options": { + "git_patch_num_lines_in_hunk": { "type": "function", - "file": "proxy.h", - "line": 88, - "lineto": 88, + "file": "git2/patch.h", + "line": 212, + "lineto": 214, "args": [ { - "name": "opts", - "type": "git_proxy_options *", - "comment": "the options struct to initialize" + "name": "patch", + "type": "const git_patch *", + "comment": "The git_patch object" }, - { - "name": "version", - "type": "unsigned int", - "comment": "the version of the struct, use `GIT_PROXY_OPTIONS_VERSION`" - } + { "name": "hunk_idx", "type": "size_t", "comment": "Index of the hunk" } ], - "argline": "git_proxy_options *opts, unsigned int version", - "sig": "git_proxy_options *::unsigned int", + "argline": "const git_patch *patch, size_t hunk_idx", + "sig": "const git_patch *::size_t", "return": { "type": "int", - "comment": null + "comment": " Number of lines in hunk or GIT_ENOTFOUND if invalid hunk index" }, - "description": "

Initialize a proxy options structure

\n", + "description": "

Get the number of lines in a hunk.

\n", "comments": "", - "group": "proxy" + "group": "patch" }, - "git_rebase_init_options": { + "git_patch_get_line_in_hunk": { "type": "function", - "file": "rebase.h", - "line": 156, - "lineto": 158, + "file": "git2/patch.h", + "line": 230, + "lineto": 234, "args": [ { - "name": "opts", - "type": "git_rebase_options *", - "comment": "the `git_rebase_options` instance to initialize." + "name": "out", + "type": "const git_diff_line **", + "comment": "The git_diff_line data for this line" }, { - "name": "version", - "type": "unsigned int", - "comment": "the version of the struct; you should pass\n `GIT_REBASE_OPTIONS_VERSION` here." + "name": "patch", + "type": "git_patch *", + "comment": "The patch to look in" + }, + { + "name": "hunk_idx", + "type": "size_t", + "comment": "The index of the hunk" + }, + { + "name": "line_of_hunk", + "type": "size_t", + "comment": "The index of the line in the hunk" } ], - "argline": "git_rebase_options *opts, unsigned int version", - "sig": "git_rebase_options *::unsigned int", + "argline": "const git_diff_line **out, git_patch *patch, size_t hunk_idx, size_t line_of_hunk", + "sig": "const git_diff_line **::git_patch *::size_t::size_t", "return": { "type": "int", - "comment": " Zero on success; -1 on failure." + "comment": " 0 on success, \n<\n0 on failure" }, - "description": "

Initializes a git_rebase_options with default values. Equivalent to\n creating an instance with GIT_REBASE_OPTIONS_INIT.

\n", - "comments": "", - "group": "rebase" + "description": "

Get data about a line in a hunk of a patch.

\n", + "comments": "

Given a patch, a hunk index, and a line index in the hunk, this will return a lot of details about that line. If you pass a hunk index larger than the number of hunks or a line index larger than the number of lines in the hunk, this will return -1.

\n", + "group": "patch" }, - "git_rebase_init": { + "git_patch_size": { "type": "function", - "file": "rebase.h", - "line": 177, - "lineto": 183, + "file": "git2/patch.h", + "line": 252, + "lineto": 256, "args": [ { - "name": "out", - "type": "git_rebase **", - "comment": "Pointer to store the rebase object" + "name": "patch", + "type": "git_patch *", + "comment": "A git_patch representing changes to one file" }, { - "name": "repo", - "type": "git_repository *", - "comment": "The repository to perform the rebase" + "name": "include_context", + "type": "int", + "comment": "Include context lines in size if non-zero" }, { - "name": "branch", - "type": "const git_annotated_commit *", - "comment": "The terminal commit to rebase, or NULL to rebase the\n current branch" + "name": "include_hunk_headers", + "type": "int", + "comment": "Include hunk header lines if non-zero" }, { - "name": "upstream", - "type": "const git_annotated_commit *", - "comment": "The commit to begin rebasing from, or NULL to rebase all\n reachable commits" + "name": "include_file_headers", + "type": "int", + "comment": "Include file header lines if non-zero" + } + ], + "argline": "git_patch *patch, int include_context, int include_hunk_headers, int include_file_headers", + "sig": "git_patch *::int::int::int", + "return": { "type": "size_t", "comment": " The number of bytes of data" }, + "description": "

Look up size of patch diff data in bytes

\n", + "comments": "

This returns the raw size of the patch data. This only includes the actual data from the lines of the diff, not the file or hunk headers.

\n\n

If you pass include_context as true (non-zero), this will be the size of all of the diff output; if you pass it as false (zero), this will only include the actual changed lines (as if context_lines was 0).

\n", + "group": "patch" + }, + "git_patch_print": { + "type": "function", + "file": "git2/patch.h", + "line": 270, + "lineto": 273, + "args": [ + { + "name": "patch", + "type": "git_patch *", + "comment": "A git_patch representing changes to one file" }, { - "name": "onto", - "type": "const git_annotated_commit *", - "comment": "The branch to rebase onto, or NULL to rebase onto the given\n upstream" + "name": "print_cb", + "type": "git_diff_line_cb", + "comment": "Callback function to output lines of the patch. Will be\n called for file headers, hunk headers, and diff lines." }, { - "name": "opts", - "type": "const git_rebase_options *", - "comment": "Options to specify how rebase is performed, or NULL" + "name": "payload", + "type": "void *", + "comment": "Reference pointer that will be passed to your callbacks." } ], - "argline": "git_rebase **out, git_repository *repo, const git_annotated_commit *branch, const git_annotated_commit *upstream, const git_annotated_commit *onto, const git_rebase_options *opts", - "sig": "git_rebase **::git_repository *::const git_annotated_commit *::const git_annotated_commit *::const git_annotated_commit *::const git_rebase_options *", + "argline": "git_patch *patch, git_diff_line_cb print_cb, void *payload", + "sig": "git_patch *::git_diff_line_cb::void *", "return": { "type": "int", - "comment": " Zero on success; -1 on failure." + "comment": " 0 on success, non-zero callback return value, or error code" }, - "description": "

Initializes a rebase operation to rebase the changes in branch\n relative to upstream onto another branch. To begin the rebase\n process, call git_rebase_next. When you have finished with this\n object, call git_rebase_free.

\n", - "comments": "", - "group": "rebase" + "description": "

Serialize the patch to text via callback.

\n", + "comments": "

Returning a non-zero value from the callback will terminate the iteration and return that value to the caller.

\n", + "group": "patch" }, - "git_rebase_open": { + "git_patch_to_buf": { "type": "function", - "file": "rebase.h", - "line": 194, - "lineto": 197, + "file": "git2/patch.h", + "line": 282, + "lineto": 284, "args": [ { "name": "out", - "type": "git_rebase **", - "comment": "Pointer to store the rebase object" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "The repository that has a rebase in-progress" + "type": "git_buf *", + "comment": "The git_buf to be filled in" }, { - "name": "opts", - "type": "const git_rebase_options *", - "comment": "Options to specify how rebase is performed" + "name": "patch", + "type": "git_patch *", + "comment": "A git_patch representing changes to one file" } ], - "argline": "git_rebase **out, git_repository *repo, const git_rebase_options *opts", - "sig": "git_rebase **::git_repository *::const git_rebase_options *", + "argline": "git_buf *out, git_patch *patch", + "sig": "git_buf *::git_patch *", "return": { "type": "int", - "comment": " Zero on success; -1 on failure." + "comment": " 0 on success, \n<\n0 on failure." }, - "description": "

Opens an existing rebase that was previously started by either an\n invocation of git_rebase_init or by another client.

\n", + "description": "

Get the content of a patch as a single diff text.

\n", "comments": "", - "group": "rebase" + "group": "patch", + "examples": { "diff.c": ["ex/v1.9.1/diff.html#git_patch_to_buf-18"] } }, - "git_rebase_operation_entrycount": { + "git_pathspec_new": { "type": "function", - "file": "rebase.h", - "line": 205, - "lineto": 205, + "file": "git2/pathspec.h", + "line": 89, + "lineto": 90, "args": [ { - "name": "rebase", - "type": "git_rebase *", - "comment": "The in-progress rebase" + "name": "out", + "type": "git_pathspec **", + "comment": "Output of the compiled pathspec" + }, + { + "name": "pathspec", + "type": "const git_strarray *", + "comment": "A git_strarray of the paths to match" } ], - "argline": "git_rebase *rebase", - "sig": "git_rebase *", + "argline": "git_pathspec **out, const git_strarray *pathspec", + "sig": "git_pathspec **::const git_strarray *", "return": { - "type": "size_t", - "comment": " The number of rebase operations in total" + "type": "int", + "comment": " 0 on success, \n<\n0 on failure" }, - "description": "

Gets the count of rebase operations that are to be applied.

\n", + "description": "

Compile a pathspec

\n", "comments": "", - "group": "rebase" + "group": "pathspec", + "examples": { "log.c": ["ex/v1.9.1/log.html#git_pathspec_new-40"] } }, - "git_rebase_operation_current": { + "git_pathspec_free": { "type": "function", - "file": "rebase.h", - "line": 216, - "lineto": 216, + "file": "git2/pathspec.h", + "line": 97, + "lineto": 97, "args": [ { - "name": "rebase", - "type": "git_rebase *", - "comment": "The in-progress rebase" + "name": "ps", + "type": "git_pathspec *", + "comment": "The compiled pathspec" } ], - "argline": "git_rebase *rebase", - "sig": "git_rebase *", - "return": { - "type": "size_t", - "comment": " The index of the rebase operation currently being applied." - }, - "description": "

Gets the index of the rebase operation that is currently being applied.\n If the first operation has not yet been applied (because you have\n called init but not yet next) then this returns\n GIT_REBASE_NO_OPERATION.

\n", + "argline": "git_pathspec *ps", + "sig": "git_pathspec *", + "return": { "type": "void", "comment": null }, + "description": "

Free a pathspec

\n", "comments": "", - "group": "rebase" + "group": "pathspec", + "examples": { "log.c": ["ex/v1.9.1/log.html#git_pathspec_free-41"] } }, - "git_rebase_operation_byindex": { + "git_pathspec_matches_path": { "type": "function", - "file": "rebase.h", - "line": 225, - "lineto": 227, + "file": "git2/pathspec.h", + "line": 112, + "lineto": 113, "args": [ { - "name": "rebase", - "type": "git_rebase *", - "comment": "The in-progress rebase" + "name": "ps", + "type": "const git_pathspec *", + "comment": "The compiled pathspec" }, { - "name": "idx", - "type": "size_t", - "comment": "The index of the rebase operation to retrieve" + "name": "flags", + "type": "uint32_t", + "comment": "Combination of git_pathspec_flag_t options to control match" + }, + { + "name": "path", + "type": "const char *", + "comment": "The pathname to attempt to match" } ], - "argline": "git_rebase *rebase, size_t idx", - "sig": "git_rebase *::size_t", + "argline": "const git_pathspec *ps, uint32_t flags, const char *path", + "sig": "const git_pathspec *::uint32_t::const char *", "return": { - "type": "git_rebase_operation *", - "comment": " The rebase operation or NULL if `idx` was out of bounds" + "type": "int", + "comment": " 1 is path matches spec, 0 if it does not" }, - "description": "

Gets the rebase operation specified by the given index.

\n", - "comments": "", - "group": "rebase" + "description": "

Try to match a path against a pathspec

\n", + "comments": "

Unlike most of the other pathspec matching functions, this will not fall back on the native case-sensitivity for your platform. You must explicitly pass flags to control case sensitivity or else this will fall back on being case sensitive.

\n", + "group": "pathspec" }, - "git_rebase_next": { + "git_pathspec_match_workdir": { "type": "function", - "file": "rebase.h", - "line": 240, - "lineto": 242, + "file": "git2/pathspec.h", + "line": 137, + "lineto": 141, "args": [ { - "name": "operation", - "type": "git_rebase_operation **", - "comment": "Pointer to store the rebase operation that is to be performed next" + "name": "out", + "type": "git_pathspec_match_list **", + "comment": "Output list of matches; pass NULL to just get return value" }, { - "name": "rebase", - "type": "git_rebase *", - "comment": "The rebase in progress" + "name": "repo", + "type": "git_repository *", + "comment": "The repository in which to match; bare repo is an error" + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Combination of git_pathspec_flag_t options to control match" + }, + { + "name": "ps", + "type": "git_pathspec *", + "comment": "Pathspec to be matched" } ], - "argline": "git_rebase_operation **operation, git_rebase *rebase", - "sig": "git_rebase_operation **::git_rebase *", + "argline": "git_pathspec_match_list **out, git_repository *repo, uint32_t flags, git_pathspec *ps", + "sig": "git_pathspec_match_list **::git_repository *::uint32_t::git_pathspec *", "return": { "type": "int", - "comment": " Zero on success; -1 on failure." + "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag was given" }, - "description": "

Performs the next rebase operation and returns the information about it.\n If the operation is one that applies a patch (which is any operation except\n GIT_REBASE_OPERATION_EXEC) then the patch will be applied and the index and\n working directory will be updated with the changes. If there are conflicts,\n you will need to address those before committing the changes.

\n", - "comments": "", - "group": "rebase" + "description": "

Match a pathspec against the working directory of a repository.

\n", + "comments": "

This matches the pathspec against the current files in the working directory of the repository. It is an error to invoke this on a bare repo. This handles git ignores (i.e. ignored files will not be considered to match the pathspec unless the file is tracked in the index).

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", + "group": "pathspec" }, - "git_rebase_inmemory_index": { + "git_pathspec_match_index": { "type": "function", - "file": "rebase.h", - "line": 255, - "lineto": 257, + "file": "git2/pathspec.h", + "line": 166, + "lineto": 170, "args": [ + { + "name": "out", + "type": "git_pathspec_match_list **", + "comment": "Output list of matches; pass NULL to just get return value" + }, { "name": "index", - "type": "git_index **", - "comment": null + "type": "git_index *", + "comment": "The index to match against" }, { - "name": "rebase", - "type": "git_rebase *", - "comment": null + "name": "flags", + "type": "uint32_t", + "comment": "Combination of git_pathspec_flag_t options to control match" + }, + { + "name": "ps", + "type": "git_pathspec *", + "comment": "Pathspec to be matched" } ], - "argline": "git_index **index, git_rebase *rebase", - "sig": "git_index **::git_rebase *", + "argline": "git_pathspec_match_list **out, git_index *index, uint32_t flags, git_pathspec *ps", + "sig": "git_pathspec_match_list **::git_index *::uint32_t::git_pathspec *", "return": { "type": "int", - "comment": null + "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used" }, - "description": "

Gets the index produced by the last operation, which is the result\n of git_rebase_next and which will be committed by the next\n invocation of git_rebase_commit. This is useful for resolving\n conflicts in an in-memory rebase before committing them. You must\n call git_index_free when you are finished with this.

\n", - "comments": "

This is only applicable for in-memory rebases; for rebases within a working directory, the changes were applied to the repository's index.

\n", - "group": "rebase" + "description": "

Match a pathspec against entries in an index.

\n", + "comments": "

This matches the pathspec against the files in the repository index.

\n\n

NOTE: At the moment, the case sensitivity of this match is controlled by the current case-sensitivity of the index object itself and the USE_CASE and IGNORE_CASE flags will have no effect. This behavior will be corrected in a future release.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", + "group": "pathspec" }, - "git_rebase_commit": { + "git_pathspec_match_tree": { "type": "function", - "file": "rebase.h", - "line": 281, - "lineto": 287, + "file": "git2/pathspec.h", + "line": 190, + "lineto": 194, "args": [ { - "name": "id", - "type": "git_oid *", - "comment": "Pointer in which to store the OID of the newly created commit" + "name": "out", + "type": "git_pathspec_match_list **", + "comment": "Output list of matches; pass NULL to just get return value" }, { - "name": "rebase", - "type": "git_rebase *", - "comment": "The rebase that is in-progress" - }, - { - "name": "author", - "type": "const git_signature *", - "comment": "The author of the updated commit, or NULL to keep the\n author from the original commit" - }, - { - "name": "committer", - "type": "const git_signature *", - "comment": "The committer of the rebase" + "name": "tree", + "type": "git_tree *", + "comment": "The root-level tree to match against" }, { - "name": "message_encoding", - "type": "const char *", - "comment": "The encoding for the message in the commit,\n represented with a standard encoding name. If message is NULL,\n this should also be NULL, and the encoding from the original\n commit will be maintained. If message is specified, this may be\n NULL to indicate that \"UTF-8\" is to be used." + "name": "flags", + "type": "uint32_t", + "comment": "Combination of git_pathspec_flag_t options to control match" }, { - "name": "message", - "type": "const char *", - "comment": "The message for this commit, or NULL to use the message\n from the original commit." + "name": "ps", + "type": "git_pathspec *", + "comment": "Pathspec to be matched" } ], - "argline": "git_oid *id, git_rebase *rebase, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message", - "sig": "git_oid *::git_rebase *::const git_signature *::const git_signature *::const char *::const char *", + "argline": "git_pathspec_match_list **out, git_tree *tree, uint32_t flags, git_pathspec *ps", + "sig": "git_pathspec_match_list **::git_tree *::uint32_t::git_pathspec *", "return": { "type": "int", - "comment": " Zero on success, GIT_EUNMERGED if there are unmerged changes in\n the index, GIT_EAPPLIED if the current commit has already\n been applied to the upstream and there is nothing to commit,\n -1 on failure." + "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used" }, - "description": "

Commits the current patch. You must have resolved any conflicts that\n were introduced during the patch application from the git_rebase_next\n invocation.

\n", - "comments": "", - "group": "rebase" + "description": "

Match a pathspec against files in a tree.

\n", + "comments": "

This matches the pathspec against the files in the given tree.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", + "group": "pathspec", + "examples": { "log.c": ["ex/v1.9.1/log.html#git_pathspec_match_tree-42"] } }, - "git_rebase_abort": { + "git_pathspec_match_diff": { "type": "function", - "file": "rebase.h", - "line": 297, - "lineto": 297, + "file": "git2/pathspec.h", + "line": 214, + "lineto": 218, "args": [ { - "name": "rebase", - "type": "git_rebase *", - "comment": "The rebase that is in-progress" + "name": "out", + "type": "git_pathspec_match_list **", + "comment": "Output list of matches; pass NULL to just get return value" + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "A generated diff list" + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Combination of git_pathspec_flag_t options to control match" + }, + { + "name": "ps", + "type": "git_pathspec *", + "comment": "Pathspec to be matched" } ], - "argline": "git_rebase *rebase", - "sig": "git_rebase *", + "argline": "git_pathspec_match_list **out, git_diff *diff, uint32_t flags, git_pathspec *ps", + "sig": "git_pathspec_match_list **::git_diff *::uint32_t::git_pathspec *", "return": { "type": "int", - "comment": " Zero on success; GIT_ENOTFOUND if a rebase is not in progress,\n -1 on other errors." + "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used" }, - "description": "

Aborts a rebase that is currently in progress, resetting the repository\n and working directory to their state before rebase began.

\n", - "comments": "", - "group": "rebase" + "description": "

Match a pathspec against files in a diff list.

\n", + "comments": "

This matches the pathspec against the files in the given diff list.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", + "group": "pathspec" }, - "git_rebase_finish": { + "git_pathspec_match_list_free": { "type": "function", - "file": "rebase.h", - "line": 307, - "lineto": 309, + "file": "git2/pathspec.h", + "line": 225, + "lineto": 225, "args": [ { - "name": "rebase", - "type": "git_rebase *", - "comment": "The rebase that is in-progress" - }, - { - "name": "signature", - "type": "const git_signature *", - "comment": "The identity that is finishing the rebase (optional)" + "name": "m", + "type": "git_pathspec_match_list *", + "comment": "The git_pathspec_match_list to be freed" } ], - "argline": "git_rebase *rebase, const git_signature *signature", - "sig": "git_rebase *::const git_signature *", - "return": { - "type": "int", - "comment": " Zero on success; -1 on error" - }, - "description": "

Finishes a rebase that is currently in progress once all patches have\n been applied.

\n", + "argline": "git_pathspec_match_list *m", + "sig": "git_pathspec_match_list *", + "return": { "type": "void", "comment": null }, + "description": "

Free memory associates with a git_pathspec_match_list

\n", "comments": "", - "group": "rebase" + "group": "pathspec" }, - "git_rebase_free": { + "git_pathspec_match_list_entrycount": { "type": "function", - "file": "rebase.h", - "line": 316, - "lineto": 316, + "file": "git2/pathspec.h", + "line": 233, + "lineto": 234, "args": [ { - "name": "rebase", - "type": "git_rebase *", - "comment": "The rebase object" + "name": "m", + "type": "const git_pathspec_match_list *", + "comment": "The git_pathspec_match_list object" } ], - "argline": "git_rebase *rebase", - "sig": "git_rebase *", + "argline": "const git_pathspec_match_list *m", + "sig": "const git_pathspec_match_list *", "return": { - "type": "void", - "comment": null + "type": "size_t", + "comment": " Number of items in match list" }, - "description": "

Frees the git_rebase object.

\n", + "description": "

Get the number of items in a match list.

\n", "comments": "", - "group": "rebase" + "group": "pathspec" }, - "git_refdb_new": { + "git_pathspec_match_list_entry": { "type": "function", - "file": "refdb.h", - "line": 35, - "lineto": 35, + "file": "git2/pathspec.h", + "line": 246, + "lineto": 247, "args": [ { - "name": "out", - "type": "git_refdb **", - "comment": "location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed." + "name": "m", + "type": "const git_pathspec_match_list *", + "comment": "The git_pathspec_match_list object" }, { - "name": "repo", - "type": "git_repository *", - "comment": "the repository" + "name": "pos", + "type": "size_t", + "comment": "The index into the list" } ], - "argline": "git_refdb **out, git_repository *repo", - "sig": "git_refdb **::git_repository *", + "argline": "const git_pathspec_match_list *m, size_t pos", + "sig": "const git_pathspec_match_list *::size_t", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "const char *", + "comment": " The filename of the match" }, - "description": "

Create a new reference database with no backends.

\n", - "comments": "

Before the Ref DB can be used for read/writing, a custom database backend must be manually set using git_refdb_set_backend()

\n", - "group": "refdb" + "description": "

Get a matching filename by position.

\n", + "comments": "

This routine cannot be used if the match list was generated by git_pathspec_match_diff. If so, it will always return NULL.

\n", + "group": "pathspec" }, - "git_refdb_open": { + "git_pathspec_match_list_diff_entry": { "type": "function", - "file": "refdb.h", - "line": 49, - "lineto": 49, + "file": "git2/pathspec.h", + "line": 259, + "lineto": 260, "args": [ { - "name": "out", - "type": "git_refdb **", - "comment": "location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed." + "name": "m", + "type": "const git_pathspec_match_list *", + "comment": "The git_pathspec_match_list object" }, { - "name": "repo", - "type": "git_repository *", - "comment": "the repository" + "name": "pos", + "type": "size_t", + "comment": "The index into the list" } ], - "argline": "git_refdb **out, git_repository *repo", - "sig": "git_refdb **::git_repository *", + "argline": "const git_pathspec_match_list *m, size_t pos", + "sig": "const git_pathspec_match_list *::size_t", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "const git_diff_delta *", + "comment": " The filename of the match" }, - "description": "

Create a new reference database and automatically add\n the default backends:

\n", - "comments": "\n", - "group": "refdb" + "description": "

Get a matching diff delta by position.

\n", + "comments": "

This routine can only be used if the match list was generated by git_pathspec_match_diff. Otherwise it will always return NULL.

\n", + "group": "pathspec" }, - "git_refdb_compress": { + "git_pathspec_match_list_failed_entrycount": { "type": "function", - "file": "refdb.h", - "line": 56, - "lineto": 56, + "file": "git2/pathspec.h", + "line": 271, + "lineto": 272, "args": [ { - "name": "refdb", - "type": "git_refdb *", - "comment": null + "name": "m", + "type": "const git_pathspec_match_list *", + "comment": "The git_pathspec_match_list object" } ], - "argline": "git_refdb *refdb", - "sig": "git_refdb *", + "argline": "const git_pathspec_match_list *m", + "sig": "const git_pathspec_match_list *", "return": { - "type": "int", - "comment": null + "type": "size_t", + "comment": " Number of items in original pathspec that had no matches" }, - "description": "

Suggests that the given refdb compress or optimize its references.\n This mechanism is implementation specific. For on-disk reference\n databases, for example, this may pack all loose references.

\n", - "comments": "", - "group": "refdb" + "description": "

Get the number of pathspec items that did not match.

\n", + "comments": "

This will be zero unless you passed GIT_PATHSPEC_FIND_FAILURES when generating the git_pathspec_match_list.

\n", + "group": "pathspec" }, - "git_refdb_free": { + "git_pathspec_match_list_failed_entry": { "type": "function", - "file": "refdb.h", - "line": 63, - "lineto": 63, + "file": "git2/pathspec.h", + "line": 283, + "lineto": 284, "args": [ { - "name": "refdb", - "type": "git_refdb *", - "comment": "reference database pointer or NULL" + "name": "m", + "type": "const git_pathspec_match_list *", + "comment": "The git_pathspec_match_list object" + }, + { + "name": "pos", + "type": "size_t", + "comment": "The index into the failed items" } ], - "argline": "git_refdb *refdb", - "sig": "git_refdb *", + "argline": "const git_pathspec_match_list *m, size_t pos", + "sig": "const git_pathspec_match_list *::size_t", "return": { - "type": "void", - "comment": null + "type": "const char *", + "comment": " The pathspec pattern that didn't match anything" }, - "description": "

Close an open reference database.

\n", - "comments": "", - "group": "refdb" + "description": "

Get an original pathspec string that had no matches.

\n", + "comments": "

This will be return NULL for positions out of range.

\n", + "group": "pathspec" }, - "git_reflog_read": { + "git_proxy_options_init": { "type": "function", - "file": "reflog.h", - "line": 38, - "lineto": 38, + "file": "git2/proxy.h", + "line": 103, + "lineto": 103, "args": [ { - "name": "out", - "type": "git_reflog **", - "comment": "pointer to reflog" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "the repostiory" + "name": "opts", + "type": "git_proxy_options *", + "comment": "The `git_proxy_options` struct to initialize." }, { - "name": "name", - "type": "const char *", - "comment": "reference to look up" + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_PROXY_OPTIONS_VERSION`." } ], - "argline": "git_reflog **out, git_repository *repo, const char *name", - "sig": "git_reflog **::git_repository *::const char *", + "argline": "git_proxy_options *opts, unsigned int version", + "sig": "git_proxy_options *::unsigned int", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " Zero on success; -1 on failure." }, - "description": "

Read the reflog for the given reference

\n", - "comments": "

If there is no reflog file for the given reference yet, an empty reflog object will be returned.

\n\n

The reflog must be freed manually by using git_reflog_free().

\n", - "group": "reflog" + "description": "

Initialize git_proxy_options structure

\n", + "comments": "

Initializes a git_proxy_options with default values. Equivalent to creating an instance with GIT_PROXY_OPTIONS_INIT.

\n", + "group": "proxy" }, - "git_reflog_write": { + "git_rebase_options_init": { "type": "function", - "file": "reflog.h", - "line": 47, - "lineto": 47, + "file": "git2/rebase.h", + "line": 201, + "lineto": 203, "args": [ { - "name": "reflog", - "type": "git_reflog *", - "comment": "an existing reflog object" + "name": "opts", + "type": "git_rebase_options *", + "comment": "The `git_rebase_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_REBASE_OPTIONS_VERSION`." } ], - "argline": "git_reflog *reflog", - "sig": "git_reflog *", + "argline": "git_rebase_options *opts, unsigned int version", + "sig": "git_rebase_options *::unsigned int", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " Zero on success; -1 on failure." }, - "description": "

Write an existing in-memory reflog object back to disk\n using an atomic file lock.

\n", - "comments": "", - "group": "reflog" + "description": "

Initialize git_rebase_options structure

\n", + "comments": "

Initializes a git_rebase_options with default values. Equivalent to creating an instance with GIT_REBASE_OPTIONS_INIT.

\n", + "group": "rebase" }, - "git_reflog_append": { + "git_rebase_init": { "type": "function", - "file": "reflog.h", - "line": 60, - "lineto": 60, + "file": "git2/rebase.h", + "line": 222, + "lineto": 228, "args": [ { - "name": "reflog", - "type": "git_reflog *", - "comment": "an existing reflog object" + "name": "out", + "type": "git_rebase **", + "comment": "Pointer to store the rebase object" }, { - "name": "id", - "type": "const git_oid *", - "comment": "the OID the reference is now pointing to" + "name": "repo", + "type": "git_repository *", + "comment": "The repository to perform the rebase" }, { - "name": "committer", - "type": "const git_signature *", - "comment": "the signature of the committer" + "name": "branch", + "type": "const git_annotated_commit *", + "comment": "The terminal commit to rebase, or NULL to rebase the\n current branch" }, { - "name": "msg", - "type": "const char *", - "comment": "the reflog message" - } - ], - "argline": "git_reflog *reflog, const git_oid *id, const git_signature *committer, const char *msg", - "sig": "git_reflog *::const git_oid *::const git_signature *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Add a new entry to the in-memory reflog.

\n", - "comments": "

msg is optional and can be NULL.

\n", - "group": "reflog" - }, - "git_reflog_rename": { - "type": "function", - "file": "reflog.h", - "line": 75, - "lineto": 75, - "args": [ - { - "name": "repo", - "type": "git_repository *", - "comment": "the repository" + "name": "upstream", + "type": "const git_annotated_commit *", + "comment": "The commit to begin rebasing from, or NULL to rebase all\n reachable commits" }, { - "name": "old_name", - "type": "const char *", - "comment": "the old name of the reference" + "name": "onto", + "type": "const git_annotated_commit *", + "comment": "The branch to rebase onto, or NULL to rebase onto the given\n upstream" }, { - "name": "name", - "type": "const char *", - "comment": "the new name of the reference" + "name": "opts", + "type": "const git_rebase_options *", + "comment": "Options to specify how rebase is performed, or NULL" } ], - "argline": "git_repository *repo, const char *old_name, const char *name", - "sig": "git_repository *::const char *::const char *", + "argline": "git_rebase **out, git_repository *repo, const git_annotated_commit *branch, const git_annotated_commit *upstream, const git_annotated_commit *onto, const git_rebase_options *opts", + "sig": "git_rebase **::git_repository *::const git_annotated_commit *::const git_annotated_commit *::const git_annotated_commit *::const git_rebase_options *", "return": { "type": "int", - "comment": " 0 on success, GIT_EINVALIDSPEC or an error code" + "comment": " Zero on success; -1 on failure." }, - "description": "

Rename a reflog

\n", - "comments": "

The reflog to be renamed is expected to already exist

\n\n

The new name will be checked for validity. See git_reference_create_symbolic() for rules about valid names.

\n", - "group": "reflog" + "description": "

Initializes a rebase operation to rebase the changes in branch\n relative to upstream onto another branch. To begin the rebase\n process, call git_rebase_next. When you have finished with this\n object, call git_rebase_free.

\n", + "comments": "", + "group": "rebase" }, - "git_reflog_delete": { + "git_rebase_open": { "type": "function", - "file": "reflog.h", - "line": 84, - "lineto": 84, + "file": "git2/rebase.h", + "line": 239, + "lineto": 242, "args": [ + { + "name": "out", + "type": "git_rebase **", + "comment": "Pointer to store the rebase object" + }, { "name": "repo", "type": "git_repository *", - "comment": "the repository" + "comment": "The repository that has a rebase in-progress" }, { - "name": "name", - "type": "const char *", - "comment": "the reflog to delete" + "name": "opts", + "type": "const git_rebase_options *", + "comment": "Options to specify how rebase is performed" } ], - "argline": "git_repository *repo, const char *name", - "sig": "git_repository *::const char *", + "argline": "git_rebase **out, git_repository *repo, const git_rebase_options *opts", + "sig": "git_rebase **::git_repository *::const git_rebase_options *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " Zero on success; -1 on failure." }, - "description": "

Delete the reflog for the given reference

\n", + "description": "

Opens an existing rebase that was previously started by either an\n invocation of git_rebase_init or by another client.

\n", "comments": "", - "group": "reflog" + "group": "rebase" }, - "git_reflog_entrycount": { + "git_rebase_orig_head_name": { "type": "function", - "file": "reflog.h", - "line": 92, - "lineto": 92, + "file": "git2/rebase.h", + "line": 250, + "lineto": 250, "args": [ { - "name": "reflog", - "type": "git_reflog *", - "comment": "the previously loaded reflog" + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase." } ], - "argline": "git_reflog *reflog", - "sig": "git_reflog *", + "argline": "git_rebase *rebase", + "sig": "git_rebase *", "return": { - "type": "size_t", - "comment": " the number of log entries" + "type": "const char *", + "comment": " The original `HEAD` ref name" }, - "description": "

Get the number of log entries in a reflog

\n", + "description": "

Gets the original HEAD ref name for merge rebases.

\n", "comments": "", - "group": "reflog" + "group": "rebase" }, - "git_reflog_entry_byindex": { + "git_rebase_orig_head_id": { "type": "function", - "file": "reflog.h", - "line": 105, - "lineto": 105, + "file": "git2/rebase.h", + "line": 258, + "lineto": 258, "args": [ { - "name": "reflog", - "type": "const git_reflog *", - "comment": "a previously loaded reflog" - }, - { - "name": "idx", - "type": "size_t", - "comment": "the position of the entry to lookup. Should be greater than or\n equal to 0 (zero) and less than `git_reflog_entrycount()`." + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase." } ], - "argline": "const git_reflog *reflog, size_t idx", - "sig": "const git_reflog *::size_t", + "argline": "git_rebase *rebase", + "sig": "git_rebase *", "return": { - "type": "const git_reflog_entry *", - "comment": " the entry; NULL if not found" + "type": "const git_oid *", + "comment": " The original `HEAD` id" }, - "description": "

Lookup an entry by its index

\n", - "comments": "

Requesting the reflog entry with an index of 0 (zero) will return the most recently created entry.

\n", - "group": "reflog" + "description": "

Gets the original HEAD id for merge rebases.

\n", + "comments": "", + "group": "rebase" }, - "git_reflog_drop": { + "git_rebase_onto_name": { "type": "function", - "file": "reflog.h", - "line": 124, - "lineto": 127, + "file": "git2/rebase.h", + "line": 266, + "lineto": 266, "args": [ { - "name": "reflog", - "type": "git_reflog *", - "comment": "a previously loaded reflog." - }, - { - "name": "idx", - "type": "size_t", - "comment": "the position of the entry to remove. Should be greater than or\n equal to 0 (zero) and less than `git_reflog_entrycount()`." - }, - { - "name": "rewrite_previous_entry", - "type": "int", - "comment": "1 to rewrite the history; 0 otherwise." + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase." } ], - "argline": "git_reflog *reflog, size_t idx, int rewrite_previous_entry", - "sig": "git_reflog *::size_t::int", - "return": { - "type": "int", - "comment": " 0 on success, GIT_ENOTFOUND if the entry doesn't exist\n or an error code." - }, - "description": "

Remove an entry from the reflog by its index

\n", - "comments": "

To ensure there's no gap in the log history, set rewrite_previous_entry param value to 1. When deleting entry n, member old_oid of entry n-1 (if any) will be updated with the value of member new_oid of entry n+1.

\n", - "group": "reflog" + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { "type": "const char *", "comment": " The `onto` ref name" }, + "description": "

Gets the onto ref name for merge rebases.

\n", + "comments": "", + "group": "rebase" }, - "git_reflog_entry_id_old": { + "git_rebase_onto_id": { "type": "function", - "file": "reflog.h", - "line": 135, - "lineto": 135, + "file": "git2/rebase.h", + "line": 274, + "lineto": 274, "args": [ { - "name": "entry", - "type": "const git_reflog_entry *", - "comment": "a reflog entry" + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase." } ], - "argline": "const git_reflog_entry *entry", - "sig": "const git_reflog_entry *", - "return": { - "type": "const git_oid *", - "comment": " the old oid" - }, - "description": "

Get the old oid

\n", + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { "type": "const git_oid *", "comment": " The `onto` id" }, + "description": "

Gets the onto id for merge rebases.

\n", "comments": "", - "group": "reflog" + "group": "rebase" }, - "git_reflog_entry_id_new": { + "git_rebase_operation_entrycount": { "type": "function", - "file": "reflog.h", - "line": 143, - "lineto": 143, + "file": "git2/rebase.h", + "line": 282, + "lineto": 282, "args": [ { - "name": "entry", - "type": "const git_reflog_entry *", - "comment": "a reflog entry" + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase" } ], - "argline": "const git_reflog_entry *entry", - "sig": "const git_reflog_entry *", + "argline": "git_rebase *rebase", + "sig": "git_rebase *", "return": { - "type": "const git_oid *", - "comment": " the new oid at this time" + "type": "size_t", + "comment": " The number of rebase operations in total" }, - "description": "

Get the new oid

\n", + "description": "

Gets the count of rebase operations that are to be applied.

\n", "comments": "", - "group": "reflog" + "group": "rebase" }, - "git_reflog_entry_committer": { + "git_rebase_operation_current": { "type": "function", - "file": "reflog.h", - "line": 151, - "lineto": 151, + "file": "git2/rebase.h", + "line": 293, + "lineto": 293, "args": [ { - "name": "entry", - "type": "const git_reflog_entry *", - "comment": "a reflog entry" + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase" } ], - "argline": "const git_reflog_entry *entry", - "sig": "const git_reflog_entry *", + "argline": "git_rebase *rebase", + "sig": "git_rebase *", "return": { - "type": "const git_signature *", - "comment": " the committer" + "type": "size_t", + "comment": " The index of the rebase operation currently being applied." }, - "description": "

Get the committer of this entry

\n", + "description": "

Gets the index of the rebase operation that is currently being applied.\n If the first operation has not yet been applied (because you have\n called init but not yet next) then this returns\n GIT_REBASE_NO_OPERATION.

\n", "comments": "", - "group": "reflog" + "group": "rebase" }, - "git_reflog_entry_message": { + "git_rebase_operation_byindex": { "type": "function", - "file": "reflog.h", - "line": 159, - "lineto": 159, + "file": "git2/rebase.h", + "line": 302, + "lineto": 304, "args": [ { - "name": "entry", - "type": "const git_reflog_entry *", - "comment": "a reflog entry" + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase" + }, + { + "name": "idx", + "type": "size_t", + "comment": "The index of the rebase operation to retrieve" } ], - "argline": "const git_reflog_entry *entry", - "sig": "const git_reflog_entry *", + "argline": "git_rebase *rebase, size_t idx", + "sig": "git_rebase *::size_t", "return": { - "type": "const char *", - "comment": " the log msg" + "type": "git_rebase_operation *", + "comment": " The rebase operation or NULL if `idx` was out of bounds" }, - "description": "

Get the log message

\n", + "description": "

Gets the rebase operation specified by the given index.

\n", "comments": "", - "group": "reflog" + "group": "rebase" }, - "git_reflog_free": { + "git_rebase_next": { "type": "function", - "file": "reflog.h", - "line": 166, - "lineto": 166, + "file": "git2/rebase.h", + "line": 317, + "lineto": 319, "args": [ { - "name": "reflog", - "type": "git_reflog *", - "comment": "reflog to free" + "name": "operation", + "type": "git_rebase_operation **", + "comment": "Pointer to store the rebase operation that is to be performed next" + }, + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The rebase in progress" } ], - "argline": "git_reflog *reflog", - "sig": "git_reflog *", + "argline": "git_rebase_operation **operation, git_rebase *rebase", + "sig": "git_rebase_operation **::git_rebase *", "return": { - "type": "void", - "comment": null + "type": "int", + "comment": " Zero on success; -1 on failure." }, - "description": "

Free the reflog

\n", + "description": "

Performs the next rebase operation and returns the information about it.\n If the operation is one that applies a patch (which is any operation except\n GIT_REBASE_OPERATION_EXEC) then the patch will be applied and the index and\n working directory will be updated with the changes. If there are conflicts,\n you will need to address those before committing the changes.

\n", "comments": "", - "group": "reflog" + "group": "rebase" }, - "git_reference_lookup": { + "git_rebase_inmemory_index": { "type": "function", - "file": "refs.h", - "line": 37, - "lineto": 37, + "file": "git2/rebase.h", + "line": 336, + "lineto": 338, "args": [ { - "name": "out", - "type": "git_reference **", - "comment": "pointer to the looked-up reference" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "the repository to look up the reference" + "name": "index", + "type": "git_index **", + "comment": "The result index of the last operation." }, { - "name": "name", - "type": "const char *", - "comment": "the long name for the reference (e.g. HEAD, refs/heads/master, refs/tags/v0.1.0, ...)" + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase." } ], - "argline": "git_reference **out, git_repository *repo, const char *name", - "sig": "git_reference **::git_repository *::const char *", - "return": { - "type": "int", - "comment": " 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code." - }, - "description": "

Lookup a reference by name in a repository.

\n", - "comments": "

The returned reference must be freed by the user.

\n\n

The name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n", - "group": "reference", - "examples": { - "general.c": [ - "ex/HEAD/general.html#git_reference_lookup-60" - ] - } + "argline": "git_index **index, git_rebase *rebase", + "sig": "git_index **::git_rebase *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Gets the index produced by the last operation, which is the result\n of git_rebase_next and which will be committed by the next\n invocation of git_rebase_commit. This is useful for resolving\n conflicts in an in-memory rebase before committing them. You must\n call git_index_free when you are finished with this.

\n", + "comments": "

This is only applicable for in-memory rebases; for rebases within a working directory, the changes were applied to the repository's index.

\n", + "group": "rebase" }, - "git_reference_name_to_id": { + "git_rebase_commit": { "type": "function", - "file": "refs.h", - "line": 54, - "lineto": 55, + "file": "git2/rebase.h", + "line": 362, + "lineto": 368, "args": [ { - "name": "out", + "name": "id", "type": "git_oid *", - "comment": "Pointer to oid to be filled in" + "comment": "Pointer in which to store the OID of the newly created commit" }, { - "name": "repo", - "type": "git_repository *", - "comment": "The repository in which to look up the reference" + "name": "rebase", + "type": "git_rebase *", + "comment": "The rebase that is in-progress" }, { - "name": "name", + "name": "author", + "type": "const git_signature *", + "comment": "The author of the updated commit, or NULL to keep the\n author from the original commit" + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": "The committer of the rebase" + }, + { + "name": "message_encoding", "type": "const char *", - "comment": "The long name for the reference (e.g. HEAD, refs/heads/master, refs/tags/v0.1.0, ...)" + "comment": "The encoding for the message in the commit,\n represented with a standard encoding name. If message is NULL,\n this should also be NULL, and the encoding from the original\n commit will be maintained. If message is specified, this may be\n NULL to indicate that \"UTF-8\" is to be used." + }, + { + "name": "message", + "type": "const char *", + "comment": "The message for this commit, or NULL to use the message\n from the original commit." } ], - "argline": "git_oid *out, git_repository *repo, const char *name", - "sig": "git_oid *::git_repository *::const char *", + "argline": "git_oid *id, git_rebase *rebase, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message", + "sig": "git_oid *::git_rebase *::const git_signature *::const git_signature *::const char *::const char *", "return": { "type": "int", - "comment": " 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code." + "comment": " Zero on success, GIT_EUNMERGED if there are unmerged changes in\n the index, GIT_EAPPLIED if the current commit has already\n been applied to the upstream and there is nothing to commit,\n -1 on failure." }, - "description": "

Lookup a reference by name and resolve immediately to OID.

\n", - "comments": "

This function provides a quick way to resolve a reference name straight through to the object id that it refers to. This avoids having to allocate or free any git_reference objects for simple situations.

\n\n

The name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n", - "group": "reference" + "description": "

Commits the current patch. You must have resolved any conflicts that\n were introduced during the patch application from the git_rebase_next\n invocation.

\n", + "comments": "", + "group": "rebase" }, - "git_reference_dwim": { + "git_rebase_abort": { "type": "function", - "file": "refs.h", - "line": 68, - "lineto": 68, + "file": "git2/rebase.h", + "line": 378, + "lineto": 378, "args": [ { - "name": "out", - "type": "git_reference **", - "comment": "pointer in which to store the reference" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "the repository in which to look" - }, - { - "name": "shorthand", - "type": "const char *", - "comment": "the short name for the reference" + "name": "rebase", + "type": "git_rebase *", + "comment": "The rebase that is in-progress" } ], - "argline": "git_reference **out, git_repository *repo, const char *shorthand", - "sig": "git_reference **::git_repository *::const char *", + "argline": "git_rebase *rebase", + "sig": "git_rebase *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " Zero on success; GIT_ENOTFOUND if a rebase is not in progress,\n -1 on other errors." }, - "description": "

Lookup a reference by DWIMing its short name

\n", - "comments": "

Apply the git precendence rules to the given shorthand to determine which reference the user is referring to.

\n", - "group": "reference" + "description": "

Aborts a rebase that is currently in progress, resetting the repository\n and working directory to their state before rebase began.

\n", + "comments": "", + "group": "rebase" }, - "git_reference_symbolic_create_matching": { + "git_rebase_finish": { "type": "function", - "file": "refs.h", - "line": 109, - "lineto": 109, + "file": "git2/rebase.h", + "line": 388, + "lineto": 390, "args": [ { - "name": "out", - "type": "git_reference **", - "comment": "Pointer to the newly created reference" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "Repository where that reference will live" - }, - { - "name": "name", - "type": "const char *", - "comment": "The name of the reference" - }, - { - "name": "target", - "type": "const char *", - "comment": "The target of the reference" - }, - { - "name": "force", - "type": "int", - "comment": "Overwrite existing references" - }, - { - "name": "current_value", - "type": "const char *", - "comment": "The expected value of the reference when updating" + "name": "rebase", + "type": "git_rebase *", + "comment": "The rebase that is in-progress" }, { - "name": "log_message", - "type": "const char *", - "comment": "The one line long message to be appended to the reflog" + "name": "signature", + "type": "const git_signature *", + "comment": "The identity that is finishing the rebase (optional)" } ], - "argline": "git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *current_value, const char *log_message", - "sig": "git_reference **::git_repository *::const char *::const char *::int::const char *::const char *", - "return": { - "type": "int", - "comment": " 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC, GIT_EMODIFIED or an error code" - }, - "description": "

Conditionally create a new symbolic reference.

\n", - "comments": "

A symbolic reference is a reference name that refers to another reference name. If the other name moves, the symbolic name will move, too. As a simple example, the "HEAD" reference might refer to "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time of updating does not match the one passed through current_value (i.e. if the ref has changed since the user read it).

\n", - "group": "reference" + "argline": "git_rebase *rebase, const git_signature *signature", + "sig": "git_rebase *::const git_signature *", + "return": { "type": "int", "comment": " Zero on success; -1 on error" }, + "description": "

Finishes a rebase that is currently in progress once all patches have\n been applied.

\n", + "comments": "", + "group": "rebase" }, - "git_reference_symbolic_create": { + "git_rebase_free": { "type": "function", - "file": "refs.h", - "line": 145, - "lineto": 145, + "file": "git2/rebase.h", + "line": 397, + "lineto": 397, "args": [ { - "name": "out", - "type": "git_reference **", - "comment": "Pointer to the newly created reference" - }, - { + "name": "rebase", + "type": "git_rebase *", + "comment": "The rebase object" + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { "type": "void", "comment": null }, + "description": "

Frees the git_rebase object.

\n", + "comments": "", + "group": "rebase" + }, + "git_refdb_new": { + "type": "function", + "file": "git2/refdb.h", + "line": 35, + "lineto": 35, + "args": [ + { + "name": "out", + "type": "git_refdb **", + "comment": "location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed." + }, + { "name": "repo", "type": "git_repository *", - "comment": "Repository where that reference will live" - }, + "comment": "the repository" + } + ], + "argline": "git_refdb **out, git_repository *repo", + "sig": "git_refdb **::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a new reference database with no backends.

\n", + "comments": "

Before the Ref DB can be used for read/writing, a custom database backend must be manually set using git_refdb_set_backend()

\n", + "group": "refdb" + }, + "git_refdb_open": { + "type": "function", + "file": "git2/refdb.h", + "line": 49, + "lineto": 49, + "args": [ { - "name": "name", - "type": "const char *", - "comment": "The name of the reference" + "name": "out", + "type": "git_refdb **", + "comment": "location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed." }, { - "name": "target", - "type": "const char *", - "comment": "The target of the reference" - }, + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + } + ], + "argline": "git_refdb **out, git_repository *repo", + "sig": "git_refdb **::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a new reference database and automatically add\n the default backends:

\n", + "comments": "\n", + "group": "refdb" + }, + "git_refdb_compress": { + "type": "function", + "file": "git2/refdb.h", + "line": 59, + "lineto": 59, + "args": [ { - "name": "force", - "type": "int", - "comment": "Overwrite existing references" - }, + "name": "refdb", + "type": "git_refdb *", + "comment": "The reference database to optimize." + } + ], + "argline": "git_refdb *refdb", + "sig": "git_refdb *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Suggests that the given refdb compress or optimize its references.\n This mechanism is implementation specific. For on-disk reference\n databases, for example, this may pack all loose references.

\n", + "comments": "", + "group": "refdb" + }, + "git_refdb_free": { + "type": "function", + "file": "git2/refdb.h", + "line": 66, + "lineto": 66, + "args": [ { - "name": "log_message", - "type": "const char *", - "comment": "The one line long message to be appended to the reflog" + "name": "refdb", + "type": "git_refdb *", + "comment": "reference database pointer or NULL" } ], - "argline": "git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *log_message", - "sig": "git_reference **::git_repository *::const char *::const char *::int::const char *", - "return": { - "type": "int", - "comment": " 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code" - }, - "description": "

Create a new symbolic reference.

\n", - "comments": "

A symbolic reference is a reference name that refers to another reference name. If the other name moves, the symbolic name will move, too. As a simple example, the "HEAD" reference might refer to "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and it does not have a reflog.

\n", - "group": "reference" + "argline": "git_refdb *refdb", + "sig": "git_refdb *", + "return": { "type": "void", "comment": null }, + "description": "

Close an open reference database.

\n", + "comments": "", + "group": "refdb" }, - "git_reference_create": { + "git_reflog_read": { "type": "function", - "file": "refs.h", - "line": 182, - "lineto": 182, + "file": "git2/reflog.h", + "line": 38, + "lineto": 38, "args": [ { "name": "out", - "type": "git_reference **", - "comment": "Pointer to the newly created reference" + "type": "git_reflog **", + "comment": "pointer to reflog" }, { "name": "repo", "type": "git_repository *", - "comment": "Repository where that reference will live" + "comment": "the repository" }, { "name": "name", "type": "const char *", - "comment": "The name of the reference" + "comment": "reference to look up" + } + ], + "argline": "git_reflog **out, git_repository *repo, const char *name", + "sig": "git_reflog **::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Read the reflog for the given reference

\n", + "comments": "

If there is no reflog file for the given reference yet, an empty reflog object will be returned.

\n\n

The reflog must be freed manually by using git_reflog_free().

\n", + "group": "reflog" + }, + "git_reflog_write": { + "type": "function", + "file": "git2/reflog.h", + "line": 47, + "lineto": 47, + "args": [ + { + "name": "reflog", + "type": "git_reflog *", + "comment": "an existing reflog object" + } + ], + "argline": "git_reflog *reflog", + "sig": "git_reflog *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Write an existing in-memory reflog object back to disk\n using an atomic file lock.

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_append": { + "type": "function", + "file": "git2/reflog.h", + "line": 60, + "lineto": 60, + "args": [ + { + "name": "reflog", + "type": "git_reflog *", + "comment": "an existing reflog object" }, { "name": "id", "type": "const git_oid *", - "comment": "The object id pointed to by the reference." + "comment": "the OID the reference is now pointing to" }, { - "name": "force", - "type": "int", - "comment": "Overwrite existing references" + "name": "committer", + "type": "const git_signature *", + "comment": "the signature of the committer" }, { - "name": "log_message", + "name": "msg", "type": "const char *", - "comment": "The one line long message to be appended to the reflog" + "comment": "the reflog message" } ], - "argline": "git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const char *log_message", - "sig": "git_reference **::git_repository *::const char *::const git_oid *::int::const char *", - "return": { - "type": "int", - "comment": " 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code" - }, - "description": "

Create a new direct reference.

\n", - "comments": "

A direct reference (also called an object id reference) refers directly to a specific object id (a.k.a. OID or SHA) in the repository. The id permanently refers to the object (although the reference itself can be moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0" refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and and it does not have a reflog.

\n", - "group": "reference" + "argline": "git_reflog *reflog, const git_oid *id, const git_signature *committer, const char *msg", + "sig": "git_reflog *::const git_oid *::const git_signature *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Add a new entry to the in-memory reflog.

\n", + "comments": "

msg is optional and can be NULL.

\n", + "group": "reflog" }, - "git_reference_create_matching": { + "git_reflog_rename": { "type": "function", - "file": "refs.h", - "line": 225, - "lineto": 225, + "file": "git2/reflog.h", + "line": 75, + "lineto": 75, "args": [ - { - "name": "out", - "type": "git_reference **", - "comment": "Pointer to the newly created reference" - }, { "name": "repo", "type": "git_repository *", - "comment": "Repository where that reference will live" + "comment": "the repository" }, { - "name": "name", + "name": "old_name", "type": "const char *", - "comment": "The name of the reference" - }, - { - "name": "id", - "type": "const git_oid *", - "comment": "The object id pointed to by the reference." - }, - { - "name": "force", - "type": "int", - "comment": "Overwrite existing references" - }, - { - "name": "current_id", - "type": "const git_oid *", - "comment": "The expected value of the reference at the time of update" + "comment": "the old name of the reference" }, { - "name": "log_message", + "name": "name", "type": "const char *", - "comment": "The one line long message to be appended to the reflog" + "comment": "the new name of the reference" } ], - "argline": "git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_oid *current_id, const char *log_message", - "sig": "git_reference **::git_repository *::const char *::const git_oid *::int::const git_oid *::const char *", + "argline": "git_repository *repo, const char *old_name, const char *name", + "sig": "git_repository *::const char *::const char *", "return": { "type": "int", - "comment": " 0 on success, GIT_EMODIFIED if the value of the reference\n has changed, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code" + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code" }, - "description": "

Conditionally create new direct reference

\n", - "comments": "

A direct reference (also called an object id reference) refers directly to a specific object id (a.k.a. OID or SHA) in the repository. The id permanently refers to the object (although the reference itself can be moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0" refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time of updating does not match the one passed through current_id (i.e. if the ref has changed since the user read it).

\n", - "group": "reference" + "description": "

Rename a reflog

\n", + "comments": "

The reflog to be renamed is expected to already exist

\n\n

The new name will be checked for validity. See git_reference_create_symbolic() for rules about valid names.

\n", + "group": "reflog" }, - "git_reference_target": { + "git_reflog_delete": { "type": "function", - "file": "refs.h", - "line": 240, - "lineto": 240, + "file": "git2/reflog.h", + "line": 84, + "lineto": 84, "args": [ { - "name": "ref", - "type": "const git_reference *", - "comment": "The reference" + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + }, + { + "name": "name", + "type": "const char *", + "comment": "the reflog to delete" } ], - "argline": "const git_reference *ref", - "sig": "const git_reference *", - "return": { - "type": "const git_oid *", - "comment": " a pointer to the oid if available, NULL otherwise" - }, - "description": "

Get the OID pointed to by a direct reference.

\n", - "comments": "

Only available if the reference is direct (i.e. an object id reference, not a symbolic one).

\n\n

To find the OID of a symbolic ref, call git_reference_resolve() and then this function (or maybe use git_reference_name_to_id() to directly resolve a reference name all the way through to an OID).

\n", - "group": "reference", - "examples": { - "general.c": [ - "ex/HEAD/general.html#git_reference_target-61" - ] - } - }, - "git_reference_target_peel": { - "type": "function", - "file": "refs.h", - "line": 251, - "lineto": 251, - "args": [ + "argline": "git_repository *repo, const char *name", + "sig": "git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Delete the reflog for the given reference

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_entrycount": { + "type": "function", + "file": "git2/reflog.h", + "line": 92, + "lineto": 92, + "args": [ { - "name": "ref", - "type": "const git_reference *", - "comment": "The reference" + "name": "reflog", + "type": "git_reflog *", + "comment": "the previously loaded reflog" } ], - "argline": "const git_reference *ref", - "sig": "const git_reference *", - "return": { - "type": "const git_oid *", - "comment": " a pointer to the oid if available, NULL otherwise" - }, - "description": "

Return the peeled OID target of this reference.

\n", - "comments": "

This peeled OID only applies to direct references that point to a hard Tag object: it is the result of peeling such Tag.

\n", - "group": "reference" + "argline": "git_reflog *reflog", + "sig": "git_reflog *", + "return": { "type": "size_t", "comment": " the number of log entries" }, + "description": "

Get the number of log entries in a reflog

\n", + "comments": "", + "group": "reflog" }, - "git_reference_symbolic_target": { + "git_reflog_entry_byindex": { "type": "function", - "file": "refs.h", - "line": 261, - "lineto": 261, + "file": "git2/reflog.h", + "line": 105, + "lineto": 105, "args": [ { - "name": "ref", - "type": "const git_reference *", - "comment": "The reference" + "name": "reflog", + "type": "const git_reflog *", + "comment": "a previously loaded reflog" + }, + { + "name": "idx", + "type": "size_t", + "comment": "the position of the entry to lookup. Should be greater than or\n equal to 0 (zero) and less than `git_reflog_entrycount()`." } ], - "argline": "const git_reference *ref", - "sig": "const git_reference *", + "argline": "const git_reflog *reflog, size_t idx", + "sig": "const git_reflog *::size_t", "return": { - "type": "const char *", - "comment": " a pointer to the name if available, NULL otherwise" + "type": "const git_reflog_entry *", + "comment": " the entry; NULL if not found" }, - "description": "

Get full name to the reference pointed to by a symbolic reference.

\n", - "comments": "

Only available if the reference is symbolic.

\n", - "group": "reference", - "examples": { - "general.c": [ - "ex/HEAD/general.html#git_reference_symbolic_target-62" - ] - } + "description": "

Lookup an entry by its index

\n", + "comments": "

Requesting the reflog entry with an index of 0 (zero) will return the most recently created entry.

\n", + "group": "reflog" }, - "git_reference_type": { + "git_reflog_drop": { "type": "function", - "file": "refs.h", - "line": 271, - "lineto": 271, + "file": "git2/reflog.h", + "line": 124, + "lineto": 127, "args": [ { - "name": "ref", - "type": "const git_reference *", - "comment": "The reference" + "name": "reflog", + "type": "git_reflog *", + "comment": "a previously loaded reflog." + }, + { + "name": "idx", + "type": "size_t", + "comment": "the position of the entry to remove. Should be greater than or\n equal to 0 (zero) and less than `git_reflog_entrycount()`." + }, + { + "name": "rewrite_previous_entry", + "type": "int", + "comment": "1 to rewrite the history; 0 otherwise." } ], - "argline": "const git_reference *ref", - "sig": "const git_reference *", + "argline": "git_reflog *reflog, size_t idx, int rewrite_previous_entry", + "sig": "git_reflog *::size_t::int", "return": { - "type": "git_ref_t", - "comment": " the type" + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if the entry doesn't exist\n or an error code." }, - "description": "

Get the type of a reference.

\n", - "comments": "

Either direct (GIT_REF_OID) or symbolic (GIT_REF_SYMBOLIC)

\n", - "group": "reference", - "examples": { - "general.c": [ - "ex/HEAD/general.html#git_reference_type-63" - ] - } + "description": "

Remove an entry from the reflog by its index

\n", + "comments": "

To ensure there's no gap in the log history, set rewrite_previous_entry param value to 1. When deleting entry n, member old_oid of entry n-1 (if any) will be updated with the value of member new_oid of entry n+1.

\n", + "group": "reflog" }, - "git_reference_name": { + "git_reflog_entry_id_old": { "type": "function", - "file": "refs.h", - "line": 281, - "lineto": 281, + "file": "git2/reflog.h", + "line": 135, + "lineto": 135, "args": [ { - "name": "ref", - "type": "const git_reference *", - "comment": "The reference" + "name": "entry", + "type": "const git_reflog_entry *", + "comment": "a reflog entry" } ], - "argline": "const git_reference *ref", - "sig": "const git_reference *", - "return": { - "type": "const char *", - "comment": " the full name for the ref" - }, - "description": "

Get the full name of a reference.

\n", - "comments": "

See git_reference_symbolic_create() for rules about valid names.

\n", - "group": "reference" + "argline": "const git_reflog_entry *entry", + "sig": "const git_reflog_entry *", + "return": { "type": "const git_oid *", "comment": " the old oid" }, + "description": "

Get the old oid

\n", + "comments": "", + "group": "reflog" }, - "git_reference_resolve": { + "git_reflog_entry_id_new": { "type": "function", - "file": "refs.h", - "line": 299, - "lineto": 299, + "file": "git2/reflog.h", + "line": 143, + "lineto": 143, "args": [ { - "name": "out", - "type": "git_reference **", - "comment": "Pointer to the peeled reference" - }, - { - "name": "ref", - "type": "const git_reference *", - "comment": "The reference" + "name": "entry", + "type": "const git_reflog_entry *", + "comment": "a reflog entry" } ], - "argline": "git_reference **out, const git_reference *ref", - "sig": "git_reference **::const git_reference *", + "argline": "const git_reflog_entry *entry", + "sig": "const git_reflog_entry *", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "const git_oid *", + "comment": " the new oid at this time" }, - "description": "

Resolve a symbolic reference to a direct reference.

\n", - "comments": "

This method iteratively peels a symbolic reference until it resolves to a direct reference to an OID.

\n\n

The peeled reference is returned in the resolved_ref argument, and must be freed manually once it's no longer needed.

\n\n

If a direct reference is passed as an argument, a copy of that reference is returned. This copy must be manually freed too.

\n", - "group": "reference" + "description": "

Get the new oid

\n", + "comments": "", + "group": "reflog" }, - "git_reference_owner": { + "git_reflog_entry_committer": { "type": "function", - "file": "refs.h", - "line": 307, - "lineto": 307, + "file": "git2/reflog.h", + "line": 151, + "lineto": 151, "args": [ { - "name": "ref", - "type": "const git_reference *", - "comment": "The reference" + "name": "entry", + "type": "const git_reflog_entry *", + "comment": "a reflog entry" } ], - "argline": "const git_reference *ref", - "sig": "const git_reference *", + "argline": "const git_reflog_entry *entry", + "sig": "const git_reflog_entry *", "return": { - "type": "git_repository *", - "comment": " a pointer to the repo" + "type": "const git_signature *", + "comment": " the committer" }, - "description": "

Get the repository where a reference resides.

\n", + "description": "

Get the committer of this entry

\n", "comments": "", - "group": "reference" + "group": "reflog" }, - "git_reference_symbolic_set_target": { + "git_reflog_entry_message": { "type": "function", - "file": "refs.h", - "line": 329, - "lineto": 333, + "file": "git2/reflog.h", + "line": 159, + "lineto": 159, + "args": [ + { + "name": "entry", + "type": "const git_reflog_entry *", + "comment": "a reflog entry" + } + ], + "argline": "const git_reflog_entry *entry", + "sig": "const git_reflog_entry *", + "return": { "type": "const char *", "comment": " the log msg" }, + "description": "

Get the log message

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_free": { + "type": "function", + "file": "git2/reflog.h", + "line": 166, + "lineto": 166, + "args": [ + { + "name": "reflog", + "type": "git_reflog *", + "comment": "reflog to free" + } + ], + "argline": "git_reflog *reflog", + "sig": "git_reflog *", + "return": { "type": "void", "comment": null }, + "description": "

Free the reflog

\n", + "comments": "", + "group": "reflog" + }, + "git_reference_lookup": { + "type": "function", + "file": "git2/refs.h", + "line": 37, + "lineto": 37, "args": [ { "name": "out", "type": "git_reference **", - "comment": "Pointer to the newly created reference" - }, - { - "name": "ref", - "type": "git_reference *", - "comment": "The reference" + "comment": "pointer to the looked-up reference" }, { - "name": "target", - "type": "const char *", - "comment": "The new target for the reference" + "name": "repo", + "type": "git_repository *", + "comment": "the repository to look up the reference" }, { - "name": "log_message", + "name": "name", "type": "const char *", - "comment": "The one line long message to be appended to the reflog" + "comment": "the long name for the reference (e.g. HEAD, refs/heads/master, refs/tags/v0.1.0, ...)" } ], - "argline": "git_reference **out, git_reference *ref, const char *target, const char *log_message", - "sig": "git_reference **::git_reference *::const char *::const char *", + "argline": "git_reference **out, git_repository *repo, const char *name", + "sig": "git_reference **::git_repository *::const char *", "return": { "type": "int", - "comment": " 0 on success, GIT_EINVALIDSPEC or an error code" + "comment": " 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code." }, - "description": "

Create a new reference with the same name as the given reference but a\n different symbolic target. The reference must be a symbolic reference,\n otherwise this will fail.

\n", - "comments": "

The new reference will be written to disk, overwriting the given reference.

\n\n

The target name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and and it does not have a reflog.

\n", - "group": "reference" + "description": "

Lookup a reference by name in a repository.

\n", + "comments": "

The returned reference must be freed by the user.

\n\n

The name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n", + "group": "reference", + "examples": { + "checkout.c": [ + "ex/v1.9.1/checkout.html#git_reference_lookup-15", + "ex/v1.9.1/checkout.html#git_reference_lookup-16" + ], + "general.c": ["ex/v1.9.1/general.html#git_reference_lookup-69"], + "merge.c": ["ex/v1.9.1/merge.html#git_reference_lookup-21"] + } }, - "git_reference_set_target": { + "git_reference_name_to_id": { "type": "function", - "file": "refs.h", - "line": 349, - "lineto": 353, + "file": "git2/refs.h", + "line": 54, + "lineto": 55, "args": [ { "name": "out", - "type": "git_reference **", - "comment": "Pointer to the newly created reference" - }, - { - "name": "ref", - "type": "git_reference *", - "comment": "The reference" + "type": "git_oid *", + "comment": "Pointer to oid to be filled in" }, { - "name": "id", - "type": "const git_oid *", - "comment": "The new target OID for the reference" + "name": "repo", + "type": "git_repository *", + "comment": "The repository in which to look up the reference" }, { - "name": "log_message", + "name": "name", "type": "const char *", - "comment": "The one line long message to be appended to the reflog" + "comment": "The long name for the reference (e.g. HEAD, refs/heads/master, refs/tags/v0.1.0, ...)" } ], - "argline": "git_reference **out, git_reference *ref, const git_oid *id, const char *log_message", - "sig": "git_reference **::git_reference *::const git_oid *::const char *", + "argline": "git_oid *out, git_repository *repo, const char *name", + "sig": "git_oid *::git_repository *::const char *", "return": { "type": "int", - "comment": " 0 on success, GIT_EMODIFIED if the value of the reference\n has changed since it was read, or an error code" + "comment": " 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code." }, - "description": "

Conditionally create a new reference with the same name as the given reference but a\n different OID target. The reference must be a direct reference, otherwise\n this will fail.

\n", - "comments": "

The new reference will be written to disk, overwriting the given reference.

\n", + "description": "

Lookup a reference by name and resolve immediately to OID.

\n", + "comments": "

This function provides a quick way to resolve a reference name straight through to the object id that it refers to. This avoids having to allocate or free any git_reference objects for simple situations.

\n\n

The name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n", "group": "reference" }, - "git_reference_rename": { + "git_reference_dwim": { "type": "function", - "file": "refs.h", - "line": 378, - "lineto": 383, + "file": "git2/refs.h", + "line": 68, + "lineto": 68, "args": [ { - "name": "new_ref", + "name": "out", "type": "git_reference **", - "comment": null + "comment": "pointer in which to store the reference" }, { - "name": "ref", - "type": "git_reference *", - "comment": "The reference to rename" + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to look" }, { - "name": "new_name", + "name": "shorthand", "type": "const char *", - "comment": "The new name for the reference" + "comment": "the short name for the reference" + } + ], + "argline": "git_reference **out, git_repository *repo, const char *shorthand", + "sig": "git_reference **::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a reference by DWIMing its short name

\n", + "comments": "

Apply the git precedence rules to the given shorthand to determine which reference the user is referring to.

\n", + "group": "reference", + "examples": { "merge.c": ["ex/v1.9.1/merge.html#git_reference_dwim-22"] } + }, + "git_reference_symbolic_create_matching": { + "type": "function", + "file": "git2/refs.h", + "line": 112, + "lineto": 112, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer to the newly created reference" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where that reference will live" + }, + { + "name": "name", + "type": "const char *", + "comment": "The name of the reference" + }, + { + "name": "target", + "type": "const char *", + "comment": "The target of the reference" }, { "name": "force", "type": "int", - "comment": "Overwrite an existing reference" + "comment": "Overwrite existing references" + }, + { + "name": "current_value", + "type": "const char *", + "comment": "The expected value of the reference when updating" }, { "name": "log_message", @@ -14695,399 +15109,540 @@ "comment": "The one line long message to be appended to the reflog" } ], - "argline": "git_reference **new_ref, git_reference *ref, const char *new_name, int force, const char *log_message", - "sig": "git_reference **::git_reference *::const char *::int::const char *", + "argline": "git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *current_value, const char *log_message", + "sig": "git_reference **::git_repository *::const char *::const char *::int::const char *::const char *", "return": { "type": "int", - "comment": " 0 on success, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" + "comment": " 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC, GIT_EMODIFIED or an error code" }, - "description": "

Rename an existing reference.

\n", - "comments": "

This method works for both direct and symbolic references.

\n\n

The new name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n\n

If the force flag is not enabled, and there's already a reference with the given name, the renaming will fail.

\n\n

IMPORTANT: The user needs to write a proper reflog entry if the reflog is enabled for the repository. We only rename the reflog if it exists.

\n", + "description": "

Conditionally create a new symbolic reference.

\n", + "comments": "

A symbolic reference is a reference name that refers to another reference name. If the other name moves, the symbolic name will move, too. As a simple example, the "HEAD" reference might refer to "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time of updating does not match the one passed through current_value (i.e. if the ref has changed since the user read it).

\n\n

If current_value is all zeros, this function will return GIT_EMODIFIED if the ref already exists.

\n", "group": "reference" }, - "git_reference_delete": { + "git_reference_symbolic_create": { "type": "function", - "file": "refs.h", - "line": 398, - "lineto": 398, + "file": "git2/refs.h", + "line": 148, + "lineto": 148, "args": [ { - "name": "ref", - "type": "git_reference *", - "comment": "The reference to remove" - } - ], - "argline": "git_reference *ref", - "sig": "git_reference *", - "return": { - "type": "int", - "comment": " 0, GIT_EMODIFIED or an error code" - }, - "description": "

Delete an existing reference.

\n", - "comments": "

This method works for both direct and symbolic references. The reference will be immediately removed on disk but the memory will not be freed. Callers must call git_reference_free.

\n\n

This function will return an error if the reference has changed from the time it was looked up.

\n", - "group": "reference" - }, - "git_reference_remove": { - "type": "function", - "file": "refs.h", - "line": 409, - "lineto": 409, - "args": [ + "name": "out", + "type": "git_reference **", + "comment": "Pointer to the newly created reference" + }, { "name": "repo", "type": "git_repository *", - "comment": null + "comment": "Repository where that reference will live" }, { "name": "name", "type": "const char *", - "comment": "The reference to remove" + "comment": "The name of the reference" + }, + { + "name": "target", + "type": "const char *", + "comment": "The target of the reference" + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing references" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" } ], - "argline": "git_repository *repo, const char *name", - "sig": "git_repository *::const char *", + "argline": "git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *log_message", + "sig": "git_reference **::git_repository *::const char *::const char *::int::const char *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code" }, - "description": "

Delete an existing reference by name

\n", - "comments": "

This method removes the named reference from the repository without looking at its old value.

\n", + "description": "

Create a new symbolic reference.

\n", + "comments": "

A symbolic reference is a reference name that refers to another reference name. If the other name moves, the symbolic name will move, too. As a simple example, the "HEAD" reference might refer to "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and it does not have a reflog.

\n", "group": "reference" }, - "git_reference_list": { + "git_reference_create": { "type": "function", - "file": "refs.h", - "line": 423, - "lineto": 423, + "file": "git2/refs.h", + "line": 185, + "lineto": 185, "args": [ { - "name": "array", - "type": "git_strarray *", - "comment": "Pointer to a git_strarray structure where\n\t\tthe reference names will be stored" + "name": "out", + "type": "git_reference **", + "comment": "Pointer to the newly created reference" }, { "name": "repo", "type": "git_repository *", - "comment": "Repository where to find the refs" + "comment": "Repository where that reference will live" + }, + { + "name": "name", + "type": "const char *", + "comment": "The name of the reference" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "The object id pointed to by the reference." + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing references" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" } ], - "argline": "git_strarray *array, git_repository *repo", - "sig": "git_strarray *::git_repository *", + "argline": "git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const char *log_message", + "sig": "git_reference **::git_repository *::const char *::const git_oid *::int::const char *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code" }, - "description": "

Fill a list with all the references that can be found in a repository.

\n", - "comments": "

The string array will be filled with the names of all references; these values are owned by the user and should be free'd manually when no longer needed, using git_strarray_free().

\n", + "description": "

Create a new direct reference.

\n", + "comments": "

A direct reference (also called an object id reference) refers directly to a specific object id (a.k.a. OID or SHA) in the repository. The id permanently refers to the object (although the reference itself can be moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0" refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and it does not have a reflog.

\n", "group": "reference", "examples": { - "general.c": [ - "ex/HEAD/general.html#git_reference_list-64" - ] + "merge.c": ["ex/v1.9.1/merge.html#git_reference_create-23"] } }, - "git_reference_foreach": { + "git_reference_create_matching": { "type": "function", - "file": "refs.h", - "line": 441, - "lineto": 444, + "file": "git2/refs.h", + "line": 228, + "lineto": 228, "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer to the newly created reference" + }, { "name": "repo", "type": "git_repository *", - "comment": "Repository where to find the refs" + "comment": "Repository where that reference will live" }, { - "name": "callback", - "type": "git_reference_foreach_cb", - "comment": "Function which will be called for every listed ref" + "name": "name", + "type": "const char *", + "comment": "The name of the reference" }, { - "name": "payload", - "type": "void *", - "comment": "Additional data to pass to the callback" - } - ], - "argline": "git_repository *repo, git_reference_foreach_cb callback, void *payload", - "sig": "git_repository *::git_reference_foreach_cb::void *", - "return": { - "type": "int", - "comment": " 0 on success, non-zero callback return value, or error code" - }, - "description": "

Perform a callback on each reference in the repository.

\n", - "comments": "

The callback function will be called for each reference in the repository, receiving the reference object and the payload value passed to this method. Returning a non-zero value from the callback will terminate the iteration.

\n", - "group": "reference" - }, - "git_reference_foreach_name": { - "type": "function", - "file": "refs.h", - "line": 459, - "lineto": 462, - "args": [ + "name": "id", + "type": "const git_oid *", + "comment": "The object id pointed to by the reference." + }, { - "name": "repo", - "type": "git_repository *", - "comment": "Repository where to find the refs" + "name": "force", + "type": "int", + "comment": "Overwrite existing references" }, { - "name": "callback", - "type": "git_reference_foreach_name_cb", - "comment": "Function which will be called for every listed ref name" + "name": "current_id", + "type": "const git_oid *", + "comment": "The expected value of the reference at the time of update" }, { - "name": "payload", - "type": "void *", - "comment": "Additional data to pass to the callback" + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" } ], - "argline": "git_repository *repo, git_reference_foreach_name_cb callback, void *payload", - "sig": "git_repository *::git_reference_foreach_name_cb::void *", + "argline": "git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_oid *current_id, const char *log_message", + "sig": "git_reference **::git_repository *::const char *::const git_oid *::int::const git_oid *::const char *", "return": { "type": "int", - "comment": " 0 on success, non-zero callback return value, or error code" + "comment": " 0 on success, GIT_EMODIFIED if the value of the reference\n has changed, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code" }, - "description": "

Perform a callback on the fully-qualified name of each reference.

\n", - "comments": "

The callback function will be called for each reference in the repository, receiving the name of the reference and the payload value passed to this method. Returning a non-zero value from the callback will terminate the iteration.

\n", + "description": "

Conditionally create new direct reference

\n", + "comments": "

A direct reference (also called an object id reference) refers directly to a specific object id (a.k.a. OID or SHA) in the repository. The id permanently refers to the object (although the reference itself can be moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0" refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time of updating does not match the one passed through current_id (i.e. if the ref has changed since the user read it).

\n", "group": "reference" }, - "git_reference_dup": { + "git_reference_target": { "type": "function", - "file": "refs.h", - "line": 473, - "lineto": 473, + "file": "git2/refs.h", + "line": 243, + "lineto": 243, "args": [ { - "name": "dest", - "type": "git_reference **", - "comment": "pointer where to store the copy" - }, + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "const git_oid *", + "comment": " a pointer to the oid if available, NULL otherwise" + }, + "description": "

Get the OID pointed to by a direct reference.

\n", + "comments": "

Only available if the reference is direct (i.e. an object id reference, not a symbolic one).

\n\n

To find the OID of a symbolic ref, call git_reference_resolve() and then this function (or maybe use git_reference_name_to_id() to directly resolve a reference name all the way through to an OID).

\n", + "group": "reference", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_reference_target-70"] + } + }, + "git_reference_target_peel": { + "type": "function", + "file": "git2/refs.h", + "line": 254, + "lineto": 254, + "args": [ { - "name": "source", - "type": "git_reference *", - "comment": "object to copy" + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" } ], - "argline": "git_reference **dest, git_reference *source", - "sig": "git_reference **::git_reference *", + "argline": "const git_reference *ref", + "sig": "const git_reference *", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "const git_oid *", + "comment": " a pointer to the oid if available, NULL otherwise" }, - "description": "

Create a copy of an existing reference.

\n", - "comments": "

Call git_reference_free to free the data.

\n", + "description": "

Return the peeled OID target of this reference.

\n", + "comments": "

This peeled OID only applies to direct references that point to a hard Tag object: it is the result of peeling such Tag.

\n", "group": "reference" }, - "git_reference_free": { + "git_reference_symbolic_target": { "type": "function", - "file": "refs.h", - "line": 480, - "lineto": 480, + "file": "git2/refs.h", + "line": 264, + "lineto": 264, "args": [ { "name": "ref", - "type": "git_reference *", - "comment": "git_reference" + "type": "const git_reference *", + "comment": "The reference" } ], - "argline": "git_reference *ref", - "sig": "git_reference *", + "argline": "const git_reference *ref", + "sig": "const git_reference *", "return": { - "type": "void", - "comment": null + "type": "const char *", + "comment": " a pointer to the name if available, NULL otherwise" }, - "description": "

Free the given reference.

\n", - "comments": "", + "description": "

Get full name to the reference pointed to by a symbolic reference.

\n", + "comments": "

Only available if the reference is symbolic.

\n", "group": "reference", "examples": { "general.c": [ - "ex/HEAD/general.html#git_reference_free-65" + "ex/v1.9.1/general.html#git_reference_symbolic_target-71" ], - "status.c": [ - "ex/HEAD/status.html#git_reference_free-3" - ] + "merge.c": ["ex/v1.9.1/merge.html#git_reference_symbolic_target-24"] } }, - "git_reference_cmp": { + "git_reference_type": { "type": "function", - "file": "refs.h", - "line": 489, - "lineto": 491, + "file": "git2/refs.h", + "line": 274, + "lineto": 274, "args": [ { - "name": "ref1", + "name": "ref", "type": "const git_reference *", - "comment": "The first git_reference" - }, + "comment": "The reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { "type": "git_reference_t", "comment": " the type" }, + "description": "

Get the type of a reference.

\n", + "comments": "

Either direct (GIT_REFERENCE_DIRECT) or symbolic (GIT_REFERENCE_SYMBOLIC)

\n", + "group": "reference", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_reference_type-72"] + } + }, + "git_reference_name": { + "type": "function", + "file": "git2/refs.h", + "line": 284, + "lineto": 284, + "args": [ { - "name": "ref2", + "name": "ref", "type": "const git_reference *", - "comment": "The second git_reference" + "comment": "The reference" } ], - "argline": "const git_reference *ref1, const git_reference *ref2", - "sig": "const git_reference *::const git_reference *", + "argline": "const git_reference *ref", + "sig": "const git_reference *", "return": { - "type": "int", - "comment": " 0 if the same, else a stable but meaningless ordering." + "type": "const char *", + "comment": " the full name for the ref" }, - "description": "

Compare two references.

\n", - "comments": "", - "group": "reference" + "description": "

Get the full name of a reference.

\n", + "comments": "

See git_reference_symbolic_create() for rules about valid names.

\n", + "group": "reference", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_reference_name-17"], + "merge.c": ["ex/v1.9.1/merge.html#git_reference_name-25"] + } }, - "git_reference_iterator_new": { + "git_reference_resolve": { "type": "function", - "file": "refs.h", - "line": 500, - "lineto": 502, + "file": "git2/refs.h", + "line": 302, + "lineto": 302, "args": [ { "name": "out", - "type": "git_reference_iterator **", - "comment": "pointer in which to store the iterator" + "type": "git_reference **", + "comment": "Pointer to the peeled reference" }, { - "name": "repo", - "type": "git_repository *", - "comment": "the repository" + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" } ], - "argline": "git_reference_iterator **out, git_repository *repo", - "sig": "git_reference_iterator **::git_repository *", + "argline": "git_reference **out, const git_reference *ref", + "sig": "git_reference **::const git_reference *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Resolve a symbolic reference to a direct reference.

\n", + "comments": "

This method iteratively peels a symbolic reference until it resolves to a direct reference to an OID.

\n\n

The peeled reference is returned in the resolved_ref argument, and must be freed manually once it's no longer needed.

\n\n

If a direct reference is passed as an argument, a copy of that reference is returned. This copy must be manually freed too.

\n", + "group": "reference" + }, + "git_reference_owner": { + "type": "function", + "file": "git2/refs.h", + "line": 310, + "lineto": 310, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "git_repository *", + "comment": " a pointer to the repo" }, - "description": "

Create an iterator for the repo's references

\n", + "description": "

Get the repository where a reference resides.

\n", "comments": "", "group": "reference" }, - "git_reference_iterator_glob_new": { + "git_reference_symbolic_set_target": { "type": "function", - "file": "refs.h", - "line": 513, - "lineto": 516, + "file": "git2/refs.h", + "line": 332, + "lineto": 336, "args": [ { "name": "out", - "type": "git_reference_iterator **", - "comment": "pointer in which to store the iterator" + "type": "git_reference **", + "comment": "Pointer to the newly created reference" }, { - "name": "repo", - "type": "git_repository *", - "comment": "the repository" + "name": "ref", + "type": "git_reference *", + "comment": "The reference" }, { - "name": "glob", + "name": "target", "type": "const char *", - "comment": "the glob to match against the reference names" + "comment": "The new target for the reference" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" } ], - "argline": "git_reference_iterator **out, git_repository *repo, const char *glob", - "sig": "git_reference_iterator **::git_repository *::const char *", + "argline": "git_reference **out, git_reference *ref, const char *target, const char *log_message", + "sig": "git_reference **::git_reference *::const char *::const char *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code" }, - "description": "

Create an iterator for the repo's references that match the\n specified glob

\n", - "comments": "", + "description": "

Create a new reference with the same name as the given reference but a\n different symbolic target. The reference must be a symbolic reference,\n otherwise this will fail.

\n", + "comments": "

The new reference will be written to disk, overwriting the given reference.

\n\n

The target name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and it does not have a reflog.

\n", "group": "reference" }, - "git_reference_next": { + "git_reference_set_target": { "type": "function", - "file": "refs.h", - "line": 525, - "lineto": 525, + "file": "git2/refs.h", + "line": 352, + "lineto": 356, "args": [ { "name": "out", "type": "git_reference **", - "comment": "pointer in which to store the reference" + "comment": "Pointer to the newly created reference" }, { - "name": "iter", - "type": "git_reference_iterator *", - "comment": "the iterator" + "name": "ref", + "type": "git_reference *", + "comment": "The reference" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "The new target OID for the reference" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" } ], - "argline": "git_reference **out, git_reference_iterator *iter", - "sig": "git_reference **::git_reference_iterator *", + "argline": "git_reference **out, git_reference *ref, const git_oid *id, const char *log_message", + "sig": "git_reference **::git_reference *::const git_oid *::const char *", "return": { "type": "int", - "comment": " 0, GIT_ITEROVER if there are no more; or an error code" + "comment": " 0 on success, GIT_EMODIFIED if the value of the reference\n has changed since it was read, or an error code" }, - "description": "

Get the next reference

\n", - "comments": "", - "group": "reference" + "description": "

Conditionally create a new reference with the same name as the given reference but a\n different OID target. The reference must be a direct reference, otherwise\n this will fail.

\n", + "comments": "

The new reference will be written to disk, overwriting the given reference.

\n", + "group": "reference", + "examples": { + "merge.c": ["ex/v1.9.1/merge.html#git_reference_set_target-26"] + } }, - "git_reference_next_name": { + "git_reference_rename": { "type": "function", - "file": "refs.h", - "line": 538, - "lineto": 538, + "file": "git2/refs.h", + "line": 382, + "lineto": 387, "args": [ { - "name": "out", - "type": "const char **", - "comment": "pointer in which to store the string" + "name": "new_ref", + "type": "git_reference **", + "comment": "The new reference" }, { - "name": "iter", - "type": "git_reference_iterator *", - "comment": "the iterator" + "name": "ref", + "type": "git_reference *", + "comment": "The reference to rename" + }, + { + "name": "new_name", + "type": "const char *", + "comment": "The new name for the reference" + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite an existing reference" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" } ], - "argline": "const char **out, git_reference_iterator *iter", - "sig": "const char **::git_reference_iterator *", + "argline": "git_reference **new_ref, git_reference *ref, const char *new_name, int force, const char *log_message", + "sig": "git_reference **::git_reference *::const char *::int::const char *", "return": { "type": "int", - "comment": " 0, GIT_ITEROVER if there are no more; or an error code" + "comment": " 0 on success, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" }, - "description": "

Get the next reference's name

\n", - "comments": "

This function is provided for convenience in case only the names are interesting as it avoids the allocation of the git_reference object which git_reference_next() needs.

\n", + "description": "

Rename an existing reference.

\n", + "comments": "

This method works for both direct and symbolic references.

\n\n

The new name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n\n

If the force flag is not enabled, and there's already a reference with the given name, the renaming will fail.

\n\n

IMPORTANT: The user needs to write a proper reflog entry if the reflog is enabled for the repository. We only rename the reflog if it exists.

\n", "group": "reference" }, - "git_reference_iterator_free": { + "git_reference_delete": { "type": "function", - "file": "refs.h", - "line": 545, - "lineto": 545, + "file": "git2/refs.h", + "line": 402, + "lineto": 402, "args": [ { - "name": "iter", - "type": "git_reference_iterator *", - "comment": "the iterator to free" + "name": "ref", + "type": "git_reference *", + "comment": "The reference to remove" } ], - "argline": "git_reference_iterator *iter", - "sig": "git_reference_iterator *", + "argline": "git_reference *ref", + "sig": "git_reference *", "return": { - "type": "void", - "comment": null + "type": "int", + "comment": " 0, GIT_EMODIFIED or an error code" }, - "description": "

Free the iterator and its associated resources

\n", - "comments": "", + "description": "

Delete an existing reference.

\n", + "comments": "

This method works for both direct and symbolic references. The reference will be immediately removed on disk but the memory will not be freed. Callers must call git_reference_free.

\n\n

This function will return an error if the reference has changed from the time it was looked up.

\n", "group": "reference" }, - "git_reference_foreach_glob": { + "git_reference_remove": { "type": "function", - "file": "refs.h", - "line": 565, - "lineto": 569, + "file": "git2/refs.h", + "line": 414, + "lineto": 414, "args": [ { "name": "repo", "type": "git_repository *", - "comment": "Repository where to find the refs" + "comment": "The repository to remove the reference from" }, { - "name": "glob", + "name": "name", "type": "const char *", - "comment": "Pattern to match (fnmatch-style) against reference name." + "comment": "The reference to remove" + } + ], + "argline": "git_repository *repo, const char *name", + "sig": "git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Delete an existing reference by name

\n", + "comments": "

This method removes the named reference from the repository without looking at its old value.

\n", + "group": "reference" + }, + "git_reference_list": { + "type": "function", + "file": "git2/refs.h", + "line": 428, + "lineto": 428, + "args": [ + { + "name": "array", + "type": "git_strarray *", + "comment": "Pointer to a git_strarray structure where\n\t\tthe reference names will be stored" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the refs" + } + ], + "argline": "git_strarray *array, git_repository *repo", + "sig": "git_strarray *::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Fill a list with all the references that can be found in a repository.

\n", + "comments": "

The string array will be filled with the names of all references; these values are owned by the user and should be free'd manually when no longer needed, using git_strarray_free().

\n", + "group": "reference", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_reference_list-73"] + } + }, + "git_reference_foreach": { + "type": "function", + "file": "git2/refs.h", + "line": 468, + "lineto": 471, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the refs" }, { "name": "callback", - "type": "git_reference_foreach_name_cb", + "type": "git_reference_foreach_cb", "comment": "Function which will be called for every listed ref" }, { @@ -15096,173 +15651,449 @@ "comment": "Additional data to pass to the callback" } ], - "argline": "git_repository *repo, const char *glob, git_reference_foreach_name_cb callback, void *payload", - "sig": "git_repository *::const char *::git_reference_foreach_name_cb::void *", + "argline": "git_repository *repo, git_reference_foreach_cb callback, void *payload", + "sig": "git_repository *::git_reference_foreach_cb::void *", "return": { "type": "int", - "comment": " 0 on success, GIT_EUSER on non-zero callback, or error code" + "comment": " 0 on success, non-zero callback return value, or error code" }, - "description": "

Perform a callback on each reference in the repository whose name\n matches the given pattern.

\n", - "comments": "

This function acts like git_reference_foreach() with an additional pattern match being applied to the reference name before issuing the callback function. See that function for more information.

\n\n

The pattern is matched using fnmatch or "glob" style where a '*' matches any sequence of letters, a '?' matches any letter, and square brackets can be used to define character ranges (such as "[0-9]" for digits).

\n", + "description": "

Perform a callback on each reference in the repository.

\n", + "comments": "

The callback function will be called for each reference in the repository, receiving the reference object and the payload value passed to this method. Returning a non-zero value from the callback will terminate the iteration.

\n\n

Note that the callback function is responsible to call git_reference_free on each reference passed to it.

\n", "group": "reference" }, - "git_reference_has_log": { + "git_reference_foreach_name": { "type": "function", - "file": "refs.h", - "line": 579, - "lineto": 579, + "file": "git2/refs.h", + "line": 486, + "lineto": 489, "args": [ { "name": "repo", "type": "git_repository *", - "comment": "the repository" + "comment": "Repository where to find the refs" }, { - "name": "refname", - "type": "const char *", - "comment": "the reference's name" + "name": "callback", + "type": "git_reference_foreach_name_cb", + "comment": "Function which will be called for every listed ref name" + }, + { + "name": "payload", + "type": "void *", + "comment": "Additional data to pass to the callback" } ], - "argline": "git_repository *repo, const char *refname", - "sig": "git_repository *::const char *", + "argline": "git_repository *repo, git_reference_foreach_name_cb callback, void *payload", + "sig": "git_repository *::git_reference_foreach_name_cb::void *", "return": { "type": "int", - "comment": " 0 when no reflog can be found, 1 when it exists;\n otherwise an error code." + "comment": " 0 on success, non-zero callback return value, or error code" }, - "description": "

Check if a reflog exists for the specified reference.

\n", - "comments": "", + "description": "

Perform a callback on the fully-qualified name of each reference.

\n", + "comments": "

The callback function will be called for each reference in the repository, receiving the name of the reference and the payload value passed to this method. Returning a non-zero value from the callback will terminate the iteration.

\n", "group": "reference" }, - "git_reference_ensure_log": { + "git_reference_dup": { "type": "function", - "file": "refs.h", - "line": 591, - "lineto": 591, + "file": "git2/refs.h", + "line": 500, + "lineto": 500, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": "the repository" + "name": "dest", + "type": "git_reference **", + "comment": "pointer where to store the copy" }, { - "name": "refname", - "type": "const char *", - "comment": "the reference's name" + "name": "source", + "type": "git_reference *", + "comment": "object to copy" } ], - "argline": "git_repository *repo, const char *refname", - "sig": "git_repository *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code." - }, - "description": "

Ensure there is a reflog for a particular reference.

\n", - "comments": "

Make sure that successive updates to the reference will append to its log.

\n", + "argline": "git_reference **dest, git_reference *source", + "sig": "git_reference **::git_reference *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a copy of an existing reference.

\n", + "comments": "

Call git_reference_free to free the data.

\n", "group": "reference" }, - "git_reference_is_branch": { + "git_reference_free": { + "type": "function", + "file": "git2/refs.h", + "line": 507, + "lineto": 507, + "args": [ + { "name": "ref", "type": "git_reference *", "comment": "git_reference" } + ], + "argline": "git_reference *ref", + "sig": "git_reference *", + "return": { "type": "void", "comment": null }, + "description": "

Free the given reference.

\n", + "comments": "", + "group": "reference", + "examples": { + "checkout.c": [ + "ex/v1.9.1/checkout.html#git_reference_free-18", + "ex/v1.9.1/checkout.html#git_reference_free-19", + "ex/v1.9.1/checkout.html#git_reference_free-20" + ], + "commit.c": ["ex/v1.9.1/commit.html#git_reference_free-7"], + "general.c": ["ex/v1.9.1/general.html#git_reference_free-74"], + "merge.c": [ + "ex/v1.9.1/merge.html#git_reference_free-27", + "ex/v1.9.1/merge.html#git_reference_free-28", + "ex/v1.9.1/merge.html#git_reference_free-29" + ], + "status.c": ["ex/v1.9.1/status.html#git_reference_free-1"] + } + }, + "git_reference_cmp": { "type": "function", - "file": "refs.h", - "line": 601, - "lineto": 601, + "file": "git2/refs.h", + "line": 516, + "lineto": 518, "args": [ { - "name": "ref", + "name": "ref1", "type": "const git_reference *", - "comment": "A git reference" + "comment": "The first git_reference" + }, + { + "name": "ref2", + "type": "const git_reference *", + "comment": "The second git_reference" } ], - "argline": "const git_reference *ref", - "sig": "const git_reference *", + "argline": "const git_reference *ref1, const git_reference *ref2", + "sig": "const git_reference *::const git_reference *", "return": { "type": "int", - "comment": " 1 when the reference lives in the refs/heads\n namespace; 0 otherwise." + "comment": " 0 if the same, else a stable but meaningless ordering." }, - "description": "

Check if a reference is a local branch.

\n", + "description": "

Compare two references.

\n", "comments": "", "group": "reference" }, - "git_reference_is_remote": { + "git_reference_iterator_new": { "type": "function", - "file": "refs.h", - "line": 611, - "lineto": 611, + "file": "git2/refs.h", + "line": 527, + "lineto": 529, "args": [ { - "name": "ref", - "type": "const git_reference *", - "comment": "A git reference" + "name": "out", + "type": "git_reference_iterator **", + "comment": "pointer in which to store the iterator" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" } ], - "argline": "const git_reference *ref", - "sig": "const git_reference *", - "return": { - "type": "int", - "comment": " 1 when the reference lives in the refs/remotes\n namespace; 0 otherwise." - }, - "description": "

Check if a reference is a remote tracking branch

\n", + "argline": "git_reference_iterator **out, git_repository *repo", + "sig": "git_reference_iterator **::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create an iterator for the repo's references

\n", "comments": "", "group": "reference" }, - "git_reference_is_tag": { + "git_reference_iterator_glob_new": { "type": "function", - "file": "refs.h", - "line": 621, - "lineto": 621, + "file": "git2/refs.h", + "line": 540, + "lineto": 543, "args": [ { - "name": "ref", - "type": "const git_reference *", - "comment": "A git reference" + "name": "out", + "type": "git_reference_iterator **", + "comment": "pointer in which to store the iterator" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + }, + { + "name": "glob", + "type": "const char *", + "comment": "the glob to match against the reference names" } ], - "argline": "const git_reference *ref", - "sig": "const git_reference *", - "return": { - "type": "int", - "comment": " 1 when the reference lives in the refs/tags\n namespace; 0 otherwise." - }, - "description": "

Check if a reference is a tag

\n", + "argline": "git_reference_iterator **out, git_repository *repo, const char *glob", + "sig": "git_reference_iterator **::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create an iterator for the repo's references that match the\n specified glob

\n", "comments": "", "group": "reference" }, - "git_reference_is_note": { + "git_reference_next": { "type": "function", - "file": "refs.h", - "line": 631, - "lineto": 631, + "file": "git2/refs.h", + "line": 552, + "lineto": 552, "args": [ { - "name": "ref", - "type": "const git_reference *", - "comment": "A git reference" + "name": "out", + "type": "git_reference **", + "comment": "pointer in which to store the reference" + }, + { + "name": "iter", + "type": "git_reference_iterator *", + "comment": "the iterator" } ], - "argline": "const git_reference *ref", - "sig": "const git_reference *", + "argline": "git_reference **out, git_reference_iterator *iter", + "sig": "git_reference **::git_reference_iterator *", "return": { "type": "int", - "comment": " 1 when the reference lives in the refs/notes\n namespace; 0 otherwise." + "comment": " 0, GIT_ITEROVER if there are no more; or an error code" }, - "description": "

Check if a reference is a note

\n", + "description": "

Get the next reference

\n", "comments": "", "group": "reference" }, - "git_reference_normalize_name": { + "git_reference_next_name": { "type": "function", - "file": "refs.h", - "line": 687, - "lineto": 691, + "file": "git2/refs.h", + "line": 565, + "lineto": 565, "args": [ { - "name": "buffer_out", - "type": "char *", - "comment": "User allocated buffer to store normalized name" + "name": "out", + "type": "const char **", + "comment": "pointer in which to store the string" }, { - "name": "buffer_size", - "type": "size_t", - "comment": "Size of buffer_out" + "name": "iter", + "type": "git_reference_iterator *", + "comment": "the iterator" + } + ], + "argline": "const char **out, git_reference_iterator *iter", + "sig": "const char **::git_reference_iterator *", + "return": { + "type": "int", + "comment": " 0, GIT_ITEROVER if there are no more; or an error code" + }, + "description": "

Get the next reference's name

\n", + "comments": "

This function is provided for convenience in case only the names are interesting as it avoids the allocation of the git_reference object which git_reference_next() needs.

\n", + "group": "reference" + }, + "git_reference_iterator_free": { + "type": "function", + "file": "git2/refs.h", + "line": 572, + "lineto": 572, + "args": [ + { + "name": "iter", + "type": "git_reference_iterator *", + "comment": "the iterator to free" + } + ], + "argline": "git_reference_iterator *iter", + "sig": "git_reference_iterator *", + "return": { "type": "void", "comment": null }, + "description": "

Free the iterator and its associated resources

\n", + "comments": "", + "group": "reference" + }, + "git_reference_foreach_glob": { + "type": "function", + "file": "git2/refs.h", + "line": 592, + "lineto": 596, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the refs" + }, + { + "name": "glob", + "type": "const char *", + "comment": "Pattern to match (fnmatch-style) against reference name." + }, + { + "name": "callback", + "type": "git_reference_foreach_name_cb", + "comment": "Function which will be called for every listed ref" + }, + { + "name": "payload", + "type": "void *", + "comment": "Additional data to pass to the callback" + } + ], + "argline": "git_repository *repo, const char *glob, git_reference_foreach_name_cb callback, void *payload", + "sig": "git_repository *::const char *::git_reference_foreach_name_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EUSER on non-zero callback, or error code" + }, + "description": "

Perform a callback on each reference in the repository whose name\n matches the given pattern.

\n", + "comments": "

This function acts like git_reference_foreach() with an additional pattern match being applied to the reference name before issuing the callback function. See that function for more information.

\n\n

The pattern is matched using fnmatch or "glob" style where a '*' matches any sequence of letters, a '?' matches any letter, and square brackets can be used to define character ranges (such as "[0-9]" for digits).

\n", + "group": "reference" + }, + "git_reference_has_log": { + "type": "function", + "file": "git2/refs.h", + "line": 606, + "lineto": 606, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the reference's name" + } + ], + "argline": "git_repository *repo, const char *refname", + "sig": "git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 when no reflog can be found, 1 when it exists;\n otherwise an error code." + }, + "description": "

Check if a reflog exists for the specified reference.

\n", + "comments": "", + "group": "reference" + }, + "git_reference_ensure_log": { + "type": "function", + "file": "git2/refs.h", + "line": 618, + "lineto": 618, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the reference's name" + } + ], + "argline": "git_repository *repo, const char *refname", + "sig": "git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Ensure there is a reflog for a particular reference.

\n", + "comments": "

Make sure that successive updates to the reference will append to its log.

\n", + "group": "reference" + }, + "git_reference_is_branch": { + "type": "function", + "file": "git2/refs.h", + "line": 628, + "lineto": 628, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "A git reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "int", + "comment": " 1 when the reference lives in the refs/heads\n namespace; 0 otherwise." + }, + "description": "

Check if a reference is a local branch.

\n", + "comments": "", + "group": "reference" + }, + "git_reference_is_remote": { + "type": "function", + "file": "git2/refs.h", + "line": 638, + "lineto": 638, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "A git reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "int", + "comment": " 1 when the reference lives in the refs/remotes\n namespace; 0 otherwise." + }, + "description": "

Check if a reference is a remote tracking branch

\n", + "comments": "", + "group": "reference", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_reference_is_remote-21"] + } + }, + "git_reference_is_tag": { + "type": "function", + "file": "git2/refs.h", + "line": 648, + "lineto": 648, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "A git reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "int", + "comment": " 1 when the reference lives in the refs/tags\n namespace; 0 otherwise." + }, + "description": "

Check if a reference is a tag

\n", + "comments": "", + "group": "reference" + }, + "git_reference_is_note": { + "type": "function", + "file": "git2/refs.h", + "line": 658, + "lineto": 658, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "A git reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "int", + "comment": " 1 when the reference lives in the refs/notes\n namespace; 0 otherwise." + }, + "description": "

Check if a reference is a note

\n", + "comments": "", + "group": "reference" + }, + "git_reference_normalize_name": { + "type": "function", + "file": "git2/refs.h", + "line": 714, + "lineto": 718, + "args": [ + { + "name": "buffer_out", + "type": "char *", + "comment": "User allocated buffer to store normalized name" + }, + { + "name": "buffer_size", + "type": "size_t", + "comment": "Size of buffer_out" }, { "name": "name", @@ -15272,7 +16103,7 @@ { "name": "flags", "type": "unsigned int", - "comment": "Flags to constrain name validation rules - see the\n GIT_REF_FORMAT constants above." + "comment": "Flags to constrain name validation rules - see the\n GIT_REFERENCE_FORMAT constants above." } ], "argline": "char *buffer_out, size_t buffer_size, const char *name, unsigned int flags", @@ -15287,9 +16118,9 @@ }, "git_reference_peel": { "type": "function", - "file": "refs.h", - "line": 708, - "lineto": 711, + "file": "git2/refs.h", + "line": 735, + "lineto": 738, "args": [ { "name": "out", @@ -15298,52 +16129,55 @@ }, { "name": "ref", - "type": "git_reference *", + "type": "const git_reference *", "comment": "The reference to be processed" }, { "name": "type", - "type": "git_otype", - "comment": "The type of the requested object (GIT_OBJ_COMMIT,\n GIT_OBJ_TAG, GIT_OBJ_TREE, GIT_OBJ_BLOB or GIT_OBJ_ANY)." + "type": "git_object_t", + "comment": "The type of the requested object (GIT_OBJECT_COMMIT,\n GIT_OBJECT_TAG, GIT_OBJECT_TREE, GIT_OBJECT_BLOB or GIT_OBJECT_ANY)." } ], - "argline": "git_object **out, git_reference *ref, git_otype type", - "sig": "git_object **::git_reference *::git_otype", + "argline": "git_object **out, const git_reference *ref, git_object_t type", + "sig": "git_object **::const git_reference *::git_object_t", "return": { "type": "int", "comment": " 0 on success, GIT_EAMBIGUOUS, GIT_ENOTFOUND or an error code" }, "description": "

Recursively peel reference until object of the specified type is found.

\n", - "comments": "

The retrieved peeled object is owned by the repository and should be closed with the git_object_free method.

\n\n

If you pass GIT_OBJ_ANY as the target type, then the object will be peeled until a non-tag object is met.

\n", - "group": "reference" + "comments": "

The retrieved peeled object is owned by the repository and should be closed with the git_object_free method.

\n\n

If you pass GIT_OBJECT_ANY as the target type, then the object will be peeled until a non-tag object is met.

\n", + "group": "reference", + "examples": { "merge.c": ["ex/v1.9.1/merge.html#git_reference_peel-30"] } }, - "git_reference_is_valid_name": { + "git_reference_name_is_valid": { "type": "function", - "file": "refs.h", - "line": 727, - "lineto": 727, + "file": "git2/refs.h", + "line": 755, + "lineto": 755, "args": [ + { + "name": "valid", + "type": "int *", + "comment": "output pointer to set with validity of given reference name" + }, { "name": "refname", "type": "const char *", "comment": "name to be checked." } ], - "argline": "const char *refname", - "sig": "const char *", - "return": { - "type": "int", - "comment": " 1 if the reference name is acceptable; 0 if it isn't" - }, + "argline": "int *valid, const char *refname", + "sig": "int *::const char *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, "description": "

Ensure the reference name is well-formed.

\n", "comments": "

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n", "group": "reference" }, "git_reference_shorthand": { "type": "function", - "file": "refs.h", - "line": 741, - "lineto": 741, + "file": "git2/refs.h", + "line": 769, + "lineto": 769, "args": [ { "name": "ref", @@ -15361,38 +16195,65 @@ "comments": "

This will transform the reference name into a name "human-readable" version. If no shortname is appropriate, it will return the full name.

\n\n

The memory is owned by the reference and must not be freed.

\n", "group": "reference", "examples": { - "status.c": [ - "ex/HEAD/status.html#git_reference_shorthand-4" - ] + "status.c": ["ex/v1.9.1/status.html#git_reference_shorthand-2"] } }, - "git_refspec_src": { + "git_refspec_parse": { "type": "function", - "file": "refspec.h", - "line": 30, - "lineto": 30, + "file": "git2/refspec.h", + "line": 32, + "lineto": 32, "args": [ { "name": "refspec", - "type": "const git_refspec *", - "comment": "the refspec" + "type": "git_refspec **", + "comment": "a pointer to hold the refspec handle" + }, + { + "name": "input", + "type": "const char *", + "comment": "the refspec string" + }, + { + "name": "is_fetch", + "type": "int", + "comment": "is this a refspec for a fetch" } ], - "argline": "const git_refspec *refspec", - "sig": "const git_refspec *", + "argline": "git_refspec **refspec, const char *input, int is_fetch", + "sig": "git_refspec **::const char *::int", "return": { - "type": "const char *", - "comment": " the refspec's source specifier" + "type": "int", + "comment": " 0 if the refspec string could be parsed, -1 otherwise" }, - "description": "

Get the source specifier

\n", + "description": "

Parse a given refspec string

\n", "comments": "", "group": "refspec" }, - "git_refspec_dst": { + "git_refspec_free": { "type": "function", - "file": "refspec.h", - "line": 38, - "lineto": 38, + "file": "git2/refspec.h", + "line": 39, + "lineto": 39, + "args": [ + { + "name": "refspec", + "type": "git_refspec *", + "comment": "the refspec object" + } + ], + "argline": "git_refspec *refspec", + "sig": "git_refspec *", + "return": { "type": "void", "comment": null }, + "description": "

Free a refspec object which has been created by git_refspec_parse

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_src": { + "type": "function", + "file": "git2/refspec.h", + "line": 47, + "lineto": 47, "args": [ { "name": "refspec", @@ -15404,7 +16265,29 @@ "sig": "const git_refspec *", "return": { "type": "const char *", - "comment": " the refspec's destination specifier" + "comment": " the refspec's source specifier" + }, + "description": "

Get the source specifier

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_dst": { + "type": "function", + "file": "git2/refspec.h", + "line": 55, + "lineto": 55, + "args": [ + { + "name": "refspec", + "type": "const git_refspec *", + "comment": "the refspec" + } + ], + "argline": "const git_refspec *refspec", + "sig": "const git_refspec *", + "return": { + "type": "const char *", + "comment": " the refspec's destination specifier" }, "description": "

Get the destination specifier

\n", "comments": "", @@ -15412,9 +16295,9 @@ }, "git_refspec_string": { "type": "function", - "file": "refspec.h", - "line": 46, - "lineto": 46, + "file": "git2/refspec.h", + "line": 63, + "lineto": 63, "args": [ { "name": "refspec", @@ -15426,7 +16309,7 @@ "sig": "const git_refspec *", "return": { "type": "const char *", - "comment": null + "comment": " the refspec's original string" }, "description": "

Get the refspec's string

\n", "comments": "", @@ -15434,9 +16317,9 @@ }, "git_refspec_force": { "type": "function", - "file": "refspec.h", - "line": 54, - "lineto": 54, + "file": "git2/refspec.h", + "line": 71, + "lineto": 71, "args": [ { "name": "refspec", @@ -15456,15 +16339,11 @@ }, "git_refspec_direction": { "type": "function", - "file": "refspec.h", - "line": 62, - "lineto": 62, + "file": "git2/refspec.h", + "line": 79, + "lineto": 79, "args": [ - { - "name": "spec", - "type": "const git_refspec *", - "comment": "refspec" - } + { "name": "spec", "type": "const git_refspec *", "comment": "refspec" } ], "argline": "const git_refspec *spec", "sig": "const git_refspec *", @@ -15476,11 +16355,38 @@ "comments": "", "group": "refspec" }, + "git_refspec_src_matches_negative": { + "type": "function", + "file": "git2/refspec.h", + "line": 88, + "lineto": 88, + "args": [ + { + "name": "refspec", + "type": "const git_refspec *", + "comment": "the refspec" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the name of the reference to check" + } + ], + "argline": "const git_refspec *refspec, const char *refname", + "sig": "const git_refspec *::const char *", + "return": { + "type": "int", + "comment": " 1 if the refspec matches, 0 otherwise" + }, + "description": "

Check if a refspec's source descriptor matches a negative reference

\n", + "comments": "", + "group": "refspec" + }, "git_refspec_src_matches": { "type": "function", - "file": "refspec.h", - "line": 71, - "lineto": 71, + "file": "git2/refspec.h", + "line": 97, + "lineto": 97, "args": [ { "name": "refspec", @@ -15499,15 +16405,15 @@ "type": "int", "comment": " 1 if the refspec matches, 0 otherwise" }, - "description": "

Check if a refspec's source descriptor matches a reference

\n", + "description": "

Check if a refspec's source descriptor matches a reference

\n", "comments": "", "group": "refspec" }, "git_refspec_dst_matches": { "type": "function", - "file": "refspec.h", - "line": 80, - "lineto": 80, + "file": "git2/refspec.h", + "line": 106, + "lineto": 106, "args": [ { "name": "refspec", @@ -15532,9 +16438,9 @@ }, "git_refspec_transform": { "type": "function", - "file": "refspec.h", - "line": 90, - "lineto": 90, + "file": "git2/refspec.h", + "line": 116, + "lineto": 116, "args": [ { "name": "out", @@ -15554,19 +16460,16 @@ ], "argline": "git_buf *out, const git_refspec *spec, const char *name", "sig": "git_buf *::const git_refspec *::const char *", - "return": { - "type": "int", - "comment": " 0, GIT_EBUFS or another error" - }, + "return": { "type": "int", "comment": " 0, GIT_EBUFS or another error" }, "description": "

Transform a reference to its target following the refspec's rules

\n", "comments": "", "group": "refspec" }, "git_refspec_rtransform": { "type": "function", - "file": "refspec.h", - "line": 100, - "lineto": 100, + "file": "git2/refspec.h", + "line": 126, + "lineto": 126, "args": [ { "name": "out", @@ -15586,17 +16489,17 @@ ], "argline": "git_buf *out, const git_refspec *spec, const char *name", "sig": "git_buf *::const git_refspec *::const char *", - "return": { - "type": "int", - "comment": " 0, GIT_EBUFS or another error" - }, + "return": { "type": "int", "comment": " 0, GIT_EBUFS or another error" }, "description": "

Transform a target reference to its source reference following the refspec's rules

\n", "comments": "", - "group": "refspec" + "group": "refspec", + "examples": { + "fetch.c": ["ex/v1.9.1/fetch.html#git_refspec_rtransform-4"] + } }, "git_remote_create": { "type": "function", - "file": "remote.h", + "file": "git2/remote.h", "line": 38, "lineto": 42, "args": [ @@ -15615,11 +16518,7 @@ "type": "const char *", "comment": "the remote's name" }, - { - "name": "url", - "type": "const char *", - "comment": "the remote's url" - } + { "name": "url", "type": "const char *", "comment": "the remote's url" } ], "argline": "git_remote **out, git_repository *repo, const char *name, const char *url", "sig": "git_remote **::git_repository *::const char *::const char *", @@ -15630,17 +16529,72 @@ "description": "

Add a remote with the default fetch refspec to the repository's configuration.

\n", "comments": "", "group": "remote", - "examples": { - "remote.c": [ - "ex/HEAD/remote.html#git_remote_create-4" - ] - } + "examples": { "remote.c": ["ex/v1.9.1/remote.html#git_remote_create-1"] } + }, + "git_remote_create_options_init": { + "type": "function", + "file": "git2/remote.h", + "line": 135, + "lineto": 137, + "args": [ + { + "name": "opts", + "type": "git_remote_create_options *", + "comment": "The `git_remote_create_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_REMOTE_CREATE_OPTIONS_VERSION`." + } + ], + "argline": "git_remote_create_options *opts, unsigned int version", + "sig": "git_remote_create_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_remote_create_options structure

\n", + "comments": "

Initializes a git_remote_create_options with default values. Equivalent to creating an instance with GIT_REMOTE_CREATE_OPTIONS_INIT.

\n", + "group": "remote" + }, + "git_remote_create_with_opts": { + "type": "function", + "file": "git2/remote.h", + "line": 151, + "lineto": 154, + "args": [ + { + "name": "out", + "type": "git_remote **", + "comment": "the resulting remote" + }, + { + "name": "url", + "type": "const char *", + "comment": "the remote's url" + }, + { + "name": "opts", + "type": "const git_remote_create_options *", + "comment": "the remote creation options" + } + ], + "argline": "git_remote **out, const char *url, const git_remote_create_options *opts", + "sig": "git_remote **::const char *::const git_remote_create_options *", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" + }, + "description": "

Create a remote, with options.

\n", + "comments": "

This function allows more fine-grained control over the remote creation.

\n\n

Passing NULL as the opts argument will result in a detached remote.

\n", + "group": "remote" }, "git_remote_create_with_fetchspec": { "type": "function", - "file": "remote.h", - "line": 55, - "lineto": 60, + "file": "git2/remote.h", + "line": 167, + "lineto": 172, "args": [ { "name": "out", @@ -15680,9 +16634,9 @@ }, "git_remote_create_anonymous": { "type": "function", - "file": "remote.h", - "line": 73, - "lineto": 76, + "file": "git2/remote.h", + "line": 185, + "lineto": 188, "args": [ { "name": "out", @@ -15702,27 +16656,46 @@ ], "argline": "git_remote **out, git_repository *repo, const char *url", "sig": "git_remote **::git_repository *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Create an anonymous remote

\n", "comments": "

Create a remote with the given url in-memory. You can use this when you have a URL instead of a remote's name.

\n", "group": "remote", "examples": { - "network/fetch.c": [ - "ex/HEAD/network/fetch.html#git_remote_create_anonymous-4" - ], - "network/ls-remote.c": [ - "ex/HEAD/network/ls-remote.html#git_remote_create_anonymous-2" + "fetch.c": ["ex/v1.9.1/fetch.html#git_remote_create_anonymous-5"], + "ls-remote.c": [ + "ex/v1.9.1/ls-remote.html#git_remote_create_anonymous-2" ] } }, + "git_remote_create_detached": { + "type": "function", + "file": "git2/remote.h", + "line": 204, + "lineto": 206, + "args": [ + { + "name": "out", + "type": "git_remote **", + "comment": "pointer to the new remote objects" + }, + { + "name": "url", + "type": "const char *", + "comment": "the remote repository's URL" + } + ], + "argline": "git_remote **out, const char *url", + "sig": "git_remote **::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a remote without a connected local repo

\n", + "comments": "

Create a remote with the given url in-memory. You can use this when you have a URL instead of a remote's name.

\n\n

Contrasted with git_remote_create_anonymous, a detached remote will not consider any repo configuration values (such as insteadof url substitutions).

\n", + "group": "remote" + }, "git_remote_lookup": { "type": "function", - "file": "remote.h", - "line": 89, - "lineto": 89, + "file": "git2/remote.h", + "line": 219, + "lineto": 219, "args": [ { "name": "out", @@ -15750,22 +16723,17 @@ "comments": "

The name will be checked for validity. See git_tag_create() for rules about valid names.

\n", "group": "remote", "examples": { - "network/fetch.c": [ - "ex/HEAD/network/fetch.html#git_remote_lookup-5" - ], - "network/ls-remote.c": [ - "ex/HEAD/network/ls-remote.html#git_remote_lookup-3" - ], - "remote.c": [ - "ex/HEAD/remote.html#git_remote_lookup-5" - ] + "fetch.c": ["ex/v1.9.1/fetch.html#git_remote_lookup-6"], + "ls-remote.c": ["ex/v1.9.1/ls-remote.html#git_remote_lookup-3"], + "push.c": ["ex/v1.9.1/push.html#git_remote_lookup-1"], + "remote.c": ["ex/v1.9.1/remote.html#git_remote_lookup-2"] } }, "git_remote_dup": { "type": "function", - "file": "remote.h", - "line": 101, - "lineto": 101, + "file": "git2/remote.h", + "line": 231, + "lineto": 231, "args": [ { "name": "dest", @@ -15780,19 +16748,16 @@ ], "argline": "git_remote **dest, git_remote *source", "sig": "git_remote **::git_remote *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Create a copy of an existing remote. All internal strings are also\n duplicated. Callbacks are not duplicated.

\n", "comments": "

Call git_remote_free to free the data.

\n", "group": "remote" }, "git_remote_owner": { "type": "function", - "file": "remote.h", - "line": 109, - "lineto": 109, + "file": "git2/remote.h", + "line": 239, + "lineto": 239, "args": [ { "name": "remote", @@ -15812,9 +16777,9 @@ }, "git_remote_name": { "type": "function", - "file": "remote.h", - "line": 117, - "lineto": 117, + "file": "git2/remote.h", + "line": 247, + "lineto": 247, "args": [ { "name": "remote", @@ -15834,9 +16799,9 @@ }, "git_remote_url": { "type": "function", - "file": "remote.h", - "line": 128, - "lineto": 128, + "file": "git2/remote.h", + "line": 259, + "lineto": 259, "args": [ { "name": "remote", @@ -15846,24 +16811,17 @@ ], "argline": "const git_remote *remote", "sig": "const git_remote *", - "return": { - "type": "const char *", - "comment": " a pointer to the url" - }, + "return": { "type": "const char *", "comment": " a pointer to the url" }, "description": "

Get the remote's url

\n", - "comments": "

If url.*.insteadOf has been configured for this URL, it will return the modified URL.

\n", + "comments": "

If url.*.insteadOf has been configured for this URL, it will return the modified URL. This function does not consider if a push url has been configured for this remote (use git_remote_pushurl if needed).

\n", "group": "remote", - "examples": { - "remote.c": [ - "ex/HEAD/remote.html#git_remote_url-6" - ] - } + "examples": { "remote.c": ["ex/v1.9.1/remote.html#git_remote_url-3"] } }, "git_remote_pushurl": { "type": "function", - "file": "remote.h", - "line": 139, - "lineto": 139, + "file": "git2/remote.h", + "line": 271, + "lineto": 271, "args": [ { "name": "remote", @@ -15877,20 +16835,16 @@ "type": "const char *", "comment": " a pointer to the url or NULL if no special url for pushing is set" }, - "description": "

Get the remote's url for pushing

\n", - "comments": "

If url.*.pushInsteadOf has been configured for this URL, it will return the modified URL.

\n", + "description": "

Get the remote's url for pushing.

\n", + "comments": "

If url.*.pushInsteadOf has been configured for this URL, it will return the modified URL. If git_remote_set_instance_pushurl has been called for this remote, then that URL will be returned.

\n", "group": "remote", - "examples": { - "remote.c": [ - "ex/HEAD/remote.html#git_remote_pushurl-7" - ] - } + "examples": { "remote.c": ["ex/v1.9.1/remote.html#git_remote_pushurl-4"] } }, "git_remote_set_url": { "type": "function", - "file": "remote.h", - "line": 152, - "lineto": 152, + "file": "git2/remote.h", + "line": 284, + "lineto": 284, "args": [ { "name": "repo", @@ -15902,32 +16856,21 @@ "type": "const char *", "comment": "the remote's name" }, - { - "name": "url", - "type": "const char *", - "comment": "the url to set" - } + { "name": "url", "type": "const char *", "comment": "the url to set" } ], "argline": "git_repository *repo, const char *remote, const char *url", "sig": "git_repository *::const char *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error value" - }, + "return": { "type": "int", "comment": " 0 or an error value" }, "description": "

Set the remote's url in the configuration

\n", "comments": "

Remote objects already in memory will not be affected. This assumes the common case of a single-url remote and will otherwise return an error.

\n", "group": "remote", - "examples": { - "remote.c": [ - "ex/HEAD/remote.html#git_remote_set_url-8" - ] - } + "examples": { "remote.c": ["ex/v1.9.1/remote.html#git_remote_set_url-5"] } }, "git_remote_set_pushurl": { "type": "function", - "file": "remote.h", - "line": 165, - "lineto": 165, + "file": "git2/remote.h", + "line": 298, + "lineto": 298, "args": [ { "name": "repo", @@ -15939,32 +16882,63 @@ "type": "const char *", "comment": "the remote's name" }, - { - "name": "url", - "type": "const char *", - "comment": "the url to set" - } + { "name": "url", "type": "const char *", "comment": "the url to set" } ], "argline": "git_repository *repo, const char *remote, const char *url", "sig": "git_repository *::const char *::const char *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0, or an error code" }, "description": "

Set the remote's url for pushing in the configuration.

\n", "comments": "

Remote objects already in memory will not be affected. This assumes the common case of a single-url remote and will otherwise return an error.

\n", "group": "remote", "examples": { - "remote.c": [ - "ex/HEAD/remote.html#git_remote_set_pushurl-9" - ] + "remote.c": ["ex/v1.9.1/remote.html#git_remote_set_pushurl-6"] } }, + "git_remote_set_instance_url": { + "type": "function", + "file": "git2/remote.h", + "line": 308, + "lineto": 308, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote's name" + }, + { "name": "url", "type": "const char *", "comment": "the url to set" } + ], + "argline": "git_remote *remote, const char *url", + "sig": "git_remote *::const char *", + "return": { "type": "int", "comment": " 0 or an error value" }, + "description": "

Set the url for this particular url instance. The URL in the\n configuration will be ignored, and will not be changed.

\n", + "comments": "", + "group": "remote" + }, + "git_remote_set_instance_pushurl": { + "type": "function", + "file": "git2/remote.h", + "line": 318, + "lineto": 318, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote's name" + }, + { "name": "url", "type": "const char *", "comment": "the url to set" } + ], + "argline": "git_remote *remote, const char *url", + "sig": "git_remote *::const char *", + "return": { "type": "int", "comment": " 0 or an error value" }, + "description": "

Set the push url for this particular url instance. The URL in the\n configuration will be ignored, and will not be changed.

\n", + "comments": "", + "group": "remote" + }, "git_remote_add_fetch": { "type": "function", - "file": "remote.h", - "line": 178, - "lineto": 178, + "file": "git2/remote.h", + "line": 331, + "lineto": 331, "args": [ { "name": "repo", @@ -15994,9 +16968,9 @@ }, "git_remote_get_fetch_refspecs": { "type": "function", - "file": "remote.h", - "line": 189, - "lineto": 189, + "file": "git2/remote.h", + "line": 343, + "lineto": 343, "args": [ { "name": "array", @@ -16011,19 +16985,16 @@ ], "argline": "git_strarray *array, const git_remote *remote", "sig": "git_strarray *::const git_remote *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Get the remote's list of fetch refspecs

\n", "comments": "

The memory is owned by the user and should be freed with git_strarray_free.

\n", "group": "remote" }, "git_remote_add_push": { "type": "function", - "file": "remote.h", - "line": 202, - "lineto": 202, + "file": "git2/remote.h", + "line": 356, + "lineto": 356, "args": [ { "name": "repo", @@ -16053,9 +17024,9 @@ }, "git_remote_get_push_refspecs": { "type": "function", - "file": "remote.h", - "line": 213, - "lineto": 213, + "file": "git2/remote.h", + "line": 368, + "lineto": 368, "args": [ { "name": "array", @@ -16070,19 +17041,16 @@ ], "argline": "git_strarray *array, const git_remote *remote", "sig": "git_strarray *::const git_remote *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Get the remote's list of push refspecs

\n", "comments": "

The memory is owned by the user and should be freed with git_strarray_free.

\n", "group": "remote" }, "git_remote_refspec_count": { "type": "function", - "file": "remote.h", - "line": 221, - "lineto": 221, + "file": "git2/remote.h", + "line": 376, + "lineto": 376, "args": [ { "name": "remote", @@ -16102,20 +17070,16 @@ }, "git_remote_get_refspec": { "type": "function", - "file": "remote.h", - "line": 230, - "lineto": 230, + "file": "git2/remote.h", + "line": 385, + "lineto": 385, "args": [ { "name": "remote", "type": "const git_remote *", "comment": "the remote to query" }, - { - "name": "n", - "type": "size_t", - "comment": "the refspec to get" - } + { "name": "n", "type": "size_t", "comment": "the refspec to get" } ], "argline": "const git_remote *remote, size_t n", "sig": "const git_remote *::size_t", @@ -16127,58 +17091,11 @@ "comments": "", "group": "remote" }, - "git_remote_connect": { - "type": "function", - "file": "remote.h", - "line": 247, - "lineto": 247, - "args": [ - { - "name": "remote", - "type": "git_remote *", - "comment": "the remote to connect to" - }, - { - "name": "direction", - "type": "git_direction", - "comment": "GIT_DIRECTION_FETCH if you want to fetch or\n GIT_DIRECTION_PUSH if you want to push" - }, - { - "name": "callbacks", - "type": "const git_remote_callbacks *", - "comment": "the callbacks to use for this connection" - }, - { - "name": "proxy_opts", - "type": "const git_proxy_options *", - "comment": "proxy settings" - }, - { - "name": "custom_headers", - "type": "const git_strarray *", - "comment": "extra HTTP headers to use in this connection" - } - ], - "argline": "git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks, const git_proxy_options *proxy_opts, const git_strarray *custom_headers", - "sig": "git_remote *::git_direction::const git_remote_callbacks *::const git_proxy_options *::const git_strarray *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Open a connection to a remote

\n", - "comments": "

The transport is selected based on the URL. The direction argument is due to a limitation of the git protocol (over TCP or SSH) which starts up a specific binary which can only do the one or the other.

\n", - "group": "remote", - "examples": { - "network/ls-remote.c": [ - "ex/HEAD/network/ls-remote.html#git_remote_connect-4" - ] - } - }, "git_remote_ls": { "type": "function", - "file": "remote.h", - "line": 269, - "lineto": 269, + "file": "git2/remote.h", + "line": 407, + "lineto": 407, "args": [ { "name": "out", @@ -16190,32 +17107,23 @@ "type": "size_t *", "comment": "the number of remote heads" }, - { - "name": "remote", - "type": "git_remote *", - "comment": "the remote" - } + { "name": "remote", "type": "git_remote *", "comment": "the remote" } ], "argline": "const git_remote_head ***out, size_t *size, git_remote *remote", "sig": "const git_remote_head ***::size_t *::git_remote *", - "return": { - "type": "int", - "comment": " 0 on success, or an error code" - }, + "return": { "type": "int", "comment": " 0 on success, or an error code" }, "description": "

Get the remote repository's reference advertisement list

\n", "comments": "

Get the list of references with which the server responds to a new connection.

\n\n

The remote (or more exactly its transport) must have connected to the remote repository. This list is available as soon as the connection to the remote is initiated and it remains available after disconnecting.

\n\n

The memory belongs to the remote. The pointer will be valid as long as a new connection is not initiated, but it is recommended that you make a copy in order to make use of the data.

\n", "group": "remote", "examples": { - "network/ls-remote.c": [ - "ex/HEAD/network/ls-remote.html#git_remote_ls-5" - ] + "ls-remote.c": ["ex/v1.9.1/ls-remote.html#git_remote_ls-4"] } }, "git_remote_connected": { "type": "function", - "file": "remote.h", - "line": 280, - "lineto": 280, + "file": "git2/remote.h", + "line": 418, + "lineto": 418, "args": [ { "name": "remote", @@ -16235,31 +17143,24 @@ }, "git_remote_stop": { "type": "function", - "file": "remote.h", - "line": 290, - "lineto": 290, + "file": "git2/remote.h", + "line": 429, + "lineto": 429, "args": [ - { - "name": "remote", - "type": "git_remote *", - "comment": "the remote" - } + { "name": "remote", "type": "git_remote *", "comment": "the remote" } ], "argline": "git_remote *remote", "sig": "git_remote *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "int", "comment": " 0 on success, or an error code" }, "description": "

Cancel the operation

\n", "comments": "

At certain points in its operation, the network code checks whether the operation has been cancelled and if so stops the operation.

\n", "group": "remote" }, "git_remote_disconnect": { "type": "function", - "file": "remote.h", - "line": 299, - "lineto": 299, + "file": "git2/remote.h", + "line": 439, + "lineto": 439, "args": [ { "name": "remote", @@ -16269,19 +17170,16 @@ ], "argline": "git_remote *remote", "sig": "git_remote *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "int", "comment": " 0 on success, or an error code" }, "description": "

Disconnect from the remote

\n", "comments": "

Close the connection to the remote.

\n", "group": "remote" }, "git_remote_free": { "type": "function", - "file": "remote.h", - "line": 309, - "lineto": 309, + "file": "git2/remote.h", + "line": 449, + "lineto": 449, "args": [ { "name": "remote", @@ -16291,31 +17189,24 @@ ], "argline": "git_remote *remote", "sig": "git_remote *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "void", "comment": null }, "description": "

Free the memory associated with a remote

\n", "comments": "

This also disconnects from the remote, if the connection has not been closed yet (using git_remote_disconnect).

\n", "group": "remote", "examples": { - "network/fetch.c": [ - "ex/HEAD/network/fetch.html#git_remote_free-6", - "ex/HEAD/network/fetch.html#git_remote_free-7" + "fetch.c": [ + "ex/v1.9.1/fetch.html#git_remote_free-7", + "ex/v1.9.1/fetch.html#git_remote_free-8" ], - "network/ls-remote.c": [ - "ex/HEAD/network/ls-remote.html#git_remote_free-6" - ], - "remote.c": [ - "ex/HEAD/remote.html#git_remote_free-10" - ] + "ls-remote.c": ["ex/v1.9.1/ls-remote.html#git_remote_free-5"], + "remote.c": ["ex/v1.9.1/remote.html#git_remote_free-7"] } }, "git_remote_list": { "type": "function", - "file": "remote.h", - "line": 320, - "lineto": 320, + "file": "git2/remote.h", + "line": 460, + "lineto": 460, "args": [ { "name": "out", @@ -16330,24 +17221,20 @@ ], "argline": "git_strarray *out, git_repository *repo", "sig": "git_strarray *::git_repository *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Get a list of the configured remotes for a repo

\n", "comments": "

The string array must be freed by the user.

\n", "group": "remote", "examples": { - "remote.c": [ - "ex/HEAD/remote.html#git_remote_list-11" - ] + "checkout.c": ["ex/v1.9.1/checkout.html#git_remote_list-22"], + "remote.c": ["ex/v1.9.1/remote.html#git_remote_list-8"] } }, "git_remote_init_callbacks": { "type": "function", - "file": "remote.h", - "line": 473, - "lineto": 475, + "file": "git2/remote.h", + "line": 714, + "lineto": 716, "args": [ { "name": "opts", @@ -16368,23 +17255,26 @@ }, "description": "

Initializes a git_remote_callbacks with default values. Equivalent to\n creating an instance with GIT_REMOTE_CALLBACKS_INIT.

\n", "comments": "", - "group": "remote" + "group": "remote", + "examples": { + "push.c": ["ex/v1.9.1/push.html#git_remote_init_callbacks-2"] + } }, - "git_fetch_init_options": { + "git_fetch_options_init": { "type": "function", - "file": "remote.h", - "line": 577, - "lineto": 579, + "file": "git2/remote.h", + "line": 852, + "lineto": 854, "args": [ { "name": "opts", "type": "git_fetch_options *", - "comment": "the `git_fetch_options` instance to initialize." + "comment": "The `git_fetch_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "the version of the struct; you should pass\n `GIT_FETCH_OPTIONS_VERSION` here." + "comment": "The struct version; pass `GIT_FETCH_OPTIONS_VERSION`." } ], "argline": "git_fetch_options *opts, unsigned int version", @@ -16393,25 +17283,25 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_fetch_options with default values. Equivalent to\n creating an instance with GIT_FETCH_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_fetch_options structure

\n", + "comments": "

Initializes a git_fetch_options with default values. Equivalent to creating an instance with GIT_FETCH_OPTIONS_INIT.

\n", "group": "fetch" }, - "git_push_init_options": { + "git_push_options_init": { "type": "function", - "file": "remote.h", - "line": 626, - "lineto": 628, + "file": "git2/remote.h", + "line": 917, + "lineto": 919, "args": [ { "name": "opts", "type": "git_push_options *", - "comment": "the `git_push_options` instance to initialize." + "comment": "The `git_push_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "the version of the struct; you should pass\n `GIT_PUSH_OPTIONS_VERSION` here." + "comment": "The struct version; pass `GIT_PUSH_OPTIONS_VERSION`." } ], "argline": "git_push_options *opts, unsigned int version", @@ -16420,21 +17310,116 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_push_options with default values. Equivalent to\n creating an instance with GIT_PUSH_OPTIONS_INIT.

\n", - "comments": "", - "group": "push" + "description": "

Initialize git_push_options structure

\n", + "comments": "

Initializes a git_push_options with default values. Equivalent to creating an instance with GIT_PUSH_OPTIONS_INIT.

\n", + "group": "push", + "examples": { "push.c": ["ex/v1.9.1/push.html#git_push_options_init-3"] } }, - "git_remote_download": { + "git_remote_connect_options_init": { + "type": "function", + "file": "git2/remote.h", + "line": 968, + "lineto": 970, + "args": [ + { + "name": "opts", + "type": "git_remote_connect_options *", + "comment": "The `git_remote_connect_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_REMOTE_CONNECT_OPTIONS_VERSION`." + } + ], + "argline": "git_remote_connect_options *opts, unsigned int version", + "sig": "git_remote_connect_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_remote_connect_options structure.

\n", + "comments": "

Initializes a git_remote_connect_options with default values. Equivalent to creating an instance with GIT_REMOTE_CONNECT_OPTIONS_INIT.

\n", + "group": "remote" + }, + "git_remote_connect": { + "type": "function", + "file": "git2/remote.h", + "line": 987, + "lineto": 992, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to connect to" + }, + { + "name": "direction", + "type": "git_direction", + "comment": "GIT_DIRECTION_FETCH if you want to fetch or\n GIT_DIRECTION_PUSH if you want to push" + }, + { + "name": "callbacks", + "type": "const git_remote_callbacks *", + "comment": "the callbacks to use for this connection" + }, + { + "name": "proxy_opts", + "type": "const git_proxy_options *", + "comment": "proxy settings" + }, + { + "name": "custom_headers", + "type": "const git_strarray *", + "comment": "extra HTTP headers to use in this connection" + } + ], + "argline": "git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks, const git_proxy_options *proxy_opts, const git_strarray *custom_headers", + "sig": "git_remote *::git_direction::const git_remote_callbacks *::const git_proxy_options *::const git_strarray *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Open a connection to a remote.

\n", + "comments": "

The transport is selected based on the URL; the direction argument is due to a limitation of the git protocol which starts up a specific binary which can only do the one or the other.

\n", + "group": "remote", + "examples": { + "ls-remote.c": ["ex/v1.9.1/ls-remote.html#git_remote_connect-6"] + } + }, + "git_remote_connect_ext": { "type": "function", - "file": "remote.h", - "line": 646, - "lineto": 646, + "file": "git2/remote.h", + "line": 1012, + "lineto": 1015, "args": [ { "name": "remote", "type": "git_remote *", - "comment": "the remote" + "comment": "the remote to connect to" + }, + { + "name": "direction", + "type": "git_direction", + "comment": "GIT_DIRECTION_FETCH if you want to fetch or\n GIT_DIRECTION_PUSH if you want to push" }, + { + "name": "opts", + "type": "const git_remote_connect_options *", + "comment": "the remote connection options" + } + ], + "argline": "git_remote *remote, git_direction direction, const git_remote_connect_options *opts", + "sig": "git_remote *::git_direction::const git_remote_connect_options *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Open a connection to a remote with extended options.

\n", + "comments": "

The transport is selected based on the URL; the direction argument is due to a limitation of the git protocol which starts up a specific binary which can only do the one or the other.

\n\n

The given options structure will form the defaults for connection options and callback setup. Callers may override these defaults by specifying git_fetch_options or git_push_options in subsequent calls.

\n", + "group": "remote" + }, + "git_remote_download": { + "type": "function", + "file": "git2/remote.h", + "line": 1037, + "lineto": 1040, + "args": [ + { "name": "remote", "type": "git_remote *", "comment": "the remote" }, { "name": "refspecs", "type": "const git_strarray *", @@ -16443,30 +17428,23 @@ { "name": "opts", "type": "const git_fetch_options *", - "comment": "the options to use for this fetch" + "comment": "the options to use for this fetch or NULL" } ], "argline": "git_remote *remote, const git_strarray *refspecs, const git_fetch_options *opts", "sig": "git_remote *::const git_strarray *::const git_fetch_options *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Download and index the packfile

\n", - "comments": "

Connect to the remote if it hasn't been done yet, negotiate with the remote git which objects are missing, download and index the packfile.

\n\n

The .idx file will be created and both it and the packfile with be renamed to their final name.

\n", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Download and index the packfile.

\n", + "comments": "

Connect to the remote if it hasn't been done yet, negotiate with the remote git which objects are missing, download and index the packfile.

\n\n

The .idx file will be created and both it and the packfile with be renamed to their final name.

\n\n

If options are specified and this remote is already connected then the existing remote connection options will be discarded and the remote will now use the new options.

\n", "group": "remote" }, "git_remote_upload": { "type": "function", - "file": "remote.h", - "line": 660, - "lineto": 660, + "file": "git2/remote.h", + "line": 1059, + "lineto": 1062, "args": [ - { - "name": "remote", - "type": "git_remote *", - "comment": "the remote" - }, + { "name": "remote", "type": "git_remote *", "comment": "the remote" }, { "name": "refspecs", "type": "const git_strarray *", @@ -16480,19 +17458,16 @@ ], "argline": "git_remote *remote, const git_strarray *refspecs, const git_push_options *opts", "sig": "git_remote *::const git_strarray *::const git_push_options *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Create a packfile and send it to the server

\n", - "comments": "

Connect to the remote if it hasn't been done yet, negotiate with the remote git which objects are missing, create a packfile with the missing objects and send it.

\n", + "comments": "

Connect to the remote if it hasn't been done yet, negotiate with the remote git which objects are missing, create a packfile with the missing objects and send it.

\n\n

If options are specified and this remote is already connected then the existing remote connection options will be discarded and the remote will now use the new options.

\n", "group": "remote" }, "git_remote_update_tips": { "type": "function", - "file": "remote.h", - "line": 676, - "lineto": 681, + "file": "git2/remote.h", + "line": 1081, + "lineto": 1086, "args": [ { "name": "remote", @@ -16502,12 +17477,12 @@ { "name": "callbacks", "type": "const git_remote_callbacks *", - "comment": "pointer to the callback structure to use" + "comment": "pointer to the callback structure to use or NULL" }, { - "name": "update_fetchhead", - "type": "int", - "comment": "whether to write to FETCH_HEAD. Pass 1 to behave like git." + "name": "update_flags", + "type": "unsigned int", + "comment": "the git_remote_update_flags for these tips." }, { "name": "download_tags", @@ -16520,21 +17495,18 @@ "comment": "The message to insert into the reflogs. If\n NULL and fetching, the default is \"fetch \n\", where \n is\n the name of the remote (or its url, for in-memory remotes). This\n parameter is ignored when pushing." } ], - "argline": "git_remote *remote, const git_remote_callbacks *callbacks, int update_fetchhead, git_remote_autotag_option_t download_tags, const char *reflog_message", - "sig": "git_remote *::const git_remote_callbacks *::int::git_remote_autotag_option_t::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Update the tips to the new state

\n", - "comments": "", + "argline": "git_remote *remote, const git_remote_callbacks *callbacks, unsigned int update_flags, git_remote_autotag_option_t download_tags, const char *reflog_message", + "sig": "git_remote *::const git_remote_callbacks *::unsigned int::git_remote_autotag_option_t::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Update the tips to the new state.

\n", + "comments": "

If callbacks are not specified then the callbacks specified to git_remote_connect will be used (if it was called).

\n", "group": "remote" }, "git_remote_fetch": { "type": "function", - "file": "remote.h", - "line": 697, - "lineto": 701, + "file": "git2/remote.h", + "line": 1106, + "lineto": 1110, "args": [ { "name": "remote", @@ -16549,7 +17521,7 @@ { "name": "opts", "type": "const git_fetch_options *", - "comment": "options to use for this fetch" + "comment": "options to use for this fetch or NULL" }, { "name": "reflog_message", @@ -16559,24 +17531,17 @@ ], "argline": "git_remote *remote, const git_strarray *refspecs, const git_fetch_options *opts, const char *reflog_message", "sig": "git_remote *::const git_strarray *::const git_fetch_options *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Download new data and update tips

\n", - "comments": "

Convenience function to connect to a remote, download the data, disconnect and update the remote-tracking branches.

\n", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Download new data and update tips.

\n", + "comments": "

Convenience function to connect to a remote, download the data, disconnect and update the remote-tracking branches.

\n\n

If options are specified and this remote is already connected then the existing remote connection options will be discarded and the remote will now use the new options.

\n", "group": "remote", - "examples": { - "network/fetch.c": [ - "ex/HEAD/network/fetch.html#git_remote_fetch-8" - ] - } + "examples": { "fetch.c": ["ex/v1.9.1/fetch.html#git_remote_fetch-9"] } }, "git_remote_prune": { "type": "function", - "file": "remote.h", - "line": 710, - "lineto": 710, + "file": "git2/remote.h", + "line": 1122, + "lineto": 1124, "args": [ { "name": "remote", @@ -16591,19 +17556,16 @@ ], "argline": "git_remote *remote, const git_remote_callbacks *callbacks", "sig": "git_remote *::const git_remote_callbacks *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Prune tracking refs that are no longer present on remote

\n", - "comments": "", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Prune tracking refs that are no longer present on remote.

\n", + "comments": "

If callbacks are not specified then the callbacks specified to git_remote_connect will be used (if it was called).

\n", "group": "remote" }, "git_remote_push": { "type": "function", - "file": "remote.h", - "line": 722, - "lineto": 724, + "file": "git2/remote.h", + "line": 1139, + "lineto": 1142, "args": [ { "name": "remote", @@ -16613,7 +17575,7 @@ { "name": "refspecs", "type": "const git_strarray *", - "comment": "the refspecs to use for pushing. If none are\n passed, the configured refspecs will be used" + "comment": "the refspecs to use for pushing. If NULL or an empty\n array, the configured refspecs will be used" }, { "name": "opts", @@ -16623,46 +17585,40 @@ ], "argline": "git_remote *remote, const git_strarray *refspecs, const git_push_options *opts", "sig": "git_remote *::const git_strarray *::const git_push_options *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Perform a push

\n", - "comments": "

Peform all the steps from a push.

\n", - "group": "remote" + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Perform a push.

\n", + "comments": "

If options are specified and this remote is already connected then the existing remote connection options will be discarded and the remote will now use the new options.

\n", + "group": "remote", + "examples": { "push.c": ["ex/v1.9.1/push.html#git_remote_push-4"] } }, "git_remote_stats": { "type": "function", - "file": "remote.h", - "line": 729, - "lineto": 729, + "file": "git2/remote.h", + "line": 1150, + "lineto": 1150, "args": [ { "name": "remote", "type": "git_remote *", - "comment": null + "comment": "the remote to get statistics for" } ], "argline": "git_remote *remote", "sig": "git_remote *", "return": { - "type": "const git_transfer_progress *", - "comment": null + "type": "const git_indexer_progress *", + "comment": " the git_indexer_progress for the remote" }, "description": "

Get the statistics structure that is filled in by the fetch operation.

\n", "comments": "", "group": "remote", - "examples": { - "network/fetch.c": [ - "ex/HEAD/network/fetch.html#git_remote_stats-9" - ] - } + "examples": { "fetch.c": ["ex/v1.9.1/fetch.html#git_remote_stats-10"] } }, "git_remote_autotag": { "type": "function", - "file": "remote.h", - "line": 737, - "lineto": 737, + "file": "git2/remote.h", + "line": 1158, + "lineto": 1158, "args": [ { "name": "remote", @@ -16682,9 +17638,9 @@ }, "git_remote_set_autotag": { "type": "function", - "file": "remote.h", - "line": 749, - "lineto": 749, + "file": "git2/remote.h", + "line": 1171, + "lineto": 1171, "args": [ { "name": "repo", @@ -16704,19 +17660,16 @@ ], "argline": "git_repository *repo, const char *remote, git_remote_autotag_option_t value", "sig": "git_repository *::const char *::git_remote_autotag_option_t", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0, or an error code." }, "description": "

Set the remote's tag following setting.

\n", "comments": "

The change will be made in the configuration. No loaded remotes will be affected.

\n", "group": "remote" }, "git_remote_prune_refs": { "type": "function", - "file": "remote.h", - "line": 756, - "lineto": 756, + "file": "git2/remote.h", + "line": 1179, + "lineto": 1179, "args": [ { "name": "remote", @@ -16726,19 +17679,16 @@ ], "argline": "const git_remote *remote", "sig": "const git_remote *", - "return": { - "type": "int", - "comment": " the ref-prune setting" - }, + "return": { "type": "int", "comment": " the ref-prune setting" }, "description": "

Retrieve the ref-prune setting

\n", "comments": "", "group": "remote" }, "git_remote_rename": { "type": "function", - "file": "remote.h", - "line": 778, - "lineto": 782, + "file": "git2/remote.h", + "line": 1201, + "lineto": 1205, "args": [ { "name": "problems", @@ -16770,39 +17720,37 @@ "description": "

Give the remote a new name

\n", "comments": "

All remote-tracking branches and configuration settings for the remote are updated.

\n\n

The new name will be checked for validity. See git_tag_create() for rules about valid names.

\n\n

No loaded instances of a the remote with the old name will change their name or their list of refspecs.

\n", "group": "remote", - "examples": { - "remote.c": [ - "ex/HEAD/remote.html#git_remote_rename-12" - ] - } + "examples": { "remote.c": ["ex/v1.9.1/remote.html#git_remote_rename-9"] } }, - "git_remote_is_valid_name": { + "git_remote_name_is_valid": { "type": "function", - "file": "remote.h", - "line": 790, - "lineto": 790, + "file": "git2/remote.h", + "line": 1214, + "lineto": 1214, "args": [ + { + "name": "valid", + "type": "int *", + "comment": "output pointer to set with validity of given remote name" + }, { "name": "remote_name", "type": "const char *", "comment": "name to be checked." } ], - "argline": "const char *remote_name", - "sig": "const char *", - "return": { - "type": "int", - "comment": " 1 if the reference name is acceptable; 0 if it isn't" - }, + "argline": "int *valid, const char *remote_name", + "sig": "int *::const char *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, "description": "

Ensure the remote name is well-formed.

\n", "comments": "", "group": "remote" }, "git_remote_delete": { "type": "function", - "file": "remote.h", - "line": 802, - "lineto": 802, + "file": "git2/remote.h", + "line": 1226, + "lineto": 1226, "args": [ { "name": "repo", @@ -16812,7 +17760,7 @@ { "name": "name", "type": "const char *", - "comment": "the name of the remove to delete" + "comment": "the name of the remote to delete" } ], "argline": "git_repository *repo, const char *name", @@ -16824,28 +17772,20 @@ "description": "

Delete an existing persisted remote.

\n", "comments": "

All remote-tracking branches and configuration settings for the remote will be removed.

\n", "group": "remote", - "examples": { - "remote.c": [ - "ex/HEAD/remote.html#git_remote_delete-13" - ] - } + "examples": { "remote.c": ["ex/v1.9.1/remote.html#git_remote_delete-10"] } }, "git_remote_default_branch": { "type": "function", - "file": "remote.h", - "line": 820, - "lineto": 820, + "file": "git2/remote.h", + "line": 1244, + "lineto": 1244, "args": [ { "name": "out", "type": "git_buf *", - "comment": "the buffern in which to store the reference name" + "comment": "the buffer in which to store the reference name" }, - { - "name": "remote", - "type": "git_remote *", - "comment": "the remote" - } + { "name": "remote", "type": "git_remote *", "comment": "the remote" } ], "argline": "git_buf *out, git_remote *remote", "sig": "git_buf *::git_remote *", @@ -16859,9 +17799,9 @@ }, "git_repository_open": { "type": "function", - "file": "repository.h", - "line": 37, - "lineto": 37, + "file": "git2/repository.h", + "line": 43, + "lineto": 43, "args": [ { "name": "out", @@ -16876,30 +17816,43 @@ ], "argline": "git_repository **out, const char *path", "sig": "git_repository **::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Open a git repository.

\n", - "comments": "

The 'path' argument must point to either a git repository folder, or an existing work dir.

\n\n

The method will automatically detect if 'path' is a normal or bare repository or fail is 'path' is neither.

\n", + "comments": "

The 'path' argument must point to either a git repository folder, or an existing work dir.

\n\n

The method will automatically detect if 'path' is a normal or bare repository or fail is 'path' is neither.

\n\n

Note that the libgit2 library must be initialized using git_libgit2_init before any APIs can be called, including this one.

\n", "group": "repository", "examples": { - "general.c": [ - "ex/HEAD/general.html#git_repository_open-66" - ], - "network/git2.c": [ - "ex/HEAD/network/git2.html#git_repository_open-5" - ], - "remote.c": [ - "ex/HEAD/remote.html#git_repository_open-14" - ] + "general.c": ["ex/v1.9.1/general.html#git_repository_open-75"] } }, + "git_repository_open_from_worktree": { + "type": "function", + "file": "git2/repository.h", + "line": 54, + "lineto": 54, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "Output pointer containing opened repository" + }, + { + "name": "wt", + "type": "git_worktree *", + "comment": "Working tree to open" + } + ], + "argline": "git_repository **out, git_worktree *wt", + "sig": "git_repository **::git_worktree *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Open working tree as a repository

\n", + "comments": "

Open the working directory of the working tree as a normal repository that can then be worked on.

\n", + "group": "repository" + }, "git_repository_wrap_odb": { "type": "function", - "file": "repository.h", - "line": 50, - "lineto": 50, + "file": "git2/repository.h", + "line": 67, + "lineto": 69, "args": [ { "name": "out", @@ -16914,19 +17867,16 @@ ], "argline": "git_repository **out, git_odb *odb", "sig": "git_repository **::git_odb *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Create a "fake" repository to wrap an object database

\n", "comments": "

Create a repository object to wrap an object database to be used with the API when all you have is an object database. This doesn't have any paths associated with it, so use with care.

\n", "group": "repository" }, "git_repository_discover": { "type": "function", - "file": "repository.h", - "line": 78, - "lineto": 82, + "file": "git2/repository.h", + "line": 101, + "lineto": 105, "args": [ { "name": "out", @@ -16951,24 +17901,16 @@ ], "argline": "git_buf *out, const char *start_path, int across_fs, const char *ceiling_dirs", "sig": "git_buf *::const char *::int::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Look for a git repository and copy its path in the given buffer.\n The lookup start from base_path and walk across parent directories\n if nothing has been found. The lookup ends when the first repository\n is found, or when reaching a directory referenced in ceiling_dirs\n or when the filesystem changes (in case across_fs is true).

\n", - "comments": "

The method will automatically detect if the repository is bare (if there is a repository).

\n", - "group": "repository", - "examples": { - "remote.c": [ - "ex/HEAD/remote.html#git_repository_discover-15" - ] - } + "comments": "

The method will automatically detect if the repository is bare (if there is a repository).

\n\n

Note that the libgit2 library must be initialized using git_libgit2_init before any APIs can be called, including this one.

\n", + "group": "repository" }, "git_repository_open_ext": { "type": "function", - "file": "repository.h", - "line": 141, - "lineto": 145, + "file": "git2/repository.h", + "line": 181, + "lineto": 185, "args": [ { "name": "out", @@ -16998,41 +17940,15 @@ "comment": " 0 on success, GIT_ENOTFOUND if no repository could be found,\n or -1 if there was a repository but open failed for some reason\n (such as repo corruption or system errors)." }, "description": "

Find and open a repository with extended controls.

\n", - "comments": "", + "comments": "

Note that the libgit2 library must be initialized using git_libgit2_init before any APIs can be called, including this one.

\n", "group": "repository", - "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_repository_open_ext-24" - ], - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_repository_open_ext-31" - ], - "describe.c": [ - "ex/HEAD/describe.html#git_repository_open_ext-6" - ], - "diff.c": [ - "ex/HEAD/diff.html#git_repository_open_ext-15" - ], - "log.c": [ - "ex/HEAD/log.html#git_repository_open_ext-44", - "ex/HEAD/log.html#git_repository_open_ext-45" - ], - "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_repository_open_ext-16" - ], - "status.c": [ - "ex/HEAD/status.html#git_repository_open_ext-5" - ], - "tag.c": [ - "ex/HEAD/tag.html#git_repository_open_ext-11" - ] - } + "examples": { "log.c": ["ex/v1.9.1/log.html#git_repository_open_ext-43"] } }, "git_repository_open_bare": { "type": "function", - "file": "repository.h", - "line": 158, - "lineto": 158, + "file": "git2/repository.h", + "line": 202, + "lineto": 202, "args": [ { "name": "out", @@ -17047,19 +17963,16 @@ ], "argline": "git_repository **out, const char *bare_path", "sig": "git_repository **::const char *", - "return": { - "type": "int", - "comment": " 0 on success, or an error code" - }, + "return": { "type": "int", "comment": " 0 on success, or an error code" }, "description": "

Open a bare repository on the serverside.

\n", - "comments": "

This is a fast open for bare repositories that will come in handy if you're e.g. hosting git repositories and need to access them efficiently

\n", + "comments": "

This is a fast open for bare repositories that will come in handy if you're e.g. hosting git repositories and need to access them efficiently

\n\n

Note that the libgit2 library must be initialized using git_libgit2_init before any APIs can be called, including this one.

\n", "group": "repository" }, "git_repository_free": { "type": "function", - "file": "repository.h", - "line": 171, - "lineto": 171, + "file": "git2/repository.h", + "line": 215, + "lineto": 215, "args": [ { "name": "repo", @@ -17069,57 +17982,20 @@ ], "argline": "git_repository *repo", "sig": "git_repository *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "void", "comment": null }, "description": "

Free a previously allocated repository

\n", "comments": "

Note that after a repository is free'd, all the objects it has spawned will still exist until they are manually closed by the user with git_object_free, but accessing any of the attributes of an object without a backing repository will result in undefined behavior

\n", "group": "repository", "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_repository_free-25" - ], - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_repository_free-32" - ], - "describe.c": [ - "ex/HEAD/describe.html#git_repository_free-7" - ], - "diff.c": [ - "ex/HEAD/diff.html#git_repository_free-16" - ], - "general.c": [ - "ex/HEAD/general.html#git_repository_free-67" - ], - "init.c": [ - "ex/HEAD/init.html#git_repository_free-6" - ], - "log.c": [ - "ex/HEAD/log.html#git_repository_free-46" - ], - "network/clone.c": [ - "ex/HEAD/network/clone.html#git_repository_free-3" - ], - "network/git2.c": [ - "ex/HEAD/network/git2.html#git_repository_free-6" - ], - "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_repository_free-17" - ], - "status.c": [ - "ex/HEAD/status.html#git_repository_free-6" - ], - "tag.c": [ - "ex/HEAD/tag.html#git_repository_free-12" - ] + "general.c": ["ex/v1.9.1/general.html#git_repository_free-76"], + "init.c": ["ex/v1.9.1/init.html#git_repository_free-4"] } }, "git_repository_init": { "type": "function", - "file": "repository.h", - "line": 188, - "lineto": 191, + "file": "git2/repository.h", + "line": 236, + "lineto": 239, "args": [ { "name": "out", @@ -17139,34 +18015,27 @@ ], "argline": "git_repository **out, const char *path, unsigned int is_bare", "sig": "git_repository **::const char *::unsigned int", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Creates a new Git repository in the given folder.

\n", - "comments": "

TODO: - Reinit the repository

\n", + "comments": "

TODO: - Reinit the repository

\n\n

Note that the libgit2 library must be initialized using git_libgit2_init before any APIs can be called, including this one.

\n", "group": "repository", - "examples": { - "init.c": [ - "ex/HEAD/init.html#git_repository_init-7" - ] - } + "examples": { "init.c": ["ex/v1.9.1/init.html#git_repository_init-5"] } }, - "git_repository_init_init_options": { + "git_repository_init_options_init": { "type": "function", - "file": "repository.h", - "line": 300, - "lineto": 302, + "file": "git2/repository.h", + "line": 405, + "lineto": 407, "args": [ { "name": "opts", "type": "git_repository_init_options *", - "comment": "the `git_repository_init_options` struct to initialize" + "comment": "The `git_repository_init_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_REPOSITORY_INIT_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_REPOSITORY_INIT_OPTIONS_VERSION`." } ], "argline": "git_repository_init_options *opts, unsigned int version", @@ -17175,15 +18044,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_repository_init_options with default values. Equivalent\n to creating an instance with GIT_REPOSITORY_INIT_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_repository_init_options structure

\n", + "comments": "

Initializes a git_repository_init_options with default values. Equivalent to creating an instance with GIT_REPOSITORY_INIT_OPTIONS_INIT.

\n", "group": "repository" }, "git_repository_init_ext": { "type": "function", - "file": "repository.h", - "line": 317, - "lineto": 320, + "file": "git2/repository.h", + "line": 426, + "lineto": 429, "args": [ { "name": "out", @@ -17203,24 +18072,19 @@ ], "argline": "git_repository **out, const char *repo_path, git_repository_init_options *opts", "sig": "git_repository **::const char *::git_repository_init_options *", - "return": { - "type": "int", - "comment": " 0 or an error code on failure." - }, + "return": { "type": "int", "comment": " 0 or an error code on failure." }, "description": "

Create a new Git repository in the given folder with extended controls.

\n", - "comments": "

This will initialize a new git repository (creating the repo_path if requested by flags) and working directory as needed. It will auto-detect the case sensitivity of the file system and if the file system supports file mode bits correctly.

\n", + "comments": "

This will initialize a new git repository (creating the repo_path if requested by flags) and working directory as needed. It will auto-detect the case sensitivity of the file system and if the file system supports file mode bits correctly.

\n\n

Note that the libgit2 library must be initialized using git_libgit2_init before any APIs can be called, including this one.

\n", "group": "repository", "examples": { - "init.c": [ - "ex/HEAD/init.html#git_repository_init_ext-8" - ] + "init.c": ["ex/v1.9.1/init.html#git_repository_init_ext-6"] } }, "git_repository_head": { "type": "function", - "file": "repository.h", - "line": 335, - "lineto": 335, + "file": "git2/repository.h", + "line": 444, + "lineto": 444, "args": [ { "name": "out", @@ -17243,16 +18107,50 @@ "comments": "

The returned git_reference will be owned by caller and git_reference_free() must be called when done with it to release the allocated memory and prevent a leak.

\n", "group": "repository", "examples": { - "status.c": [ - "ex/HEAD/status.html#git_repository_head-7" - ] + "merge.c": [ + "ex/v1.9.1/merge.html#git_repository_head-31", + "ex/v1.9.1/merge.html#git_repository_head-32" + ], + "status.c": ["ex/v1.9.1/status.html#git_repository_head-3"] } }, + "git_repository_head_for_worktree": { + "type": "function", + "file": "git2/repository.h", + "line": 454, + "lineto": 455, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "pointer to the reference which will be retrieved" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "a repository object" + }, + { + "name": "name", + "type": "const char *", + "comment": "name of the worktree to retrieve HEAD for" + } + ], + "argline": "git_reference **out, git_repository *repo, const char *name", + "sig": "git_reference **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 when successful, error-code otherwise" + }, + "description": "

Retrieve the referenced HEAD for the worktree

\n", + "comments": "", + "group": "repository" + }, "git_repository_head_detached": { "type": "function", - "file": "repository.h", - "line": 347, - "lineto": 347, + "file": "git2/repository.h", + "line": 467, + "lineto": 467, "args": [ { "name": "repo", @@ -17270,11 +18168,38 @@ "comments": "

A repository's HEAD is detached when it points directly to a commit instead of a branch.

\n", "group": "repository" }, + "git_repository_head_detached_for_worktree": { + "type": "function", + "file": "git2/repository.h", + "line": 480, + "lineto": 481, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "a repository object" + }, + { + "name": "name", + "type": "const char *", + "comment": "name of the worktree to retrieve HEAD for" + } + ], + "argline": "git_repository *repo, const char *name", + "sig": "git_repository *::const char *", + "return": { + "type": "int", + "comment": " 1 if HEAD is detached, 0 if its not; error code if\n there was an error" + }, + "description": "

Check if a worktree's HEAD is detached

\n", + "comments": "

A worktree's HEAD is detached when it points directly to a commit instead of a branch.

\n", + "group": "repository" + }, "git_repository_head_unborn": { "type": "function", - "file": "repository.h", - "line": 359, - "lineto": 359, + "file": "git2/repository.h", + "line": 493, + "lineto": 493, "args": [ { "name": "repo", @@ -17294,9 +18219,9 @@ }, "git_repository_is_empty": { "type": "function", - "file": "repository.h", - "line": 371, - "lineto": 371, + "file": "git2/repository.h", + "line": 507, + "lineto": 507, "args": [ { "name": "repo", @@ -17311,23 +18236,55 @@ "comment": " 1 if the repository is empty, 0 if it isn't, error code\n if the repository is corrupted" }, "description": "

Check if a repository is empty

\n", - "comments": "

An empty repository has just been initialized and contains no references apart from HEAD, which must be pointing to the unborn master branch.

\n", + "comments": "

An empty repository has just been initialized and contains no references apart from HEAD, which must be pointing to the unborn master branch, or the branch specified for the repository in the init.defaultBranch configuration variable.

\n", + "group": "repository" + }, + "git_repository_item_path": { + "type": "function", + "file": "git2/repository.h", + "line": 545, + "lineto": 545, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Buffer to store the path at" + }, + { + "name": "repo", + "type": "const git_repository *", + "comment": "Repository to get path for" + }, + { + "name": "item", + "type": "git_repository_item_t", + "comment": "The repository item for which to retrieve the path" + } + ], + "argline": "git_buf *out, const git_repository *repo, git_repository_item_t item", + "sig": "git_buf *::const git_repository *::git_repository_item_t", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if the path cannot exist or an error code" + }, + "description": "

Get the location of a specific repository file or directory

\n", + "comments": "

This function will retrieve the path of a specific repository item. It will thereby honor things like the repository's common directory, gitdir, etc. In case a file path cannot exist for a given item (e.g. the working directory of a bare repository), GIT_ENOTFOUND is returned.

\n", "group": "repository" }, "git_repository_path": { "type": "function", - "file": "repository.h", - "line": 382, - "lineto": 382, + "file": "git2/repository.h", + "line": 556, + "lineto": 556, "args": [ { "name": "repo", - "type": "git_repository *", + "type": "const git_repository *", "comment": "A repository object" } ], - "argline": "git_repository *repo", - "sig": "git_repository *", + "argline": "const git_repository *repo", + "sig": "const git_repository *", "return": { "type": "const char *", "comment": " the path to the repository" @@ -17336,28 +18293,24 @@ "comments": "

This is the path of the .git folder for normal repositories, or of the repository itself for bare repositories.

\n", "group": "repository", "examples": { - "init.c": [ - "ex/HEAD/init.html#git_repository_path-9" - ], - "status.c": [ - "ex/HEAD/status.html#git_repository_path-8" - ] + "init.c": ["ex/v1.9.1/init.html#git_repository_path-7"], + "status.c": ["ex/v1.9.1/status.html#git_repository_path-4"] } }, "git_repository_workdir": { "type": "function", - "file": "repository.h", - "line": 393, - "lineto": 393, + "file": "git2/repository.h", + "line": 567, + "lineto": 567, "args": [ { "name": "repo", - "type": "git_repository *", + "type": "const git_repository *", "comment": "A repository object" } ], - "argline": "git_repository *repo", - "sig": "git_repository *", + "argline": "const git_repository *repo", + "sig": "const git_repository *", "return": { "type": "const char *", "comment": " the path to the working dir, if it exists" @@ -17365,17 +18318,35 @@ "description": "

Get the path of the working directory for this repository

\n", "comments": "

If the repository is bare, this function will always return NULL.

\n", "group": "repository", - "examples": { - "init.c": [ - "ex/HEAD/init.html#git_repository_workdir-10" - ] - } + "examples": { "init.c": ["ex/v1.9.1/init.html#git_repository_workdir-8"] } + }, + "git_repository_commondir": { + "type": "function", + "file": "git2/repository.h", + "line": 579, + "lineto": 579, + "args": [ + { + "name": "repo", + "type": "const git_repository *", + "comment": "A repository object" + } + ], + "argline": "const git_repository *repo", + "sig": "const git_repository *", + "return": { + "type": "const char *", + "comment": " the path to the common dir" + }, + "description": "

Get the path of the shared common directory for this repository.

\n", + "comments": "

If the repository is bare, it is the root directory for the repository. If the repository is a worktree, it is the parent repo's gitdir. Otherwise, it is the gitdir.

\n", + "group": "repository" }, "git_repository_set_workdir": { "type": "function", - "file": "repository.h", - "line": 412, - "lineto": 413, + "file": "git2/repository.h", + "line": 598, + "lineto": 599, "args": [ { "name": "repo", @@ -17395,28 +18366,25 @@ ], "argline": "git_repository *repo, const char *workdir, int update_gitlink", "sig": "git_repository *::const char *::int", - "return": { - "type": "int", - "comment": " 0, or an error code" - }, + "return": { "type": "int", "comment": " 0, or an error code" }, "description": "

Set the path to the working directory for this repository

\n", "comments": "

The working directory doesn't need to be the same one that contains the .git folder for this repository.

\n\n

If this repository is bare, setting its working directory will turn it into a normal repository, capable of performing all the common workdir operations (checkout, status, index manipulation, etc).

\n", "group": "repository" }, "git_repository_is_bare": { "type": "function", - "file": "repository.h", - "line": 421, - "lineto": 421, + "file": "git2/repository.h", + "line": 607, + "lineto": 607, "args": [ { "name": "repo", - "type": "git_repository *", + "type": "const git_repository *", "comment": "Repo to test" } ], - "argline": "git_repository *repo", - "sig": "git_repository *", + "argline": "const git_repository *repo", + "sig": "const git_repository *", "return": { "type": "int", "comment": " 1 if the repository is bare, 0 otherwise." @@ -17425,43 +18393,36 @@ "comments": "", "group": "repository", "examples": { - "status.c": [ - "ex/HEAD/status.html#git_repository_is_bare-9" - ] + "status.c": ["ex/v1.9.1/status.html#git_repository_is_bare-5"] } }, - "git_repository_config": { + "git_repository_is_worktree": { "type": "function", - "file": "repository.h", - "line": 437, - "lineto": 437, + "file": "git2/repository.h", + "line": 615, + "lineto": 615, "args": [ - { - "name": "out", - "type": "git_config **", - "comment": "Pointer to store the loaded configuration" - }, { "name": "repo", - "type": "git_repository *", - "comment": "A repository object" + "type": "const git_repository *", + "comment": "Repo to test" } ], - "argline": "git_config **out, git_repository *repo", - "sig": "git_config **::git_repository *", + "argline": "const git_repository *repo", + "sig": "const git_repository *", "return": { "type": "int", - "comment": " 0, or an error code" + "comment": " 1 if the repository is a linked work tree, 0 otherwise." }, - "description": "

Get the configuration file for this repository.

\n", - "comments": "

If a configuration file has not been set, the default config set for the repository will be returned, including global and system configurations (if they are available).

\n\n

The configuration file must be freed once it's no longer being used by the user.

\n", + "description": "

Check if a repository is a linked work tree

\n", + "comments": "", "group": "repository" }, - "git_repository_config_snapshot": { + "git_repository_config": { "type": "function", - "file": "repository.h", - "line": 453, - "lineto": 453, + "file": "git2/repository.h", + "line": 631, + "lineto": 631, "args": [ { "name": "out", @@ -17471,29 +18432,54 @@ { "name": "repo", "type": "git_repository *", - "comment": "the repository" + "comment": "A repository object" } ], "argline": "git_config **out, git_repository *repo", "sig": "git_config **::git_repository *", - "return": { - "type": "int", - "comment": " 0, or an error code" - }, + "return": { "type": "int", "comment": " 0, or an error code" }, + "description": "

Get the configuration file for this repository.

\n", + "comments": "

If a configuration file has not been set, the default config set for the repository will be returned, including global and system configurations (if they are available).

\n\n

The configuration file must be freed once it's no longer being used by the user.

\n", + "group": "repository", + "examples": { + "config.c": ["ex/v1.9.1/config.html#git_repository_config-9"] + } + }, + "git_repository_config_snapshot": { + "type": "function", + "file": "git2/repository.h", + "line": 647, + "lineto": 647, + "args": [ + { + "name": "out", + "type": "git_config **", + "comment": "Pointer to store the loaded configuration" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + } + ], + "argline": "git_config **out, git_repository *repo", + "sig": "git_config **::git_repository *", + "return": { "type": "int", "comment": " 0, or an error code" }, "description": "

Get a snapshot of the repository's configuration

\n", "comments": "

Convenience function to take a snapshot from the repository's configuration. The contents of this snapshot will not change, even if the underlying config files are modified.

\n\n

The configuration file must be freed once it's no longer being used by the user.

\n", "group": "repository", "examples": { "general.c": [ - "ex/HEAD/general.html#git_repository_config_snapshot-68" + "ex/v1.9.1/general.html#git_repository_config_snapshot-77", + "ex/v1.9.1/general.html#git_repository_config_snapshot-78" ] } }, "git_repository_odb": { "type": "function", - "file": "repository.h", - "line": 469, - "lineto": 469, + "file": "git2/repository.h", + "line": 663, + "lineto": 663, "args": [ { "name": "out", @@ -17508,27 +18494,20 @@ ], "argline": "git_odb **out, git_repository *repo", "sig": "git_odb **::git_repository *", - "return": { - "type": "int", - "comment": " 0, or an error code" - }, + "return": { "type": "int", "comment": " 0, or an error code" }, "description": "

Get the Object Database for this repository.

\n", "comments": "

If a custom ODB has not been set, the default database for the repository will be returned (the one located in .git/objects).

\n\n

The ODB must be freed once it's no longer being used by the user.

\n", "group": "repository", "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_repository_odb-33" - ], - "general.c": [ - "ex/HEAD/general.html#git_repository_odb-69" - ] + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_repository_odb-29"], + "general.c": ["ex/v1.9.1/general.html#git_repository_odb-79"] } }, "git_repository_refdb": { "type": "function", - "file": "repository.h", - "line": 485, - "lineto": 485, + "file": "git2/repository.h", + "line": 679, + "lineto": 679, "args": [ { "name": "out", @@ -17543,19 +18522,16 @@ ], "argline": "git_refdb **out, git_repository *repo", "sig": "git_refdb **::git_repository *", - "return": { - "type": "int", - "comment": " 0, or an error code" - }, + "return": { "type": "int", "comment": " 0, or an error code" }, "description": "

Get the Reference Database Backend for this repository.

\n", "comments": "

If a custom refsdb has not been set, the default database for the repository will be returned (the one that manipulates loose and packed references in the .git directory).

\n\n

The refdb must be freed once it's no longer being used by the user.

\n", "group": "repository" }, "git_repository_index": { "type": "function", - "file": "repository.h", - "line": 501, - "lineto": 501, + "file": "git2/repository.h", + "line": 695, + "lineto": 695, "args": [ { "name": "out", @@ -17570,27 +18546,24 @@ ], "argline": "git_index **out, git_repository *repo", "sig": "git_index **::git_repository *", - "return": { - "type": "int", - "comment": " 0, or an error code" - }, + "return": { "type": "int", "comment": " 0, or an error code" }, "description": "

Get the Index file for this repository.

\n", "comments": "

If a custom index has not been set, the default index for the repository will be returned (the one located in .git/index).

\n\n

The index must be freed once it's no longer being used by the user.

\n", "group": "repository", "examples": { - "general.c": [ - "ex/HEAD/general.html#git_repository_index-70" - ], - "init.c": [ - "ex/HEAD/init.html#git_repository_index-11" - ] + "add.c": ["ex/v1.9.1/add.html#git_repository_index-5"], + "commit.c": ["ex/v1.9.1/commit.html#git_repository_index-8"], + "general.c": ["ex/v1.9.1/general.html#git_repository_index-80"], + "init.c": ["ex/v1.9.1/init.html#git_repository_index-9"], + "ls-files.c": ["ex/v1.9.1/ls-files.html#git_repository_index-5"], + "merge.c": ["ex/v1.9.1/merge.html#git_repository_index-33"] } }, "git_repository_message": { "type": "function", - "file": "repository.h", - "line": 519, - "lineto": 519, + "file": "git2/repository.h", + "line": 713, + "lineto": 713, "args": [ { "name": "out", @@ -17615,31 +18588,28 @@ }, "git_repository_message_remove": { "type": "function", - "file": "repository.h", - "line": 526, - "lineto": 526, + "file": "git2/repository.h", + "line": 723, + "lineto": 723, "args": [ { "name": "repo", "type": "git_repository *", - "comment": null + "comment": "Repository to remove prepared message from." } ], "argline": "git_repository *repo", "sig": "git_repository *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Remove git's prepared message.

\n", "comments": "

Remove the message that git_repository_message retrieves.

\n", "group": "repository" }, "git_repository_state_cleanup": { "type": "function", - "file": "repository.h", - "line": 535, - "lineto": 535, + "file": "git2/repository.h", + "line": 732, + "lineto": 732, "args": [ { "name": "repo", @@ -17649,19 +18619,19 @@ ], "argline": "git_repository *repo", "sig": "git_repository *", - "return": { - "type": "int", - "comment": " 0 on success, or error" - }, + "return": { "type": "int", "comment": " 0 on success, or error" }, "description": "

Remove all the metadata associated with an ongoing command like merge,\n revert, cherry-pick, etc. For example: MERGE_HEAD, MERGE_MSG, etc.

\n", "comments": "", - "group": "repository" + "group": "repository", + "examples": { + "merge.c": ["ex/v1.9.1/merge.html#git_repository_state_cleanup-34"] + } }, "git_repository_fetchhead_foreach": { "type": "function", - "file": "repository.h", - "line": 554, - "lineto": 557, + "file": "git2/repository.h", + "line": 763, + "lineto": 766, "args": [ { "name": "repo", @@ -17691,9 +18661,9 @@ }, "git_repository_mergehead_foreach": { "type": "function", - "file": "repository.h", - "line": 574, - "lineto": 577, + "file": "git2/repository.h", + "line": 792, + "lineto": 795, "args": [ { "name": "repo", @@ -17723,9 +18693,9 @@ }, "git_repository_hashfile": { "type": "function", - "file": "repository.h", - "line": 602, - "lineto": 607, + "file": "git2/repository.h", + "line": 822, + "lineto": 827, "args": [ { "name": "out", @@ -17740,34 +18710,31 @@ { "name": "path", "type": "const char *", - "comment": "Path to file on disk whose contents should be hashed. If the\n repository is not NULL, this can be a relative path." + "comment": "Path to file on disk whose contents should be hashed. This\n may be an absolute path or a relative path, in which case it\n will be treated as a path within the working directory." }, { "name": "type", - "type": "git_otype", - "comment": "The object type to hash as (e.g. GIT_OBJ_BLOB)" + "type": "git_object_t", + "comment": "The object type to hash as (e.g. GIT_OBJECT_BLOB)" }, { "name": "as_path", "type": "const char *", - "comment": "The path to use to look up filtering rules. If this is\n NULL, then the `path` parameter will be used instead. If\n this is passed as the empty string, then no filters will be\n applied when calculating the hash." + "comment": "The path to use to look up filtering rules. If this is\n an empty string then no filters will be applied when\n calculating the hash. If this is `NULL` and the `path`\n parameter is a file within the repository's working\n directory, then the `path` will be used." } ], - "argline": "git_oid *out, git_repository *repo, const char *path, git_otype type, const char *as_path", - "sig": "git_oid *::git_repository *::const char *::git_otype::const char *", - "return": { - "type": "int", - "comment": " 0 on success, or an error code" - }, + "argline": "git_oid *out, git_repository *repo, const char *path, git_object_t type, const char *as_path", + "sig": "git_oid *::git_repository *::const char *::git_object_t::const char *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, "description": "

Calculate hash of file using repository filtering rules.

\n", "comments": "

If you simply want to calculate the hash of a file on disk with no filters, you can just use the git_odb_hashfile() API. However, if you want to hash a file in the repository and you want to apply filtering rules (e.g. crlf filters) before generating the SHA, then use this function.

\n\n

Note: if the repository has core.safecrlf set to fail and the filtering triggers that failure, then this function will return an error and not calculate the hash of the file.

\n", "group": "repository" }, "git_repository_set_head": { "type": "function", - "file": "repository.h", - "line": 627, - "lineto": 629, + "file": "git2/repository.h", + "line": 847, + "lineto": 849, "args": [ { "name": "repo", @@ -17782,19 +18749,19 @@ ], "argline": "git_repository *repo, const char *refname", "sig": "git_repository *::const char *", - "return": { - "type": "int", - "comment": " 0 on success, or an error code" - }, + "return": { "type": "int", "comment": " 0 on success, or an error code" }, "description": "

Make the repository HEAD point to the specified reference.

\n", "comments": "

If the provided reference points to a Tree or a Blob, the HEAD is unaltered and -1 is returned.

\n\n

If the provided reference points to a branch, the HEAD will point to that branch, staying attached, or become attached if it isn't yet. If the branch doesn't exist yet, no error will be return. The HEAD will then be attached to an unborn branch.

\n\n

Otherwise, the HEAD will be detached and will directly point to the Commit.

\n", - "group": "repository" + "group": "repository", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_repository_set_head-23"] + } }, "git_repository_set_head_detached": { "type": "function", - "file": "repository.h", - "line": 647, - "lineto": 649, + "file": "git2/repository.h", + "line": 867, + "lineto": 869, "args": [ { "name": "repo", @@ -17802,53 +18769,52 @@ "comment": "Repository pointer" }, { - "name": "commitish", + "name": "committish", "type": "const git_oid *", "comment": "Object id of the Commit the HEAD should point to" } ], - "argline": "git_repository *repo, const git_oid *commitish", + "argline": "git_repository *repo, const git_oid *committish", "sig": "git_repository *::const git_oid *", - "return": { - "type": "int", - "comment": " 0 on success, or an error code" - }, + "return": { "type": "int", "comment": " 0 on success, or an error code" }, "description": "

Make the repository HEAD directly point to the Commit.

\n", - "comments": "

If the provided committish cannot be found in the repository, the HEAD is unaltered and GIT_ENOTFOUND is returned.

\n\n

If the provided commitish cannot be peeled into a commit, the HEAD is unaltered and -1 is returned.

\n\n

Otherwise, the HEAD will eventually be detached and will directly point to the peeled Commit.

\n", + "comments": "

If the provided committish cannot be found in the repository, the HEAD is unaltered and GIT_ENOTFOUND is returned.

\n\n

If the provided committish cannot be peeled into a commit, the HEAD is unaltered and -1 is returned.

\n\n

Otherwise, the HEAD will eventually be detached and will directly point to the peeled Commit.

\n", "group": "repository" }, "git_repository_set_head_detached_from_annotated": { "type": "function", - "file": "repository.h", - "line": 663, - "lineto": 665, + "file": "git2/repository.h", + "line": 885, + "lineto": 887, "args": [ { "name": "repo", "type": "git_repository *", - "comment": null + "comment": "Repository pointer" }, { - "name": "commitish", + "name": "committish", "type": "const git_annotated_commit *", - "comment": null + "comment": "annotated commit to point HEAD to" } ], - "argline": "git_repository *repo, const git_annotated_commit *commitish", + "argline": "git_repository *repo, const git_annotated_commit *committish", "sig": "git_repository *::const git_annotated_commit *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 on success, or an error code" }, "description": "

Make the repository HEAD directly point to the Commit.

\n", "comments": "

This behaves like git_repository_set_head_detached() but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages.

\n\n

See the documentation for git_repository_set_head_detached().

\n", - "group": "repository" + "group": "repository", + "examples": { + "checkout.c": [ + "ex/v1.9.1/checkout.html#git_repository_set_head_detached_from_annotated-24" + ] + } }, "git_repository_detach_head": { "type": "function", - "file": "repository.h", - "line": 684, - "lineto": 685, + "file": "git2/repository.h", + "line": 906, + "lineto": 907, "args": [ { "name": "repo", @@ -17863,14 +18829,14 @@ "comment": " 0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing\n branch or an error code" }, "description": "

Detach the HEAD.

\n", - "comments": "

If the HEAD is already detached and points to a Commit, 0 is returned.

\n\n

If the HEAD is already detached and points to a Tag, the HEAD is updated into making it point to the peeled Commit, and 0 is returned.

\n\n

If the HEAD is already detached and points to a non commitish, the HEAD is unaltered, and -1 is returned.

\n\n

Otherwise, the HEAD will be detached and point to the peeled Commit.

\n", + "comments": "

If the HEAD is already detached and points to a Commit, 0 is returned.

\n\n

If the HEAD is already detached and points to a Tag, the HEAD is updated into making it point to the peeled Commit, and 0 is returned.

\n\n

If the HEAD is already detached and points to a non committish, the HEAD is unaltered, and -1 is returned.

\n\n

Otherwise, the HEAD will be detached and point to the peeled Commit.

\n", "group": "repository" }, "git_repository_state": { "type": "function", - "file": "repository.h", - "line": 715, - "lineto": 715, + "file": "git2/repository.h", + "line": 937, + "lineto": 937, "args": [ { "name": "repo", @@ -17880,25 +18846,22 @@ ], "argline": "git_repository *repo", "sig": "git_repository *", - "return": { - "type": "int", - "comment": " The state of the repository" - }, + "return": { "type": "int", "comment": " The state of the repository" }, "description": "

Determines the status of a git repository - ie, whether an operation\n (merge, cherry-pick, etc) is in progress.

\n", "comments": "", - "group": "repository" + "group": "repository", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_repository_state-25"], + "merge.c": ["ex/v1.9.1/merge.html#git_repository_state-35"] + } }, "git_repository_set_namespace": { "type": "function", - "file": "repository.h", - "line": 729, - "lineto": 729, + "file": "git2/repository.h", + "line": 951, + "lineto": 951, "args": [ - { - "name": "repo", - "type": "git_repository *", - "comment": "The repo" - }, + { "name": "repo", "type": "git_repository *", "comment": "The repo" }, { "name": "nmspace", "type": "const char *", @@ -17907,25 +18870,18 @@ ], "argline": "git_repository *repo, const char *nmspace", "sig": "git_repository *::const char *", - "return": { - "type": "int", - "comment": " 0 on success, -1 on error" - }, + "return": { "type": "int", "comment": " 0 on success, -1 on error" }, "description": "

Sets the active namespace for this Git Repository

\n", "comments": "

This namespace affects all reference operations for the repo. See man gitnamespaces

\n", "group": "repository" }, "git_repository_get_namespace": { "type": "function", - "file": "repository.h", - "line": 737, - "lineto": 737, + "file": "git2/repository.h", + "line": 959, + "lineto": 959, "args": [ - { - "name": "repo", - "type": "git_repository *", - "comment": "The repo" - } + { "name": "repo", "type": "git_repository *", "comment": "The repo" } ], "argline": "git_repository *repo", "sig": "git_repository *", @@ -17939,9 +18895,9 @@ }, "git_repository_is_shallow": { "type": "function", - "file": "repository.h", - "line": 746, - "lineto": 746, + "file": "git2/repository.h", + "line": 968, + "lineto": 968, "args": [ { "name": "repo", @@ -17951,19 +18907,16 @@ ], "argline": "git_repository *repo", "sig": "git_repository *", - "return": { - "type": "int", - "comment": " 1 if shallow, zero if not" - }, + "return": { "type": "int", "comment": " 1 if shallow, zero if not" }, "description": "

Determine if the repository was a shallow clone

\n", "comments": "", "group": "repository" }, "git_repository_ident": { "type": "function", - "file": "repository.h", - "line": 758, - "lineto": 758, + "file": "git2/repository.h", + "line": 981, + "lineto": 981, "args": [ { "name": "name", @@ -17983,19 +18936,16 @@ ], "argline": "const char **name, const char **email, const git_repository *repo", "sig": "const char **::const char **::const git_repository *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Retrieve the configured identity to use for reflogs

\n", "comments": "

The memory is owned by the repository and must not be freed by the user.

\n", "group": "repository" }, "git_repository_set_ident": { "type": "function", - "file": "repository.h", - "line": 771, - "lineto": 771, + "file": "git2/repository.h", + "line": 995, + "lineto": 995, "args": [ { "name": "repo", @@ -18015,17 +18965,57 @@ ], "argline": "git_repository *repo, const char *name, const char *email", "sig": "git_repository *::const char *::const char *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Set the identity to be used for writing reflogs

\n", "comments": "

If both are set, this name and email will be used to write to the reflog. Pass NULL to unset. When unset, the identity will be taken from the repository's configuration.

\n", "group": "repository" }, + "git_repository_oid_type": { + "type": "function", + "file": "git2/repository.h", + "line": 1003, + "lineto": 1003, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { "type": "git_oid_t", "comment": " the object id type" }, + "description": "

Gets the object type used by this repository.

\n", + "comments": "", + "group": "repository" + }, + "git_repository_commit_parents": { + "type": "function", + "file": "git2/repository.h", + "line": 1014, + "lineto": 1014, + "args": [ + { + "name": "commits", + "type": "git_commitarray *", + "comment": "a `git_commitarray` that will contain the commit parents" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + } + ], + "argline": "git_commitarray *commits, git_repository *repo", + "sig": "git_commitarray *::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Gets the parents of the next commit, given the current repository state.\n Generally, this is the HEAD commit, except when performing a merge, in\n which case it is two or more commits.

\n", + "comments": "", + "group": "repository" + }, "git_reset": { "type": "function", - "file": "reset.h", + "file": "git2/reset.h", "line": 62, "lineto": 66, "args": [ @@ -18036,8 +19026,8 @@ }, { "name": "target", - "type": "git_object *", - "comment": "Committish to which the Head should be moved to. This object\n must belong to the given `repo` and can either be a git_commit or a\n git_tag. When a git_tag is being passed, it should be dereferencable\n to a git_commit which oid will be used as the target of the branch." + "type": "const git_object *", + "comment": "Committish to which the Head should be moved to. This object\n must belong to the given `repo` and can either be a git_commit or a\n git_tag. When a git_tag is being passed, it should be dereferenceable\n to a git_commit which oid will be used as the target of the branch." }, { "name": "reset_type", @@ -18050,58 +19040,52 @@ "comment": "Optional checkout options to be used for a HARD reset.\n The checkout_strategy field will be overridden (based on reset_type).\n This parameter can be used to propagate notify and progress callbacks." } ], - "argline": "git_repository *repo, git_object *target, git_reset_t reset_type, const git_checkout_options *checkout_opts", - "sig": "git_repository *::git_object *::git_reset_t::const git_checkout_options *", - "return": { - "type": "int", - "comment": " 0 on success or an error code" - }, + "argline": "git_repository *repo, const git_object *target, git_reset_t reset_type, const git_checkout_options *checkout_opts", + "sig": "git_repository *::const git_object *::git_reset_t::const git_checkout_options *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, "description": "

Sets the current head to the specified commit oid and optionally\n resets the index and working tree to match.

\n", "comments": "

SOFT reset means the Head will be moved to the commit.

\n\n

MIXED reset will trigger a SOFT reset, plus the index will be replaced with the content of the commit tree.

\n\n

HARD reset will trigger a MIXED reset and the working directory will be replaced with the content of the index. (Untracked and ignored files will be left alone, however.)

\n\n

TODO: Implement remaining kinds of resets.

\n", "group": "reset" }, "git_reset_from_annotated": { "type": "function", - "file": "reset.h", - "line": 80, - "lineto": 84, + "file": "git2/reset.h", + "line": 92, + "lineto": 96, "args": [ { "name": "repo", "type": "git_repository *", - "comment": null + "comment": "Repository where to perform the reset operation." }, { - "name": "commit", - "type": "git_annotated_commit *", - "comment": null + "name": "target", + "type": "const git_annotated_commit *", + "comment": "Annotated commit to which the Head should be moved to.\n This object must belong to the given `repo`, it will be dereferenced\n to a git_commit which oid will be used as the target of the branch." }, { "name": "reset_type", "type": "git_reset_t", - "comment": null + "comment": "Kind of reset operation to perform." }, { "name": "checkout_opts", "type": "const git_checkout_options *", - "comment": null + "comment": "Optional checkout options to be used for a HARD reset.\n The checkout_strategy field will be overridden (based on reset_type).\n This parameter can be used to propagate notify and progress callbacks." } ], - "argline": "git_repository *repo, git_annotated_commit *commit, git_reset_t reset_type, const git_checkout_options *checkout_opts", - "sig": "git_repository *::git_annotated_commit *::git_reset_t::const git_checkout_options *", - "return": { - "type": "int", - "comment": null - }, + "argline": "git_repository *repo, const git_annotated_commit *target, git_reset_t reset_type, const git_checkout_options *checkout_opts", + "sig": "git_repository *::const git_annotated_commit *::git_reset_t::const git_checkout_options *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, "description": "

Sets the current head to the specified commit oid and optionally\n resets the index and working tree to match.

\n", "comments": "

This behaves like git_reset() but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages.

\n\n

See the documentation for git_reset().

\n", "group": "reset" }, "git_reset_default": { "type": "function", - "file": "reset.h", - "line": 104, - "lineto": 107, + "file": "git2/reset.h", + "line": 116, + "lineto": 119, "args": [ { "name": "repo", @@ -18110,17 +19094,17 @@ }, { "name": "target", - "type": "git_object *", + "type": "const git_object *", "comment": "The committish which content will be used to reset the content\n of the index." }, { "name": "pathspecs", - "type": "git_strarray *", + "type": "const git_strarray *", "comment": "List of pathspecs to operate on." } ], - "argline": "git_repository *repo, git_object *target, git_strarray *pathspecs", - "sig": "git_repository *::git_object *::git_strarray *", + "argline": "git_repository *repo, const git_object *target, const git_strarray *pathspecs", + "sig": "git_repository *::const git_object *::const git_strarray *", "return": { "type": "int", "comment": " 0 on success or an error code \n<\n 0" @@ -18129,21 +19113,21 @@ "comments": "

The scope of the updated entries is determined by the paths being passed in the pathspec parameters.

\n\n

Passing a NULL target will result in removing entries in the index matching the provided pathspecs.

\n", "group": "reset" }, - "git_revert_init_options": { + "git_revert_options_init": { "type": "function", - "file": "revert.h", - "line": 47, - "lineto": 49, + "file": "git2/revert.h", + "line": 54, + "lineto": 56, "args": [ { "name": "opts", "type": "git_revert_options *", - "comment": "the `git_revert_options` struct to initialize" + "comment": "The `git_revert_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_REVERT_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_REVERT_OPTIONS_VERSION`." } ], "argline": "git_revert_options *opts, unsigned int version", @@ -18152,15 +19136,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_revert_options with default values. Equivalent to\n creating an instance with GIT_REVERT_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_revert_options structure

\n", + "comments": "

Initializes a git_revert_options with default values. Equivalent to creating an instance with GIT_REVERT_OPTIONS_INIT.

\n", "group": "revert" }, "git_revert_commit": { "type": "function", - "file": "revert.h", - "line": 65, - "lineto": 71, + "file": "git2/revert.h", + "line": 72, + "lineto": 78, "args": [ { "name": "out", @@ -18205,9 +19189,9 @@ }, "git_revert": { "type": "function", - "file": "revert.h", - "line": 81, - "lineto": 84, + "file": "git2/revert.h", + "line": 88, + "lineto": 91, "args": [ { "name": "repo", @@ -18237,7 +19221,7 @@ }, "git_revparse_single": { "type": "function", - "file": "revparse.h", + "file": "git2/revparse.h", "line": 37, "lineto": 38, "args": [ @@ -18267,29 +19251,21 @@ "comments": "

See man gitrevisions, or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for information on the syntax accepted.

\n\n

The returned object should be released with git_object_free when no longer needed.

\n", "group": "revparse", "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_revparse_single-26" - ], - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_revparse_single-34" - ], - "describe.c": [ - "ex/HEAD/describe.html#git_revparse_single-8" - ], - "log.c": [ - "ex/HEAD/log.html#git_revparse_single-47" - ], + "blame.c": ["ex/v1.9.1/blame.html#git_revparse_single-21"], + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_revparse_single-30"], + "describe.c": ["ex/v1.9.1/describe.html#git_revparse_single-6"], + "log.c": ["ex/v1.9.1/log.html#git_revparse_single-44"], "tag.c": [ - "ex/HEAD/tag.html#git_revparse_single-13", - "ex/HEAD/tag.html#git_revparse_single-14", - "ex/HEAD/tag.html#git_revparse_single-15", - "ex/HEAD/tag.html#git_revparse_single-16" + "ex/v1.9.1/tag.html#git_revparse_single-9", + "ex/v1.9.1/tag.html#git_revparse_single-10", + "ex/v1.9.1/tag.html#git_revparse_single-11", + "ex/v1.9.1/tag.html#git_revparse_single-12" ] } }, "git_revparse_ext": { "type": "function", - "file": "revparse.h", + "file": "git2/revparse.h", "line": 61, "lineto": 65, "args": [ @@ -18322,11 +19298,12 @@ }, "description": "

Find a single object and intermediate reference by a revision string.

\n", "comments": "

See man gitrevisions, or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for information on the syntax accepted.

\n\n

In some cases (@{<-n>} or <branchname>@{upstream}), the expression may point to an intermediate reference. When such expressions are being passed in, reference_out will be valued as well.

\n\n

The returned object should be released with git_object_free and the returned reference with git_reference_free when no longer needed.

\n", - "group": "revparse" + "group": "revparse", + "examples": { "commit.c": ["ex/v1.9.1/commit.html#git_revparse_ext-9"] } }, "git_revparse": { "type": "function", - "file": "revparse.h", + "file": "git2/revparse.h", "line": 105, "lineto": 108, "args": [ @@ -18356,21 +19333,17 @@ "comments": "

See man gitrevisions or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for information on the syntax accepted.

\n", "group": "revparse", "examples": { - "blame.c": [ - "ex/HEAD/blame.html#git_revparse-27" - ], - "log.c": [ - "ex/HEAD/log.html#git_revparse-48" - ], + "blame.c": ["ex/v1.9.1/blame.html#git_revparse-22"], + "log.c": ["ex/v1.9.1/log.html#git_revparse-45"], "rev-parse.c": [ - "ex/HEAD/rev-parse.html#git_revparse-18", - "ex/HEAD/rev-parse.html#git_revparse-19" + "ex/v1.9.1/rev-parse.html#git_revparse-14", + "ex/v1.9.1/rev-parse.html#git_revparse-15" ] } }, "git_revwalk_new": { "type": "function", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 73, "lineto": 73, "args": [ @@ -18387,28 +19360,23 @@ ], "argline": "git_revwalk **out, git_repository *repo", "sig": "git_revwalk **::git_repository *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Allocate a new revision walker to iterate through a repo.

\n", "comments": "

This revision walker uses a custom memory pool and an internal commit cache, so it is relatively expensive to allocate.

\n\n

For maximum performance, this revision walker should be reused for different walks.

\n\n

This revision walker is not thread safe: it may only be used to walk a repository on a single thread; however, it is possible to have several revision walkers in several different threads walking the same repository.

\n", "group": "revwalk", "examples": { - "general.c": [ - "ex/HEAD/general.html#git_revwalk_new-71" - ], + "general.c": ["ex/v1.9.1/general.html#git_revwalk_new-81"], "log.c": [ - "ex/HEAD/log.html#git_revwalk_new-49", - "ex/HEAD/log.html#git_revwalk_new-50" + "ex/v1.9.1/log.html#git_revwalk_new-46", + "ex/v1.9.1/log.html#git_revwalk_new-47" ] } }, "git_revwalk_reset": { "type": "function", - "file": "revwalk.h", - "line": 88, - "lineto": 88, + "file": "git2/revwalk.h", + "line": 89, + "lineto": 89, "args": [ { "name": "walker", @@ -18418,19 +19386,16 @@ ], "argline": "git_revwalk *walker", "sig": "git_revwalk *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Reset the revision walker for reuse.

\n", "comments": "

This will clear all the pushed and hidden commits, and leave the walker in a blank state (just like at creation) ready to receive new commit pushes and start a new walk.

\n\n

The revision walk is automatically reset when a walk is over.

\n", "group": "revwalk" }, "git_revwalk_push": { "type": "function", - "file": "revwalk.h", - "line": 107, - "lineto": 107, + "file": "git2/revwalk.h", + "line": 108, + "lineto": 108, "args": [ { "name": "walk", @@ -18445,27 +19410,20 @@ ], "argline": "git_revwalk *walk, const git_oid *id", "sig": "git_revwalk *::const git_oid *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Add a new root for the traversal

\n", "comments": "

The pushed commit will be marked as one of the roots from which to start the walk. This commit may not be walked if it or a child is hidden.

\n\n

At least one commit must be pushed onto the walker before a walk can be started.

\n\n

The given id must belong to a committish on the walked repository.

\n", "group": "revwalk", "examples": { - "general.c": [ - "ex/HEAD/general.html#git_revwalk_push-72" - ], - "log.c": [ - "ex/HEAD/log.html#git_revwalk_push-51" - ] + "general.c": ["ex/v1.9.1/general.html#git_revwalk_push-82"], + "log.c": ["ex/v1.9.1/log.html#git_revwalk_push-48"] } }, "git_revwalk_push_glob": { "type": "function", - "file": "revwalk.h", - "line": 125, - "lineto": 125, + "file": "git2/revwalk.h", + "line": 126, + "lineto": 126, "args": [ { "name": "walk", @@ -18480,19 +19438,16 @@ ], "argline": "git_revwalk *walk, const char *glob", "sig": "git_revwalk *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Push matching references

\n", "comments": "

The OIDs pointed to by the references that match the given glob pattern will be pushed to the revision walker.

\n\n

A leading 'refs/' is implied if not present as well as a trailing '/*' if the glob lacks '?', '*' or '['.

\n\n

Any references matching this glob which do not point to a committish will be ignored.

\n", "group": "revwalk" }, "git_revwalk_push_head": { "type": "function", - "file": "revwalk.h", - "line": 133, - "lineto": 133, + "file": "git2/revwalk.h", + "line": 134, + "lineto": 134, "args": [ { "name": "walk", @@ -18502,24 +19457,17 @@ ], "argline": "git_revwalk *walk", "sig": "git_revwalk *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Push the repository's HEAD

\n", "comments": "", "group": "revwalk", - "examples": { - "log.c": [ - "ex/HEAD/log.html#git_revwalk_push_head-52" - ] - } + "examples": { "log.c": ["ex/v1.9.1/log.html#git_revwalk_push_head-49"] } }, "git_revwalk_hide": { "type": "function", - "file": "revwalk.h", - "line": 148, - "lineto": 148, + "file": "git2/revwalk.h", + "line": 149, + "lineto": 149, "args": [ { "name": "walk", @@ -18534,25 +19482,18 @@ ], "argline": "git_revwalk *walk, const git_oid *commit_id", "sig": "git_revwalk *::const git_oid *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Mark a commit (and its ancestors) uninteresting for the output.

\n", "comments": "

The given id must belong to a committish on the walked repository.

\n\n

The resolved commit and all its parents will be hidden from the output on the revision walk.

\n", "group": "revwalk", - "examples": { - "log.c": [ - "ex/HEAD/log.html#git_revwalk_hide-53" - ] - } + "examples": { "log.c": ["ex/v1.9.1/log.html#git_revwalk_hide-50"] } }, "git_revwalk_hide_glob": { "type": "function", - "file": "revwalk.h", - "line": 167, - "lineto": 167, - "args": [ + "file": "git2/revwalk.h", + "line": 168, + "lineto": 168, + "args": [ { "name": "walk", "type": "git_revwalk *", @@ -18566,19 +19507,16 @@ ], "argline": "git_revwalk *walk, const char *glob", "sig": "git_revwalk *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Hide matching references.

\n", "comments": "

The OIDs pointed to by the references that match the given glob pattern and their ancestors will be hidden from the output on the revision walk.

\n\n

A leading 'refs/' is implied if not present as well as a trailing '/*' if the glob lacks '?', '*' or '['.

\n\n

Any references matching this glob which do not point to a committish will be ignored.

\n", "group": "revwalk" }, "git_revwalk_hide_head": { "type": "function", - "file": "revwalk.h", - "line": 175, - "lineto": 175, + "file": "git2/revwalk.h", + "line": 176, + "lineto": 176, "args": [ { "name": "walk", @@ -18588,19 +19526,16 @@ ], "argline": "git_revwalk *walk", "sig": "git_revwalk *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Hide the repository's HEAD

\n", "comments": "", "group": "revwalk" }, "git_revwalk_push_ref": { "type": "function", - "file": "revwalk.h", - "line": 186, - "lineto": 186, + "file": "git2/revwalk.h", + "line": 187, + "lineto": 187, "args": [ { "name": "walk", @@ -18615,19 +19550,16 @@ ], "argline": "git_revwalk *walk, const char *refname", "sig": "git_revwalk *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Push the OID pointed to by a reference

\n", "comments": "

The reference must point to a committish.

\n", "group": "revwalk" }, "git_revwalk_hide_ref": { "type": "function", - "file": "revwalk.h", - "line": 197, - "lineto": 197, + "file": "git2/revwalk.h", + "line": 198, + "lineto": 198, "args": [ { "name": "walk", @@ -18642,19 +19574,16 @@ ], "argline": "git_revwalk *walk, const char *refname", "sig": "git_revwalk *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Hide the OID pointed to by a reference

\n", "comments": "

The reference must point to a committish.

\n", "group": "revwalk" }, "git_revwalk_next": { "type": "function", - "file": "revwalk.h", - "line": 217, - "lineto": 217, + "file": "git2/revwalk.h", + "line": 218, + "lineto": 218, "args": [ { "name": "out", @@ -18677,19 +19606,15 @@ "comments": "

The initial call to this method is not blocking when iterating through a repo with a time-sorting mode.

\n\n

Iterating with Topological or inverted modes makes the initial call blocking to preprocess the commit list, but this block should be mostly unnoticeable on most repositories (topological preprocessing times at 0.3s on the git.git repo).

\n\n

The revision walker is reset when the walk is over.

\n", "group": "revwalk", "examples": { - "general.c": [ - "ex/HEAD/general.html#git_revwalk_next-73" - ], - "log.c": [ - "ex/HEAD/log.html#git_revwalk_next-54" - ] + "general.c": ["ex/v1.9.1/general.html#git_revwalk_next-83"], + "log.c": ["ex/v1.9.1/log.html#git_revwalk_next-51"] } }, "git_revwalk_sorting": { "type": "function", - "file": "revwalk.h", - "line": 228, - "lineto": 228, + "file": "git2/revwalk.h", + "line": 230, + "lineto": 230, "args": [ { "name": "walk", @@ -18704,77 +19629,62 @@ ], "argline": "git_revwalk *walk, unsigned int sort_mode", "sig": "git_revwalk *::unsigned int", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Change the sorting mode when iterating through the\n repository's contents.

\n", "comments": "

Changing the sorting mode resets the walker.

\n", "group": "revwalk", "examples": { - "general.c": [ - "ex/HEAD/general.html#git_revwalk_sorting-74" - ], + "general.c": ["ex/v1.9.1/general.html#git_revwalk_sorting-84"], "log.c": [ - "ex/HEAD/log.html#git_revwalk_sorting-55", - "ex/HEAD/log.html#git_revwalk_sorting-56" + "ex/v1.9.1/log.html#git_revwalk_sorting-52", + "ex/v1.9.1/log.html#git_revwalk_sorting-53" ] } }, "git_revwalk_push_range": { "type": "function", - "file": "revwalk.h", - "line": 243, - "lineto": 243, + "file": "git2/revwalk.h", + "line": 245, + "lineto": 245, "args": [ { "name": "walk", "type": "git_revwalk *", "comment": "the walker being used for the traversal" }, - { - "name": "range", - "type": "const char *", - "comment": "the range" - } + { "name": "range", "type": "const char *", "comment": "the range" } ], "argline": "git_revwalk *walk, const char *range", "sig": "git_revwalk *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Push and hide the respective endpoints of the given range.

\n", "comments": "

The range should be of the form .. where each is in the form accepted by 'git_revparse_single'. The left-hand commit will be hidden and the right-hand commit pushed.

\n", "group": "revwalk" }, "git_revwalk_simplify_first_parent": { "type": "function", - "file": "revwalk.h", - "line": 250, - "lineto": 250, + "file": "git2/revwalk.h", + "line": 255, + "lineto": 255, "args": [ { "name": "walk", "type": "git_revwalk *", - "comment": null + "comment": "The revision walker." } ], "argline": "git_revwalk *walk", "sig": "git_revwalk *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Simplify the history by first-parent

\n", "comments": "

No parents other than the first for each commit will be enqueued.

\n", "group": "revwalk" }, "git_revwalk_free": { "type": "function", - "file": "revwalk.h", - "line": 258, - "lineto": 258, + "file": "git2/revwalk.h", + "line": 263, + "lineto": 263, "args": [ { "name": "walk", @@ -18784,27 +19694,20 @@ ], "argline": "git_revwalk *walk", "sig": "git_revwalk *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "void", "comment": null }, "description": "

Free a revision walker previously allocated.

\n", "comments": "", "group": "revwalk", "examples": { - "general.c": [ - "ex/HEAD/general.html#git_revwalk_free-75" - ], - "log.c": [ - "ex/HEAD/log.html#git_revwalk_free-57" - ] + "general.c": ["ex/v1.9.1/general.html#git_revwalk_free-85"], + "log.c": ["ex/v1.9.1/log.html#git_revwalk_free-54"] } }, "git_revwalk_repository": { "type": "function", - "file": "revwalk.h", - "line": 267, - "lineto": 267, + "file": "git2/revwalk.h", + "line": 272, + "lineto": 272, "args": [ { "name": "walk", @@ -18824,9 +19727,9 @@ }, "git_revwalk_add_hide_cb": { "type": "function", - "file": "revwalk.h", - "line": 288, - "lineto": 291, + "file": "git2/revwalk.h", + "line": 295, + "lineto": 298, "args": [ { "name": "walk", @@ -18846,19 +19749,16 @@ ], "argline": "git_revwalk *walk, git_revwalk_hide_cb hide_cb, void *payload", "sig": "git_revwalk *::git_revwalk_hide_cb::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Adds a callback function to hide a commit and its parents

\n", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Adds, changes or removes a callback function to hide a commit and its parents

\n", "comments": "", "group": "revwalk" }, "git_signature_new": { "type": "function", - "file": "signature.h", - "line": 37, - "lineto": 37, + "file": "git2/signature.h", + "line": 41, + "lineto": 41, "args": [ { "name": "out", @@ -18878,35 +19778,32 @@ { "name": "time", "type": "git_time_t", - "comment": "time when the action happened" + "comment": "time (in seconds from epoch) when the action happened" }, { "name": "offset", "type": "int", - "comment": "timezone offset in minutes for the time" + "comment": "timezone offset (in minutes) for the time" } ], "argline": "git_signature **out, const char *name, const char *email, git_time_t time, int offset", "sig": "git_signature **::const char *::const char *::git_time_t::int", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Create a new action signature.

\n", "comments": "

Call git_signature_free() to free the data.

\n\n

Note: angle brackets ('<' and '>') characters are not allowed to be used in either the name or the email parameter.

\n", "group": "signature", "examples": { "general.c": [ - "ex/HEAD/general.html#git_signature_new-76", - "ex/HEAD/general.html#git_signature_new-77" + "ex/v1.9.1/general.html#git_signature_new-86", + "ex/v1.9.1/general.html#git_signature_new-87" ] } }, "git_signature_now": { "type": "function", - "file": "signature.h", - "line": 49, - "lineto": 49, + "file": "git2/signature.h", + "line": 53, + "lineto": 53, "args": [ { "name": "out", @@ -18926,19 +19823,54 @@ ], "argline": "git_signature **out, const char *name, const char *email", "sig": "git_signature **::const char *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a new action signature with a timestamp of 'now'.

\n", + "comments": "

Call git_signature_free() to free the data.

\n", + "group": "signature", + "examples": { "merge.c": ["ex/v1.9.1/merge.html#git_signature_now-36"] } + }, + "git_signature_default_from_env": { + "type": "function", + "file": "git2/signature.h", + "line": 86, + "lineto": 89, + "args": [ + { + "name": "author_out", + "type": "git_signature **", + "comment": "pointer to set the author signature, or NULL" + }, + { + "name": "committer_out", + "type": "git_signature **", + "comment": "pointer to set the committer signature, or NULL" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository pointer" + } + ], + "argline": "git_signature **author_out, git_signature **committer_out, git_repository *repo", + "sig": "git_signature **::git_signature **::git_repository *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, GIT_ENOTFOUND if config is missing, or error code" }, - "description": "

Create a new action signature with a timestamp of 'now'.

\n", - "comments": "

Call git_signature_free() to free the data.

\n", - "group": "signature" + "description": "

Create a new author and/or committer signatures with default\n information based on the configuration and environment variables.

\n", + "comments": "

If author_out is set, it will be populated with the author information. The GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL environment variables will be honored, and user.name and user.email configuration options will be honored if the environment variables are unset. For timestamps, GIT_AUTHOR_DATE will be used, otherwise the current time will be used.

\n\n

If committer_out is set, it will be populated with the committer information. The GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL environment variables will be honored, and user.name and user.email configuration options will be honored if the environment variables are unset. For timestamps, GIT_COMMITTER_DATE will be used, otherwise the current time will be used.

\n\n

If neither GIT_AUTHOR_DATE nor GIT_COMMITTER_DATE are set, both timestamps will be set to the same time.

\n\n

It will return GIT_ENOTFOUND if either the user.name or user.email are not set and there is no fallback from an environment variable. One of author_out or committer_out must be set.

\n", + "group": "signature", + "examples": { + "commit.c": ["ex/v1.9.1/commit.html#git_signature_default_from_env-10"], + "init.c": ["ex/v1.9.1/init.html#git_signature_default_from_env-10"], + "tag.c": ["ex/v1.9.1/tag.html#git_signature_default_from_env-13"] + } }, "git_signature_default": { "type": "function", - "file": "signature.h", - "line": 63, - "lineto": 63, + "file": "git2/signature.h", + "line": 107, + "lineto": 107, "args": [ { "name": "out", @@ -18958,39 +19890,27 @@ "comment": " 0 on success, GIT_ENOTFOUND if config is missing, or error code" }, "description": "

Create a new action signature with default user and now timestamp.

\n", - "comments": "

This looks up the user.name and user.email from the configuration and uses the current time as the timestamp, and creates a new signature based on that information. It will return GIT_ENOTFOUND if either the user.name or user.email are not set.

\n", - "group": "signature", - "examples": { - "init.c": [ - "ex/HEAD/init.html#git_signature_default-12" - ], - "tag.c": [ - "ex/HEAD/tag.html#git_signature_default-17" - ] - } + "comments": "

This looks up the user.name and user.email from the configuration and uses the current time as the timestamp, and creates a new signature based on that information. It will return GIT_ENOTFOUND if either the user.name or user.email are not set.

\n\n

Note that these do not examine environment variables, only the configuration files. Use git_signature_default_from_env to consider the environment variables.

\n", + "group": "signature" }, "git_signature_from_buffer": { "type": "function", - "file": "signature.h", - "line": 76, - "lineto": 76, + "file": "git2/signature.h", + "line": 120, + "lineto": 120, "args": [ { "name": "out", "type": "git_signature **", "comment": "new signature" }, - { - "name": "buf", - "type": "const char *", - "comment": "signature string" - } + { "name": "buf", "type": "const char *", "comment": "signature string" } ], "argline": "git_signature **out, const char *buf", "sig": "git_signature **::const char *", "return": { "type": "int", - "comment": " 0 on success, or an error code" + "comment": " 0 on success, GIT_EINVALID if the signature is not parseable, or an error code" }, "description": "

Create a new signature by parsing the given buffer, which is\n expected to be in the format "Real Name \n<email

\n\n
\n

timestamp tzoffset",\n where timestamp is the number of seconds since the Unix epoch and\n tzoffset is the timezone offset in hhmm format (note the lack\n of a colon separator).

\n
\n", "comments": "", @@ -18998,9 +19918,9 @@ }, "git_signature_dup": { "type": "function", - "file": "signature.h", - "line": 88, - "lineto": 88, + "file": "git2/signature.h", + "line": 132, + "lineto": 132, "args": [ { "name": "dest", @@ -19015,19 +19935,16 @@ ], "argline": "git_signature **dest, const git_signature *sig", "sig": "git_signature **::const git_signature *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Create a copy of an existing signature. All internal strings are also\n duplicated.

\n", "comments": "

Call git_signature_free() to free the data.

\n", "group": "signature" }, "git_signature_free": { "type": "function", - "file": "signature.h", - "line": 99, - "lineto": 99, + "file": "git2/signature.h", + "line": 143, + "lineto": 143, "args": [ { "name": "sig", @@ -19037,41 +19954,142 @@ ], "argline": "git_signature *sig", "sig": "git_signature *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "void", "comment": null }, "description": "

Free an existing signature.

\n", "comments": "

Because the signature is not an opaque structure, it is legal to free it manually, but be sure to free the "name" and "email" strings in addition to the structure itself.

\n", "group": "signature", "examples": { + "commit.c": [ + "ex/v1.9.1/commit.html#git_signature_free-11", + "ex/v1.9.1/commit.html#git_signature_free-12" + ], "general.c": [ - "ex/HEAD/general.html#git_signature_free-78", - "ex/HEAD/general.html#git_signature_free-79" + "ex/v1.9.1/general.html#git_signature_free-88", + "ex/v1.9.1/general.html#git_signature_free-89" ], "init.c": [ - "ex/HEAD/init.html#git_signature_free-13" + "ex/v1.9.1/init.html#git_signature_free-11", + "ex/v1.9.1/init.html#git_signature_free-12" ], - "tag.c": [ - "ex/HEAD/tag.html#git_signature_free-18" - ] + "tag.c": ["ex/v1.9.1/tag.html#git_signature_free-14"] } }, - "git_stash_apply_init_options": { + "git_stash_save": { "type": "function", - "file": "stash.h", - "line": 153, - "lineto": 154, + "file": "git2/stash.h", + "line": 72, + "lineto": 77, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "Object id of the commit containing the stashed state.\n This commit is also the target of the direct reference refs/stash." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The owning repository." + }, + { + "name": "stasher", + "type": "const git_signature *", + "comment": "The identity of the person performing the stashing." + }, + { + "name": "message", + "type": "const char *", + "comment": "Optional description along with the stashed state." + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Flags to control the stashing process. (see GIT_STASH_* above)" + } + ], + "argline": "git_oid *out, git_repository *repo, const git_signature *stasher, const char *message, uint32_t flags", + "sig": "git_oid *::git_repository *::const git_signature *::const char *::uint32_t", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND where there's nothing to stash,\n or error code." + }, + "description": "

Save the local modifications to a new stash.

\n", + "comments": "", + "group": "stash" + }, + "git_stash_save_options_init": { + "type": "function", + "file": "git2/stash.h", + "line": 118, + "lineto": 119, + "args": [ + { + "name": "opts", + "type": "git_stash_save_options *", + "comment": "The `git_stash_save_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_STASH_SAVE_OPTIONS_VERSION`." + } + ], + "argline": "git_stash_save_options *opts, unsigned int version", + "sig": "git_stash_save_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_stash_save_options structure

\n", + "comments": "

Initializes a git_stash_save_options with default values. Equivalent to creating an instance with GIT_STASH_SAVE_OPTIONS_INIT.

\n", + "group": "stash" + }, + "git_stash_save_with_opts": { + "type": "function", + "file": "git2/stash.h", + "line": 131, + "lineto": 134, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "Object id of the commit containing the stashed state.\n This commit is also the target of the direct reference refs/stash." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The owning repository." + }, + { + "name": "opts", + "type": "const git_stash_save_options *", + "comment": "The stash options." + } + ], + "argline": "git_oid *out, git_repository *repo, const git_stash_save_options *opts", + "sig": "git_oid *::git_repository *::const git_stash_save_options *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND where there's nothing to stash,\n or error code." + }, + "description": "

Save the local modifications to a new stash, with options.

\n", + "comments": "", + "group": "stash" + }, + "git_stash_apply_options_init": { + "type": "function", + "file": "git2/stash.h", + "line": 225, + "lineto": 226, "args": [ { "name": "opts", "type": "git_stash_apply_options *", - "comment": "the `git_stash_apply_options` instance to initialize." + "comment": "The `git_stash_apply_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "the version of the struct; you should pass\n `GIT_STASH_APPLY_OPTIONS_INIT` here." + "comment": "The struct version; pass `GIT_STASH_APPLY_OPTIONS_VERSION`." } ], "argline": "git_stash_apply_options *opts, unsigned int version", @@ -19080,15 +20098,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_stash_apply_options with default values. Equivalent to\n creating an instance with GIT_STASH_APPLY_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_stash_apply_options structure

\n", + "comments": "

Initializes a git_stash_apply_options with default values. Equivalent to creating an instance with GIT_STASH_APPLY_OPTIONS_INIT.

\n", "group": "stash" }, "git_stash_apply": { "type": "function", - "file": "stash.h", - "line": 182, - "lineto": 185, + "file": "git2/stash.h", + "line": 252, + "lineto": 255, "args": [ { "name": "repo", @@ -19103,7 +20121,7 @@ { "name": "options", "type": "const git_stash_apply_options *", - "comment": "Options to control how stashes are applied." + "comment": "Optional options to control how stashes are applied." } ], "argline": "git_repository *repo, size_t index, const git_stash_apply_options *options", @@ -19113,14 +20131,14 @@ "comment": " 0 on success, GIT_ENOTFOUND if there's no stashed state for the\n given index, GIT_EMERGECONFLICT if changes exist in the working\n directory, or an error code" }, "description": "

Apply a single stashed state from the stash list.

\n", - "comments": "

If local changes in the working directory conflict with changes in the stash then GIT_EMERGECONFLICT will be returned. In this case, the index will always remain unmodified and all files in the working directory will remain unmodified. However, if you are restoring untracked files or ignored files and there is a conflict when applying the modified files, then those files will remain in the working directory.

\n\n

If passing the GIT_STASH_APPLY_REINSTATE_INDEX flag and there would be conflicts when reinstating the index, the function will return GIT_EMERGECONFLICT and both the working directory and index will be left unmodified.

\n\n

Note that a minimum checkout strategy of GIT_CHECKOUT_SAFE is implied.

\n", + "comments": "

If local changes in the working directory conflict with changes in the stash then GIT_EMERGECONFLICT will be returned. In this case, the index will always remain unmodified and all files in the working directory will remain unmodified. However, if you are restoring untracked files or ignored files and there is a conflict when applying the modified files, then those files will remain in the working directory.

\n\n

If passing the GIT_STASH_APPLY_REINSTATE_INDEX flag and there would be conflicts when reinstating the index, the function will return GIT_EMERGECONFLICT and both the working directory and index will be left unmodified.

\n", "group": "stash" }, "git_stash_foreach": { "type": "function", - "file": "stash.h", - "line": 218, - "lineto": 221, + "file": "git2/stash.h", + "line": 288, + "lineto": 291, "args": [ { "name": "repo", @@ -19150,9 +20168,9 @@ }, "git_stash_drop": { "type": "function", - "file": "stash.h", - "line": 234, - "lineto": 236, + "file": "git2/stash.h", + "line": 304, + "lineto": 306, "args": [ { "name": "repo", @@ -19177,9 +20195,9 @@ }, "git_stash_pop": { "type": "function", - "file": "stash.h", - "line": 250, - "lineto": 253, + "file": "git2/stash.h", + "line": 320, + "lineto": 323, "args": [ { "name": "repo", @@ -19194,7 +20212,7 @@ { "name": "options", "type": "const git_stash_apply_options *", - "comment": "Options to control how stashes are applied." + "comment": "Optional options to control how stashes are applied." } ], "argline": "git_repository *repo, size_t index, const git_stash_apply_options *options", @@ -19207,21 +20225,21 @@ "comments": "", "group": "stash" }, - "git_status_init_options": { + "git_status_options_init": { "type": "function", - "file": "status.h", - "line": 195, - "lineto": 197, + "file": "git2/status.h", + "line": 280, + "lineto": 282, "args": [ { "name": "opts", "type": "git_status_options *", - "comment": "The `git_status_options` instance to initialize." + "comment": "The `git_status_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_STATUS_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_STATUS_OPTIONS_VERSION`." } ], "argline": "git_status_options *opts, unsigned int version", @@ -19230,15 +20248,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_status_options with default values. Equivalent to\n creating an instance with GIT_STATUS_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_status_options structure

\n", + "comments": "

Initializes a git_status_options with default values. Equivalent to creating an instance with GIT_STATUS_OPTIONS_INIT.

\n", "group": "status" }, "git_status_foreach": { "type": "function", - "file": "status.h", - "line": 235, - "lineto": 238, + "file": "git2/status.h", + "line": 320, + "lineto": 323, "args": [ { "name": "repo", @@ -19265,17 +20283,13 @@ "description": "

Gather file statuses and run a callback for each one.

\n", "comments": "

The callback is passed the path of the file, the status (a combination of the git_status_t values above) and the payload data pointer passed into this function.

\n\n

If the callback returns a non-zero value, this function will stop looping and return that value to caller.

\n", "group": "status", - "examples": { - "status.c": [ - "ex/HEAD/status.html#git_status_foreach-10" - ] - } + "examples": { "status.c": ["ex/v1.9.1/status.html#git_status_foreach-6"] } }, "git_status_foreach_ext": { "type": "function", - "file": "status.h", - "line": 259, - "lineto": 263, + "file": "git2/status.h", + "line": 344, + "lineto": 348, "args": [ { "name": "repo", @@ -19308,16 +20322,14 @@ "comments": "

This is an extended version of the git_status_foreach() API that allows for more granular control over which paths will be processed and in what order. See the git_status_options structure for details about the additional controls that this makes available.

\n\n

Note that if a pathspec is given in the git_status_options to filter the status, then the results from rename detection (if you enable it) may not be accurate. To do rename detection properly, this must be called with no pathspec so that all files can be considered.

\n", "group": "status", "examples": { - "status.c": [ - "ex/HEAD/status.html#git_status_foreach_ext-11" - ] + "status.c": ["ex/v1.9.1/status.html#git_status_foreach_ext-7"] } }, "git_status_file": { "type": "function", - "file": "status.h", - "line": 291, - "lineto": 294, + "file": "git2/status.h", + "line": 376, + "lineto": 379, "args": [ { "name": "status_flags", @@ -19343,13 +20355,14 @@ }, "description": "

Get file status for a single file.

\n", "comments": "

This tries to get status for the filename that you give. If no files match that name (in either the HEAD, index, or working directory), this returns GIT_ENOTFOUND.

\n\n

If the name matches multiple files (for example, if the path names a directory or if running on a case- insensitive filesystem and yet the HEAD has two entries that both match the path), then this returns GIT_EAMBIGUOUS because it cannot give correct results.

\n\n

This does not do any sort of rename detection. Renames require a set of targets and because of the path filtering, there is not enough information to check renames correctly. To check file status with rename detection, there is no choice but to do a full git_status_list_new and scan through looking for the path that you are interested in.

\n", - "group": "status" + "group": "status", + "examples": { "add.c": ["ex/v1.9.1/add.html#git_status_file-6"] } }, "git_status_list_new": { "type": "function", - "file": "status.h", - "line": 309, - "lineto": 312, + "file": "git2/status.h", + "line": 394, + "lineto": 397, "args": [ { "name": "out", @@ -19369,25 +20382,22 @@ ], "argline": "git_status_list **out, git_repository *repo, const git_status_options *opts", "sig": "git_status_list **::git_repository *::const git_status_options *", - "return": { - "type": "int", - "comment": " 0 on success or error code" - }, + "return": { "type": "int", "comment": " 0 on success or error code" }, "description": "

Gather file status information and populate the git_status_list.

\n", "comments": "

Note that if a pathspec is given in the git_status_options to filter the status, then the results from rename detection (if you enable it) may not be accurate. To do rename detection properly, this must be called with no pathspec so that all files can be considered.

\n", "group": "status", "examples": { "status.c": [ - "ex/HEAD/status.html#git_status_list_new-12", - "ex/HEAD/status.html#git_status_list_new-13" + "ex/v1.9.1/status.html#git_status_list_new-8", + "ex/v1.9.1/status.html#git_status_list_new-9" ] } }, "git_status_list_entrycount": { "type": "function", - "file": "status.h", - "line": 323, - "lineto": 324, + "file": "git2/status.h", + "line": 408, + "lineto": 409, "args": [ { "name": "statuslist", @@ -19406,27 +20416,23 @@ "group": "status", "examples": { "status.c": [ - "ex/HEAD/status.html#git_status_list_entrycount-14", - "ex/HEAD/status.html#git_status_list_entrycount-15" + "ex/v1.9.1/status.html#git_status_list_entrycount-10", + "ex/v1.9.1/status.html#git_status_list_entrycount-11" ] } }, "git_status_byindex": { "type": "function", - "file": "status.h", - "line": 335, - "lineto": 337, + "file": "git2/status.h", + "line": 420, + "lineto": 422, "args": [ { "name": "statuslist", "type": "git_status_list *", "comment": "Existing status list object" }, - { - "name": "idx", - "type": "size_t", - "comment": "Position of the entry" - } + { "name": "idx", "type": "size_t", "comment": "Position of the entry" } ], "argline": "git_status_list *statuslist, size_t idx", "sig": "git_status_list *::size_t", @@ -19439,20 +20445,20 @@ "group": "status", "examples": { "status.c": [ - "ex/HEAD/status.html#git_status_byindex-16", - "ex/HEAD/status.html#git_status_byindex-17", - "ex/HEAD/status.html#git_status_byindex-18", - "ex/HEAD/status.html#git_status_byindex-19", - "ex/HEAD/status.html#git_status_byindex-20", - "ex/HEAD/status.html#git_status_byindex-21" + "ex/v1.9.1/status.html#git_status_byindex-12", + "ex/v1.9.1/status.html#git_status_byindex-13", + "ex/v1.9.1/status.html#git_status_byindex-14", + "ex/v1.9.1/status.html#git_status_byindex-15", + "ex/v1.9.1/status.html#git_status_byindex-16", + "ex/v1.9.1/status.html#git_status_byindex-17" ] } }, "git_status_list_free": { "type": "function", - "file": "status.h", - "line": 344, - "lineto": 345, + "file": "git2/status.h", + "line": 429, + "lineto": 430, "args": [ { "name": "statuslist", @@ -19462,24 +20468,19 @@ ], "argline": "git_status_list *statuslist", "sig": "git_status_list *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "void", "comment": null }, "description": "

Free an existing status list

\n", "comments": "", "group": "status", "examples": { - "status.c": [ - "ex/HEAD/status.html#git_status_list_free-22" - ] + "status.c": ["ex/v1.9.1/status.html#git_status_list_free-18"] } }, "git_status_should_ignore": { "type": "function", - "file": "status.h", - "line": 363, - "lineto": 366, + "file": "git2/status.h", + "line": 448, + "lineto": 451, "args": [ { "name": "ignored", @@ -19507,82 +20508,49 @@ "comments": "

This function checks the ignore rules to see if they would apply to the given file. This indicates if the file would be ignored regardless of whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git add ." on the directory containing the file, would it be added or not?

\n", "group": "status" }, - "git_strarray_free": { + "git_strarray_dispose": { "type": "function", - "file": "strarray.h", - "line": 41, - "lineto": 41, + "file": "git2/strarray.h", + "line": 37, + "lineto": 37, "args": [ { "name": "array", "type": "git_strarray *", - "comment": "git_strarray from which to free string data" + "comment": "The git_strarray that contains strings to free" } ], "argline": "git_strarray *array", "sig": "git_strarray *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Close a string array object

\n", - "comments": "

This method should be called on git_strarray objects where the strings array is allocated and contains allocated strings, such as what you would get from git_strarray_copy(). Not doing so, will result in a memory leak.

\n\n

This does not free the git_strarray itself, since the library will never allocate that object directly itself (it is more commonly embedded inside another struct or created on the stack).

\n", + "return": { "type": "void", "comment": null }, + "description": "

Free the strings contained in a string array. This method should\n be called on git_strarray objects that were provided by the\n library. Not doing so, will result in a memory leak.

\n", + "comments": "

This does not free the git_strarray itself, since the library will never allocate that object directly itself.

\n", "group": "strarray", "examples": { - "general.c": [ - "ex/HEAD/general.html#git_strarray_free-80" - ], + "checkout.c": ["ex/v1.9.1/checkout.html#git_strarray_dispose-26"], + "general.c": ["ex/v1.9.1/general.html#git_strarray_dispose-90"], "remote.c": [ - "ex/HEAD/remote.html#git_strarray_free-16", - "ex/HEAD/remote.html#git_strarray_free-17" + "ex/v1.9.1/remote.html#git_strarray_dispose-11", + "ex/v1.9.1/remote.html#git_strarray_dispose-12" ], - "tag.c": [ - "ex/HEAD/tag.html#git_strarray_free-19" - ] + "tag.c": ["ex/v1.9.1/tag.html#git_strarray_dispose-15"] } }, - "git_strarray_copy": { - "type": "function", - "file": "strarray.h", - "line": 53, - "lineto": 53, - "args": [ - { - "name": "tgt", - "type": "git_strarray *", - "comment": "target" - }, - { - "name": "src", - "type": "const git_strarray *", - "comment": "source" - } - ], - "argline": "git_strarray *tgt, const git_strarray *src", - "sig": "git_strarray *::const git_strarray *", - "return": { - "type": "int", - "comment": " 0 on success, \n<\n 0 on allocation failure" - }, - "description": "

Copy a string array object from source to target.

\n", - "comments": "

Note: target is overwritten and hence should be empty, otherwise its contents are leaked. Call git_strarray_free() if necessary.

\n", - "group": "strarray" - }, - "git_submodule_update_init_options": { + "git_submodule_update_options_init": { "type": "function", - "file": "submodule.h", - "line": 170, - "lineto": 171, + "file": "git2/submodule.h", + "line": 180, + "lineto": 181, "args": [ { "name": "opts", "type": "git_submodule_update_options *", - "comment": "The `git_submodule_update_options` instance to initialize." + "comment": "The `git_submodule_update_options` struct to initialize." }, { "name": "version", "type": "unsigned int", - "comment": "Version of struct; pass `GIT_SUBMODULE_UPDATE_OPTIONS_VERSION`" + "comment": "The struct version; pass `GIT_SUBMODULE_UPDATE_OPTIONS_VERSION`." } ], "argline": "git_submodule_update_options *opts, unsigned int version", @@ -19591,15 +20559,15 @@ "type": "int", "comment": " Zero on success; -1 on failure." }, - "description": "

Initializes a git_submodule_update_options with default values.\n Equivalent to creating an instance with GIT_SUBMODULE_UPDATE_OPTIONS_INIT.

\n", - "comments": "", + "description": "

Initialize git_submodule_update_options structure

\n", + "comments": "

Initializes a git_submodule_update_options with default values. Equivalent to creating an instance with GIT_SUBMODULE_UPDATE_OPTIONS_INIT.

\n", "group": "submodule" }, "git_submodule_update": { "type": "function", - "file": "submodule.h", - "line": 191, - "lineto": 191, + "file": "git2/submodule.h", + "line": 201, + "lineto": 201, "args": [ { "name": "submodule", @@ -19609,7 +20577,7 @@ { "name": "init", "type": "int", - "comment": "If the submodule is not initialized, setting this flag to true\n will initialize the submodule before updating. Otherwise, this will\n return an error if attempting to update an uninitialzed repository.\n but setting this to true forces them to be updated." + "comment": "If the submodule is not initialized, setting this flag to true\n will initialize the submodule before updating. Otherwise, this will\n return an error if attempting to update an uninitialized repository.\n but setting this to true forces them to be updated." }, { "name": "options", @@ -19621,7 +20589,7 @@ "sig": "git_submodule *::int::git_submodule_update_options *", "return": { "type": "int", - "comment": " 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `giterr_last` for a detailed error message)." + "comment": " 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `git_error_last` for a detailed error message)." }, "description": "

Update a submodule. This will clone a missing submodule and\n checkout the subrepository to the commit specified in the index of\n the containing repository. If the submodule repository doesn't contain\n the target commit (e.g. because fetchRecurseSubmodules isn't set), then\n the submodule is fetched using the fetch options supplied in options.

\n", "comments": "", @@ -19629,9 +20597,9 @@ }, "git_submodule_lookup": { "type": "function", - "file": "submodule.h", - "line": 220, - "lineto": 223, + "file": "git2/submodule.h", + "line": 230, + "lineto": 233, "args": [ { "name": "out", @@ -19659,11 +20627,35 @@ "comments": "

Given either the submodule name or path (they are usually the same), this returns a structure describing the submodule.

\n\n

There are two expected error scenarios:

\n\n\n\n

You must call git_submodule_free when done with the submodule.

\n", "group": "submodule" }, + "git_submodule_dup": { + "type": "function", + "file": "git2/submodule.h", + "line": 243, + "lineto": 243, + "args": [ + { + "name": "out", + "type": "git_submodule **", + "comment": "Pointer to store the copy of the submodule." + }, + { + "name": "source", + "type": "git_submodule *", + "comment": "Original submodule to copy." + } + ], + "argline": "git_submodule **out, git_submodule *source", + "sig": "git_submodule **::git_submodule *", + "return": { "type": "int", "comment": " 0" }, + "description": "

Create an in-memory copy of a submodule. The copy must be explicitly\n free'd or it will leak.

\n", + "comments": "", + "group": "submodule" + }, "git_submodule_free": { "type": "function", - "file": "submodule.h", - "line": 230, - "lineto": 230, + "file": "git2/submodule.h", + "line": 250, + "lineto": 250, "args": [ { "name": "submodule", @@ -19673,19 +20665,16 @@ ], "argline": "git_submodule *submodule", "sig": "git_submodule *", - "return": { - "type": "void", - "comment": null - }, + "return": { "type": "void", "comment": null }, "description": "

Release a submodule

\n", "comments": "", "group": "submodule" }, "git_submodule_foreach": { "type": "function", - "file": "submodule.h", - "line": 250, - "lineto": 253, + "file": "git2/submodule.h", + "line": 270, + "lineto": 273, "args": [ { "name": "repo", @@ -19713,16 +20702,14 @@ "comments": "

See the note on git_submodule above. This iterates over the tracked submodules as described therein.

\n\n

If you are concerned about items in the working directory that look like submodules but are not tracked, the diff API will generate a diff record for workdir items that look like submodules but are not tracked, showing them as added in the workdir. Also, the status API will treat the entire subdirectory of a contained git repo as a single GIT_STATUS_WT_NEW item.

\n", "group": "submodule", "examples": { - "status.c": [ - "ex/HEAD/status.html#git_submodule_foreach-23" - ] + "status.c": ["ex/v1.9.1/status.html#git_submodule_foreach-19"] } }, "git_submodule_add_setup": { "type": "function", - "file": "submodule.h", - "line": 280, - "lineto": 285, + "file": "git2/submodule.h", + "line": 301, + "lineto": 306, "args": [ { "name": "out", @@ -19757,14 +20744,46 @@ "comment": " 0 on success, GIT_EEXISTS if submodule already exists,\n -1 on other errors." }, "description": "

Set up a new git submodule for checkout.

\n", - "comments": "

This does "git submodule add" up to the fetch and checkout of the submodule contents. It preps a new submodule, creates an entry in .gitmodules and creates an empty initialized repository either at the given path in the working directory or in .git/modules with a gitlink from the working directory to the new repo.

\n\n

To fully emulate "git submodule add" call this function, then open the submodule repo and perform the clone step as needed. Lastly, call git_submodule_add_finalize() to wrap up adding the new submodule and .gitmodules to the index to be ready to commit.

\n\n

You must call git_submodule_free on the submodule object when done.

\n", + "comments": "

This does "git submodule add" up to the fetch and checkout of the submodule contents. It preps a new submodule, creates an entry in .gitmodules and creates an empty initialized repository either at the given path in the working directory or in .git/modules with a gitlink from the working directory to the new repo.

\n\n

To fully emulate "git submodule add" call this function, then open the submodule repo and perform the clone step as needed (if you don't need anything custom see git_submodule_add_clone()). Lastly, call git_submodule_add_finalize() to wrap up adding the new submodule and .gitmodules to the index to be ready to commit.

\n\n

You must call git_submodule_free on the submodule object when done.

\n", + "group": "submodule" + }, + "git_submodule_clone": { + "type": "function", + "file": "git2/submodule.h", + "line": 319, + "lineto": 322, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "The newly created repository object. Optional." + }, + { + "name": "submodule", + "type": "git_submodule *", + "comment": "The submodule currently waiting for its clone." + }, + { + "name": "opts", + "type": "const git_submodule_update_options *", + "comment": "The options to use." + } + ], + "argline": "git_repository **out, git_submodule *submodule, const git_submodule_update_options *opts", + "sig": "git_repository **::git_submodule *::const git_submodule_update_options *", + "return": { + "type": "int", + "comment": " 0 on success, -1 on other errors (see git_clone)." + }, + "description": "

Perform the clone step for a newly created submodule.

\n", + "comments": "

This performs the necessary git_clone to setup a newly-created submodule.

\n", "group": "submodule" }, "git_submodule_add_finalize": { "type": "function", - "file": "submodule.h", - "line": 297, - "lineto": 297, + "file": "git2/submodule.h", + "line": 335, + "lineto": 335, "args": [ { "name": "submodule", @@ -19774,19 +20793,16 @@ ], "argline": "git_submodule *submodule", "sig": "git_submodule *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Resolve the setup of a new git submodule.

\n", "comments": "

This should be called on a submodule once you have called add setup and done the clone of the submodule. This adds the .gitmodules file and the newly cloned submodule to the index to be ready to be committed (but doesn't actually do the commit).

\n", "group": "submodule" }, "git_submodule_add_to_index": { "type": "function", - "file": "submodule.h", - "line": 309, - "lineto": 311, + "file": "git2/submodule.h", + "line": 347, + "lineto": 349, "args": [ { "name": "submodule", @@ -19811,9 +20827,9 @@ }, "git_submodule_owner": { "type": "function", - "file": "submodule.h", - "line": 324, - "lineto": 324, + "file": "git2/submodule.h", + "line": 362, + "lineto": 362, "args": [ { "name": "submodule", @@ -19833,9 +20849,9 @@ }, "git_submodule_name": { "type": "function", - "file": "submodule.h", - "line": 332, - "lineto": 332, + "file": "git2/submodule.h", + "line": 370, + "lineto": 370, "args": [ { "name": "submodule", @@ -19853,16 +20869,14 @@ "comments": "", "group": "submodule", "examples": { - "status.c": [ - "ex/HEAD/status.html#git_submodule_name-24" - ] + "status.c": ["ex/v1.9.1/status.html#git_submodule_name-20"] } }, "git_submodule_path": { "type": "function", - "file": "submodule.h", - "line": 343, - "lineto": 343, + "file": "git2/submodule.h", + "line": 381, + "lineto": 381, "args": [ { "name": "submodule", @@ -19880,16 +20894,14 @@ "comments": "

The path is almost always the same as the submodule name, but the two are actually not required to match.

\n", "group": "submodule", "examples": { - "status.c": [ - "ex/HEAD/status.html#git_submodule_path-25" - ] + "status.c": ["ex/v1.9.1/status.html#git_submodule_path-21"] } }, "git_submodule_url": { "type": "function", - "file": "submodule.h", - "line": 351, - "lineto": 351, + "file": "git2/submodule.h", + "line": 389, + "lineto": 389, "args": [ { "name": "submodule", @@ -19909,9 +20921,9 @@ }, "git_submodule_resolve_url": { "type": "function", - "file": "submodule.h", - "line": 361, - "lineto": 361, + "file": "git2/submodule.h", + "line": 399, + "lineto": 399, "args": [ { "name": "out", @@ -19923,27 +20935,20 @@ "type": "git_repository *", "comment": "Pointer to repository object" }, - { - "name": "url", - "type": "const char *", - "comment": "Relative url" - } + { "name": "url", "type": "const char *", "comment": "Relative url" } ], "argline": "git_buf *out, git_repository *repo, const char *url", "sig": "git_buf *::git_repository *::const char *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Resolve a submodule url relative to the given repository.

\n", "comments": "", "group": "submodule" }, "git_submodule_branch": { "type": "function", - "file": "submodule.h", - "line": 369, - "lineto": 369, + "file": "git2/submodule.h", + "line": 407, + "lineto": 407, "args": [ { "name": "submodule", @@ -19963,9 +20968,9 @@ }, "git_submodule_set_branch": { "type": "function", - "file": "submodule.h", - "line": 382, - "lineto": 382, + "file": "git2/submodule.h", + "line": 420, + "lineto": 420, "args": [ { "name": "repo", @@ -19995,9 +21000,9 @@ }, "git_submodule_set_url": { "type": "function", - "file": "submodule.h", - "line": 396, - "lineto": 396, + "file": "git2/submodule.h", + "line": 434, + "lineto": 434, "args": [ { "name": "repo", @@ -20027,9 +21032,9 @@ }, "git_submodule_index_id": { "type": "function", - "file": "submodule.h", - "line": 404, - "lineto": 404, + "file": "git2/submodule.h", + "line": 442, + "lineto": 442, "args": [ { "name": "submodule", @@ -20049,9 +21054,9 @@ }, "git_submodule_head_id": { "type": "function", - "file": "submodule.h", - "line": 412, - "lineto": 412, + "file": "git2/submodule.h", + "line": 450, + "lineto": 450, "args": [ { "name": "submodule", @@ -20071,9 +21076,9 @@ }, "git_submodule_wd_id": { "type": "function", - "file": "submodule.h", - "line": 425, - "lineto": 425, + "file": "git2/submodule.h", + "line": 463, + "lineto": 463, "args": [ { "name": "submodule", @@ -20093,9 +21098,9 @@ }, "git_submodule_ignore": { "type": "function", - "file": "submodule.h", - "line": 450, - "lineto": 451, + "file": "git2/submodule.h", + "line": 488, + "lineto": 489, "args": [ { "name": "submodule", @@ -20115,9 +21120,9 @@ }, "git_submodule_set_ignore": { "type": "function", - "file": "submodule.h", - "line": 463, - "lineto": 466, + "file": "git2/submodule.h", + "line": 501, + "lineto": 504, "args": [ { "name": "repo", @@ -20137,19 +21142,16 @@ ], "argline": "git_repository *repo, const char *name, git_submodule_ignore_t ignore", "sig": "git_repository *::const char *::git_submodule_ignore_t", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Set the ignore rule for the submodule in the configuration

\n", "comments": "

This does not affect any currently-loaded instances.

\n", "group": "submodule" }, "git_submodule_update_strategy": { "type": "function", - "file": "submodule.h", - "line": 478, - "lineto": 479, + "file": "git2/submodule.h", + "line": 516, + "lineto": 517, "args": [ { "name": "submodule", @@ -20169,9 +21171,9 @@ }, "git_submodule_set_update": { "type": "function", - "file": "submodule.h", - "line": 491, - "lineto": 494, + "file": "git2/submodule.h", + "line": 529, + "lineto": 532, "args": [ { "name": "repo", @@ -20191,31 +21193,28 @@ ], "argline": "git_repository *repo, const char *name, git_submodule_update_t update", "sig": "git_repository *::const char *::git_submodule_update_t", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, + "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Set the update rule for the submodule in the configuration

\n", "comments": "

This setting won't affect any existing instances.

\n", "group": "submodule" }, "git_submodule_fetch_recurse_submodules": { "type": "function", - "file": "submodule.h", - "line": 507, - "lineto": 508, + "file": "git2/submodule.h", + "line": 546, + "lineto": 547, "args": [ { "name": "submodule", "type": "git_submodule *", - "comment": null + "comment": "the submodule to examine" } ], "argline": "git_submodule *submodule", "sig": "git_submodule *", "return": { "type": "git_submodule_recurse_t", - "comment": " 0 if fetchRecurseSubmodules is false, 1 if true" + "comment": " the submodule recursion configuration" }, "description": "

Read the fetchRecurseSubmodules rule for a submodule.

\n", "comments": "

This accesses the submodule..fetchRecurseSubmodules value for the submodule that controls fetching behavior for the submodule.

\n\n

Note that at this time, libgit2 does not honor this setting and the fetch functionality current ignores submodules.

\n", @@ -20223,9 +21222,9 @@ }, "git_submodule_set_fetch_recurse_submodules": { "type": "function", - "file": "submodule.h", - "line": 520, - "lineto": 523, + "file": "git2/submodule.h", + "line": 559, + "lineto": 562, "args": [ { "name": "repo", @@ -20240,7 +21239,7 @@ { "name": "fetch_recurse_submodules", "type": "git_submodule_recurse_t", - "comment": "Boolean value" + "comment": "the submodule recursion configuration" } ], "argline": "git_repository *repo, const char *name, git_submodule_recurse_t fetch_recurse_submodules", @@ -20255,9 +21254,9 @@ }, "git_submodule_init": { "type": "function", - "file": "submodule.h", - "line": 538, - "lineto": 538, + "file": "git2/submodule.h", + "line": 577, + "lineto": 577, "args": [ { "name": "submodule", @@ -20282,9 +21281,9 @@ }, "git_submodule_repo_init": { "type": "function", - "file": "submodule.h", - "line": 553, - "lineto": 556, + "file": "git2/submodule.h", + "line": 592, + "lineto": 595, "args": [ { "name": "out", @@ -20314,31 +21313,28 @@ }, "git_submodule_sync": { "type": "function", - "file": "submodule.h", - "line": 566, - "lineto": 566, + "file": "git2/submodule.h", + "line": 608, + "lineto": 608, "args": [ { "name": "submodule", "type": "git_submodule *", - "comment": null + "comment": "The submodule to copy." } ], "argline": "git_submodule *submodule", "sig": "git_submodule *", - "return": { - "type": "int", - "comment": null - }, + "return": { "type": "int", "comment": " 0 or an error code." }, "description": "

Copy submodule remote info into submodule repo.

\n", "comments": "

This copies the information about the submodules URL into the checked out submodule config, acting like "git submodule sync". This is useful if you have altered the URL for the submodule (or it has been altered by a fetch of upstream changes) and you need to update your local repo.

\n", "group": "submodule" }, "git_submodule_open": { "type": "function", - "file": "submodule.h", - "line": 580, - "lineto": 582, + "file": "git2/submodule.h", + "line": 622, + "lineto": 624, "args": [ { "name": "repo", @@ -20363,9 +21359,9 @@ }, "git_submodule_reload": { "type": "function", - "file": "submodule.h", - "line": 594, - "lineto": 594, + "file": "git2/submodule.h", + "line": 636, + "lineto": 636, "args": [ { "name": "submodule", @@ -20380,19 +21376,16 @@ ], "argline": "git_submodule *submodule, int force", "sig": "git_submodule *::int", - "return": { - "type": "int", - "comment": " 0 on success, \n<\n0 on error" - }, + "return": { "type": "int", "comment": " 0 on success, \n<\n0 on error" }, "description": "

Reread submodule info from config, index, and HEAD.

\n", "comments": "

Call this to reread cached submodule information for this submodule if you have reason to believe that it has changed.

\n", "group": "submodule" }, "git_submodule_status": { "type": "function", - "file": "submodule.h", - "line": 610, - "lineto": 614, + "file": "git2/submodule.h", + "line": 652, + "lineto": 656, "args": [ { "name": "status", @@ -20417,24 +21410,19 @@ ], "argline": "unsigned int *status, git_repository *repo, const char *name, git_submodule_ignore_t ignore", "sig": "unsigned int *::git_repository *::const char *::git_submodule_ignore_t", - "return": { - "type": "int", - "comment": " 0 on success, \n<\n0 on error" - }, + "return": { "type": "int", "comment": " 0 on success, \n<\n0 on error" }, "description": "

Get the status for a submodule.

\n", "comments": "

This looks at a submodule and tries to determine the status. It will return a combination of the GIT_SUBMODULE_STATUS values above. How deeply it examines the working directory to do this will depend on the git_submodule_ignore_t value for the submodule.

\n", "group": "submodule", "examples": { - "status.c": [ - "ex/HEAD/status.html#git_submodule_status-26" - ] + "status.c": ["ex/v1.9.1/status.html#git_submodule_status-22"] } }, "git_submodule_location": { "type": "function", - "file": "submodule.h", - "line": 630, - "lineto": 632, + "file": "git2/submodule.h", + "line": 672, + "lineto": 674, "args": [ { "name": "location_status", @@ -20449,4930 +21437,3877 @@ ], "argline": "unsigned int *location_status, git_submodule *submodule", "sig": "unsigned int *::git_submodule *", - "return": { - "type": "int", - "comment": " 0 on success, \n<\n0 on error" - }, + "return": { "type": "int", "comment": " 0 on success, \n<\n0 on error" }, "description": "

Get the locations of submodule information.

\n", "comments": "

This is a bit like a very lightweight version of git_submodule_status. It just returns a made of the first four submodule status values (i.e. the ones like GIT_SUBMODULE_STATUS_IN_HEAD, etc) that tell you where the submodule data comes from (i.e. the HEAD commit, gitmodules file, etc.). This can be useful if you want to know if the submodule is present in the working directory at this point in time, etc.

\n", "group": "submodule" }, - "git_commit_create_from_ids": { + "git_tag_lookup": { "type": "function", - "file": "sys/commit.h", - "line": 34, - "lineto": 44, + "file": "git2/tag.h", + "line": 33, + "lineto": 34, "args": [ { - "name": "id", - "type": "git_oid *", - "comment": null + "name": "out", + "type": "git_tag **", + "comment": "pointer to the looked up tag" }, { "name": "repo", "type": "git_repository *", - "comment": null - }, - { - "name": "update_ref", - "type": "const char *", - "comment": null - }, - { - "name": "author", - "type": "const git_signature *", - "comment": null + "comment": "the repo to use when locating the tag." }, { - "name": "committer", - "type": "const git_signature *", - "comment": null - }, + "name": "id", + "type": "const git_oid *", + "comment": "identity of the tag to locate." + } + ], + "argline": "git_tag **out, git_repository *repo, const git_oid *id", + "sig": "git_tag **::git_repository *::const git_oid *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a tag object from the repository.

\n", + "comments": "", + "group": "tag", + "examples": { "general.c": ["ex/v1.9.1/general.html#git_tag_lookup-91"] } + }, + "git_tag_lookup_prefix": { + "type": "function", + "file": "git2/tag.h", + "line": 48, + "lineto": 49, + "args": [ { - "name": "message_encoding", - "type": "const char *", - "comment": null + "name": "out", + "type": "git_tag **", + "comment": "pointer to the looked up tag" }, { - "name": "message", - "type": "const char *", - "comment": null + "name": "repo", + "type": "git_repository *", + "comment": "the repo to use when locating the tag." }, { - "name": "tree", + "name": "id", "type": "const git_oid *", - "comment": null + "comment": "identity of the tag to locate." }, { - "name": "parent_count", + "name": "len", "type": "size_t", - "comment": null - }, - { - "name": "parents", - "type": "const git_oid *[]", - "comment": null + "comment": "the length of the short identifier" } ], - "argline": "git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_oid *tree, size_t parent_count, const git_oid *[] parents", - "sig": "git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_oid *::size_t::const git_oid *[]", - "return": { - "type": "int", - "comment": null - }, - "description": "

Create new commit in the repository from a list of git_oid values.

\n", - "comments": "

See documentation for git_commit_create() for information about the parameters, as the meaning is identical excepting that tree and parents now take git_oid. This is a dangerous API in that nor the tree, neither the parents list of git_oids are checked for validity.

\n", - "group": "commit" + "argline": "git_tag **out, git_repository *repo, const git_oid *id, size_t len", + "sig": "git_tag **::git_repository *::const git_oid *::size_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a tag object from the repository,\n given a prefix of its identifier (short id).

\n", + "comments": "", + "group": "tag" }, - "git_commit_create_from_callback": { + "git_tag_free": { "type": "function", - "file": "sys/commit.h", - "line": 66, - "lineto": 76, + "file": "git2/tag.h", + "line": 61, + "lineto": 61, "args": [ - { - "name": "id", - "type": "git_oid *", - "comment": null - }, - { - "name": "repo", - "type": "git_repository *", - "comment": null - }, - { - "name": "update_ref", - "type": "const char *", - "comment": null - }, - { - "name": "author", - "type": "const git_signature *", - "comment": null - }, - { - "name": "committer", - "type": "const git_signature *", - "comment": null - }, - { - "name": "message_encoding", - "type": "const char *", - "comment": null - }, - { - "name": "message", - "type": "const char *", - "comment": null - }, - { - "name": "tree", - "type": "const git_oid *", - "comment": null - }, - { - "name": "parent_cb", - "type": "git_commit_parent_callback", - "comment": null - }, - { - "name": "parent_payload", - "type": "void *", - "comment": null - } + { "name": "tag", "type": "git_tag *", "comment": "the tag to close" } ], - "argline": "git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_oid *tree, git_commit_parent_callback parent_cb, void *parent_payload", - "sig": "git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_oid *::git_commit_parent_callback::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Create a new commit in the repository with an callback to supply parents.

\n", - "comments": "

See documentation for git_commit_create() for information about the parameters, as the meaning is identical excepting that tree takes a git_oid and doesn't check for validity, and parent_cb is invoked with parent_payload and should return git_oid values or NULL to indicate that all parents are accounted for.

\n", - "group": "commit" + "argline": "git_tag *tag", + "sig": "git_tag *", + "return": { "type": "void", "comment": null }, + "description": "

Close an open tag

\n", + "comments": "

You can no longer use the git_tag pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you are through with a tag to release memory. Failure to do so will cause a memory leak.

\n", + "group": "tag", + "examples": { "general.c": ["ex/v1.9.1/general.html#git_tag_free-92"] } }, - "git_config_init_backend": { + "git_tag_id": { "type": "function", - "file": "sys/config.h", - "line": 97, - "lineto": 99, + "file": "git2/tag.h", + "line": 69, + "lineto": 69, "args": [ { - "name": "backend", - "type": "git_config_backend *", - "comment": "the `git_config_backend` struct to initialize." - }, - { - "name": "version", - "type": "unsigned int", - "comment": "Version of struct; pass `GIT_CONFIG_BACKEND_VERSION`" + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." } ], - "argline": "git_config_backend *backend, unsigned int version", - "sig": "git_config_backend *::unsigned int", + "argline": "const git_tag *tag", + "sig": "const git_tag *", "return": { - "type": "int", - "comment": " Zero on success; -1 on failure." + "type": "const git_oid *", + "comment": " object identity for the tag." }, - "description": "

Initializes a git_config_backend with default values. Equivalent to\n creating an instance with GIT_CONFIG_BACKEND_INIT.

\n", + "description": "

Get the id of a tag.

\n", "comments": "", - "group": "config" + "group": "tag" }, - "git_config_add_backend": { + "git_tag_owner": { "type": "function", - "file": "sys/config.h", - "line": 119, - "lineto": 123, + "file": "git2/tag.h", + "line": 77, + "lineto": 77, "args": [ { - "name": "cfg", - "type": "git_config *", - "comment": "the configuration to add the file to" - }, - { - "name": "file", - "type": "git_config_backend *", - "comment": "the configuration file (backend) to add" - }, - { - "name": "level", - "type": "git_config_level_t", - "comment": "the priority level of the backend" - }, - { - "name": "force", - "type": "int", - "comment": "if a config file already exists for the given\n priority level, replace it" + "name": "tag", + "type": "const git_tag *", + "comment": "A previously loaded tag." } ], - "argline": "git_config *cfg, git_config_backend *file, git_config_level_t level, int force", - "sig": "git_config *::git_config_backend *::git_config_level_t::int", + "argline": "const git_tag *tag", + "sig": "const git_tag *", "return": { - "type": "int", - "comment": " 0 on success, GIT_EEXISTS when adding more than one file\n for a given priority level (and force_replace set to 0), or error code" + "type": "git_repository *", + "comment": " Repository that contains this tag." }, - "description": "

Add a generic config file instance to an existing config

\n", - "comments": "

Note that the configuration object will free the file automatically.

\n\n

Further queries on this config object will access each of the config file instances in order (instances with a higher priority level will be accessed first).

\n", - "group": "config" + "description": "

Get the repository that contains the tag.

\n", + "comments": "", + "group": "tag" }, - "git_diff_print_callback__to_buf": { + "git_tag_target": { "type": "function", - "file": "sys/diff.h", - "line": 37, - "lineto": 41, + "file": "git2/tag.h", + "line": 89, + "lineto": 89, "args": [ { - "name": "delta", - "type": "const git_diff_delta *", - "comment": null - }, - { - "name": "hunk", - "type": "const git_diff_hunk *", - "comment": null - }, - { - "name": "line", - "type": "const git_diff_line *", - "comment": null + "name": "target_out", + "type": "git_object **", + "comment": "pointer where to store the target" }, { - "name": "payload", - "type": "void *", - "comment": null + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." } ], - "argline": "const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload", - "sig": "const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Diff print callback that writes to a git_buf.

\n", - "comments": "

This function is provided not for you to call it directly, but instead so you can use it as a function pointer to the git_diff_print or git_patch_print APIs. When using those APIs, you specify a callback to actually handle the diff and/or patch data.

\n\n

Use this callback to easily write that data to a git_buf buffer. You must pass a git_buf * value as the payload to the git_diff_print and/or git_patch_print function. The data will be appended to the buffer (after any existing content).

\n", - "group": "diff" + "argline": "git_object **target_out, const git_tag *tag", + "sig": "git_object **::const git_tag *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the tagged object of a tag

\n", + "comments": "

This method performs a repository lookup for the given object and returns it

\n", + "group": "tag", + "examples": { "general.c": ["ex/v1.9.1/general.html#git_tag_target-93"] } }, - "git_diff_print_callback__to_file_handle": { + "git_tag_target_id": { "type": "function", - "file": "sys/diff.h", - "line": 57, - "lineto": 61, + "file": "git2/tag.h", + "line": 97, + "lineto": 97, "args": [ { - "name": "delta", - "type": "const git_diff_delta *", - "comment": null - }, - { - "name": "hunk", - "type": "const git_diff_hunk *", - "comment": null - }, - { - "name": "line", - "type": "const git_diff_line *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." } ], - "argline": "const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload", - "sig": "const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Diff print callback that writes to stdio FILE handle.

\n", - "comments": "

This function is provided not for you to call it directly, but instead so you can use it as a function pointer to the git_diff_print or git_patch_print APIs. When using those APIs, you specify a callback to actually handle the diff and/or patch data.

\n\n

Use this callback to easily write that data to a stdio FILE handle. You must pass a FILE * value (such as stdout or stderr or the return value from fopen()) as the payload to the git_diff_print and/or git_patch_print function. If you pass NULL, this will write data to stdout.

\n", - "group": "diff" + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { "type": "const git_oid *", "comment": " pointer to the OID" }, + "description": "

Get the OID of the tagged object of a tag

\n", + "comments": "", + "group": "tag", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tag_target_id-31"] + } }, - "git_diff_get_perfdata": { + "git_tag_target_type": { "type": "function", - "file": "sys/diff.h", - "line": 83, - "lineto": 84, + "file": "git2/tag.h", + "line": 105, + "lineto": 105, "args": [ { - "name": "out", - "type": "git_diff_perfdata *", - "comment": "Structure to be filled with diff performance data" - }, - { - "name": "diff", - "type": "const git_diff *", - "comment": "Diff to read performance data from" + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." } ], - "argline": "git_diff_perfdata *out, const git_diff *diff", - "sig": "git_diff_perfdata *::const git_diff *", + "argline": "const git_tag *tag", + "sig": "const git_tag *", "return": { - "type": "int", - "comment": " 0 for success, \n<\n0 for error" + "type": "git_object_t", + "comment": " type of the tagged object" }, - "description": "

Get performance data for a diff object.

\n", + "description": "

Get the type of a tag's tagged object

\n", "comments": "", - "group": "diff" + "group": "tag", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tag_target_type-32"], + "general.c": ["ex/v1.9.1/general.html#git_tag_target_type-94"] + } }, - "git_status_list_get_perfdata": { + "git_tag_name": { "type": "function", - "file": "sys/diff.h", - "line": 89, - "lineto": 90, + "file": "git2/tag.h", + "line": 113, + "lineto": 113, "args": [ { - "name": "out", - "type": "git_diff_perfdata *", - "comment": null - }, - { - "name": "status", - "type": "const git_status_list *", - "comment": null + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." } ], - "argline": "git_diff_perfdata *out, const git_status_list *status", - "sig": "git_diff_perfdata *::const git_status_list *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Get performance data for diffs from a git_status_list

\n", + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { "type": "const char *", "comment": " name of the tag" }, + "description": "

Get the name of a tag

\n", "comments": "", - "group": "status" + "group": "tag", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tag_name-33"], + "general.c": ["ex/v1.9.1/general.html#git_tag_name-95"], + "tag.c": ["ex/v1.9.1/tag.html#git_tag_name-16"] + } }, - "git_filter_lookup": { + "git_tag_tagger": { "type": "function", - "file": "sys/filter.h", - "line": 27, - "lineto": 27, + "file": "git2/tag.h", + "line": 121, + "lineto": 121, "args": [ { - "name": "name", - "type": "const char *", - "comment": "The name of the filter" + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." } ], - "argline": "const char *name", - "sig": "const char *", - "return": { - "type": "git_filter *", - "comment": " Pointer to the filter object or NULL if not found" + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { + "type": "const git_signature *", + "comment": " reference to the tag's author or NULL when unspecified" }, - "description": "

Look up a filter by name

\n", + "description": "

Get the tagger (author) of a tag

\n", "comments": "", - "group": "filter" + "group": "tag", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tag_tagger-34"] + } }, - "git_filter_list_new": { + "git_tag_message": { "type": "function", - "file": "sys/filter.h", - "line": 57, - "lineto": 61, + "file": "git2/tag.h", + "line": 129, + "lineto": 129, "args": [ { - "name": "out", - "type": "git_filter_list **", - "comment": null + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." + } + ], + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { + "type": "const char *", + "comment": " message of the tag or NULL when unspecified" + }, + "description": "

Get the message of a tag

\n", + "comments": "", + "group": "tag", + "examples": { + "cat-file.c": [ + "ex/v1.9.1/cat-file.html#git_tag_message-35", + "ex/v1.9.1/cat-file.html#git_tag_message-36" + ], + "general.c": ["ex/v1.9.1/general.html#git_tag_message-96"], + "tag.c": ["ex/v1.9.1/tag.html#git_tag_message-17"] + } + }, + "git_tag_create": { + "type": "function", + "file": "git2/tag.h", + "line": 171, + "lineto": 178, + "args": [ + { + "name": "oid", + "type": "git_oid *", + "comment": "Pointer where to store the OID of the\n newly created tag. If the tag already exists, this parameter\n will be the oid of the existing tag, and the function will\n return a GIT_EEXISTS error code." }, { "name": "repo", "type": "git_repository *", - "comment": null + "comment": "Repository where to store the tag" }, { - "name": "mode", - "type": "git_filter_mode_t", - "comment": null + "name": "tag_name", + "type": "const char *", + "comment": "Name for the tag; this name is validated\n for consistency. It should also not conflict with an\n already existing tag name" }, { - "name": "options", - "type": "uint32_t", - "comment": null - } - ], - "argline": "git_filter_list **out, git_repository *repo, git_filter_mode_t mode, uint32_t options", - "sig": "git_filter_list **::git_repository *::git_filter_mode_t::uint32_t", - "return": { - "type": "int", - "comment": null - }, - "description": "

Create a new empty filter list

\n", - "comments": "

Normally you won't use this because git_filter_list_load will create the filter list for you, but you can use this in combination with the git_filter_lookup and git_filter_list_push functions to assemble your own chains of filters.

\n", - "group": "filter" - }, - "git_filter_list_push": { - "type": "function", - "file": "sys/filter.h", - "line": 76, - "lineto": 77, - "args": [ + "name": "target", + "type": "const git_object *", + "comment": "Object to which this tag points. This object\n must belong to the given `repo`." + }, { - "name": "fl", - "type": "git_filter_list *", - "comment": null + "name": "tagger", + "type": "const git_signature *", + "comment": "Signature of the tagger for this tag, and\n of the tagging time" }, { - "name": "filter", - "type": "git_filter *", - "comment": null + "name": "message", + "type": "const char *", + "comment": "Full message for this tag" }, { - "name": "payload", - "type": "void *", - "comment": null + "name": "force", + "type": "int", + "comment": "Overwrite existing references" } ], - "argline": "git_filter_list *fl, git_filter *filter, void *payload", - "sig": "git_filter_list *::git_filter *::void *", + "argline": "git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, const git_signature *tagger, const char *message, int force", + "sig": "git_oid *::git_repository *::const char *::const git_object *::const git_signature *::const char *::int", "return": { "type": "int", - "comment": null + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code\n\tA tag object is written to the ODB, and a proper reference\n\tis written in the /refs/tags folder, pointing to it" }, - "description": "

Add a filter to a filter list with the given payload.

\n", - "comments": "

Normally you won't have to do this because the filter list is created by calling the "check" function on registered filters when the filter attributes are set, but this does allow more direct manipulation of filter lists when desired.

\n\n

Note that normally the "check" function can set up a payload for the filter. Using this function, you can either pass in a payload if you know the expected payload format, or you can pass NULL. Some filters may fail with a NULL payload. Good luck!

\n", - "group": "filter" + "description": "

Create a new tag in the repository from an object

\n", + "comments": "

A new reference will also be created pointing to this tag object. If force is true and a reference already exists with the given name, it'll be replaced.

\n\n

The message will not be cleaned up. This can be achieved through git_message_prettify().

\n\n

The tag name will be checked for validity. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.

\n", + "group": "tag", + "examples": { "tag.c": ["ex/v1.9.1/tag.html#git_tag_create-18"] } }, - "git_filter_list_length": { + "git_tag_annotation_create": { "type": "function", - "file": "sys/filter.h", - "line": 90, - "lineto": 90, + "file": "git2/tag.h", + "line": 203, + "lineto": 209, "args": [ { - "name": "fl", - "type": "const git_filter_list *", - "comment": "A filter list" + "name": "oid", + "type": "git_oid *", + "comment": "Pointer where to store the OID of the\n newly created tag" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to store the tag" + }, + { + "name": "tag_name", + "type": "const char *", + "comment": "Name for the tag" + }, + { + "name": "target", + "type": "const git_object *", + "comment": "Object to which this tag points. This object\n must belong to the given `repo`." + }, + { + "name": "tagger", + "type": "const git_signature *", + "comment": "Signature of the tagger for this tag, and\n of the tagging time" + }, + { + "name": "message", + "type": "const char *", + "comment": "Full message for this tag" } ], - "argline": "const git_filter_list *fl", - "sig": "const git_filter_list *", - "return": { - "type": "size_t", - "comment": " The number of filters in the list" - }, - "description": "

Look up how many filters are in the list

\n", - "comments": "

We will attempt to apply all of these filters to any data passed in, but note that the filter apply action still has the option of skipping data that is passed in (for example, the CRLF filter will skip data that appears to be binary).

\n", - "group": "filter" + "argline": "git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, const git_signature *tagger, const char *message", + "sig": "git_oid *::git_repository *::const char *::const git_object *::const git_signature *::const char *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Create a new tag in the object database pointing to a git_object

\n", + "comments": "

The message will not be cleaned up. This can be achieved through git_message_prettify().

\n", + "group": "tag" }, - "git_filter_source_repo": { + "git_tag_create_from_buffer": { "type": "function", - "file": "sys/filter.h", - "line": 100, - "lineto": 100, + "file": "git2/tag.h", + "line": 220, + "lineto": 224, "args": [ { - "name": "src", - "type": "const git_filter_source *", - "comment": null - } + "name": "oid", + "type": "git_oid *", + "comment": "Pointer where to store the OID of the newly created tag" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to store the tag" + }, + { "name": "buffer", "type": "const char *", "comment": "Raw tag data" }, + { "name": "force", "type": "int", "comment": "Overwrite existing tags" } ], - "argline": "const git_filter_source *src", - "sig": "const git_filter_source *", + "argline": "git_oid *oid, git_repository *repo, const char *buffer, int force", + "sig": "git_oid *::git_repository *::const char *::int", "return": { - "type": "git_repository *", - "comment": null + "type": "int", + "comment": " 0 on success; error code otherwise" }, - "description": "

Get the repository that the source data is coming from.

\n", + "description": "

Create a new tag in the repository from a buffer

\n", "comments": "", - "group": "filter" + "group": "tag" }, - "git_filter_source_path": { + "git_tag_create_lightweight": { "type": "function", - "file": "sys/filter.h", - "line": 105, - "lineto": 105, + "file": "git2/tag.h", + "line": 256, + "lineto": 261, "args": [ { - "name": "src", - "type": "const git_filter_source *", - "comment": null + "name": "oid", + "type": "git_oid *", + "comment": "Pointer where to store the OID of the provided\n target object. If the tag already exists, this parameter\n will be filled with the oid of the existing pointed object\n and the function will return a GIT_EEXISTS error code." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to store the lightweight tag" + }, + { + "name": "tag_name", + "type": "const char *", + "comment": "Name for the tag; this name is validated\n for consistency. It should also not conflict with an\n already existing tag name" + }, + { + "name": "target", + "type": "const git_object *", + "comment": "Object to which this tag points. This object\n must belong to the given `repo`." + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing references" } ], - "argline": "const git_filter_source *src", - "sig": "const git_filter_source *", + "argline": "git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, int force", + "sig": "git_oid *::git_repository *::const char *::const git_object *::int", "return": { - "type": "const char *", - "comment": null + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code\n\tA proper reference is written in the /refs/tags folder,\n pointing to the provided target object" }, - "description": "

Get the path that the source data is coming from.

\n", - "comments": "", - "group": "filter" + "description": "

Create a new lightweight tag pointing at a target object

\n", + "comments": "

A new direct reference will be created pointing to this target object. If force is true and a reference already exists with the given name, it'll be replaced.

\n\n

The tag name will be checked for validity. See git_tag_create() for rules about valid names.

\n", + "group": "tag", + "examples": { + "tag.c": ["ex/v1.9.1/tag.html#git_tag_create_lightweight-19"] + } }, - "git_filter_source_filemode": { + "git_tag_delete": { "type": "function", - "file": "sys/filter.h", - "line": 111, - "lineto": 111, + "file": "git2/tag.h", + "line": 276, + "lineto": 278, "args": [ { - "name": "src", - "type": "const git_filter_source *", - "comment": null + "name": "repo", + "type": "git_repository *", + "comment": "Repository where lives the tag" + }, + { + "name": "tag_name", + "type": "const char *", + "comment": "Name of the tag to be deleted;\n this name is validated for consistency." } ], - "argline": "const git_filter_source *src", - "sig": "const git_filter_source *", + "argline": "git_repository *repo, const char *tag_name", + "sig": "git_repository *::const char *", "return": { - "type": "uint16_t", - "comment": null + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code" }, - "description": "

Get the file mode of the source file\n If the mode is unknown, this will return 0

\n", - "comments": "", - "group": "filter" + "description": "

Delete an existing tag reference.

\n", + "comments": "

The tag name will be checked for validity. See git_tag_create() for rules about valid names.

\n", + "group": "tag", + "examples": { "tag.c": ["ex/v1.9.1/tag.html#git_tag_delete-20"] } }, - "git_filter_source_id": { + "git_tag_list": { "type": "function", - "file": "sys/filter.h", - "line": 118, - "lineto": 118, + "file": "git2/tag.h", + "line": 293, + "lineto": 295, "args": [ { - "name": "src", - "type": "const git_filter_source *", - "comment": null + "name": "tag_names", + "type": "git_strarray *", + "comment": "Pointer to a git_strarray structure where\n\t\tthe tag names will be stored" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the tags" } ], - "argline": "const git_filter_source *src", - "sig": "const git_filter_source *", - "return": { - "type": "const git_oid *", - "comment": null - }, - "description": "

Get the OID of the source\n If the OID is unknown (often the case with GIT_FILTER_CLEAN) then\n this will return NULL.

\n", - "comments": "", - "group": "filter" + "argline": "git_strarray *tag_names, git_repository *repo", + "sig": "git_strarray *::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Fill a list with all the tags in the Repository

\n", + "comments": "

The string array will be filled with the names of the matching tags; these values are owned by the user and should be free'd manually when no longer needed, using git_strarray_free.

\n", + "group": "tag" }, - "git_filter_source_mode": { + "git_tag_list_match": { "type": "function", - "file": "sys/filter.h", - "line": 123, - "lineto": 123, + "file": "git2/tag.h", + "line": 315, + "lineto": 318, "args": [ { - "name": "src", - "type": "const git_filter_source *", - "comment": null - } - ], - "argline": "const git_filter_source *src", - "sig": "const git_filter_source *", - "return": { - "type": "git_filter_mode_t", - "comment": null - }, - "description": "

Get the git_filter_mode_t to be used

\n", - "comments": "", - "group": "filter" - }, - "git_filter_source_flags": { - "type": "function", - "file": "sys/filter.h", - "line": 128, - "lineto": 128, - "args": [ + "name": "tag_names", + "type": "git_strarray *", + "comment": "Pointer to a git_strarray structure where\n\t\tthe tag names will be stored" + }, { - "name": "src", - "type": "const git_filter_source *", - "comment": null + "name": "pattern", + "type": "const char *", + "comment": "Standard fnmatch pattern" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the tags" } ], - "argline": "const git_filter_source *src", - "sig": "const git_filter_source *", - "return": { - "type": "uint32_t", - "comment": null - }, - "description": "

Get the combination git_filter_flag_t options to be applied

\n", - "comments": "", - "group": "filter" + "argline": "git_strarray *tag_names, const char *pattern, git_repository *repo", + "sig": "git_strarray *::const char *::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Fill a list with all the tags in the Repository\n which name match a defined pattern

\n", + "comments": "

If an empty pattern is provided, all the tags will be returned.

\n\n

The string array will be filled with the names of the matching tags; these values are owned by the user and should be free'd manually when no longer needed, using git_strarray_free.

\n", + "group": "tag", + "examples": { "tag.c": ["ex/v1.9.1/tag.html#git_tag_list_match-21"] } }, - "git_filter_register": { + "git_tag_foreach": { "type": "function", - "file": "sys/filter.h", - "line": 301, - "lineto": 302, + "file": "git2/tag.h", + "line": 340, + "lineto": 343, "args": [ + { "name": "repo", "type": "git_repository *", "comment": "Repository" }, { - "name": "name", - "type": "const char *", - "comment": "A name by which the filter can be referenced. Attempting\n \t\t\tto register with an in-use name will return GIT_EEXISTS." - }, - { - "name": "filter", - "type": "git_filter *", - "comment": "The filter definition. This pointer will be stored as is\n \t\t\tby libgit2 so it must be a durable allocation (either static\n \t\t\tor on the heap)." + "name": "callback", + "type": "git_tag_foreach_cb", + "comment": "Callback function" }, { - "name": "priority", - "type": "int", - "comment": "The priority for filter application" + "name": "payload", + "type": "void *", + "comment": "Pointer to callback data (optional)" } ], - "argline": "const char *name, git_filter *filter, int priority", - "sig": "const char *::git_filter *::int", - "return": { - "type": "int", - "comment": " 0 on successful registry, error code \n<\n0 on failure" - }, - "description": "

Register a filter under a given name with a given priority.

\n", - "comments": "

As mentioned elsewhere, the initialize callback will not be invoked immediately. It is deferred until the filter is used in some way.

\n\n

A filter's attribute checks and check and apply callbacks will be issued in order of priority on smudge (to workdir), and in reverse order of priority on clean (to odb).

\n\n

Two filters are preregistered with libgit2: - GIT_FILTER_CRLF with priority 0 - GIT_FILTER_IDENT with priority 100

\n\n

Currently the filter registry is not thread safe, so any registering or deregistering of filters must be done outside of any possible usage of the filters (i.e. during application setup or shutdown).

\n", - "group": "filter" + "argline": "git_repository *repo, git_tag_foreach_cb callback, void *payload", + "sig": "git_repository *::git_tag_foreach_cb::void *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Call callback `cb' for each tag in the repository

\n", + "comments": "", + "group": "tag" }, - "git_filter_unregister": { + "git_tag_peel": { "type": "function", - "file": "sys/filter.h", - "line": 317, - "lineto": 317, + "file": "git2/tag.h", + "line": 356, + "lineto": 358, "args": [ { - "name": "name", - "type": "const char *", - "comment": "The name under which the filter was registered" + "name": "tag_target_out", + "type": "git_object **", + "comment": "Pointer to the peeled git_object" + }, + { + "name": "tag", + "type": "const git_tag *", + "comment": "The tag to be processed" } ], - "argline": "const char *name", - "sig": "const char *", - "return": { - "type": "int", - "comment": " 0 on success, error code \n<\n0 on failure" - }, - "description": "

Remove the filter with the given name

\n", - "comments": "

Attempting to remove the builtin libgit2 filters is not permitted and will return an error.

\n\n

Currently the filter registry is not thread safe, so any registering or deregistering of filters must be done outside of any possible usage of the filters (i.e. during application setup or shutdown).

\n", - "group": "filter" + "argline": "git_object **tag_target_out, const git_tag *tag", + "sig": "git_object **::const git_tag *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Recursively peel a tag until a non tag git_object is found

\n", + "comments": "

The retrieved tag_target object is owned by the repository and should be closed with the git_object_free method.

\n", + "group": "tag" }, - "git_hashsig_create": { + "git_tag_dup": { "type": "function", - "file": "sys/hashsig.h", - "line": 62, - "lineto": 66, + "file": "git2/tag.h", + "line": 368, + "lineto": 368, "args": [ { "name": "out", - "type": "git_hashsig **", - "comment": "The computed similarity signature." - }, - { - "name": "buf", - "type": "const char *", - "comment": "The input buffer." - }, - { - "name": "buflen", - "type": "size_t", - "comment": "The input buffer size." + "type": "git_tag **", + "comment": "Pointer to store the copy of the tag" }, { - "name": "opts", - "type": "git_hashsig_option_t", - "comment": "The signature computation options (see above)." + "name": "source", + "type": "git_tag *", + "comment": "Original tag to copy" } ], - "argline": "git_hashsig **out, const char *buf, size_t buflen, git_hashsig_option_t opts", - "sig": "git_hashsig **::const char *::size_t::git_hashsig_option_t", - "return": { - "type": "int", - "comment": " 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to\n compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or\n error code." - }, - "description": "

Compute a similarity signature for a text buffer

\n", - "comments": "

If you have passed the option GIT_HASHSIG_IGNORE_WHITESPACE, then the whitespace will be removed from the buffer while it is being processed, modifying the buffer in place. Sorry about that!

\n", - "group": "hashsig" + "argline": "git_tag **out, git_tag *source", + "sig": "git_tag **::git_tag *", + "return": { "type": "int", "comment": " 0" }, + "description": "

Create an in-memory copy of a tag. The copy must be explicitly\n free'd or it will leak.

\n", + "comments": "", + "group": "tag" }, - "git_hashsig_create_fromfile": { + "git_tag_name_is_valid": { "type": "function", - "file": "sys/hashsig.h", - "line": 81, - "lineto": 84, + "file": "git2/tag.h", + "line": 380, + "lineto": 380, "args": [ { - "name": "out", - "type": "git_hashsig **", - "comment": "The computed similarity signature." + "name": "valid", + "type": "int *", + "comment": "output pointer to set with validity of given tag name" }, { - "name": "path", + "name": "name", "type": "const char *", - "comment": "The path to the input file." - }, - { - "name": "opts", - "type": "git_hashsig_option_t", - "comment": "The signature computation options (see above)." + "comment": "a tag name to test" } ], - "argline": "git_hashsig **out, const char *path, git_hashsig_option_t opts", - "sig": "git_hashsig **::const char *::git_hashsig_option_t", - "return": { - "type": "int", - "comment": " 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to\n compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or\n error code." - }, - "description": "

Compute a similarity signature for a text file

\n", - "comments": "

This walks through the file, only loading a maximum of 4K of file data at a time. Otherwise, it acts just like git_hashsig_create.

\n", - "group": "hashsig" + "argline": "int *valid, const char *name", + "sig": "int *::const char *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Determine whether a tag name is valid, meaning that (when prefixed\n with refs/tags/) that it is a valid reference name, and that any\n additional tag name restrictions are imposed (eg, it cannot start\n with a -).

\n", + "comments": "", + "group": "tag" }, - "git_hashsig_free": { + "git_trace_set": { "type": "function", - "file": "sys/hashsig.h", - "line": 91, - "lineto": 91, + "file": "git2/trace.h", + "line": 68, + "lineto": 68, "args": [ { - "name": "sig", - "type": "git_hashsig *", - "comment": "The similarity signature to free." + "name": "level", + "type": "git_trace_level_t", + "comment": "Level to set tracing to" + }, + { + "name": "cb", + "type": "git_trace_cb", + "comment": "Function to call with trace data" } ], - "argline": "git_hashsig *sig", - "sig": "git_hashsig *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Release memory for a content similarity signature

\n", + "argline": "git_trace_level_t level, git_trace_cb cb", + "sig": "git_trace_level_t::git_trace_cb", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Sets the system tracing configuration to the specified level with the\n specified callback. When system events occur at a level equal to, or\n lower than, the given level they will be reported to the given callback.

\n", "comments": "", - "group": "hashsig" + "group": "trace" }, - "git_hashsig_compare": { + "git_transaction_new": { "type": "function", - "file": "sys/hashsig.h", - "line": 100, - "lineto": 102, + "file": "git2/transaction.h", + "line": 32, + "lineto": 32, "args": [ { - "name": "a", - "type": "const git_hashsig *", - "comment": "The first similarity signature to compare." + "name": "out", + "type": "git_transaction **", + "comment": "the resulting transaction" }, { - "name": "b", - "type": "const git_hashsig *", - "comment": "The second similarity signature to compare." + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to lock" } ], - "argline": "const git_hashsig *a, const git_hashsig *b", - "sig": "const git_hashsig *::const git_hashsig *", - "return": { - "type": "int", - "comment": " [0 to 100] on success as the similarity score, or error code." - }, - "description": "

Measure similarity score between two similarity signatures

\n", - "comments": "", - "group": "hashsig" + "argline": "git_transaction **out, git_repository *repo", + "sig": "git_transaction **::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a new transaction object

\n", + "comments": "

This does not lock anything, but sets up the transaction object to know from which repository to lock.

\n", + "group": "transaction" }, - "git_mempack_new": { + "git_transaction_lock_ref": { "type": "function", - "file": "sys/mempack.h", + "file": "git2/transaction.h", "line": 44, "lineto": 44, "args": [ { - "name": "out", - "type": "git_odb_backend **", - "comment": "Poiter where to store the ODB backend" + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the reference to lock" } ], - "argline": "git_odb_backend **out", - "sig": "git_odb_backend **", - "return": { - "type": "int", - "comment": " 0 on success; error code otherwise" - }, - "description": "
Instantiate a new mempack backend.\n
\n", - "comments": "
The backend must be added to an existing ODB with the highest   priority.\n\n    git_mempack_new(&mempacker);        git_repository_odb(&odb, repository);       git_odb_add_backend(odb, mempacker, 999);\n\nOnce the backend has been loaded, all writes to the ODB will    instead be queued in memory, and can be finalized with  `git_mempack_dump`.\n\nSubsequent reads will also be served from the in-memory store   to ensure consistency, until the memory store is dumped.\n
\n", - "group": "mempack" + "argline": "git_transaction *tx, const char *refname", + "sig": "git_transaction *::const char *", + "return": { "type": "int", "comment": " 0 or an error message" }, + "description": "

Lock a reference

\n", + "comments": "

Lock the specified reference. This is the first step to updating a reference.

\n", + "group": "transaction" }, - "git_mempack_reset": { + "git_transaction_set_target": { "type": "function", - "file": "sys/mempack.h", - "line": 81, - "lineto": 81, + "file": "git2/transaction.h", + "line": 59, + "lineto": 59, "args": [ { - "name": "backend", - "type": "git_odb_backend *", - "comment": "The mempack backend" + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + }, + { + "name": "refname", + "type": "const char *", + "comment": "reference to update" + }, + { + "name": "target", + "type": "const git_oid *", + "comment": "target to set the reference to" + }, + { + "name": "sig", + "type": "const git_signature *", + "comment": "signature to use in the reflog; pass NULL to read the identity from the config" + }, + { + "name": "msg", + "type": "const char *", + "comment": "message to use in the reflog" } ], - "argline": "git_odb_backend *backend", - "sig": "git_odb_backend *", + "argline": "git_transaction *tx, const char *refname, const git_oid *target, const git_signature *sig, const char *msg", + "sig": "git_transaction *::const char *::const git_oid *::const git_signature *::const char *", "return": { - "type": "void", - "comment": null + "type": "int", + "comment": " 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code" }, - "description": "
Reset the memory packer by clearing all the queued objects.\n
\n", - "comments": "
This assumes that `git_mempack_dump` has been called before to  store all the queued objects into a single packfile.\n\nAlternatively, call `reset` without a previous dump to "undo"   all the recently written objects, giving transaction-like   semantics to the Git repository.\n
\n", - "group": "mempack" + "description": "

Set the target of a reference

\n", + "comments": "

Set the target of the specified reference. This reference must be locked.

\n", + "group": "transaction" }, - "git_odb_init_backend": { + "git_transaction_set_symbolic_target": { "type": "function", - "file": "sys/odb_backend.h", - "line": 115, - "lineto": 117, + "file": "git2/transaction.h", + "line": 74, + "lineto": 74, "args": [ { - "name": "backend", - "type": "git_odb_backend *", - "comment": "the `git_odb_backend` struct to initialize." + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" }, { - "name": "version", - "type": "unsigned int", - "comment": "Version the struct; pass `GIT_ODB_BACKEND_VERSION`" + "name": "refname", + "type": "const char *", + "comment": "reference to update" + }, + { + "name": "target", + "type": "const char *", + "comment": "target to set the reference to" + }, + { + "name": "sig", + "type": "const git_signature *", + "comment": "signature to use in the reflog; pass NULL to read the identity from the config" + }, + { + "name": "msg", + "type": "const char *", + "comment": "message to use in the reflog" } ], - "argline": "git_odb_backend *backend, unsigned int version", - "sig": "git_odb_backend *::unsigned int", - "return": { - "type": "int", - "comment": " Zero on success; -1 on failure." - }, - "description": "

Initializes a git_odb_backend with default values. Equivalent to\n creating an instance with GIT_ODB_BACKEND_INIT.

\n", - "comments": "", - "group": "odb" - }, - "git_openssl_set_locking": { - "type": "function", - "file": "sys/openssl.h", - "line": 34, - "lineto": 34, - "args": [], - "argline": "", - "sig": "", + "argline": "git_transaction *tx, const char *refname, const char *target, const git_signature *sig, const char *msg", + "sig": "git_transaction *::const char *::const char *::const git_signature *::const char *", "return": { "type": "int", - "comment": " 0 on success, -1 if there are errors or if libgit2 was not\n built with OpenSSL and threading support." + "comment": " 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code" }, - "description": "

Initialize the OpenSSL locks

\n", - "comments": "

OpenSSL requires the application to determine how it performs locking.

\n\n

This is a last-resort convenience function which libgit2 provides for allocating and initializing the locks as well as setting the locking function to use the system's native locking functions.

\n\n

The locking function will be cleared and the memory will be freed when you call git_threads_sutdown().

\n\n

If your programming language has an OpenSSL package/bindings, it likely sets up locking. You should very strongly prefer that over this function.

\n", - "group": "openssl" + "description": "

Set the target of a reference

\n", + "comments": "

Set the target of the specified reference. This reference must be locked.

\n", + "group": "transaction" }, - "git_refdb_init_backend": { + "git_transaction_set_reflog": { "type": "function", - "file": "sys/refdb_backend.h", - "line": 183, - "lineto": 185, + "file": "git2/transaction.h", + "line": 87, + "lineto": 87, "args": [ { - "name": "backend", - "type": "git_refdb_backend *", - "comment": "the `git_refdb_backend` struct to initialize" + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" }, { - "name": "version", - "type": "unsigned int", - "comment": "Version of struct; pass `GIT_REFDB_BACKEND_VERSION`" + "name": "refname", + "type": "const char *", + "comment": "the reference whose reflog to set" + }, + { + "name": "reflog", + "type": "const git_reflog *", + "comment": "the reflog as it should be written out" } ], - "argline": "git_refdb_backend *backend, unsigned int version", - "sig": "git_refdb_backend *::unsigned int", + "argline": "git_transaction *tx, const char *refname, const git_reflog *reflog", + "sig": "git_transaction *::const char *::const git_reflog *", "return": { "type": "int", - "comment": " Zero on success; -1 on failure." + "comment": " 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code" }, - "description": "

Initializes a git_refdb_backend with default values. Equivalent to\n creating an instance with GIT_REFDB_BACKEND_INIT.

\n", - "comments": "", - "group": "refdb" + "description": "

Set the reflog of a reference

\n", + "comments": "

Set the specified reference's reflog. If this is combined with setting the target, that update won't be written to the reflog.

\n", + "group": "transaction" }, - "git_refdb_backend_fs": { + "git_transaction_remove": { "type": "function", - "file": "sys/refdb_backend.h", - "line": 198, - "lineto": 200, + "file": "git2/transaction.h", + "line": 96, + "lineto": 96, "args": [ { - "name": "backend_out", - "type": "git_refdb_backend **", - "comment": "Output pointer to the git_refdb_backend object" + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" }, { - "name": "repo", - "type": "git_repository *", - "comment": "Git repository to access" + "name": "refname", + "type": "const char *", + "comment": "the reference to remove" } ], - "argline": "git_refdb_backend **backend_out, git_repository *repo", - "sig": "git_refdb_backend **::git_repository *", + "argline": "git_transaction *tx, const char *refname", + "sig": "git_transaction *::const char *", "return": { "type": "int", - "comment": " 0 on success, \n<\n0 error code on failure" + "comment": " 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code" }, - "description": "

Constructors for default filesystem-based refdb backend

\n", - "comments": "

Under normal usage, this is called for you when the repository is opened / created, but you can use this to explicitly construct a filesystem refdb backend for a repository.

\n", - "group": "refdb" + "description": "

Remove a reference

\n", + "comments": "", + "group": "transaction" }, - "git_refdb_set_backend": { + "git_transaction_commit": { "type": "function", - "file": "sys/refdb_backend.h", - "line": 212, - "lineto": 214, + "file": "git2/transaction.h", + "line": 107, + "lineto": 107, "args": [ { - "name": "refdb", - "type": "git_refdb *", - "comment": "database to add the backend to" - }, + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + } + ], + "argline": "git_transaction *tx", + "sig": "git_transaction *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Commit the changes from the transaction

\n", + "comments": "

Perform the changes that have been queued. The updates will be made one by one, and the first failure will stop the processing.

\n", + "group": "transaction" + }, + "git_transaction_free": { + "type": "function", + "file": "git2/transaction.h", + "line": 117, + "lineto": 117, + "args": [ { - "name": "backend", - "type": "git_refdb_backend *", - "comment": "pointer to a git_refdb_backend instance" + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" } ], - "argline": "git_refdb *refdb, git_refdb_backend *backend", - "sig": "git_refdb *::git_refdb_backend *", - "return": { - "type": "int", - "comment": " 0 on success; error code otherwise" - }, - "description": "

Sets the custom backend to an existing reference DB

\n", - "comments": "

The git_refdb will take ownership of the git_refdb_backend so you should NOT free it after calling this function.

\n", - "group": "refdb" + "argline": "git_transaction *tx", + "sig": "git_transaction *", + "return": { "type": "void", "comment": null }, + "description": "

Free the resources allocated by this transaction

\n", + "comments": "

If any references remain locked, they will be unlocked without any changes made to them.

\n", + "group": "transaction" }, - "git_reference__alloc": { + "git_tree_lookup": { "type": "function", - "file": "sys/refs.h", - "line": 31, - "lineto": 34, + "file": "git2/tree.h", + "line": 32, + "lineto": 33, "args": [ { - "name": "name", - "type": "const char *", - "comment": "the reference name" + "name": "out", + "type": "git_tree **", + "comment": "Pointer to the looked up tree" }, { - "name": "oid", - "type": "const git_oid *", - "comment": "the object id for a direct reference" + "name": "repo", + "type": "git_repository *", + "comment": "The repo to use when locating the tree." }, { - "name": "peel", + "name": "id", "type": "const git_oid *", - "comment": "the first non-tag object's OID, or NULL" + "comment": "Identity of the tree to locate." } ], - "argline": "const char *name, const git_oid *oid, const git_oid *peel", - "sig": "const char *::const git_oid *::const git_oid *", - "return": { - "type": "git_reference *", - "comment": " the created git_reference or NULL on error" - }, - "description": "

Create a new direct reference from an OID.

\n", + "argline": "git_tree **out, git_repository *repo, const git_oid *id", + "sig": "git_tree **::git_repository *::const git_oid *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a tree object from the repository.

\n", "comments": "", - "group": "reference" + "group": "tree", + "examples": { + "commit.c": ["ex/v1.9.1/commit.html#git_tree_lookup-13"], + "general.c": [ + "ex/v1.9.1/general.html#git_tree_lookup-97", + "ex/v1.9.1/general.html#git_tree_lookup-98" + ], + "init.c": ["ex/v1.9.1/init.html#git_tree_lookup-13"], + "merge.c": ["ex/v1.9.1/merge.html#git_tree_lookup-37"] + } }, - "git_reference__alloc_symbolic": { + "git_tree_lookup_prefix": { "type": "function", - "file": "sys/refs.h", - "line": 43, - "lineto": 45, + "file": "git2/tree.h", + "line": 47, + "lineto": 51, "args": [ { - "name": "name", - "type": "const char *", - "comment": "the reference name" + "name": "out", + "type": "git_tree **", + "comment": "pointer to the looked up tree" }, { - "name": "target", - "type": "const char *", - "comment": "the target for a symbolic reference" + "name": "repo", + "type": "git_repository *", + "comment": "the repo to use when locating the tree." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "identity of the tree to locate." + }, + { + "name": "len", + "type": "size_t", + "comment": "the length of the short identifier" } ], - "argline": "const char *name, const char *target", - "sig": "const char *::const char *", - "return": { - "type": "git_reference *", - "comment": " the created git_reference or NULL on error" - }, - "description": "

Create a new symbolic reference.

\n", + "argline": "git_tree **out, git_repository *repo, const git_oid *id, size_t len", + "sig": "git_tree **::git_repository *::const git_oid *::size_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a tree object from the repository,\n given a prefix of its identifier (short id).

\n", "comments": "", - "group": "reference" + "group": "tree" }, - "git_repository_new": { + "git_tree_free": { "type": "function", - "file": "sys/repository.h", - "line": 31, - "lineto": 31, + "file": "git2/tree.h", + "line": 63, + "lineto": 63, "args": [ - { - "name": "out", - "type": "git_repository **", - "comment": "The blank repository" - } + { "name": "tree", "type": "git_tree *", "comment": "The tree to close" } ], - "argline": "git_repository **out", - "sig": "git_repository **", - "return": { - "type": "int", - "comment": " 0 on success, or an error code" - }, - "description": "

Create a new repository with neither backends nor config object

\n", - "comments": "

Note that this is only useful if you wish to associate the repository with a non-filesystem-backed object database and config store.

\n", - "group": "repository" + "argline": "git_tree *tree", + "sig": "git_tree *", + "return": { "type": "void", "comment": null }, + "description": "

Close an open tree

\n", + "comments": "

You can no longer use the git_tree pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you stop using a tree to release memory. Failure to do so will cause a memory leak.

\n", + "group": "tree", + "examples": { + "commit.c": ["ex/v1.9.1/commit.html#git_tree_free-14"], + "diff.c": [ + "ex/v1.9.1/diff.html#git_tree_free-19", + "ex/v1.9.1/diff.html#git_tree_free-20" + ], + "general.c": [ + "ex/v1.9.1/general.html#git_tree_free-99", + "ex/v1.9.1/general.html#git_tree_free-100" + ], + "init.c": ["ex/v1.9.1/init.html#git_tree_free-14"], + "log.c": [ + "ex/v1.9.1/log.html#git_tree_free-55", + "ex/v1.9.1/log.html#git_tree_free-56", + "ex/v1.9.1/log.html#git_tree_free-57", + "ex/v1.9.1/log.html#git_tree_free-58", + "ex/v1.9.1/log.html#git_tree_free-59" + ] + } }, - "git_repository__cleanup": { + "git_tree_id": { "type": "function", - "file": "sys/repository.h", - "line": 44, - "lineto": 44, + "file": "git2/tree.h", + "line": 71, + "lineto": 71, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": null + "name": "tree", + "type": "const git_tree *", + "comment": "a previously loaded tree." } ], - "argline": "git_repository *repo", - "sig": "git_repository *", + "argline": "const git_tree *tree", + "sig": "const git_tree *", "return": { - "type": "void", - "comment": null + "type": "const git_oid *", + "comment": " object identity for the tree." }, - "description": "

Reset all the internal state in a repository.

\n", - "comments": "

This will free all the mapped memory and internal objects of the repository and leave it in a "blank" state.

\n\n

There's no need to call this function directly unless you're trying to aggressively cleanup the repo before its deallocation. git_repository_free already performs this operation before deallocation the repo.

\n", - "group": "repository" + "description": "

Get the id of a tree.

\n", + "comments": "", + "group": "tree" }, - "git_repository_reinit_filesystem": { + "git_tree_owner": { "type": "function", - "file": "sys/repository.h", - "line": 61, - "lineto": 63, + "file": "git2/tree.h", + "line": 79, + "lineto": 79, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": "A repository object" - }, - { - "name": "recurse_submodules", - "type": "int", - "comment": "Should submodules be updated recursively" + "name": "tree", + "type": "const git_tree *", + "comment": "A previously loaded tree." } ], - "argline": "git_repository *repo, int recurse_submodules", - "sig": "git_repository *::int", + "argline": "const git_tree *tree", + "sig": "const git_tree *", "return": { - "type": "int", - "comment": " 0 on success, \n<\n 0 on error" + "type": "git_repository *", + "comment": " Repository that contains this tree." }, - "description": "

Update the filesystem config settings for an open repository

\n", - "comments": "

When a repository is initialized, config values are set based on the properties of the filesystem that the repository is on, such as "core.ignorecase", "core.filemode", "core.symlinks", etc. If the repository is moved to a new filesystem, these properties may no longer be correct and API calls may not behave as expected. This call reruns the phase of repository initialization that sets those properties to compensate for the current filesystem of the repo.

\n", - "group": "repository" + "description": "

Get the repository that contains the tree.

\n", + "comments": "", + "group": "tree" }, - "git_repository_set_config": { + "git_tree_entrycount": { "type": "function", - "file": "sys/repository.h", - "line": 78, - "lineto": 78, + "file": "git2/tree.h", + "line": 87, + "lineto": 87, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": "A repository object" - }, - { - "name": "config", - "type": "git_config *", - "comment": "A Config object" + "name": "tree", + "type": "const git_tree *", + "comment": "a previously loaded tree." } ], - "argline": "git_repository *repo, git_config *config", - "sig": "git_repository *::git_config *", + "argline": "const git_tree *tree", + "sig": "const git_tree *", "return": { - "type": "void", - "comment": null + "type": "size_t", + "comment": " the number of entries in the tree" }, - "description": "

Set the configuration file for this repository

\n", - "comments": "

This configuration file will be used for all configuration queries involving this repository.

\n\n

The repository will keep a reference to the config file; the user must still free the config after setting it to the repository, or it will leak.

\n", - "group": "repository" + "description": "

Get the number of entries listed in a tree

\n", + "comments": "", + "group": "tree", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tree_entrycount-37"], + "general.c": ["ex/v1.9.1/general.html#git_tree_entrycount-101"] + } }, - "git_repository_set_odb": { + "git_tree_entry_byname": { "type": "function", - "file": "sys/repository.h", - "line": 93, - "lineto": 93, + "file": "git2/tree.h", + "line": 99, + "lineto": 100, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": "A repository object" + "name": "tree", + "type": "const git_tree *", + "comment": "a previously loaded tree." }, { - "name": "odb", - "type": "git_odb *", - "comment": "An ODB object" + "name": "filename", + "type": "const char *", + "comment": "the filename of the desired entry" } ], - "argline": "git_repository *repo, git_odb *odb", - "sig": "git_repository *::git_odb *", + "argline": "const git_tree *tree, const char *filename", + "sig": "const git_tree *::const char *", "return": { - "type": "void", - "comment": null + "type": "const git_tree_entry *", + "comment": " the tree entry; NULL if not found" }, - "description": "

Set the Object Database for this repository

\n", - "comments": "

The ODB will be used for all object-related operations involving this repository.

\n\n

The repository will keep a reference to the ODB; the user must still free the ODB object after setting it to the repository, or it will leak.

\n", - "group": "repository" + "description": "

Lookup a tree entry by its filename

\n", + "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't have to free it, but you must not use it after the git_tree is released.

\n", + "group": "tree", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_tree_entry_byname-102"] + } }, - "git_repository_set_refdb": { + "git_tree_entry_byindex": { "type": "function", - "file": "sys/repository.h", - "line": 108, - "lineto": 108, + "file": "git2/tree.h", + "line": 112, + "lineto": 113, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": "A repository object" + "name": "tree", + "type": "const git_tree *", + "comment": "a previously loaded tree." }, { - "name": "refdb", - "type": "git_refdb *", - "comment": "An refdb object" + "name": "idx", + "type": "size_t", + "comment": "the position in the entry list" } ], - "argline": "git_repository *repo, git_refdb *refdb", - "sig": "git_repository *::git_refdb *", + "argline": "const git_tree *tree, size_t idx", + "sig": "const git_tree *::size_t", "return": { - "type": "void", - "comment": null + "type": "const git_tree_entry *", + "comment": " the tree entry; NULL if not found" }, - "description": "

Set the Reference Database Backend for this repository

\n", - "comments": "

The refdb will be used for all reference related operations involving this repository.

\n\n

The repository will keep a reference to the refdb; the user must still free the refdb object after setting it to the repository, or it will leak.

\n", - "group": "repository" + "description": "

Lookup a tree entry by its position in the tree

\n", + "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't have to free it, but you must not use it after the git_tree is released.

\n", + "group": "tree", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tree_entry_byindex-38"], + "general.c": ["ex/v1.9.1/general.html#git_tree_entry_byindex-103"] + } }, - "git_repository_set_index": { + "git_tree_entry_byid": { "type": "function", - "file": "sys/repository.h", - "line": 123, - "lineto": 123, + "file": "git2/tree.h", + "line": 127, + "lineto": 128, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": "A repository object" + "name": "tree", + "type": "const git_tree *", + "comment": "a previously loaded tree." }, { - "name": "index", - "type": "git_index *", - "comment": "An index object" + "name": "id", + "type": "const git_oid *", + "comment": "the sha being looked for" } ], - "argline": "git_repository *repo, git_index *index", - "sig": "git_repository *::git_index *", + "argline": "const git_tree *tree, const git_oid *id", + "sig": "const git_tree *::const git_oid *", "return": { - "type": "void", - "comment": null + "type": "const git_tree_entry *", + "comment": " the tree entry; NULL if not found" }, - "description": "

Set the index file for this repository

\n", - "comments": "

This index will be used for all index-related operations involving this repository.

\n\n

The repository will keep a reference to the index file; the user must still free the index after setting it to the repository, or it will leak.

\n", - "group": "repository" + "description": "

Lookup a tree entry by SHA value.

\n", + "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't have to free it, but you must not use it after the git_tree is released.

\n\n

Warning: this must examine every entry in the tree, so it is not fast.

\n", + "group": "tree" }, - "git_repository_set_bare": { + "git_tree_entry_bypath": { "type": "function", - "file": "sys/repository.h", - "line": 136, - "lineto": 136, + "file": "git2/tree.h", + "line": 142, + "lineto": 145, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": "Repo to make bare" - } - ], - "argline": "git_repository *repo", - "sig": "git_repository *", - "return": { - "type": "int", - "comment": " 0 on success, \n<\n0 on failure" - }, - "description": "

Set a repository to be bare.

\n", - "comments": "

Clear the working directory and set core.bare to true. You may also want to call git_repository_set_index(repo, NULL) since a bare repo typically does not have an index, but this function will not do that for you.

\n", - "group": "repository" - }, - "git_repository_submodule_cache_all": { - "type": "function", - "file": "sys/repository.h", - "line": 149, - "lineto": 150, - "args": [ + "name": "out", + "type": "git_tree_entry **", + "comment": "Pointer where to store the tree entry" + }, { - "name": "repo", - "type": "git_repository *", - "comment": "the repository whose submodules will be cached." + "name": "root", + "type": "const git_tree *", + "comment": "Previously loaded tree which is the root of the relative path" + }, + { + "name": "path", + "type": "const char *", + "comment": "Path to the contained entry" } ], - "argline": "git_repository *repo", - "sig": "git_repository *", + "argline": "git_tree_entry **out, const git_tree *root, const char *path", + "sig": "git_tree_entry **::const git_tree *::const char *", "return": { "type": "int", - "comment": null + "comment": " 0 on success; GIT_ENOTFOUND if the path does not exist" }, - "description": "

Load and cache all submodules.

\n", - "comments": "

Because the .gitmodules file is unstructured, loading submodules is an O(N) operation. Any operation (such as git_rebase_init) that requires accessing all submodules is O(N^2) in the number of submodules, if it has to look each one up individually. This function loads all submodules and caches them so that subsequent calls to git_submodule_lookup are O(1).

\n", - "group": "repository" + "description": "

Retrieve a tree entry contained in a tree or in any of its subtrees,\n given its relative path.

\n", + "comments": "

Unlike the other lookup functions, the returned tree entry is owned by the user and must be freed explicitly with git_tree_entry_free().

\n", + "group": "tree" }, - "git_repository_submodule_cache_clear": { + "git_tree_entry_dup": { "type": "function", - "file": "sys/repository.h", - "line": 164, - "lineto": 165, + "file": "git2/tree.h", + "line": 157, + "lineto": 157, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": "the repository whose submodule cache will be cleared" + "name": "dest", + "type": "git_tree_entry **", + "comment": "pointer where to store the copy" + }, + { + "name": "source", + "type": "const git_tree_entry *", + "comment": "tree entry to duplicate" } ], - "argline": "git_repository *repo", - "sig": "git_repository *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Clear the submodule cache.

\n", - "comments": "

Clear the submodule cache populated by git_repository_submodule_cache_all. If there is no cache, do nothing.

\n\n

The cache incorporates data from the repository's configuration, as well as the state of the working tree, the index, and HEAD. So any time any of these has changed, the cache might become invalid.

\n", - "group": "repository" + "argline": "git_tree_entry **dest, const git_tree_entry *source", + "sig": "git_tree_entry **::const git_tree_entry *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Duplicate a tree entry

\n", + "comments": "

Create a copy of a tree entry. The returned copy is owned by the user, and must be freed explicitly with git_tree_entry_free().

\n", + "group": "tree" }, - "git_stream_register_tls": { + "git_tree_entry_free": { "type": "function", - "file": "sys/stream.h", - "line": 54, - "lineto": 54, + "file": "git2/tree.h", + "line": 168, + "lineto": 168, "args": [ { - "name": "ctor", - "type": "git_stream_cb", - "comment": "the constructor to use" + "name": "entry", + "type": "git_tree_entry *", + "comment": "The entry to free" } ], - "argline": "git_stream_cb ctor", - "sig": "git_stream_cb", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Register a TLS stream constructor for the library to use

\n", - "comments": "

If a constructor is already set, it will be overwritten. Pass NULL in order to deregister the current constructor.

\n", - "group": "stream" + "argline": "git_tree_entry *entry", + "sig": "git_tree_entry *", + "return": { "type": "void", "comment": null }, + "description": "

Free a user-owned tree entry

\n", + "comments": "

IMPORTANT: This function is only needed for tree entries owned by the user, such as the ones returned by git_tree_entry_dup() or git_tree_entry_bypath().

\n", + "group": "tree" }, - "git_time_monotonic": { + "git_tree_entry_name": { "type": "function", - "file": "sys/time.h", - "line": 27, - "lineto": 27, - "args": [], - "argline": "", - "sig": "", - "return": { - "type": "double", - "comment": null - }, - "description": "

Return a monotonic time value, useful for measuring running time\n and setting up timeouts.

\n", - "comments": "

The returned value is an arbitrary point in time -- it can only be used when comparing it to another git_time_monotonic call.

\n\n

The time is returned in seconds, with a decimal fraction that differs on accuracy based on the underlying system, but should be least accurate to Nanoseconds.

\n\n

This function cannot fail.

\n", - "group": "time" + "file": "git2/tree.h", + "line": 176, + "lineto": 176, + "args": [ + { + "name": "entry", + "type": "const git_tree_entry *", + "comment": "a tree entry" + } + ], + "argline": "const git_tree_entry *entry", + "sig": "const git_tree_entry *", + "return": { "type": "const char *", "comment": " the name of the file" }, + "description": "

Get the filename of a tree entry

\n", + "comments": "", + "group": "tree", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tree_entry_name-39"], + "general.c": [ + "ex/v1.9.1/general.html#git_tree_entry_name-104", + "ex/v1.9.1/general.html#git_tree_entry_name-105" + ] + } }, - "git_transport_init": { + "git_tree_entry_id": { "type": "function", - "file": "sys/transport.h", - "line": 119, - "lineto": 121, + "file": "git2/tree.h", + "line": 184, + "lineto": 184, "args": [ { - "name": "opts", - "type": "git_transport *", - "comment": "the `git_transport` struct to initialize" - }, - { - "name": "version", - "type": "unsigned int", - "comment": "Version of struct; pass `GIT_TRANSPORT_VERSION`" + "name": "entry", + "type": "const git_tree_entry *", + "comment": "a tree entry" } ], - "argline": "git_transport *opts, unsigned int version", - "sig": "git_transport *::unsigned int", + "argline": "const git_tree_entry *entry", + "sig": "const git_tree_entry *", "return": { - "type": "int", - "comment": " Zero on success; -1 on failure." + "type": "const git_oid *", + "comment": " the oid of the object" }, - "description": "

Initializes a git_transport with default values. Equivalent to\n creating an instance with GIT_TRANSPORT_INIT.

\n", + "description": "

Get the id of the object pointed by the entry

\n", "comments": "", - "group": "transport" + "group": "tree", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tree_entry_id-40"] + } }, - "git_transport_new": { + "git_tree_entry_type": { "type": "function", - "file": "sys/transport.h", - "line": 133, - "lineto": 133, + "file": "git2/tree.h", + "line": 192, + "lineto": 192, "args": [ { - "name": "out", - "type": "git_transport **", - "comment": "The newly created transport (out)" - }, - { - "name": "owner", - "type": "git_remote *", - "comment": "The git_remote which will own this transport" - }, - { - "name": "url", - "type": "const char *", - "comment": "The URL to connect to" + "name": "entry", + "type": "const git_tree_entry *", + "comment": "a tree entry" } ], - "argline": "git_transport **out, git_remote *owner, const char *url", - "sig": "git_transport **::git_remote *::const char *", + "argline": "const git_tree_entry *entry", + "sig": "const git_tree_entry *", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "git_object_t", + "comment": " the type of the pointed object" }, - "description": "

Function to use to create a transport from a URL. The transport database\n is scanned to find a transport that implements the scheme of the URI (i.e.\n git:// or http://) and a transport object is returned to the caller.

\n", + "description": "

Get the type of the object pointed by the entry

\n", "comments": "", - "group": "transport" + "group": "tree", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tree_entry_type-41"] + } }, - "git_transport_ssh_with_paths": { + "git_tree_entry_filemode": { "type": "function", - "file": "sys/transport.h", - "line": 149, - "lineto": 149, + "file": "git2/tree.h", + "line": 200, + "lineto": 200, "args": [ { - "name": "out", - "type": "git_transport **", - "comment": "the resulting transport" - }, - { - "name": "owner", - "type": "git_remote *", - "comment": "the owning remote" - }, - { - "name": "payload", - "type": "void *", - "comment": "a strarray with the paths" + "name": "entry", + "type": "const git_tree_entry *", + "comment": "a tree entry" } ], - "argline": "git_transport **out, git_remote *owner, void *payload", - "sig": "git_transport **::git_remote *::void *", + "argline": "const git_tree_entry *entry", + "sig": "const git_tree_entry *", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "git_filemode_t", + "comment": " filemode as an integer" }, - "description": "

Create an ssh transport with custom git command paths

\n", - "comments": "

This is a factory function suitable for setting as the transport callback in a remote (or for a clone in the options).

\n\n

The payload argument must be a strarray pointer with the paths for the git-upload-pack and git-receive-pack at index 0 and 1.

\n", - "group": "transport" + "description": "

Get the UNIX file attributes of a tree entry

\n", + "comments": "", + "group": "tree", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tree_entry_filemode-42"] + } }, - "git_transport_unregister": { + "git_tree_entry_filemode_raw": { "type": "function", - "file": "sys/transport.h", - "line": 177, - "lineto": 178, + "file": "git2/tree.h", + "line": 212, + "lineto": 212, "args": [ { - "name": "prefix", - "type": "const char *", - "comment": "From the previous call to git_transport_register" + "name": "entry", + "type": "const git_tree_entry *", + "comment": "a tree entry" } ], - "argline": "const char *prefix", - "sig": "const char *", + "argline": "const git_tree_entry *entry", + "sig": "const git_tree_entry *", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "git_filemode_t", + "comment": " filemode as an integer" }, - "description": "

Unregister a custom transport definition which was previously registered\n with git_transport_register.

\n", - "comments": "", - "group": "transport" + "description": "

Get the raw UNIX file attributes of a tree entry

\n", + "comments": "

This function does not perform any normalization and is only useful if you need to be able to recreate the original tree object.

\n", + "group": "tree" }, - "git_transport_dummy": { + "git_tree_entry_cmp": { "type": "function", - "file": "sys/transport.h", - "line": 191, - "lineto": 194, + "file": "git2/tree.h", + "line": 220, + "lineto": 220, "args": [ { - "name": "out", - "type": "git_transport **", - "comment": "The newly created transport (out)" - }, - { - "name": "owner", - "type": "git_remote *", - "comment": "The git_remote which will own this transport" + "name": "e1", + "type": "const git_tree_entry *", + "comment": "first tree entry" }, { - "name": "payload", - "type": "void *", - "comment": "You must pass NULL for this parameter." + "name": "e2", + "type": "const git_tree_entry *", + "comment": "second tree entry" } ], - "argline": "git_transport **out, git_remote *owner, void *payload", - "sig": "git_transport **::git_remote *::void *", + "argline": "const git_tree_entry *e1, const git_tree_entry *e2", + "sig": "const git_tree_entry *::const git_tree_entry *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " \n<\n0 if e1 is before e2, 0 if e1 == e2, >0 if e1 is after e2" }, - "description": "

Create an instance of the dummy transport.

\n", + "description": "

Compare two tree entries

\n", "comments": "", - "group": "transport" + "group": "tree" }, - "git_transport_local": { + "git_tree_entry_to_object": { "type": "function", - "file": "sys/transport.h", - "line": 204, - "lineto": 207, + "file": "git2/tree.h", + "line": 232, + "lineto": 235, "args": [ { - "name": "out", - "type": "git_transport **", - "comment": "The newly created transport (out)" + "name": "object_out", + "type": "git_object **", + "comment": "pointer to the converted object" }, { - "name": "owner", - "type": "git_remote *", - "comment": "The git_remote which will own this transport" + "name": "repo", + "type": "git_repository *", + "comment": "repository where to lookup the pointed object" }, { - "name": "payload", - "type": "void *", - "comment": "You must pass NULL for this parameter." + "name": "entry", + "type": "const git_tree_entry *", + "comment": "a tree entry" } ], - "argline": "git_transport **out, git_remote *owner, void *payload", - "sig": "git_transport **::git_remote *::void *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Create an instance of the local transport.

\n", - "comments": "", - "group": "transport" + "argline": "git_object **object_out, git_repository *repo, const git_tree_entry *entry", + "sig": "git_object **::git_repository *::const git_tree_entry *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Convert a tree entry to the git_object it points to.

\n", + "comments": "

You must call git_object_free() on the object when you are done with it.

\n", + "group": "tree", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_tree_entry_to_object-106"] + } }, - "git_transport_smart": { + "git_treebuilder_new": { "type": "function", - "file": "sys/transport.h", - "line": 217, - "lineto": 220, + "file": "git2/tree.h", + "line": 254, + "lineto": 255, "args": [ { "name": "out", - "type": "git_transport **", - "comment": "The newly created transport (out)" + "type": "git_treebuilder **", + "comment": "Pointer where to store the tree builder" }, { - "name": "owner", - "type": "git_remote *", - "comment": "The git_remote which will own this transport" + "name": "repo", + "type": "git_repository *", + "comment": "Repository in which to store the object" }, { - "name": "payload", - "type": "void *", - "comment": "A pointer to a git_smart_subtransport_definition" + "name": "source", + "type": "const git_tree *", + "comment": "Source tree to initialize the builder (optional)" } ], - "argline": "git_transport **out, git_remote *owner, void *payload", - "sig": "git_transport **::git_remote *::void *", + "argline": "git_treebuilder **out, git_repository *repo, const git_tree *source", + "sig": "git_treebuilder **::git_repository *::const git_tree *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success; error code otherwise" }, - "description": "

Create an instance of the smart transport.

\n", - "comments": "", - "group": "transport" + "description": "

Create a new tree builder.

\n", + "comments": "

The tree builder can be used to create or modify trees in memory and write them as tree objects to the database.

\n\n

If the source parameter is not NULL, the tree builder will be initialized with the entries of the given tree.

\n\n

If the source parameter is NULL, the tree builder will start with no entries and will have to be filled manually.

\n", + "group": "treebuilder" }, - "git_transport_smart_certificate_check": { + "git_treebuilder_clear": { "type": "function", - "file": "sys/transport.h", - "line": 231, - "lineto": 231, + "file": "git2/tree.h", + "line": 263, + "lineto": 263, "args": [ { - "name": "transport", - "type": "git_transport *", - "comment": "a smart transport" - }, - { - "name": "cert", - "type": "git_cert *", - "comment": "the certificate to pass to the caller" - }, - { - "name": "valid", - "type": "int", - "comment": "whether we believe the certificate is valid" - }, - { - "name": "hostname", - "type": "const char *", - "comment": "the hostname we connected to" + "name": "bld", + "type": "git_treebuilder *", + "comment": "Builder to clear" } ], - "argline": "git_transport *transport, git_cert *cert, int valid, const char *hostname", - "sig": "git_transport *::git_cert *::int::const char *", + "argline": "git_treebuilder *bld", + "sig": "git_treebuilder *", "return": { "type": "int", - "comment": " the return value of the callback" + "comment": " 0 on success; error code otherwise" }, - "description": "

Call the certificate check for this transport.

\n", + "description": "

Clear all the entries in the builder

\n", "comments": "", - "group": "transport" + "group": "treebuilder" }, - "git_smart_subtransport_http": { + "git_treebuilder_entrycount": { "type": "function", - "file": "sys/transport.h", - "line": 352, - "lineto": 355, + "file": "git2/tree.h", + "line": 271, + "lineto": 271, "args": [ { - "name": "out", - "type": "git_smart_subtransport **", - "comment": "The newly created subtransport" - }, - { - "name": "owner", - "type": "git_transport *", - "comment": "The smart transport to own this subtransport" - }, - { - "name": "param", - "type": "void *", - "comment": null + "name": "bld", + "type": "git_treebuilder *", + "comment": "a previously loaded treebuilder." } ], - "argline": "git_smart_subtransport **out, git_transport *owner, void *param", - "sig": "git_smart_subtransport **::git_transport *::void *", + "argline": "git_treebuilder *bld", + "sig": "git_treebuilder *", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "size_t", + "comment": " the number of entries in the treebuilder" }, - "description": "

Create an instance of the http subtransport. This subtransport\n also supports https. On Win32, this subtransport may be implemented\n using the WinHTTP library.

\n", + "description": "

Get the number of entries listed in a treebuilder

\n", "comments": "", - "group": "smart" + "group": "treebuilder" }, - "git_smart_subtransport_git": { + "git_treebuilder_free": { "type": "function", - "file": "sys/transport.h", - "line": 364, - "lineto": 367, + "file": "git2/tree.h", + "line": 282, + "lineto": 282, "args": [ { - "name": "out", - "type": "git_smart_subtransport **", - "comment": "The newly created subtransport" - }, - { - "name": "owner", - "type": "git_transport *", - "comment": "The smart transport to own this subtransport" - }, - { - "name": "param", - "type": "void *", - "comment": null + "name": "bld", + "type": "git_treebuilder *", + "comment": "Builder to free" } ], - "argline": "git_smart_subtransport **out, git_transport *owner, void *param", - "sig": "git_smart_subtransport **::git_transport *::void *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Create an instance of the git subtransport.

\n", - "comments": "", - "group": "smart" + "argline": "git_treebuilder *bld", + "sig": "git_treebuilder *", + "return": { "type": "void", "comment": null }, + "description": "

Free a tree builder

\n", + "comments": "

This will clear all the entries and free to builder. Failing to free the builder after you're done using it will result in a memory leak

\n", + "group": "treebuilder" }, - "git_smart_subtransport_ssh": { + "git_treebuilder_get": { "type": "function", - "file": "sys/transport.h", - "line": 376, - "lineto": 379, + "file": "git2/tree.h", + "line": 294, + "lineto": 295, "args": [ { - "name": "out", - "type": "git_smart_subtransport **", - "comment": "The newly created subtransport" - }, - { - "name": "owner", - "type": "git_transport *", - "comment": "The smart transport to own this subtransport" + "name": "bld", + "type": "git_treebuilder *", + "comment": "Tree builder" }, { - "name": "param", - "type": "void *", - "comment": null + "name": "filename", + "type": "const char *", + "comment": "Name of the entry" } ], - "argline": "git_smart_subtransport **out, git_transport *owner, void *param", - "sig": "git_smart_subtransport **::git_transport *::void *", + "argline": "git_treebuilder *bld, const char *filename", + "sig": "git_treebuilder *::const char *", "return": { - "type": "int", - "comment": " 0 or an error code" + "type": "const git_tree_entry *", + "comment": " pointer to the entry; NULL if not found" }, - "description": "

Create an instance of the ssh subtransport.

\n", - "comments": "", - "group": "smart" + "description": "

Get an entry from the builder from its filename

\n", + "comments": "

The returned entry is owned by the builder and should not be freed manually.

\n", + "group": "treebuilder" }, - "git_tag_lookup": { + "git_treebuilder_insert": { "type": "function", - "file": "tag.h", - "line": 33, - "lineto": 34, + "file": "git2/tree.h", + "line": 325, + "lineto": 330, "args": [ { "name": "out", - "type": "git_tag **", - "comment": "pointer to the looked up tag" + "type": "const git_tree_entry **", + "comment": "Pointer to store the entry (optional)" }, { - "name": "repo", - "type": "git_repository *", - "comment": "the repo to use when locating the tag." + "name": "bld", + "type": "git_treebuilder *", + "comment": "Tree builder" + }, + { + "name": "filename", + "type": "const char *", + "comment": "Filename of the entry" }, { "name": "id", "type": "const git_oid *", - "comment": "identity of the tag to locate." + "comment": "SHA1 oid of the entry" + }, + { + "name": "filemode", + "type": "git_filemode_t", + "comment": "Folder attributes of the entry. This parameter must\n\t\t\tbe valued with one of the following entries: 0040000, 0100644,\n\t\t\t0100755, 0120000 or 0160000." } ], - "argline": "git_tag **out, git_repository *repo, const git_oid *id", - "sig": "git_tag **::git_repository *::const git_oid *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Lookup a tag object from the repository.

\n", - "comments": "", - "group": "tag", - "examples": { - "general.c": [ - "ex/HEAD/general.html#git_tag_lookup-81" - ] - } + "argline": "const git_tree_entry **out, git_treebuilder *bld, const char *filename, const git_oid *id, git_filemode_t filemode", + "sig": "const git_tree_entry **::git_treebuilder *::const char *::const git_oid *::git_filemode_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Add or update an entry to the builder

\n", + "comments": "

Insert a new entry for filename in the builder with the given attributes.

\n\n

If an entry named filename already exists, its attributes will be updated with the given ones.

\n\n

The optional pointer out can be used to retrieve a pointer to the newly created/updated entry. Pass NULL if you do not need it. The pointer may not be valid past the next operation in this builder. Duplicate the entry if you want to keep it.

\n\n

By default the entry that you are inserting will be checked for validity; that it exists in the object database and is of the correct type. If you do not want this behavior, set the GIT_OPT_ENABLE_STRICT_OBJECT_CREATION library option to false.

\n", + "group": "treebuilder" }, - "git_tag_lookup_prefix": { + "git_treebuilder_remove": { "type": "function", - "file": "tag.h", - "line": 48, - "lineto": 49, + "file": "git2/tree.h", + "line": 339, + "lineto": 340, "args": [ { - "name": "out", - "type": "git_tag **", - "comment": "pointer to the looked up tag" + "name": "bld", + "type": "git_treebuilder *", + "comment": "Tree builder" }, { - "name": "repo", - "type": "git_repository *", - "comment": "the repo to use when locating the tag." + "name": "filename", + "type": "const char *", + "comment": "Filename of the entry to remove" + } + ], + "argline": "git_treebuilder *bld, const char *filename", + "sig": "git_treebuilder *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Remove an entry from the builder by its filename

\n", + "comments": "", + "group": "treebuilder" + }, + "git_treebuilder_filter": { + "type": "function", + "file": "git2/tree.h", + "line": 368, + "lineto": 371, + "args": [ + { + "name": "bld", + "type": "git_treebuilder *", + "comment": "Tree builder" }, { - "name": "id", - "type": "const git_oid *", - "comment": "identity of the tag to locate." + "name": "filter", + "type": "git_treebuilder_filter_cb", + "comment": "Callback to filter entries" }, { - "name": "len", - "type": "size_t", - "comment": "the length of the short identifier" + "name": "payload", + "type": "void *", + "comment": "Extra data to pass to filter callback" } ], - "argline": "git_tag **out, git_repository *repo, const git_oid *id, size_t len", - "sig": "git_tag **::git_repository *::const git_oid *::size_t", + "argline": "git_treebuilder *bld, git_treebuilder_filter_cb filter, void *payload", + "sig": "git_treebuilder *::git_treebuilder_filter_cb::void *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, non-zero callback return value, or error code" }, - "description": "

Lookup a tag object from the repository,\n given a prefix of its identifier (short id).

\n", - "comments": "", - "group": "tag" + "description": "

Selectively remove entries in the tree

\n", + "comments": "

The filter callback will be called for each entry in the tree with a pointer to the entry and the provided payload; if the callback returns non-zero, the entry will be filtered (removed from the builder).

\n", + "group": "treebuilder" }, - "git_tag_free": { + "git_treebuilder_write": { "type": "function", - "file": "tag.h", - "line": 61, - "lineto": 61, + "file": "git2/tree.h", + "line": 383, + "lineto": 384, "args": [ { - "name": "tag", - "type": "git_tag *", - "comment": "the tag to close" + "name": "id", + "type": "git_oid *", + "comment": "Pointer to store the OID of the newly written tree" + }, + { + "name": "bld", + "type": "git_treebuilder *", + "comment": "Tree builder to write" } ], - "argline": "git_tag *tag", - "sig": "git_tag *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Close an open tag

\n", - "comments": "

You can no longer use the git_tag pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you are through with a tag to release memory. Failure to do so will cause a memory leak.

\n", - "group": "tag", - "examples": { - "general.c": [ - "ex/HEAD/general.html#git_tag_free-82" - ] - } + "argline": "git_oid *id, git_treebuilder *bld", + "sig": "git_oid *::git_treebuilder *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Write the contents of the tree builder as a tree object

\n", + "comments": "

The tree builder will be written to the given repo, and its identifying SHA1 hash will be stored in the id pointer.

\n", + "group": "treebuilder" }, - "git_tag_id": { + "git_tree_walk": { "type": "function", - "file": "tag.h", - "line": 69, - "lineto": 69, + "file": "git2/tree.h", + "line": 420, + "lineto": 424, "args": [ { - "name": "tag", - "type": "const git_tag *", - "comment": "a previously loaded tag." - } - ], - "argline": "const git_tag *tag", - "sig": "const git_tag *", - "return": { - "type": "const git_oid *", - "comment": " object identity for the tag." - }, - "description": "

Get the id of a tag.

\n", - "comments": "", - "group": "tag" + "name": "tree", + "type": "const git_tree *", + "comment": "The tree to walk" + }, + { + "name": "mode", + "type": "git_treewalk_mode", + "comment": "Traversal mode (pre or post-order)" + }, + { + "name": "callback", + "type": "git_treewalk_cb", + "comment": "Function to call on each tree entry" + }, + { + "name": "payload", + "type": "void *", + "comment": "Opaque pointer to be passed on each callback" + } + ], + "argline": "const git_tree *tree, git_treewalk_mode mode, git_treewalk_cb callback, void *payload", + "sig": "const git_tree *::git_treewalk_mode::git_treewalk_cb::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Traverse the entries in a tree and its subtrees in post or pre order.

\n", + "comments": "

The entries will be traversed in the specified order, children subtrees will be automatically loaded as required, and the callback will be called once per entry with the current (relative) root for the entry and the entry data itself.

\n\n

If the callback returns a positive value, the passed entry will be skipped on the traversal (in pre mode). A negative value stops the walk.

\n", + "group": "tree" }, - "git_tag_owner": { + "git_tree_dup": { "type": "function", - "file": "tag.h", - "line": 77, - "lineto": 77, + "file": "git2/tree.h", + "line": 434, + "lineto": 434, "args": [ { - "name": "tag", - "type": "const git_tag *", - "comment": "A previously loaded tag." + "name": "out", + "type": "git_tree **", + "comment": "Pointer to store the copy of the tree" + }, + { + "name": "source", + "type": "git_tree *", + "comment": "Original tree to copy" } ], - "argline": "const git_tag *tag", - "sig": "const git_tag *", - "return": { - "type": "git_repository *", - "comment": " Repository that contains this tag." - }, - "description": "

Get the repository that contains the tag.

\n", + "argline": "git_tree **out, git_tree *source", + "sig": "git_tree **::git_tree *", + "return": { "type": "int", "comment": " 0" }, + "description": "

Create an in-memory copy of a tree. The copy must be explicitly\n free'd or it will leak.

\n", "comments": "", - "group": "tag" + "group": "tree" }, - "git_tag_target": { + "git_tree_create_updated": { "type": "function", - "file": "tag.h", - "line": 89, - "lineto": 89, + "file": "git2/tree.h", + "line": 481, + "lineto": 481, "args": [ + { "name": "out", "type": "git_oid *", "comment": "id of the new tree" }, { - "name": "target_out", - "type": "git_object **", - "comment": "pointer where to store the target" + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to create the tree, must be the\n same as for `baseline`" }, { - "name": "tag", - "type": "const git_tag *", - "comment": "a previously loaded tag." + "name": "baseline", + "type": "git_tree *", + "comment": "the tree to base these changes on" + }, + { + "name": "nupdates", + "type": "size_t", + "comment": "the number of elements in the update list" + }, + { + "name": "updates", + "type": "const git_tree_update *", + "comment": "the list of updates to perform" } ], - "argline": "git_object **target_out, const git_tag *tag", - "sig": "git_object **::const git_tag *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Get the tagged object of a tag

\n", - "comments": "

This method performs a repository lookup for the given object and returns it

\n", - "group": "tag", - "examples": { - "general.c": [ - "ex/HEAD/general.html#git_tag_target-83" - ] - } + "argline": "git_oid *out, git_repository *repo, git_tree *baseline, size_t nupdates, const git_tree_update *updates", + "sig": "git_oid *::git_repository *::git_tree *::size_t::const git_tree_update *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a tree based on another one with the specified modifications

\n", + "comments": "

Given the baseline perform the changes described in the list of updates and create a new tree.

\n\n

This function is optimized for common file/directory addition, removal and replacement in trees. It is much more efficient than reading the tree into a git_index and modifying that, but in exchange it is not as flexible.

\n\n

Deleting and adding the same entry is undefined behaviour, changing a tree to a blob or viceversa is not supported.

\n", + "group": "tree" }, - "git_tag_target_id": { + "git_worktree_list": { "type": "function", - "file": "tag.h", - "line": 97, - "lineto": 97, + "file": "git2/worktree.h", + "line": 35, + "lineto": 35, "args": [ { - "name": "tag", - "type": "const git_tag *", - "comment": "a previously loaded tag." + "name": "out", + "type": "git_strarray *", + "comment": "pointer to the array of working tree names" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repo to use when listing working trees" } ], - "argline": "const git_tag *tag", - "sig": "const git_tag *", - "return": { - "type": "const git_oid *", - "comment": " pointer to the OID" - }, - "description": "

Get the OID of the tagged object of a tag

\n", - "comments": "", - "group": "tag", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tag_target_id-35" - ] - } + "argline": "git_strarray *out, git_repository *repo", + "sig": "git_strarray *::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

List names of linked working trees

\n", + "comments": "

The returned list should be released with git_strarray_free when no longer needed.

\n", + "group": "worktree" }, - "git_tag_target_type": { + "git_worktree_lookup": { "type": "function", - "file": "tag.h", - "line": 105, - "lineto": 105, + "file": "git2/worktree.h", + "line": 45, + "lineto": 45, "args": [ { - "name": "tag", - "type": "const git_tag *", - "comment": "a previously loaded tag." + "name": "out", + "type": "git_worktree **", + "comment": "Output pointer to looked up worktree or `NULL`" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing worktrees" + }, + { + "name": "name", + "type": "const char *", + "comment": "Name of the working tree to look up" } ], - "argline": "const git_tag *tag", - "sig": "const git_tag *", - "return": { - "type": "git_otype", - "comment": " type of the tagged object" - }, - "description": "

Get the type of a tag's tagged object

\n", + "argline": "git_worktree **out, git_repository *repo, const char *name", + "sig": "git_worktree **::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a working tree by its name for a given repository

\n", "comments": "", - "group": "tag", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tag_target_type-36" - ], - "general.c": [ - "ex/HEAD/general.html#git_tag_target_type-84" - ] - } + "group": "worktree" }, - "git_tag_name": { + "git_worktree_open_from_repository": { "type": "function", - "file": "tag.h", - "line": 113, - "lineto": 113, + "file": "git2/worktree.h", + "line": 58, + "lineto": 58, "args": [ { - "name": "tag", - "type": "const git_tag *", - "comment": "a previously loaded tag." + "name": "out", + "type": "git_worktree **", + "comment": "Out-pointer for the newly allocated worktree" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository to look up worktree for" } ], - "argline": "const git_tag *tag", - "sig": "const git_tag *", - "return": { - "type": "const char *", - "comment": " name of the tag" - }, - "description": "

Get the name of a tag

\n", + "argline": "git_worktree **out, git_repository *repo", + "sig": "git_worktree **::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Open a worktree of a given repository

\n", + "comments": "

If a repository is not the main tree but a worktree, this function will look up the worktree inside the parent repository and create a new git_worktree structure.

\n", + "group": "worktree" + }, + "git_worktree_free": { + "type": "function", + "file": "git2/worktree.h", + "line": 65, + "lineto": 65, + "args": [ + { + "name": "wt", + "type": "git_worktree *", + "comment": "worktree handle to close. If NULL nothing occurs." + } + ], + "argline": "git_worktree *wt", + "sig": "git_worktree *", + "return": { "type": "void", "comment": null }, + "description": "

Free a previously allocated worktree

\n", "comments": "", - "group": "tag", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tag_name-37" - ], - "general.c": [ - "ex/HEAD/general.html#git_tag_name-85" - ], - "tag.c": [ - "ex/HEAD/tag.html#git_tag_name-20" - ] - } + "group": "worktree" }, - "git_tag_tagger": { + "git_worktree_validate": { "type": "function", - "file": "tag.h", - "line": 121, - "lineto": 121, + "file": "git2/worktree.h", + "line": 77, + "lineto": 77, "args": [ { - "name": "tag", - "type": "const git_tag *", - "comment": "a previously loaded tag." + "name": "wt", + "type": "const git_worktree *", + "comment": "Worktree to check" } ], - "argline": "const git_tag *tag", - "sig": "const git_tag *", + "argline": "const git_worktree *wt", + "sig": "const git_worktree *", "return": { - "type": "const git_signature *", - "comment": " reference to the tag's author or NULL when unspecified" + "type": "int", + "comment": " 0 when worktree is valid, error-code otherwise" }, - "description": "

Get the tagger (author) of a tag

\n", - "comments": "", - "group": "tag", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tag_tagger-38" - ] - } + "description": "

Check if worktree is valid

\n", + "comments": "

A valid worktree requires both the git data structures inside the linked parent repository and the linked working copy to be present.

\n", + "group": "worktree" }, - "git_tag_message": { + "git_worktree_add_options_init": { "type": "function", - "file": "tag.h", - "line": 129, - "lineto": 129, + "file": "git2/worktree.h", + "line": 116, + "lineto": 117, "args": [ { - "name": "tag", - "type": "const git_tag *", - "comment": "a previously loaded tag." + "name": "opts", + "type": "git_worktree_add_options *", + "comment": "The `git_worktree_add_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_WORKTREE_ADD_OPTIONS_VERSION`." } ], - "argline": "const git_tag *tag", - "sig": "const git_tag *", + "argline": "git_worktree_add_options *opts, unsigned int version", + "sig": "git_worktree_add_options *::unsigned int", "return": { - "type": "const char *", - "comment": " message of the tag or NULL when unspecified" + "type": "int", + "comment": " Zero on success; -1 on failure." }, - "description": "

Get the message of a tag

\n", - "comments": "", - "group": "tag", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tag_message-39", - "ex/HEAD/cat-file.html#git_tag_message-40" - ], - "general.c": [ - "ex/HEAD/general.html#git_tag_message-86" - ], - "tag.c": [ - "ex/HEAD/tag.html#git_tag_message-21" - ] - } + "description": "

Initialize git_worktree_add_options structure

\n", + "comments": "

Initializes a git_worktree_add_options with default values. Equivalent to creating an instance with GIT_WORKTREE_ADD_OPTIONS_INIT.

\n", + "group": "worktree" }, - "git_tag_create": { + "git_worktree_add": { "type": "function", - "file": "tag.h", - "line": 171, - "lineto": 178, + "file": "git2/worktree.h", + "line": 133, + "lineto": 135, "args": [ { - "name": "oid", - "type": "git_oid *", - "comment": "Pointer where to store the OID of the\n newly created tag. If the tag already exists, this parameter\n will be the oid of the existing tag, and the function will\n return a GIT_EEXISTS error code." + "name": "out", + "type": "git_worktree **", + "comment": "Output pointer containing new working tree" }, { "name": "repo", "type": "git_repository *", - "comment": "Repository where to store the tag" + "comment": "Repository to create working tree for" }, { - "name": "tag_name", + "name": "name", "type": "const char *", - "comment": "Name for the tag; this name is validated\n for consistency. It should also not conflict with an\n already existing tag name" + "comment": "Name of the working tree" }, { - "name": "target", - "type": "const git_object *", - "comment": "Object to which this tag points. This object\n must belong to the given `repo`." - }, - { - "name": "tagger", - "type": "const git_signature *", - "comment": "Signature of the tagger for this tag, and\n of the tagging time" - }, - { - "name": "message", + "name": "path", "type": "const char *", - "comment": "Full message for this tag" + "comment": "Path to create working tree at" }, { - "name": "force", - "type": "int", - "comment": "Overwrite existing references" + "name": "opts", + "type": "const git_worktree_add_options *", + "comment": "Options to modify default behavior. May be NULL" } ], - "argline": "git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, const git_signature *tagger, const char *message, int force", - "sig": "git_oid *::git_repository *::const char *::const git_object *::const git_signature *::const char *::int", - "return": { - "type": "int", - "comment": " 0 on success, GIT_EINVALIDSPEC or an error code\n\tA tag object is written to the ODB, and a proper reference\n\tis written in the /refs/tags folder, pointing to it" - }, - "description": "

Create a new tag in the repository from an object

\n", - "comments": "

A new reference will also be created pointing to this tag object. If force is true and a reference already exists with the given name, it'll be replaced.

\n\n

The message will not be cleaned up. This can be achieved through git_message_prettify().

\n\n

The tag name will be checked for validity. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.

\n", - "group": "tag", - "examples": { - "tag.c": [ - "ex/HEAD/tag.html#git_tag_create-22" - ] - } + "argline": "git_worktree **out, git_repository *repo, const char *name, const char *path, const git_worktree_add_options *opts", + "sig": "git_worktree **::git_repository *::const char *::const char *::const git_worktree_add_options *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Add a new working tree

\n", + "comments": "

Add a new working tree for the repository, that is create the required data structures inside the repository and check out the current HEAD at path

\n", + "group": "worktree" }, - "git_tag_annotation_create": { + "git_worktree_lock": { "type": "function", - "file": "tag.h", - "line": 203, - "lineto": 209, + "file": "git2/worktree.h", + "line": 147, + "lineto": 147, "args": [ { - "name": "oid", - "type": "git_oid *", - "comment": "Pointer where to store the OID of the\n newly created tag" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "Repository where to store the tag" - }, - { - "name": "tag_name", - "type": "const char *", - "comment": "Name for the tag" - }, - { - "name": "target", - "type": "const git_object *", - "comment": "Object to which this tag points. This object\n must belong to the given `repo`." - }, - { - "name": "tagger", - "type": "const git_signature *", - "comment": "Signature of the tagger for this tag, and\n of the tagging time" + "name": "wt", + "type": "git_worktree *", + "comment": "Worktree to lock" }, { - "name": "message", + "name": "reason", "type": "const char *", - "comment": "Full message for this tag" + "comment": "Reason why the working tree is being locked" } ], - "argline": "git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, const git_signature *tagger, const char *message", - "sig": "git_oid *::git_repository *::const char *::const git_object *::const git_signature *::const char *", + "argline": "git_worktree *wt, const char *reason", + "sig": "git_worktree *::const char *", "return": { "type": "int", - "comment": " 0 on success or an error code" + "comment": " 0 on success, non-zero otherwise" }, - "description": "

Create a new tag in the object database pointing to a git_object

\n", - "comments": "

The message will not be cleaned up. This can be achieved through git_message_prettify().

\n", - "group": "tag" + "description": "

Lock worktree if not already locked

\n", + "comments": "

Lock a worktree, optionally specifying a reason why the linked working tree is being locked.

\n", + "group": "worktree" }, - "git_tag_create_frombuffer": { + "git_worktree_unlock": { "type": "function", - "file": "tag.h", - "line": 220, - "lineto": 224, + "file": "git2/worktree.h", + "line": 156, + "lineto": 156, "args": [ { - "name": "oid", - "type": "git_oid *", - "comment": "Pointer where to store the OID of the newly created tag" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "Repository where to store the tag" - }, - { - "name": "buffer", - "type": "const char *", - "comment": "Raw tag data" - }, - { - "name": "force", - "type": "int", - "comment": "Overwrite existing tags" + "name": "wt", + "type": "git_worktree *", + "comment": "Worktree to unlock" } ], - "argline": "git_oid *oid, git_repository *repo, const char *buffer, int force", - "sig": "git_oid *::git_repository *::const char *::int", + "argline": "git_worktree *wt", + "sig": "git_worktree *", "return": { "type": "int", - "comment": " 0 on success; error code otherwise" + "comment": " 0 on success, 1 if worktree was not locked, error-code\n otherwise" }, - "description": "

Create a new tag in the repository from a buffer

\n", + "description": "

Unlock a locked worktree

\n", "comments": "", - "group": "tag" + "group": "worktree" }, - "git_tag_create_lightweight": { + "git_worktree_is_locked": { "type": "function", - "file": "tag.h", - "line": 256, - "lineto": 261, + "file": "git2/worktree.h", + "line": 170, + "lineto": 170, "args": [ { - "name": "oid", - "type": "git_oid *", - "comment": "Pointer where to store the OID of the provided\n target object. If the tag already exists, this parameter\n will be filled with the oid of the existing pointed object\n and the function will return a GIT_EEXISTS error code." - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "Repository where to store the lightweight tag" - }, - { - "name": "tag_name", - "type": "const char *", - "comment": "Name for the tag; this name is validated\n for consistency. It should also not conflict with an\n already existing tag name" - }, - { - "name": "target", - "type": "const git_object *", - "comment": "Object to which this tag points. This object\n must belong to the given `repo`." + "name": "reason", + "type": "git_buf *", + "comment": "Buffer to store reason in. If NULL no reason is stored." }, { - "name": "force", - "type": "int", - "comment": "Overwrite existing references" + "name": "wt", + "type": "const git_worktree *", + "comment": "Worktree to check" } ], - "argline": "git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, int force", - "sig": "git_oid *::git_repository *::const char *::const git_object *::int", + "argline": "git_buf *reason, const git_worktree *wt", + "sig": "git_buf *::const git_worktree *", "return": { "type": "int", - "comment": " 0 on success, GIT_EINVALIDSPEC or an error code\n\tA proper reference is written in the /refs/tags folder,\n pointing to the provided target object" + "comment": " 0 when the working tree not locked, a value greater\n than zero if it is locked, less than zero if there was an\n error" }, - "description": "

Create a new lightweight tag pointing at a target object

\n", - "comments": "

A new direct reference will be created pointing to this target object. If force is true and a reference already exists with the given name, it'll be replaced.

\n\n

The tag name will be checked for validity. See git_tag_create() for rules about valid names.

\n", - "group": "tag", - "examples": { - "tag.c": [ - "ex/HEAD/tag.html#git_tag_create_lightweight-23" - ] - } + "description": "

Check if worktree is locked

\n", + "comments": "

A worktree may be locked if the linked working tree is stored on a portable device which is not available.

\n", + "group": "worktree" }, - "git_tag_delete": { + "git_worktree_name": { "type": "function", - "file": "tag.h", - "line": 276, - "lineto": 278, + "file": "git2/worktree.h", + "line": 179, + "lineto": 179, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": "Repository where lives the tag" - }, + "name": "wt", + "type": "const git_worktree *", + "comment": "Worktree to get the name for" + } + ], + "argline": "const git_worktree *wt", + "sig": "const git_worktree *", + "return": { + "type": "const char *", + "comment": " The worktree's name. The pointer returned is valid for the\n lifetime of the git_worktree" + }, + "description": "

Retrieve the name of the worktree

\n", + "comments": "", + "group": "worktree" + }, + "git_worktree_path": { + "type": "function", + "file": "git2/worktree.h", + "line": 188, + "lineto": 188, + "args": [ { - "name": "tag_name", - "type": "const char *", - "comment": "Name of the tag to be deleted;\n this name is validated for consistency." + "name": "wt", + "type": "const git_worktree *", + "comment": "Worktree to get the path for" } ], - "argline": "git_repository *repo, const char *tag_name", - "sig": "git_repository *::const char *", + "argline": "const git_worktree *wt", + "sig": "const git_worktree *", "return": { - "type": "int", - "comment": " 0 on success, GIT_EINVALIDSPEC or an error code" + "type": "const char *", + "comment": " The worktree's filesystem path. The pointer returned\n is valid for the lifetime of the git_worktree." }, - "description": "

Delete an existing tag reference.

\n", - "comments": "

The tag name will be checked for validity. See git_tag_create() for rules about valid names.

\n", - "group": "tag", - "examples": { - "tag.c": [ - "ex/HEAD/tag.html#git_tag_delete-24" - ] - } + "description": "

Retrieve the filesystem path for the worktree

\n", + "comments": "", + "group": "worktree" }, - "git_tag_list": { + "git_worktree_prune_options_init": { "type": "function", - "file": "tag.h", - "line": 293, - "lineto": 295, + "file": "git2/worktree.h", + "line": 233, + "lineto": 235, "args": [ { - "name": "tag_names", - "type": "git_strarray *", - "comment": "Pointer to a git_strarray structure where\n\t\tthe tag names will be stored" + "name": "opts", + "type": "git_worktree_prune_options *", + "comment": "The `git_worktree_prune_options` struct to initialize." }, { - "name": "repo", - "type": "git_repository *", - "comment": "Repository where to find the tags" + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_WORKTREE_PRUNE_OPTIONS_VERSION`." } ], - "argline": "git_strarray *tag_names, git_repository *repo", - "sig": "git_strarray *::git_repository *", + "argline": "git_worktree_prune_options *opts, unsigned int version", + "sig": "git_worktree_prune_options *::unsigned int", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " Zero on success; -1 on failure." }, - "description": "

Fill a list with all the tags in the Repository

\n", - "comments": "

The string array will be filled with the names of the matching tags; these values are owned by the user and should be free'd manually when no longer needed, using git_strarray_free.

\n", - "group": "tag" + "description": "

Initialize git_worktree_prune_options structure

\n", + "comments": "

Initializes a git_worktree_prune_options with default values. Equivalent to creating an instance with GIT_WORKTREE_PRUNE_OPTIONS_INIT.

\n", + "group": "worktree" }, - "git_tag_list_match": { + "git_worktree_is_prunable": { "type": "function", - "file": "tag.h", - "line": 315, - "lineto": 318, + "file": "git2/worktree.h", + "line": 257, + "lineto": 258, "args": [ { - "name": "tag_names", - "type": "git_strarray *", - "comment": "Pointer to a git_strarray structure where\n\t\tthe tag names will be stored" - }, - { - "name": "pattern", - "type": "const char *", - "comment": "Standard fnmatch pattern" + "name": "wt", + "type": "git_worktree *", + "comment": "Worktree to check." }, { - "name": "repo", - "type": "git_repository *", - "comment": "Repository where to find the tags" + "name": "opts", + "type": "git_worktree_prune_options *", + "comment": "The prunable options." } ], - "argline": "git_strarray *tag_names, const char *pattern, git_repository *repo", - "sig": "git_strarray *::const char *::git_repository *", + "argline": "git_worktree *wt, git_worktree_prune_options *opts", + "sig": "git_worktree *::git_worktree_prune_options *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 1 if the worktree is prunable, 0 otherwise, or an error code." }, - "description": "

Fill a list with all the tags in the Repository\n which name match a defined pattern

\n", - "comments": "

If an empty pattern is provided, all the tags will be returned.

\n\n

The string array will be filled with the names of the matching tags; these values are owned by the user and should be free'd manually when no longer needed, using git_strarray_free.

\n", - "group": "tag", - "examples": { - "tag.c": [ - "ex/HEAD/tag.html#git_tag_list_match-25" - ] - } + "description": "

Is the worktree prunable with the given options?

\n", + "comments": "

A worktree is not prunable in the following scenarios:

\n\n\n\n

If the worktree is not valid and not locked or if the above flags have been passed in, this function will return a positive value. If the worktree is not prunable, an error message will be set (visible in giterr_last) with details about why.

\n", + "group": "worktree" }, - "git_tag_foreach": { + "git_worktree_prune": { "type": "function", - "file": "tag.h", - "line": 330, - "lineto": 333, + "file": "git2/worktree.h", + "line": 272, + "lineto": 273, "args": [ { - "name": "repo", - "type": "git_repository *", - "comment": "Repository" + "name": "wt", + "type": "git_worktree *", + "comment": "Worktree to prune" }, { - "name": "callback", - "type": "git_tag_foreach_cb", - "comment": "Callback function" + "name": "opts", + "type": "git_worktree_prune_options *", + "comment": "Specifies which checks to override. See\n `git_worktree_is_prunable`. May be NULL" + } + ], + "argline": "git_worktree *wt, git_worktree_prune_options *opts", + "sig": "git_worktree *::git_worktree_prune_options *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Prune working tree

\n", + "comments": "

Prune the working tree, that is remove the git data structures on disk. The repository will only be pruned of git_worktree_is_prunable succeeds.

\n", + "group": "worktree" + } + }, + "callbacks": { + "git_apply_delta_cb": { + "type": "callback", + "file": "git2/apply.h", + "line": 41, + "lineto": 43, + "args": [ + { + "name": "delta", + "type": "const git_diff_delta *", + "comment": "The delta to be applied" }, { "name": "payload", "type": "void *", - "comment": "Pointer to callback data (optional)" + "comment": "User-specified payload" } ], - "argline": "git_repository *repo, git_tag_foreach_cb callback, void *payload", - "sig": "git_repository *::git_tag_foreach_cb::void *", + "argline": "const git_diff_delta *delta, void *payload", + "sig": "const git_diff_delta *::void *", "return": { "type": "int", - "comment": null + "comment": " 0 if the delta is applied, \n<\n 0 if the apply process will be aborted\n\tor > 0 if the delta will not be applied." }, - "description": "

Call callback `cb' for each tag in the repository

\n", - "comments": "", - "group": "tag" + "description": "

When applying a patch, callback that will be made per delta (file).

\n", + "comments": "

When the callback: - returns < 0, the apply process will be aborted. - returns > 0, the delta will not be applied, but the apply process continues - returns 0, the delta is applied, and the apply process continues.

\n" }, - "git_tag_peel": { - "type": "function", - "file": "tag.h", - "line": 346, - "lineto": 348, + "git_apply_hunk_cb": { + "type": "callback", + "file": "git2/apply.h", + "line": 59, + "lineto": 61, "args": [ { - "name": "tag_target_out", - "type": "git_object **", - "comment": "Pointer to the peeled git_object" + "name": "hunk", + "type": "const git_diff_hunk *", + "comment": "The hunk to be applied" }, { - "name": "tag", - "type": "const git_tag *", - "comment": "The tag to be processed" + "name": "payload", + "type": "void *", + "comment": "User-specified payload" } ], - "argline": "git_object **tag_target_out, const git_tag *tag", - "sig": "git_object **::const git_tag *", + "argline": "const git_diff_hunk *hunk, void *payload", + "sig": "const git_diff_hunk *::void *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 if the hunk is applied, \n<\n 0 if the apply process will be aborted\n\tor > 0 if the hunk will not be applied." }, - "description": "

Recursively peel a tag until a non tag git_object is found

\n", - "comments": "

The retrieved tag_target object is owned by the repository and should be closed with the git_object_free method.

\n", - "group": "tag" + "description": "

When applying a patch, callback that will be made per hunk.

\n", + "comments": "

When the callback: - returns < 0, the apply process will be aborted. - returns > 0, the hunk will not be applied, but the apply process continues - returns 0, the hunk is applied, and the apply process continues.

\n" }, - "git_tag_dup": { - "type": "function", - "file": "tag.h", - "line": 357, - "lineto": 357, + "git_attr_foreach_cb": { + "type": "callback", + "file": "git2/attr.h", + "line": 304, + "lineto": 304, "args": [ { - "name": "out", - "type": "git_tag **", - "comment": "Pointer to store the copy of the tag" + "name": "name", + "type": "const char *", + "comment": "The attribute name." }, { - "name": "source", - "type": "git_tag *", - "comment": "Original tag to copy" + "name": "value", + "type": "const char *", + "comment": "The attribute value. May be NULL if the attribute is explicitly\n set to UNSPECIFIED using the '!' sign." + }, + { + "name": "payload", + "type": "void *", + "comment": "A user-specified pointer." } ], - "argline": "git_tag **out, git_tag *source", - "sig": "git_tag **::git_tag *", + "argline": "const char *name, const char *value, void *payload", + "sig": "const char *::const char *::void *", "return": { "type": "int", - "comment": null + "comment": " 0 to continue looping, non-zero to stop. This value will be returned\n from git_attr_foreach." }, - "description": "

Create an in-memory copy of a tag. The copy must be explicitly\n free'd or it will leak.

\n", - "comments": "", - "group": "tag" + "description": "

The callback used with git_attr_foreach.

\n", + "comments": "

This callback will be invoked only once per attribute name, even if there are multiple rules for a given file. The highest priority rule will be used.

\n" }, - "git_trace_set": { - "type": "function", - "file": "trace.h", - "line": 63, - "lineto": 63, + "git_transport_certificate_check_cb": { + "type": "callback", + "file": "git2/cert.h", + "line": 72, + "lineto": 72, "args": [ { - "name": "level", - "type": "git_trace_level_t", - "comment": "Level to set tracing to" + "name": "cert", + "type": "git_cert *", + "comment": "The host certificate" }, { - "name": "cb", - "type": "git_trace_callback", - "comment": "Function to call with trace data" + "name": "valid", + "type": "int", + "comment": "Whether the libgit2 checks (OpenSSL or WinHTTP) think\n this certificate is valid" + }, + { + "name": "host", + "type": "const char *", + "comment": "Hostname of the host libgit2 connected to" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload provided by the caller" } ], - "argline": "git_trace_level_t level, git_trace_callback cb", - "sig": "git_trace_level_t::git_trace_callback", + "argline": "git_cert *cert, int valid, const char *host, void *payload", + "sig": "git_cert *::int::const char *::void *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 to proceed with the connection, \n<\n 0 to fail the connection\n or > 0 to indicate that the callback refused to act and that\n the existing validity determination should be honored" }, - "description": "

Sets the system tracing configuration to the specified level with the\n specified callback. When system events occur at a level equal to, or\n lower than, the given level they will be reported to the given callback.

\n", - "comments": "", - "group": "trace" + "description": "

Callback for the user's custom certificate checks.

\n", + "comments": "" }, - "git_cred_has_username": { - "type": "function", - "file": "transport.h", - "line": 190, - "lineto": 190, + "git_checkout_notify_cb": { + "type": "callback", + "file": "git2/checkout.h", + "line": 275, + "lineto": 281, "args": [ { - "name": "cred", - "type": "git_cred *", - "comment": "object to check" + "name": "why", + "type": "git_checkout_notify_t", + "comment": "the notification reason" + }, + { + "name": "path", + "type": "const char *", + "comment": "the path to the file being checked out" + }, + { + "name": "baseline", + "type": "const git_diff_file *", + "comment": "the baseline's diff file information" + }, + { + "name": "target", + "type": "const git_diff_file *", + "comment": "the checkout target diff file information" + }, + { + "name": "workdir", + "type": "const git_diff_file *", + "comment": "the working directory diff file information" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-supplied callback payload" } ], - "argline": "git_cred *cred", - "sig": "git_cred *", - "return": { - "type": "int", - "comment": " 1 if the credential object has non-NULL username, 0 otherwise" - }, - "description": "

Check whether a credential object contains username information.

\n", - "comments": "", - "group": "cred" + "argline": "git_checkout_notify_t why, const char *path, const git_diff_file *baseline, const git_diff_file *target, const git_diff_file *workdir, void *payload", + "sig": "git_checkout_notify_t::const char *::const git_diff_file *::const git_diff_file *::const git_diff_file *::void *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Checkout notification callback function.

\n", + "comments": "" }, - "git_cred_userpass_plaintext_new": { - "type": "function", - "file": "transport.h", - "line": 201, - "lineto": 204, + "git_checkout_progress_cb": { + "type": "callback", + "file": "git2/checkout.h", + "line": 291, + "lineto": 295, "args": [ { - "name": "out", - "type": "git_cred **", - "comment": "The newly created credential object." + "name": "path", + "type": "const char *", + "comment": "the path to the file being checked out" }, { - "name": "username", - "type": "const char *", - "comment": "The username of the credential." + "name": "completed_steps", + "type": "size_t", + "comment": "number of checkout steps completed" }, { - "name": "password", - "type": "const char *", - "comment": "The password of the credential." + "name": "total_steps", + "type": "size_t", + "comment": "number of total steps in the checkout process" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-supplied callback payload" } ], - "argline": "git_cred **out, const char *username, const char *password", - "sig": "git_cred **::const char *::const char *", - "return": { - "type": "int", - "comment": " 0 for success or an error code for failure" - }, - "description": "

Create a new plain-text username and password credential object.\n The supplied credential parameter will be internally duplicated.

\n", - "comments": "", - "group": "cred" + "argline": "const char *path, size_t completed_steps, size_t total_steps, void *payload", + "sig": "const char *::size_t::size_t::void *", + "return": { "type": "void", "comment": null }, + "description": "

Checkout progress notification function.

\n", + "comments": "" }, - "git_cred_ssh_key_new": { - "type": "function", - "file": "transport.h", - "line": 217, - "lineto": 222, + "git_checkout_perfdata_cb": { + "type": "callback", + "file": "git2/checkout.h", + "line": 303, + "lineto": 305, "args": [ { - "name": "out", - "type": "git_cred **", - "comment": "The newly created credential object." + "name": "perfdata", + "type": "const git_checkout_perfdata *", + "comment": "the performance data for the checkout" }, { - "name": "username", - "type": "const char *", - "comment": "username to use to authenticate" + "name": "payload", + "type": "void *", + "comment": "the user-supplied callback payload" + } + ], + "argline": "const git_checkout_perfdata *perfdata, void *payload", + "sig": "const git_checkout_perfdata *::void *", + "return": { "type": "void", "comment": null }, + "description": "

Checkout performance data reporting function.

\n", + "comments": "" + }, + "git_remote_create_cb": { + "type": "callback", + "file": "git2/clone.h", + "line": 73, + "lineto": 78, + "args": [ + { + "name": "out", + "type": "git_remote **", + "comment": "the resulting remote" }, { - "name": "publickey", - "type": "const char *", - "comment": "The path to the public key of the credential." + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to create the remote" }, { - "name": "privatekey", + "name": "name", "type": "const char *", - "comment": "The path to the private key of the credential." + "comment": "the remote's name" }, { - "name": "passphrase", + "name": "url", "type": "const char *", - "comment": "The passphrase of the credential." - } + "comment": "the remote's url" + }, + { "name": "payload", "type": "void *", "comment": "an opaque payload" } ], - "argline": "git_cred **out, const char *username, const char *publickey, const char *privatekey, const char *passphrase", - "sig": "git_cred **::const char *::const char *::const char *::const char *", + "argline": "git_remote **out, git_repository *repo, const char *name, const char *url, void *payload", + "sig": "git_remote **::git_repository *::const char *::const char *::void *", "return": { "type": "int", - "comment": " 0 for success or an error code for failure" + "comment": " 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" }, - "description": "

Create a new passphrase-protected ssh key credential object.\n The supplied credential parameter will be internally duplicated.

\n", - "comments": "", - "group": "cred" + "description": "

The signature of a function matching git_remote_create, with an additional\n void* as a callback payload.

\n", + "comments": "

Callers of git_clone may provide a function matching this signature to override the remote creation and customization process during a clone operation.

\n" }, - "git_cred_ssh_interactive_new": { - "type": "function", - "file": "transport.h", - "line": 233, - "lineto": 237, + "git_repository_create_cb": { + "type": "callback", + "file": "git2/clone.h", + "line": 94, + "lineto": 98, "args": [ { "name": "out", - "type": "git_cred **", - "comment": null + "type": "git_repository **", + "comment": "the resulting repository" }, { - "name": "username", + "name": "path", "type": "const char *", - "comment": "Username to use to authenticate." + "comment": "path in which to create the repository" }, { - "name": "prompt_callback", - "type": "git_cred_ssh_interactive_callback", - "comment": "The callback method used for prompts." + "name": "bare", + "type": "int", + "comment": "whether the repository is bare. This is the value from the clone options" }, { "name": "payload", "type": "void *", - "comment": "Additional data to pass to the callback." + "comment": "payload specified by the options" } ], - "argline": "git_cred **out, const char *username, git_cred_ssh_interactive_callback prompt_callback, void *payload", - "sig": "git_cred **::const char *::git_cred_ssh_interactive_callback::void *", + "argline": "git_repository **out, const char *path, int bare, void *payload", + "sig": "git_repository **::const char *::int::void *", "return": { "type": "int", - "comment": " 0 for success or an error code for failure." + "comment": " 0, or a negative value to indicate error" }, - "description": "

Create a new ssh keyboard-interactive based credential object.\n The supplied credential parameter will be internally duplicated.

\n", - "comments": "", - "group": "cred" + "description": "

The signature of a function matching git_repository_init, with an\n additional void * as callback payload.

\n", + "comments": "

Callers of git_clone my provide a function matching this signature to override the repository creation and customization process during a clone operation.

\n" }, - "git_cred_ssh_key_from_agent": { - "type": "function", - "file": "transport.h", - "line": 247, - "lineto": 249, + "git_commit_create_cb": { + "type": "callback", + "file": "git2/commit.h", + "line": 643, + "lineto": 652, "args": [ { "name": "out", - "type": "git_cred **", - "comment": "The newly created credential object." + "type": "git_oid *", + "comment": "pointer that this callback will populate with the object\n id of the commit that is created" }, { - "name": "username", - "type": "const char *", - "comment": "username to use to authenticate" - } - ], - "argline": "git_cred **out, const char *username", - "sig": "git_cred **::const char *", - "return": { - "type": "int", - "comment": " 0 for success or an error code for failure" - }, - "description": "

Create a new ssh key credential object used for querying an ssh-agent.\n The supplied credential parameter will be internally duplicated.

\n", - "comments": "", - "group": "cred" - }, - "git_cred_ssh_custom_new": { - "type": "function", - "file": "transport.h", - "line": 269, - "lineto": 275, - "args": [ + "name": "author", + "type": "const git_signature *", + "comment": "the author name and time of the commit" + }, { - "name": "out", - "type": "git_cred **", - "comment": "The newly created credential object." + "name": "committer", + "type": "const git_signature *", + "comment": "the committer name and time of the commit" }, { - "name": "username", + "name": "message_encoding", "type": "const char *", - "comment": "username to use to authenticate" + "comment": "the encoding of the given message, or NULL\n to assume UTF8" }, { - "name": "publickey", + "name": "message", "type": "const char *", - "comment": "The bytes of the public key." + "comment": "the commit message" }, { - "name": "publickey_len", - "type": "size_t", - "comment": "The length of the public key in bytes." + "name": "tree", + "type": "const git_tree *", + "comment": "the tree to be committed" }, { - "name": "sign_callback", - "type": "git_cred_sign_callback", - "comment": "The callback method to sign the data during the challenge." + "name": "parent_count", + "type": "size_t", + "comment": "the number of parents for this commit" + }, + { + "name": "parents", + "type": "const git_commit *[]", + "comment": "the commit parents" }, { "name": "payload", "type": "void *", - "comment": "Additional data to pass to the callback." - } - ], - "argline": "git_cred **out, const char *username, const char *publickey, size_t publickey_len, git_cred_sign_callback sign_callback, void *payload", - "sig": "git_cred **::const char *::const char *::size_t::git_cred_sign_callback::void *", - "return": { - "type": "int", - "comment": " 0 for success or an error code for failure" - }, - "description": "

Create an ssh key credential with a custom signing function.

\n", - "comments": "

This lets you use your own function to sign the challenge.

\n\n

This function and its credential type is provided for completeness and wraps libssh2_userauth_publickey(), which is undocumented.

\n\n

The supplied credential parameter will be internally duplicated.

\n", - "group": "cred" - }, - "git_cred_default_new": { - "type": "function", - "file": "transport.h", - "line": 283, - "lineto": 283, - "args": [ - { - "name": "out", - "type": "git_cred **", - "comment": null + "comment": "the payload pointer in the rebase options" } ], - "argline": "git_cred **out", - "sig": "git_cred **", + "argline": "git_oid *out, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree, size_t parent_count, const git_commit *[] parents, void *payload", + "sig": "git_oid *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *::size_t::const git_commit *[]::void *", "return": { "type": "int", - "comment": " 0 for success or an error code for failure" + "comment": " 0 if this callback has created the commit and populated the out\n parameter, GIT_PASSTHROUGH if the callback has not created a\n commit and wants the calling function to create the commit as\n if no callback had been specified, any other value to stop\n and return a failure" }, - "description": "

Create a "default" credential usable for Negotiate mechanisms like NTLM\n or Kerberos authentication.

\n", - "comments": "", - "group": "cred" + "description": "

Commit creation callback: used when a function is going to create\n commits (for example, in git_rebase_commit) to allow callers to\n override the commit creation behavior. For example, users may\n wish to sign commits by providing this information to\n git_commit_create_buffer, signing that buffer, then calling\n git_commit_create_with_signature. The resultant commit id\n should be set in the out object id parameter.

\n", + "comments": "" }, - "git_cred_username_new": { - "type": "function", - "file": "transport.h", - "line": 291, - "lineto": 291, + "git_config_foreach_cb": { + "type": "callback", + "file": "git2/config.h", + "line": 140, + "lineto": 140, "args": [ { - "name": "cred", - "type": "git_cred **", - "comment": null + "name": "entry", + "type": "const git_config_entry *", + "comment": "the entry currently being enumerated" }, { - "name": "username", - "type": "const char *", - "comment": null + "name": "payload", + "type": "void *", + "comment": "a user-specified pointer" } ], - "argline": "git_cred **cred, const char *username", - "sig": "git_cred **::const char *", + "argline": "const git_config_entry *entry, void *payload", + "sig": "const git_config_entry *::void *", "return": { "type": "int", - "comment": null + "comment": " non-zero to terminate the iteration." }, - "description": "

Create a credential to specify a username.

\n", - "comments": "

This is used with ssh authentication to query for the username if none is specified in the url.

\n", - "group": "cred" + "description": "

A config enumeration callback.

\n", + "comments": "" }, - "git_cred_ssh_key_memory_new": { - "type": "function", - "file": "transport.h", - "line": 303, - "lineto": 308, + "git_credential_acquire_cb": { + "type": "callback", + "file": "git2/credential.h", + "line": 134, + "lineto": 139, "args": [ { "name": "out", - "type": "git_cred **", + "type": "git_credential **", "comment": "The newly created credential object." }, { - "name": "username", + "name": "url", "type": "const char *", - "comment": "username to use to authenticate." + "comment": "The resource for which we are demanding a credential." }, { - "name": "publickey", + "name": "username_from_url", "type": "const char *", - "comment": "The public key of the credential." + "comment": "The username that was embedded in a \"user\n@\nhost\"\n remote url, or NULL if not included." }, { - "name": "privatekey", - "type": "const char *", - "comment": "The private key of the credential." + "name": "allowed_types", + "type": "unsigned int", + "comment": "A bitmask stating which credential types are OK to return." }, { - "name": "passphrase", - "type": "const char *", - "comment": "The passphrase of the credential." + "name": "payload", + "type": "void *", + "comment": "The payload provided when specifying this callback." } ], - "argline": "git_cred **out, const char *username, const char *publickey, const char *privatekey, const char *passphrase", - "sig": "git_cred **::const char *::const char *::const char *::const char *", + "argline": "git_credential **out, const char *url, const char *username_from_url, unsigned int allowed_types, void *payload", + "sig": "git_credential **::const char *::const char *::unsigned int::void *", "return": { "type": "int", - "comment": " 0 for success or an error code for failure" + "comment": " 0 for success, \n<\n 0 to indicate an error, > 0 to indicate\n no credential was acquired" }, - "description": "

Create a new ssh key credential object reading the keys from memory.

\n", - "comments": "", - "group": "cred" + "description": "

Credential acquisition callback.

\n", + "comments": "

This callback is usually involved any time another system might need authentication. As such, you are expected to provide a valid git_credential object back, depending on allowed_types (a git_credential_t bitmask).

\n\n

Note that most authentication details are your responsibility - this callback will be called until the authentication succeeds, or you report an error. As such, it's easy to get in a loop if you fail to stop providing the same incorrect credentials.

\n" }, - "git_cred_free": { - "type": "function", - "file": "transport.h", - "line": 319, - "lineto": 319, + "git_credential_ssh_interactive_cb": { + "type": "callback", + "file": "git2/credential.h", + "line": 259, + "lineto": 265, "args": [ + { "name": "name", "type": "const char *", "comment": "the name" }, { - "name": "cred", - "type": "git_cred *", - "comment": "the object to free" - } - ], - "argline": "git_cred *cred", - "sig": "git_cred *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Free a credential.

\n", - "comments": "

This is only necessary if you own the object; that is, if you are a transport.

\n", - "group": "cred" - }, - "git_tree_lookup": { - "type": "function", - "file": "tree.h", - "line": 32, - "lineto": 33, - "args": [ + "name": "name_len", + "type": "int", + "comment": "the length of the name" + }, { - "name": "out", - "type": "git_tree **", - "comment": "Pointer to the looked up tree" + "name": "instruction", + "type": "const char *", + "comment": "the authentication instruction" }, { - "name": "repo", - "type": "git_repository *", - "comment": "The repo to use when locating the tree." + "name": "instruction_len", + "type": "int", + "comment": "the length of the instruction" }, { - "name": "id", - "type": "const git_oid *", - "comment": "Identity of the tree to locate." - } + "name": "num_prompts", + "type": "int", + "comment": "the number of prompts" + }, + { + "name": "prompts", + "type": "const LIBSSH2_USERAUTH_KBDINT_PROMPT *", + "comment": "the prompts" + }, + { + "name": "responses", + "type": "LIBSSH2_USERAUTH_KBDINT_RESPONSE *", + "comment": "the responses" + }, + { "name": "abstract", "type": "void **", "comment": "the abstract" } ], - "argline": "git_tree **out, git_repository *repo, const git_oid *id", - "sig": "git_tree **::git_repository *::const git_oid *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Lookup a tree object from the repository.

\n", - "comments": "", - "group": "tree", - "examples": { - "general.c": [ - "ex/HEAD/general.html#git_tree_lookup-87", - "ex/HEAD/general.html#git_tree_lookup-88" - ], - "init.c": [ - "ex/HEAD/init.html#git_tree_lookup-14" - ] - } + "argline": "const char *name, int name_len, const char *instruction, int instruction_len, int num_prompts, const LIBSSH2_USERAUTH_KBDINT_PROMPT *prompts, LIBSSH2_USERAUTH_KBDINT_RESPONSE *responses, void **abstract", + "sig": "const char *::int::const char *::int::int::const LIBSSH2_USERAUTH_KBDINT_PROMPT *::LIBSSH2_USERAUTH_KBDINT_RESPONSE *::void **", + "return": { "type": "void", "comment": null }, + "description": "

Callback for interactive SSH credentials.

\n", + "comments": "" }, - "git_tree_lookup_prefix": { - "type": "function", - "file": "tree.h", - "line": 47, - "lineto": 51, + "git_credential_sign_cb": { + "type": "callback", + "file": "git2/credential.h", + "line": 308, + "lineto": 312, "args": [ { - "name": "out", - "type": "git_tree **", - "comment": "pointer to the looked up tree" + "name": "session", + "type": "LIBSSH2_SESSION *", + "comment": "the libssh2 session" }, { - "name": "repo", - "type": "git_repository *", - "comment": "the repo to use when locating the tree." + "name": "sig", + "type": "unsigned char **", + "comment": "the signature" }, { - "name": "id", - "type": "const git_oid *", - "comment": "identity of the tree to locate." + "name": "sig_len", + "type": "size_t *", + "comment": "the length of the signature" }, { - "name": "len", + "name": "data", + "type": "const unsigned char *", + "comment": "the data" + }, + { + "name": "data_len", "type": "size_t", - "comment": "the length of the short identifier" - } + "comment": "the length of the data" + }, + { "name": "abstract", "type": "void **", "comment": "the abstract" } ], - "argline": "git_tree **out, git_repository *repo, const git_oid *id, size_t len", - "sig": "git_tree **::git_repository *::const git_oid *::size_t", + "argline": "LIBSSH2_SESSION *session, unsigned char **sig, size_t *sig_len, const unsigned char *data, size_t data_len, void **abstract", + "sig": "LIBSSH2_SESSION *::unsigned char **::size_t *::const unsigned char *::size_t::void **", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 for success, \n<\n 0 to indicate an error, > 0 to indicate\n no credential was acquired" }, - "description": "

Lookup a tree object from the repository,\n given a prefix of its identifier (short id).

\n", - "comments": "", - "group": "tree" + "description": "

Callback for credential signing.

\n", + "comments": "" }, - "git_tree_free": { - "type": "function", - "file": "tree.h", - "line": 63, - "lineto": 63, + "git_commit_signing_cb": { + "type": "callback", + "file": "git2/deprecated.h", + "line": 285, + "lineto": 289, "args": [ - { - "name": "tree", - "type": "git_tree *", - "comment": "The tree to close" - } + { "name": "signature", "type": "git_buf *", "comment": null }, + { "name": "signature_field", "type": "git_buf *", "comment": null }, + { "name": "commit_content", "type": "const char *", "comment": null }, + { "name": "payload", "type": "void *", "comment": null } ], - "argline": "git_tree *tree", - "sig": "git_tree *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Close an open tree

\n", - "comments": "

You can no longer use the git_tree pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you stop using a tree to release memory. Failure to do so will cause a memory leak.

\n", - "group": "tree", - "examples": { - "diff.c": [ - "ex/HEAD/diff.html#git_tree_free-17", - "ex/HEAD/diff.html#git_tree_free-18" - ], - "general.c": [ - "ex/HEAD/general.html#git_tree_free-89", - "ex/HEAD/general.html#git_tree_free-90" - ], - "init.c": [ - "ex/HEAD/init.html#git_tree_free-15" - ], - "log.c": [ - "ex/HEAD/log.html#git_tree_free-58", - "ex/HEAD/log.html#git_tree_free-59", - "ex/HEAD/log.html#git_tree_free-60", - "ex/HEAD/log.html#git_tree_free-61", - "ex/HEAD/log.html#git_tree_free-62" - ] - } + "argline": "git_buf *signature, git_buf *signature_field, const char *commit_content, void *payload", + "sig": "git_buf *::git_buf *::const char *::void *", + "return": { "type": "int", "comment": null }, + "description": "

Provide a commit signature during commit creation.

\n", + "comments": "

Callers should instead define a git_commit_create_cb that generates a commit buffer using git_commit_create_buffer, sign that buffer and call git_commit_create_with_signature.

\n" }, - "git_tree_id": { - "type": "function", - "file": "tree.h", - "line": 71, - "lineto": 71, + "git_headlist_cb": { + "type": "callback", + "file": "git2/deprecated.h", + "line": 967, + "lineto": 967, "args": [ - { - "name": "tree", - "type": "const git_tree *", - "comment": "a previously loaded tree." - } + { "name": "rhead", "type": "git_remote_head *", "comment": null }, + { "name": "payload", "type": "void *", "comment": null } ], - "argline": "const git_tree *tree", - "sig": "const git_tree *", - "return": { - "type": "const git_oid *", - "comment": " object identity for the tree." - }, - "description": "

Get the id of a tree.

\n", - "comments": "", - "group": "tree" + "argline": "git_remote_head *rhead, void *payload", + "sig": "git_remote_head *::void *", + "return": { "type": "int", "comment": null }, + "description": "

Callback for listing the remote heads

\n", + "comments": "" }, - "git_tree_owner": { - "type": "function", - "file": "tree.h", - "line": 79, - "lineto": 79, + "git_diff_notify_cb": { + "type": "callback", + "file": "git2/diff.h", + "line": 352, + "lineto": 356, "args": [ { - "name": "tree", - "type": "const git_tree *", - "comment": "A previously loaded tree." + "name": "diff_so_far", + "type": "const git_diff *", + "comment": "the diff structure as it currently exists" + }, + { + "name": "delta_to_add", + "type": "const git_diff_delta *", + "comment": "the delta that is to be added" + }, + { + "name": "matched_pathspec", + "type": "const char *", + "comment": "the pathspec" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-specified callback payload" } ], - "argline": "const git_tree *tree", - "sig": "const git_tree *", + "argline": "const git_diff *diff_so_far, const git_diff_delta *delta_to_add, const char *matched_pathspec, void *payload", + "sig": "const git_diff *::const git_diff_delta *::const char *::void *", "return": { - "type": "git_repository *", - "comment": " Repository that contains this tree." + "type": "int", + "comment": " 0 on success, 1 to skip this delta, or an error code" }, - "description": "

Get the repository that contains the tree.

\n", - "comments": "", - "group": "tree" + "description": "

Diff notification callback function.

\n", + "comments": "

The callback will be called for each file, just before the git_diff_delta gets inserted into the diff.

\n\n

When the callback: - returns < 0, the diff process will be aborted. - returns > 0, the delta will not be inserted into the diff, but the diff process continues. - returns 0, the delta is inserted into the diff, and the diff process continues.

\n" }, - "git_tree_entrycount": { - "type": "function", - "file": "tree.h", - "line": 87, - "lineto": 87, + "git_diff_progress_cb": { + "type": "callback", + "file": "git2/diff.h", + "line": 369, + "lineto": 373, "args": [ { - "name": "tree", - "type": "const git_tree *", - "comment": "a previously loaded tree." - } - ], - "argline": "const git_tree *tree", - "sig": "const git_tree *", - "return": { - "type": "size_t", - "comment": " the number of entries in the tree" - }, - "description": "

Get the number of entries listed in a tree

\n", - "comments": "", - "group": "tree", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tree_entrycount-41" - ], - "general.c": [ - "ex/HEAD/general.html#git_tree_entrycount-91" - ] - } + "name": "diff_so_far", + "type": "const git_diff *", + "comment": "The diff being generated." + }, + { + "name": "old_path", + "type": "const char *", + "comment": "The path to the old file or NULL." + }, + { + "name": "new_path", + "type": "const char *", + "comment": "The path to the new file or NULL." + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-specified callback payload" + } + ], + "argline": "const git_diff *diff_so_far, const char *old_path, const char *new_path, void *payload", + "sig": "const git_diff *::const char *::const char *::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Diff progress callback.

\n", + "comments": "

Called before each file comparison.

\n" }, - "git_tree_entry_byname": { - "type": "function", - "file": "tree.h", - "line": 99, - "lineto": 100, + "git_diff_file_cb": { + "type": "callback", + "file": "git2/diff.h", + "line": 504, + "lineto": 507, "args": [ { - "name": "tree", - "type": "const git_tree *", - "comment": "a previously loaded tree." + "name": "delta", + "type": "const git_diff_delta *", + "comment": "A pointer to the delta data for the file" }, { - "name": "filename", - "type": "const char *", - "comment": "the filename of the desired entry" + "name": "progress", + "type": "float", + "comment": "Goes from 0 to 1 over the diff" + }, + { + "name": "payload", + "type": "void *", + "comment": "User-specified pointer from foreach function" } ], - "argline": "const git_tree *tree, const char *filename", - "sig": "const git_tree *::const char *", - "return": { - "type": "const git_tree_entry *", - "comment": " the tree entry; NULL if not found" - }, - "description": "

Lookup a tree entry by its filename

\n", - "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't have to free it, but you must not use it after the git_tree is released.

\n", - "group": "tree", - "examples": { - "general.c": [ - "ex/HEAD/general.html#git_tree_entry_byname-92" - ] - } + "argline": "const git_diff_delta *delta, float progress, void *payload", + "sig": "const git_diff_delta *::float::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

When iterating over a diff, callback that will be made per file.

\n", + "comments": "" }, - "git_tree_entry_byindex": { - "type": "function", - "file": "tree.h", - "line": 112, - "lineto": 113, + "git_diff_binary_cb": { + "type": "callback", + "file": "git2/diff.h", + "line": 576, + "lineto": 579, "args": [ { - "name": "tree", - "type": "const git_tree *", - "comment": "a previously loaded tree." + "name": "delta", + "type": "const git_diff_delta *", + "comment": "the delta" }, { - "name": "idx", - "type": "size_t", - "comment": "the position in the entry list" + "name": "binary", + "type": "const git_diff_binary *", + "comment": "the binary content" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-specified callback payload" } ], - "argline": "const git_tree *tree, size_t idx", - "sig": "const git_tree *::size_t", - "return": { - "type": "const git_tree_entry *", - "comment": " the tree entry; NULL if not found" - }, - "description": "

Lookup a tree entry by its position in the tree

\n", - "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't have to free it, but you must not use it after the git_tree is released.

\n", - "group": "tree", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tree_entry_byindex-42" - ], - "general.c": [ - "ex/HEAD/general.html#git_tree_entry_byindex-93" - ] - } + "argline": "const git_diff_delta *delta, const git_diff_binary *binary, void *payload", + "sig": "const git_diff_delta *::const git_diff_binary *::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

When iterating over a diff, callback that will be made for\n binary content within the diff.

\n", + "comments": "" }, - "git_tree_entry_byid": { - "type": "function", - "file": "tree.h", - "line": 127, - "lineto": 128, + "git_diff_hunk_cb": { + "type": "callback", + "file": "git2/diff.h", + "line": 607, + "lineto": 610, "args": [ { - "name": "tree", - "type": "const git_tree *", - "comment": "a previously loaded tree." + "name": "delta", + "type": "const git_diff_delta *", + "comment": "the delta" }, { - "name": "id", - "type": "const git_oid *", - "comment": "the sha being looked for" + "name": "hunk", + "type": "const git_diff_hunk *", + "comment": "the hunk" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-specified callback payload" } ], - "argline": "const git_tree *tree, const git_oid *id", - "sig": "const git_tree *::const git_oid *", - "return": { - "type": "const git_tree_entry *", - "comment": " the tree entry; NULL if not found" - }, - "description": "

Lookup a tree entry by SHA value.

\n", - "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't have to free it, but you must not use it after the git_tree is released.

\n\n

Warning: this must examine every entry in the tree, so it is not fast.

\n", - "group": "tree" + "argline": "const git_diff_delta *delta, const git_diff_hunk *hunk, void *payload", + "sig": "const git_diff_delta *::const git_diff_hunk *::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

When iterating over a diff, callback that will be made per hunk.

\n", + "comments": "" }, - "git_tree_entry_bypath": { - "type": "function", - "file": "tree.h", - "line": 142, - "lineto": 145, + "git_diff_line_cb": { + "type": "callback", + "file": "git2/diff.h", + "line": 674, + "lineto": 678, "args": [ { - "name": "out", - "type": "git_tree_entry **", - "comment": "Pointer where to store the tree entry" + "name": "delta", + "type": "const git_diff_delta *", + "comment": "the delta that contains the line" }, { - "name": "root", - "type": "const git_tree *", - "comment": "Previously loaded tree which is the root of the relative path" + "name": "hunk", + "type": "const git_diff_hunk *", + "comment": "the hunk that contains the line" }, { - "name": "path", + "name": "line", + "type": "const git_diff_line *", + "comment": "the line in the diff" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-specified callback payload" + } + ], + "argline": "const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload", + "sig": "const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

When iterating over a diff, callback that will be made per text diff\n line. In this context, the provided range will be NULL.

\n", + "comments": "

When printing a diff, callback that will be made to output each line of text. This uses some extra GIT_DIFF_LINE_... constants for output of lines of file and hunk headers.

\n" + }, + "git_index_matched_path_cb": { + "type": "callback", + "file": "git2/index.h", + "line": 158, + "lineto": 159, + "args": [ + { "name": "path", "type": "const char *", "comment": "the path" }, + { + "name": "matched_pathspec", "type": "const char *", - "comment": "Path to the contained entry" + "comment": "the given pathspec" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-specified payload" } ], - "argline": "git_tree_entry **out, const git_tree *root, const char *path", - "sig": "git_tree_entry **::const git_tree *::const char *", + "argline": "const char *path, const char *matched_pathspec, void *payload", + "sig": "const char *::const char *::void *", "return": { "type": "int", - "comment": " 0 on success; GIT_ENOTFOUND if the path does not exist" + "comment": " 0 to continue with the index operation, positive number to skip this file for the index operation, negative number on failure" }, - "description": "

Retrieve a tree entry contained in a tree or in any of its subtrees,\n given its relative path.

\n", - "comments": "

Unlike the other lookup functions, the returned tree entry is owned by the user and must be freed explicitly with git_tree_entry_free().

\n", - "group": "tree" + "description": "

Callback for APIs that add/remove/update files matching pathspec

\n", + "comments": "" }, - "git_tree_entry_dup": { - "type": "function", - "file": "tree.h", - "line": 157, - "lineto": 157, + "git_indexer_progress_cb": { + "type": "callback", + "file": "git2/indexer.h", + "line": 68, + "lineto": 68, "args": [ { - "name": "dest", - "type": "git_tree_entry **", - "comment": "pointer where to store the copy" + "name": "stats", + "type": "const git_indexer_progress *", + "comment": "Structure containing information about the state of the transfer" }, { - "name": "source", - "type": "const git_tree_entry *", - "comment": "tree entry to duplicate" + "name": "payload", + "type": "void *", + "comment": "Payload provided by caller" } ], - "argline": "git_tree_entry **dest, const git_tree_entry *source", - "sig": "git_tree_entry **::const git_tree_entry *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Duplicate a tree entry

\n", - "comments": "

Create a copy of a tree entry. The returned copy is owned by the user, and must be freed explicitly with git_tree_entry_free().

\n", - "group": "tree" + "argline": "const git_indexer_progress *stats, void *payload", + "sig": "const git_indexer_progress *::void *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Type for progress callbacks during indexing. Return a value less\n than zero to cancel the indexing or download.

\n", + "comments": "" }, - "git_tree_entry_free": { - "type": "function", - "file": "tree.h", - "line": 168, - "lineto": 168, + "git_note_foreach_cb": { + "type": "callback", + "file": "git2/notes.h", + "line": 29, + "lineto": 32, "args": [ { - "name": "entry", - "type": "git_tree_entry *", - "comment": "The entry to free" + "name": "blob_id", + "type": "const git_oid *", + "comment": "object id of the blob containing the message" + }, + { + "name": "annotated_object_id", + "type": "const git_oid *", + "comment": "the id of the object being annotated" + }, + { + "name": "payload", + "type": "void *", + "comment": "user-specified data to the foreach function" } ], - "argline": "git_tree_entry *entry", - "sig": "git_tree_entry *", + "argline": "const git_oid *blob_id, const git_oid *annotated_object_id, void *payload", + "sig": "const git_oid *::const git_oid *::void *", "return": { - "type": "void", - "comment": null + "type": "int", + "comment": " 0 on success, or a negative number on failure" }, - "description": "

Free a user-owned tree entry

\n", - "comments": "

IMPORTANT: This function is only needed for tree entries owned by the user, such as the ones returned by git_tree_entry_dup() or git_tree_entry_bypath().

\n", - "group": "tree" + "description": "

Callback for git_note_foreach.

\n", + "comments": "" }, - "git_tree_entry_name": { - "type": "function", - "file": "tree.h", - "line": 176, - "lineto": 176, + "git_odb_foreach_cb": { + "type": "callback", + "file": "git2/odb.h", + "line": 43, + "lineto": 43, "args": [ { - "name": "entry", - "type": "const git_tree_entry *", - "comment": "a tree entry" + "name": "id", + "type": "const git_oid *", + "comment": "an id of an object in the object database" + }, + { + "name": "payload", + "type": "void *", + "comment": "the payload from the initial call to git_odb_foreach" } ], - "argline": "const git_tree_entry *entry", - "sig": "const git_tree_entry *", - "return": { - "type": "const char *", - "comment": " the name of the file" - }, - "description": "

Get the filename of a tree entry

\n", - "comments": "", - "group": "tree", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tree_entry_name-43" - ], - "general.c": [ - "ex/HEAD/general.html#git_tree_entry_name-94", - "ex/HEAD/general.html#git_tree_entry_name-95" - ] - } + "argline": "const git_oid *id, void *payload", + "sig": "const git_oid *::void *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Function type for callbacks from git_odb_foreach.

\n", + "comments": "" }, - "git_tree_entry_id": { - "type": "function", - "file": "tree.h", - "line": 184, - "lineto": 184, + "git_packbuilder_foreach_cb": { + "type": "callback", + "file": "git2/pack.h", + "line": 208, + "lineto": 208, "args": [ { - "name": "entry", - "type": "const git_tree_entry *", - "comment": "a tree entry" + "name": "buf", + "type": "void *", + "comment": "A pointer to the object's data" + }, + { + "name": "size", + "type": "size_t", + "comment": "The size of the underlying object" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_packbuilder_foreach" } ], - "argline": "const git_tree_entry *entry", - "sig": "const git_tree_entry *", + "argline": "void *buf, size_t size, void *payload", + "sig": "void *::size_t::void *", "return": { - "type": "const git_oid *", - "comment": " the oid of the object" + "type": "int", + "comment": " non-zero to terminate the iteration" }, - "description": "

Get the id of the object pointed by the entry

\n", - "comments": "", - "group": "tree", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tree_entry_id-44" - ] - } + "description": "

Callback used to iterate over packed objects

\n", + "comments": "" }, - "git_tree_entry_type": { - "type": "function", - "file": "tree.h", - "line": 192, - "lineto": 192, + "git_packbuilder_progress": { + "type": "callback", + "file": "git2/pack.h", + "line": 245, + "lineto": 249, "args": [ { - "name": "entry", - "type": "const git_tree_entry *", - "comment": "a tree entry" + "name": "stage", + "type": "int", + "comment": "the stage of the packbuilder" + }, + { + "name": "current", + "type": "uint32_t", + "comment": "the current object" + }, + { + "name": "total", + "type": "uint32_t", + "comment": "the total number of objects" + }, + { + "name": "payload", + "type": "void *", + "comment": "the callback payload" } ], - "argline": "const git_tree_entry *entry", - "sig": "const git_tree_entry *", - "return": { - "type": "git_otype", - "comment": " the type of the pointed object" - }, - "description": "

Get the type of the object pointed by the entry

\n", - "comments": "", - "group": "tree", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tree_entry_type-45" - ] - } + "argline": "int stage, uint32_t current, uint32_t total, void *payload", + "sig": "int::uint32_t::uint32_t::void *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Packbuilder progress notification function.

\n", + "comments": "" }, - "git_tree_entry_filemode": { - "type": "function", - "file": "tree.h", - "line": 200, - "lineto": 200, + "git_reference_foreach_cb": { + "type": "callback", + "file": "git2/refs.h", + "line": 439, + "lineto": 439, "args": [ { - "name": "entry", - "type": "const git_tree_entry *", - "comment": "a tree entry" + "name": "reference", + "type": "git_reference *", + "comment": "The reference object" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_reference_foreach" } ], - "argline": "const git_tree_entry *entry", - "sig": "const git_tree_entry *", + "argline": "git_reference *reference, void *payload", + "sig": "git_reference *::void *", "return": { - "type": "git_filemode_t", - "comment": " filemode as an integer" + "type": "int", + "comment": " non-zero to terminate the iteration" }, - "description": "

Get the UNIX file attributes of a tree entry

\n", - "comments": "", - "group": "tree", - "examples": { - "cat-file.c": [ - "ex/HEAD/cat-file.html#git_tree_entry_filemode-46" - ] - } + "description": "

Callback used to iterate over references

\n", + "comments": "" }, - "git_tree_entry_filemode_raw": { - "type": "function", - "file": "tree.h", - "line": 212, - "lineto": 212, + "git_reference_foreach_name_cb": { + "type": "callback", + "file": "git2/refs.h", + "line": 450, + "lineto": 450, "args": [ { - "name": "entry", - "type": "const git_tree_entry *", - "comment": "a tree entry" + "name": "name", + "type": "const char *", + "comment": "The reference name" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_reference_foreach_name" } ], - "argline": "const git_tree_entry *entry", - "sig": "const git_tree_entry *", + "argline": "const char *name, void *payload", + "sig": "const char *::void *", "return": { - "type": "git_filemode_t", - "comment": " filemode as an integer" + "type": "int", + "comment": " non-zero to terminate the iteration" }, - "description": "

Get the raw UNIX file attributes of a tree entry

\n", - "comments": "

This function does not perform any normalization and is only useful if you need to be able to recreate the original tree object.

\n", - "group": "tree" + "description": "

Callback used to iterate over reference names

\n", + "comments": "" }, - "git_tree_entry_cmp": { - "type": "function", - "file": "tree.h", - "line": 220, - "lineto": 220, + "git_push_transfer_progress_cb": { + "type": "callback", + "file": "git2/remote.h", + "line": 481, + "lineto": 485, "args": [ { - "name": "e1", - "type": "const git_tree_entry *", - "comment": "first tree entry" + "name": "current", + "type": "unsigned int", + "comment": "The number of objects pushed so far" }, { - "name": "e2", - "type": "const git_tree_entry *", - "comment": "second tree entry" + "name": "total", + "type": "unsigned int", + "comment": "The total number of objects to push" + }, + { + "name": "bytes", + "type": "size_t", + "comment": "The number of bytes pushed" + }, + { + "name": "payload", + "type": "void *", + "comment": "The user-specified payload callback" } ], - "argline": "const git_tree_entry *e1, const git_tree_entry *e2", - "sig": "const git_tree_entry *::const git_tree_entry *", + "argline": "unsigned int current, unsigned int total, size_t bytes, void *payload", + "sig": "unsigned int::unsigned int::size_t::void *", "return": { "type": "int", - "comment": " \n<\n0 if e1 is before e2, 0 if e1 == e2, >0 if e1 is after e2" + "comment": " 0 or an error code to stop the transfer" }, - "description": "

Compare two tree entries

\n", - "comments": "", - "group": "tree" + "description": "

Push network progress notification callback.

\n", + "comments": "" }, - "git_tree_entry_to_object": { - "type": "function", - "file": "tree.h", - "line": 232, - "lineto": 235, + "git_push_negotiation": { + "type": "callback", + "file": "git2/remote.h", + "line": 518, + "lineto": 521, "args": [ { - "name": "object_out", - "type": "git_object **", - "comment": "pointer to the converted object" + "name": "updates", + "type": "const git_push_update **", + "comment": "an array containing the updates which will be sent\n as commands to the destination." }, { - "name": "repo", - "type": "git_repository *", - "comment": "repository where to lookup the pointed object" + "name": "len", + "type": "size_t", + "comment": "number of elements in `updates`" }, { - "name": "entry", - "type": "const git_tree_entry *", - "comment": "a tree entry" + "name": "payload", + "type": "void *", + "comment": "Payload provided by the caller" } ], - "argline": "git_object **object_out, git_repository *repo, const git_tree_entry *entry", - "sig": "git_object **::git_repository *::const git_tree_entry *", + "argline": "const git_push_update **updates, size_t len, void *payload", + "sig": "const git_push_update **::size_t::void *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 or an error code to stop the push" }, - "description": "

Convert a tree entry to the git_object it points to.

\n", - "comments": "

You must call git_object_free() on the object when you are done with it.

\n", - "group": "tree", - "examples": { - "general.c": [ - "ex/HEAD/general.html#git_tree_entry_to_object-96" - ] - } + "description": "

Callback used to inform of upcoming updates.

\n", + "comments": "" }, - "git_treebuilder_new": { - "type": "function", - "file": "tree.h", - "line": 254, - "lineto": 255, + "git_push_update_reference_cb": { + "type": "callback", + "file": "git2/remote.h", + "line": 535, + "lineto": 535, "args": [ { - "name": "out", - "type": "git_treebuilder **", - "comment": "Pointer where to store the tree builder" + "name": "refname", + "type": "const char *", + "comment": "refname specifying to the remote ref" }, { - "name": "repo", - "type": "git_repository *", - "comment": "Repository in which to store the object" + "name": "status", + "type": "const char *", + "comment": "status message sent from the remote" }, { - "name": "source", - "type": "const git_tree *", - "comment": "Source tree to initialize the builder (optional)" + "name": "data", + "type": "void *", + "comment": "data provided by the caller" } ], - "argline": "git_treebuilder **out, git_repository *repo, const git_tree *source", - "sig": "git_treebuilder **::git_repository *::const git_tree *", + "argline": "const char *refname, const char *status, void *data", + "sig": "const char *::const char *::void *", "return": { "type": "int", - "comment": " 0 on success; error code otherwise" + "comment": " 0 on success, otherwise an error" }, - "description": "

Create a new tree builder.

\n", - "comments": "

The tree builder can be used to create or modify trees in memory and write them as tree objects to the database.

\n\n

If the source parameter is not NULL, the tree builder will be initialized with the entries of the given tree.

\n\n

If the source parameter is NULL, the tree builder will start with no entries and will have to be filled manually.

\n", - "group": "treebuilder" + "description": "

Callback used to inform of the update status from the remote.

\n", + "comments": "

Called for each updated reference on push. If status is not NULL, the update was rejected by the remote server and status contains the reason given.

\n" }, - "git_treebuilder_clear": { - "type": "function", - "file": "tree.h", - "line": 262, - "lineto": 262, + "git_url_resolve_cb": { + "type": "callback", + "file": "git2/remote.h", + "line": 551, + "lineto": 551, "args": [ { - "name": "bld", - "type": "git_treebuilder *", - "comment": "Builder to clear" - } - ], - "argline": "git_treebuilder *bld", - "sig": "git_treebuilder *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Clear all the entires in the builder

\n", - "comments": "", - "group": "treebuilder" - }, - "git_treebuilder_entrycount": { - "type": "function", - "file": "tree.h", - "line": 270, - "lineto": 270, - "args": [ + "name": "url_resolved", + "type": "git_buf *", + "comment": "The buffer to write the resolved URL to" + }, { - "name": "bld", - "type": "git_treebuilder *", - "comment": "a previously loaded treebuilder." - } - ], - "argline": "git_treebuilder *bld", - "sig": "git_treebuilder *", - "return": { - "type": "unsigned int", - "comment": " the number of entries in the treebuilder" - }, - "description": "

Get the number of entries listed in a treebuilder

\n", - "comments": "", - "group": "treebuilder" - }, - "git_treebuilder_free": { - "type": "function", - "file": "tree.h", - "line": 281, - "lineto": 281, - "args": [ + "name": "url", + "type": "const char *", + "comment": "The URL to resolve" + }, { - "name": "bld", - "type": "git_treebuilder *", - "comment": "Builder to free" + "name": "direction", + "type": "int", + "comment": "GIT_DIRECTION_FETCH or GIT_DIRECTION_PUSH" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload provided by the caller" } ], - "argline": "git_treebuilder *bld", - "sig": "git_treebuilder *", + "argline": "git_buf *url_resolved, const char *url, int direction, void *payload", + "sig": "git_buf *::const char *::int::void *", "return": { - "type": "void", - "comment": null + "type": "int", + "comment": " 0 on success, GIT_PASSTHROUGH or an error\n " }, - "description": "

Free a tree builder

\n", - "comments": "

This will clear all the entries and free to builder. Failing to free the builder after you're done using it will result in a memory leak

\n", - "group": "treebuilder" + "description": "

Callback to resolve URLs before connecting to remote

\n", + "comments": "

If you return GIT_PASSTHROUGH, you don't need to write anything to url_resolved.

\n" }, - "git_treebuilder_get": { - "type": "function", - "file": "tree.h", - "line": 293, - "lineto": 294, + "git_remote_ready_cb": { + "type": "callback", + "file": "git2/remote.h", + "line": 564, + "lineto": 564, "args": [ { - "name": "bld", - "type": "git_treebuilder *", - "comment": "Tree builder" + "name": "remote", + "type": "git_remote *", + "comment": "The remote to be connected" }, { - "name": "filename", - "type": "const char *", - "comment": "Name of the entry" + "name": "direction", + "type": "int", + "comment": "GIT_DIRECTION_FETCH or GIT_DIRECTION_PUSH" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload provided by the caller" } ], - "argline": "git_treebuilder *bld, const char *filename", - "sig": "git_treebuilder *::const char *", - "return": { - "type": "const git_tree_entry *", - "comment": " pointer to the entry; NULL if not found" - }, - "description": "

Get an entry from the builder from its filename

\n", - "comments": "

The returned entry is owned by the builder and should not be freed manually.

\n", - "group": "treebuilder" + "argline": "git_remote *remote, int direction, void *payload", + "sig": "git_remote *::int::void *", + "return": { "type": "int", "comment": " 0 on success, or an error" }, + "description": "

Callback invoked immediately before we attempt to connect to the\n given url. Callers may change the URL before the connection by\n calling git_remote_set_instance_url in the callback.

\n", + "comments": "" }, - "git_treebuilder_insert": { - "type": "function", - "file": "tree.h", - "line": 323, - "lineto": 328, + "git_repository_fetchhead_foreach_cb": { + "type": "callback", + "file": "git2/repository.h", + "line": 746, + "lineto": 750, "args": [ { - "name": "out", - "type": "const git_tree_entry **", - "comment": "Pointer to store the entry (optional)" - }, - { - "name": "bld", - "type": "git_treebuilder *", - "comment": "Tree builder" + "name": "ref_name", + "type": "const char *", + "comment": "The reference name" }, { - "name": "filename", + "name": "remote_url", "type": "const char *", - "comment": "Filename of the entry" + "comment": "The remote URL" }, { - "name": "id", + "name": "oid", "type": "const git_oid *", - "comment": "SHA1 oid of the entry" + "comment": "The reference target OID" }, { - "name": "filemode", - "type": "git_filemode_t", - "comment": "Folder attributes of the entry. This parameter must\n\t\t\tbe valued with one of the following entries: 0040000, 0100644,\n\t\t\t0100755, 0120000 or 0160000." + "name": "is_merge", + "type": "unsigned int", + "comment": "Was the reference the result of a merge" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_repository_fetchhead_foreach" } ], - "argline": "const git_tree_entry **out, git_treebuilder *bld, const char *filename, const git_oid *id, git_filemode_t filemode", - "sig": "const git_tree_entry **::git_treebuilder *::const char *::const git_oid *::git_filemode_t", + "argline": "const char *ref_name, const char *remote_url, const git_oid *oid, unsigned int is_merge, void *payload", + "sig": "const char *::const char *::const git_oid *::unsigned int::void *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " non-zero to terminate the iteration" }, - "description": "

Add or update an entry to the builder

\n", - "comments": "

Insert a new entry for filename in the builder with the given attributes.

\n\n

If an entry named filename already exists, its attributes will be updated with the given ones.

\n\n

The optional pointer out can be used to retrieve a pointer to the newly created/updated entry. Pass NULL if you do not need it. The pointer may not be valid past the next operation in this builder. Duplicate the entry if you want to keep it.

\n\n

No attempt is being made to ensure that the provided oid points to an existing git object in the object database, nor that the attributes make sense regarding the type of the pointed at object.

\n", - "group": "treebuilder" + "description": "

Callback used to iterate over each FETCH_HEAD entry

\n", + "comments": "" }, - "git_treebuilder_remove": { - "type": "function", - "file": "tree.h", - "line": 336, - "lineto": 337, + "git_repository_mergehead_foreach_cb": { + "type": "callback", + "file": "git2/repository.h", + "line": 777, + "lineto": 778, "args": [ { - "name": "bld", - "type": "git_treebuilder *", - "comment": "Tree builder" + "name": "oid", + "type": "const git_oid *", + "comment": "The merge OID" }, { - "name": "filename", - "type": "const char *", - "comment": "Filename of the entry to remove" + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_repository_mergehead_foreach" } ], - "argline": "git_treebuilder *bld, const char *filename", - "sig": "git_treebuilder *::const char *", + "argline": "const git_oid *oid, void *payload", + "sig": "const git_oid *::void *", "return": { "type": "int", - "comment": null + "comment": " non-zero to terminate the iteration" }, - "description": "

Remove an entry from the builder by its filename

\n", - "comments": "", - "group": "treebuilder" + "description": "

Callback used to iterate over each MERGE_HEAD entry

\n", + "comments": "" }, - "git_treebuilder_filter": { - "type": "function", - "file": "tree.h", - "line": 360, - "lineto": 363, + "git_revwalk_hide_cb": { + "type": "callback", + "file": "git2/revwalk.h", + "line": 283, + "lineto": 285, "args": [ { - "name": "bld", - "type": "git_treebuilder *", - "comment": "Tree builder" - }, - { - "name": "filter", - "type": "git_treebuilder_filter_cb", - "comment": "Callback to filter entries" + "name": "commit_id", + "type": "const git_oid *", + "comment": "oid of Commit" }, { "name": "payload", "type": "void *", - "comment": "Extra data to pass to filter callback" + "comment": "User-specified pointer to data to be passed as data payload" } ], - "argline": "git_treebuilder *bld, git_treebuilder_filter_cb filter, void *payload", - "sig": "git_treebuilder *::git_treebuilder_filter_cb::void *", + "argline": "const git_oid *commit_id, void *payload", + "sig": "const git_oid *::void *", "return": { - "type": "void", - "comment": null + "type": "int", + "comment": " non-zero to hide the commmit and it parent." }, - "description": "

Selectively remove entries in the tree

\n", - "comments": "

The filter callback will be called for each entry in the tree with a pointer to the entry and the provided payload; if the callback returns non-zero, the entry will be filtered (removed from the builder).

\n", - "group": "treebuilder" + "description": "

This is a callback function that user can provide to hide a\n commit and its parents. If the callback function returns non-zero value,\n then this commit and its parents will be hidden.

\n", + "comments": "" }, - "git_treebuilder_write": { - "type": "function", - "file": "tree.h", - "line": 375, - "lineto": 376, + "git_stash_apply_progress_cb": { + "type": "callback", + "file": "git2/stash.h", + "line": 181, + "lineto": 183, "args": [ { - "name": "id", - "type": "git_oid *", - "comment": "Pointer to store the OID of the newly written tree" + "name": "progress", + "type": "git_stash_apply_progress_t", + "comment": "the progress information" }, { - "name": "bld", - "type": "git_treebuilder *", - "comment": "Tree builder to write" + "name": "payload", + "type": "void *", + "comment": "the user-specified payload to the apply function" } ], - "argline": "git_oid *id, git_treebuilder *bld", - "sig": "git_oid *::git_treebuilder *", - "return": { - "type": "int", - "comment": " 0 or an error code" - }, - "description": "

Write the contents of the tree builder as a tree object

\n", - "comments": "

The tree builder will be written to the given repo, and its identifying SHA1 hash will be stored in the id pointer.

\n", - "group": "treebuilder" + "argline": "git_stash_apply_progress_t progress, void *payload", + "sig": "git_stash_apply_progress_t::void *", + "return": { "type": "int", "comment": " 0 on success, -1 on error" }, + "description": "

Stash application progress notification function.\n Return 0 to continue processing, or a negative value to\n abort the stash application.

\n", + "comments": "" }, - "git_treebuilder_write_with_buffer": { - "type": "function", - "file": "tree.h", - "line": 389, - "lineto": 390, + "git_stash_cb": { + "type": "callback", + "file": "git2/stash.h", + "line": 268, + "lineto": 272, "args": [ { - "name": "oid", - "type": "git_oid *", - "comment": "Pointer to store the OID of the newly written tree" + "name": "index", + "type": "size_t", + "comment": "The position within the stash list. 0 points to the\n most recent stashed state." }, { - "name": "bld", - "type": "git_treebuilder *", - "comment": "Tree builder to write" + "name": "message", + "type": "const char *", + "comment": "The stash message." }, { - "name": "tree", - "type": "git_buf *", - "comment": "Shared buffer for writing the tree. Will be grown as necessary." + "name": "stash_id", + "type": "const git_oid *", + "comment": "The commit oid of the stashed state." + }, + { + "name": "payload", + "type": "void *", + "comment": "Extra parameter to callback function." } ], - "argline": "git_oid *oid, git_treebuilder *bld, git_buf *tree", - "sig": "git_oid *::git_treebuilder *::git_buf *", + "argline": "size_t index, const char *message, const git_oid *stash_id, void *payload", + "sig": "size_t::const char *::const git_oid *::void *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 to continue iterating or non-zero to stop." }, - "description": "

Write the contents of the tree builder as a tree object\n using a shared git_buf.

\n", - "comments": "", - "group": "treebuilder" + "description": "

This is a callback function you can provide to iterate over all the\n stashed states that will be invoked per entry.

\n", + "comments": "" }, - "git_tree_walk": { - "type": "function", - "file": "tree.h", - "line": 419, - "lineto": 423, + "git_status_cb": { + "type": "callback", + "file": "git2/status.h", + "line": 62, + "lineto": 63, "args": [ { - "name": "tree", - "type": "const git_tree *", - "comment": "The tree to walk" + "name": "path", + "type": "const char *", + "comment": "is the path to the file" }, { - "name": "mode", - "type": "git_treewalk_mode", - "comment": "Traversal mode (pre or post-order)" - }, - { - "name": "callback", - "type": "git_treewalk_cb", - "comment": "Function to call on each tree entry" + "name": "status_flags", + "type": "unsigned int", + "comment": "the `git_status_t` values for file's status" }, { "name": "payload", "type": "void *", - "comment": "Opaque pointer to be passed on each callback" + "comment": "the user-specified payload to the foreach function" } ], - "argline": "const git_tree *tree, git_treewalk_mode mode, git_treewalk_cb callback, void *payload", - "sig": "const git_tree *::git_treewalk_mode::git_treewalk_cb::void *", + "argline": "const char *path, unsigned int status_flags, void *payload", + "sig": "const char *::unsigned int::void *", "return": { "type": "int", - "comment": " 0 or an error code" + "comment": " 0 on success, or a negative number on failure" }, - "description": "

Traverse the entries in a tree and its subtrees in post or pre order.

\n", - "comments": "

The entries will be traversed in the specified order, children subtrees will be automatically loaded as required, and the callback will be called once per entry with the current (relative) root for the entry and the entry data itself.

\n\n

If the callback returns a positive value, the passed entry will be skipped on the traversal (in pre mode). A negative value stops the walk.

\n", - "group": "tree" + "description": "

Function pointer to receive status on individual files

\n", + "comments": "" }, - "git_tree_dup": { - "type": "function", - "file": "tree.h", - "line": 432, - "lineto": 432, + "git_submodule_cb": { + "type": "callback", + "file": "git2/submodule.h", + "line": 125, + "lineto": 126, "args": [ { - "name": "out", - "type": "git_tree **", - "comment": "Pointer to store the copy of the tree" + "name": "sm", + "type": "git_submodule *", + "comment": "git_submodule currently being visited" }, { - "name": "source", - "type": "git_tree *", - "comment": "Original tree to copy" + "name": "name", + "type": "const char *", + "comment": "name of the submodule" + }, + { + "name": "payload", + "type": "void *", + "comment": "value you passed to the foreach function as payload" } ], - "argline": "git_tree **out, git_tree *source", - "sig": "git_tree **::git_tree *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Create an in-memory copy of a tree. The copy must be explicitly\n free'd or it will leak.

\n", - "comments": "", - "group": "tree" + "argline": "git_submodule *sm, const char *name, void *payload", + "sig": "git_submodule *::const char *::void *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Function pointer to receive each submodule

\n", + "comments": "" }, - "git_tree_create_updated": { - "type": "function", - "file": "tree.h", - "line": 478, - "lineto": 478, + "git_tag_foreach_cb": { + "type": "callback", + "file": "git2/tag.h", + "line": 330, + "lineto": 330, "args": [ + { "name": "name", "type": "const char *", "comment": "The tag name" }, + { "name": "oid", "type": "git_oid *", "comment": "The tag's OID" }, { - "name": "out", - "type": "git_oid *", - "comment": "id of the new tree" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "the repository in which to create the tree, must be the\n same as for `baseline`" - }, - { - "name": "baseline", - "type": "git_tree *", - "comment": "the tree to base these changes on" - }, - { - "name": "nupdates", - "type": "size_t", - "comment": "the number of elements in the update list" - }, - { - "name": "updates", - "type": "const git_tree_update *", - "comment": "the list of updates to perform" + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_tag_foreach" } ], - "argline": "git_oid *out, git_repository *repo, git_tree *baseline, size_t nupdates, const git_tree_update *updates", - "sig": "git_oid *::git_repository *::git_tree *::size_t::const git_tree_update *", + "argline": "const char *name, git_oid *oid, void *payload", + "sig": "const char *::git_oid *::void *", "return": { "type": "int", - "comment": null + "comment": " non-zero to terminate the iteration" }, - "description": "

Create a tree based on another one with the specified modifications

\n", - "comments": "

Given the baseline perform the changes described in the list of updates and create a new tree.

\n\n

This function is optimized for common file/directory addition, removal and replacement in trees. It is much more efficient than reading the tree into a git_index and modifying that, but in exchange it is not as flexible.

\n\n

Deleting and adding the same entry is undefined behaviour, changing a tree to a blob or viceversa is not supported.

\n", - "group": "tree" - } - }, - "callbacks": { - "git_checkout_notify_cb": { + "description": "

Callback used to iterate over tag names

\n", + "comments": "" + }, + "git_trace_cb": { "type": "callback", - "file": "checkout.h", - "line": 223, - "lineto": 229, + "file": "git2/trace.h", + "line": 55, + "lineto": 57, "args": [ { - "name": "why", - "type": "git_checkout_notify_t", - "comment": null + "name": "level", + "type": "git_trace_level_t", + "comment": "the trace level" }, { - "name": "path", + "name": "msg", "type": "const char *", - "comment": null - }, - { - "name": "baseline", - "type": "const git_diff_file *", - "comment": null - }, - { - "name": "target", - "type": "const git_diff_file *", - "comment": null - }, - { - "name": "workdir", - "type": "const git_diff_file *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null + "comment": "the trace message" } ], - "argline": "git_checkout_notify_t why, const char *path, const git_diff_file *baseline, const git_diff_file *target, const git_diff_file *workdir, void *payload", - "sig": "git_checkout_notify_t::const char *::const git_diff_file *::const git_diff_file *::const git_diff_file *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Checkout notification callback function

\n", + "argline": "git_trace_level_t level, const char *msg", + "sig": "git_trace_level_t::const char *", + "return": { "type": "void", "comment": null }, + "description": "

An instance for a tracing function

\n", "comments": "" }, - "git_checkout_progress_cb": { + "git_transport_message_cb": { "type": "callback", - "file": "checkout.h", - "line": 232, - "lineto": 236, + "file": "git2/transport.h", + "line": 35, + "lineto": 35, "args": [ { - "name": "path", + "name": "str", "type": "const char *", - "comment": null - }, - { - "name": "completed_steps", - "type": "size_t", - "comment": null + "comment": "The message from the transport" }, { - "name": "total_steps", - "type": "size_t", - "comment": null + "name": "len", + "type": "int", + "comment": "The length of the message" }, { "name": "payload", "type": "void *", - "comment": null + "comment": "Payload provided by the caller" } ], - "argline": "const char *path, size_t completed_steps, size_t total_steps, void *payload", - "sig": "const char *::size_t::size_t::void *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Checkout progress notification function

\n", - "comments": "" + "argline": "const char *str, int len, void *payload", + "sig": "const char *::int::void *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Callback for messages received by the transport.

\n", + "comments": "

Return a negative value to cancel the network operation.

\n" }, - "git_checkout_perfdata_cb": { + "git_transport_cb": { "type": "callback", - "file": "checkout.h", - "line": 239, - "lineto": 241, + "file": "git2/transport.h", + "line": 45, + "lineto": 45, "args": [ { - "name": "perfdata", - "type": "const git_checkout_perfdata *", - "comment": null + "name": "out", + "type": "git_transport **", + "comment": "the transport generate" }, { - "name": "payload", + "name": "owner", + "type": "git_remote *", + "comment": "the owner for the transport" + }, + { + "name": "param", "type": "void *", - "comment": null + "comment": "the param to the transport creation" } ], - "argline": "const git_checkout_perfdata *perfdata, void *payload", - "sig": "const git_checkout_perfdata *::void *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Checkout perfdata notification function

\n", + "argline": "git_transport **out, git_remote *owner, void *param", + "sig": "git_transport **::git_remote *::void *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Signature of a function which creates a transport.

\n", "comments": "" }, - "git_remote_create_cb": { + "git_treebuilder_filter_cb": { "type": "callback", - "file": "clone.h", - "line": 69, - "lineto": 74, + "file": "git2/tree.h", + "line": 353, + "lineto": 354, "args": [ { - "name": "out", - "type": "git_remote **", - "comment": "the resulting remote" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "the repository in which to create the remote" - }, - { - "name": "name", - "type": "const char *", - "comment": "the remote's name" - }, - { - "name": "url", - "type": "const char *", - "comment": "the remote's url" + "name": "entry", + "type": "const git_tree_entry *", + "comment": "the tree entry for the callback to examine" }, { "name": "payload", "type": "void *", - "comment": "an opaque payload" + "comment": "the payload from the caller" } ], - "argline": "git_remote **out, git_repository *repo, const char *name, const char *url, void *payload", - "sig": "git_remote **::git_repository *::const char *::const char *::void *", + "argline": "const git_tree_entry *entry, void *payload", + "sig": "const git_tree_entry *::void *", "return": { "type": "int", - "comment": " 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" + "comment": " 0 to do nothing, non-zero to remove the entry" }, - "description": "

The signature of a function matching git_remote_create, with an additional\n void* as a callback payload.

\n", - "comments": "

Callers of git_clone may provide a function matching this signature to override the remote creation and customization process during a clone operation.

\n" + "description": "

Callback for git_treebuilder_filter

\n", + "comments": "

The return value is treated as a boolean, with zero indicating that the entry should be left alone and any non-zero value meaning that the entry should be removed from the treebuilder list (i.e. filtered out).

\n" }, - "git_repository_create_cb": { + "git_treewalk_cb": { "type": "callback", - "file": "clone.h", - "line": 90, - "lineto": 94, + "file": "git2/tree.h", + "line": 394, + "lineto": 395, "args": [ { - "name": "out", - "type": "git_repository **", - "comment": "the resulting repository" - }, - { - "name": "path", + "name": "root", "type": "const char *", - "comment": "path in which to create the repository" + "comment": "the current (relative) root to the entry" }, { - "name": "bare", - "type": "int", - "comment": "whether the repository is bare. This is the value from the clone options" + "name": "entry", + "type": "const git_tree_entry *", + "comment": "the tree entry" }, { "name": "payload", "type": "void *", - "comment": "payload specified by the options" + "comment": "the caller-provided callback payload" } ], - "argline": "git_repository **out, const char *path, int bare, void *payload", - "sig": "git_repository **::const char *::int::void *", + "argline": "const char *root, const git_tree_entry *entry, void *payload", + "sig": "const char *::const git_tree_entry *::void *", "return": { "type": "int", - "comment": " 0, or a negative value to indicate error" + "comment": " a positive value to skip the entry, a negative value to stop the walk" }, - "description": "

The signature of a function matchin git_repository_init, with an\n aditional void * as callback payload.

\n", - "comments": "

Callers of git_clone my provide a function matching this signature to override the repository creation and customization process during a clone operation.

\n" - }, - "git_diff_notify_cb": { - "type": "callback", - "file": "diff.h", - "line": 353, - "lineto": 357, - "args": [ - { - "name": "diff_so_far", - "type": "const git_diff *", - "comment": null - }, - { - "name": "delta_to_add", - "type": "const git_diff_delta *", - "comment": null - }, - { - "name": "matched_pathspec", - "type": "const char *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "const git_diff *diff_so_far, const git_diff_delta *delta_to_add, const char *matched_pathspec, void *payload", - "sig": "const git_diff *::const git_diff_delta *::const char *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Diff notification callback function.

\n", - "comments": "

The callback will be called for each file, just before the git_delta_t gets inserted into the diff.

\n\n

When the callback: - returns < 0, the diff process will be aborted. - returns > 0, the delta will not be inserted into the diff, but the diff process continues. - returns 0, the delta is inserted into the diff, and the diff process continues.

\n" - }, - "git_diff_progress_cb": { - "type": "callback", - "file": "diff.h", - "line": 369, - "lineto": 373, - "args": [ - { - "name": "diff_so_far", - "type": "const git_diff *", - "comment": "The diff being generated." - }, - { - "name": "old_path", - "type": "const char *", - "comment": "The path to the old file or NULL." - }, - { - "name": "new_path", - "type": "const char *", - "comment": "The path to the new file or NULL." - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "const git_diff *diff_so_far, const char *old_path, const char *new_path, void *payload", - "sig": "const git_diff *::const char *::const char *::void *", - "return": { - "type": "int", - "comment": " Non-zero to abort the diff." - }, - "description": "

Diff progress callback.

\n", - "comments": "

Called before each file comparison.

\n" - }, - "git_diff_file_cb": { - "type": "callback", - "file": "diff.h", - "line": 452, - "lineto": 455, - "args": [ - { - "name": "delta", - "type": "const git_diff_delta *", - "comment": "A pointer to the delta data for the file" - }, - { - "name": "progress", - "type": "float", - "comment": "Goes from 0 to 1 over the diff" - }, - { - "name": "payload", - "type": "void *", - "comment": "User-specified pointer from foreach function" - } - ], - "argline": "const git_diff_delta *delta, float progress, void *payload", - "sig": "const git_diff_delta *::float::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

When iterating over a diff, callback that will be made per file.

\n", - "comments": "" - }, - "git_diff_binary_cb": { - "type": "callback", - "file": "diff.h", - "line": 509, - "lineto": 512, - "args": [ - { - "name": "delta", - "type": "const git_diff_delta *", - "comment": null - }, - { - "name": "binary", - "type": "const git_diff_binary *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "const git_diff_delta *delta, const git_diff_binary *binary, void *payload", - "sig": "const git_diff_delta *::const git_diff_binary *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

When iterating over a diff, callback that will be made for\n binary content within the diff.

\n", - "comments": "" - }, - "git_diff_hunk_cb": { - "type": "callback", - "file": "diff.h", - "line": 529, - "lineto": 532, - "args": [ - { - "name": "delta", - "type": "const git_diff_delta *", - "comment": null - }, - { - "name": "hunk", - "type": "const git_diff_hunk *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "const git_diff_delta *delta, const git_diff_hunk *hunk, void *payload", - "sig": "const git_diff_delta *::const git_diff_hunk *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

When iterating over a diff, callback that will be made per hunk.

\n", - "comments": "" - }, - "git_diff_line_cb": { - "type": "callback", - "file": "diff.h", - "line": 582, - "lineto": 586, - "args": [ - { - "name": "delta", - "type": "const git_diff_delta *", - "comment": null - }, - { - "name": "hunk", - "type": "const git_diff_hunk *", - "comment": null - }, - { - "name": "line", - "type": "const git_diff_line *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload", - "sig": "const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

When iterating over a diff, callback that will be made per text diff\n line. In this context, the provided range will be NULL.

\n", - "comments": "

When printing a diff, callback that will be made to output each line of text. This uses some extra GIT_DIFF_LINE_... constants for output of lines of file and hunk headers.

\n" - }, - "git_index_matched_path_cb": { - "type": "callback", - "file": "index.h", - "line": 146, - "lineto": 147, - "args": [ - { - "name": "path", - "type": "const char *", - "comment": null - }, - { - "name": "matched_pathspec", - "type": "const char *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "const char *path, const char *matched_pathspec, void *payload", - "sig": "const char *::const char *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Callback for APIs that add/remove/update files matching pathspec

\n", - "comments": "" - }, - "git_headlist_cb": { - "type": "callback", - "file": "net.h", - "line": 55, - "lineto": 55, - "args": [ - { - "name": "rhead", - "type": "git_remote_head *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "git_remote_head *rhead, void *payload", - "sig": "git_remote_head *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Callback for listing the remote heads

\n", - "comments": "" - }, - "git_note_foreach_cb": { - "type": "callback", - "file": "notes.h", - "line": 29, - "lineto": 30, - "args": [ - { - "name": "blob_id", - "type": "const git_oid *", - "comment": null - }, - { - "name": "annotated_object_id", - "type": "const git_oid *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "const git_oid *blob_id, const git_oid *annotated_object_id, void *payload", - "sig": "const git_oid *::const git_oid *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Callback for git_note_foreach.

\n", - "comments": "

Receives: - blob_id: Oid of the blob containing the message - annotated_object_id: Oid of the git object being annotated - payload: Payload data passed to git_note_foreach

\n" - }, - "git_odb_foreach_cb": { - "type": "callback", - "file": "odb.h", - "line": 27, - "lineto": 27, - "args": [ - { - "name": "id", - "type": "const git_oid *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "const git_oid *id, void *payload", - "sig": "const git_oid *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Function type for callbacks from git_odb_foreach.

\n", - "comments": "" - }, - "git_packbuilder_progress": { - "type": "callback", - "file": "pack.h", - "line": 210, - "lineto": 214, - "args": [ - { - "name": "stage", - "type": "int", - "comment": null - }, - { - "name": "current", - "type": "uint32_t", - "comment": null - }, - { - "name": "total", - "type": "uint32_t", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "int stage, uint32_t current, uint32_t total, void *payload", - "sig": "int::uint32_t::uint32_t::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Packbuilder progress notification function

\n", - "comments": "" - }, - "git_push_transfer_progress": { - "type": "callback", - "file": "remote.h", - "line": 333, - "lineto": 337, - "args": [ - { - "name": "current", - "type": "unsigned int", - "comment": null - }, - { - "name": "total", - "type": "unsigned int", - "comment": null - }, - { - "name": "bytes", - "type": "size_t", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "unsigned int current, unsigned int total, size_t bytes, void *payload", - "sig": "unsigned int::unsigned int::size_t::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Push network progress notification function

\n", - "comments": "" - }, - "git_push_negotiation": { - "type": "callback", - "file": "remote.h", - "line": 368, - "lineto": 368, - "args": [ - { - "name": "updates", - "type": "const git_push_update **", - "comment": "an array containing the updates which will be sent\n as commands to the destination." - }, - { - "name": "len", - "type": "size_t", - "comment": "number of elements in `updates`" - }, - { - "name": "payload", - "type": "void *", - "comment": "Payload provided by the caller" - } - ], - "argline": "const git_push_update **updates, size_t len, void *payload", - "sig": "const git_push_update **::size_t::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Callback used to inform of upcoming updates.

\n", - "comments": "" - }, - "git_revwalk_hide_cb": { - "type": "callback", - "file": "revwalk.h", - "line": 277, - "lineto": 279, - "args": [ - { - "name": "commit_id", - "type": "const git_oid *", - "comment": "oid of Commit" - }, - { - "name": "payload", - "type": "void *", - "comment": "User-specified pointer to data to be passed as data payload" - } - ], - "argline": "const git_oid *commit_id, void *payload", - "sig": "const git_oid *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

This is a callback function that user can provide to hide a\n commit and its parents. If the callback function returns non-zero value,\n then this commit and its parents will be hidden.

\n", - "comments": "" - }, - "git_stash_apply_progress_cb": { - "type": "callback", - "file": "stash.h", - "line": 113, - "lineto": 115, - "args": [ - { - "name": "progress", - "type": "git_stash_apply_progress_t", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "git_stash_apply_progress_t progress, void *payload", - "sig": "git_stash_apply_progress_t::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Stash application progress notification function.\n Return 0 to continue processing, or a negative value to\n abort the stash application.

\n", - "comments": "" - }, - "git_stash_cb": { - "type": "callback", - "file": "stash.h", - "line": 198, - "lineto": 202, - "args": [ - { - "name": "index", - "type": "size_t", - "comment": "The position within the stash list. 0 points to the\n most recent stashed state." - }, - { - "name": "message", - "type": "const char *", - "comment": "The stash message." - }, - { - "name": "stash_id", - "type": "const int *", - "comment": "The commit oid of the stashed state." - }, - { - "name": "payload", - "type": "void *", - "comment": "Extra parameter to callback function." - } - ], - "argline": "size_t index, const char *message, const int *stash_id, void *payload", - "sig": "size_t::const char *::const int *::void *", - "return": { - "type": "int", - "comment": " 0 to continue iterating or non-zero to stop." - }, - "description": "

This is a callback function you can provide to iterate over all the\n stashed states that will be invoked per entry.

\n", - "comments": "" - }, - "git_status_cb": { - "type": "callback", - "file": "status.h", - "line": 61, - "lineto": 62, - "args": [ - { - "name": "path", - "type": "const char *", - "comment": null - }, - { - "name": "status_flags", - "type": "unsigned int", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "const char *path, unsigned int status_flags, void *payload", - "sig": "const char *::unsigned int::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Function pointer to receive status on individual files

\n", - "comments": "

path is the relative path to the file from the root of the repository.

\n\n

status_flags is a combination of git_status_t values that apply.

\n\n

payload is the value you passed to the foreach function as payload.

\n" - }, - "git_submodule_cb": { - "type": "callback", - "file": "submodule.h", - "line": 118, - "lineto": 119, - "args": [ - { - "name": "sm", - "type": "git_submodule *", - "comment": "git_submodule currently being visited" - }, - { - "name": "name", - "type": "const char *", - "comment": "name of the submodule" - }, - { - "name": "payload", - "type": "void *", - "comment": "value you passed to the foreach function as payload" - } - ], - "argline": "git_submodule *sm, const char *name, void *payload", - "sig": "git_submodule *::const char *::void *", - "return": { - "type": "int", - "comment": " 0 on success or error code" - }, - "description": "

Function pointer to receive each submodule

\n", - "comments": "" - }, - "git_filter_init_fn": { - "type": "callback", - "file": "sys/filter.h", - "line": 141, - "lineto": 141, - "args": [ - { - "name": "self", - "type": "git_filter *", - "comment": null - } - ], - "argline": "git_filter *self", - "sig": "git_filter *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Initialize callback on filter

\n", - "comments": "

Specified as filter.initialize, this is an optional callback invoked before a filter is first used. It will be called once at most.

\n\n

If non-NULL, the filter's initialize callback will be invoked right before the first use of the filter, so you can defer expensive initialization operations (in case libgit2 is being used in a way that doesn't need the filter).

\n" - }, - "git_filter_shutdown_fn": { - "type": "callback", - "file": "sys/filter.h", - "line": 153, - "lineto": 153, - "args": [ - { - "name": "self", - "type": "git_filter *", - "comment": null - } - ], - "argline": "git_filter *self", - "sig": "git_filter *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Shutdown callback on filter

\n", - "comments": "

Specified as filter.shutdown, this is an optional callback invoked when the filter is unregistered or when libgit2 is shutting down. It will be called once at most and should release resources as needed. This may be called even if the initialize callback was not made.

\n\n

Typically this function will free the git_filter object itself.

\n" - }, - "git_filter_check_fn": { - "type": "callback", - "file": "sys/filter.h", - "line": 175, - "lineto": 179, - "args": [ - { - "name": "self", - "type": "git_filter *", - "comment": null - }, - { - "name": "payload", - "type": "void **", - "comment": null - }, - { - "name": "src", - "type": "const git_filter_source *", - "comment": null - }, - { - "name": "attr_values", - "type": "const char **", - "comment": null - } - ], - "argline": "git_filter *self, void **payload, const git_filter_source *src, const char **attr_values", - "sig": "git_filter *::void **::const git_filter_source *::const char **", - "return": { - "type": "int", - "comment": null - }, - "description": "

Callback to decide if a given source needs this filter

\n", - "comments": "

Specified as filter.check, this is an optional callback that checks if filtering is needed for a given source.

\n\n

It should return 0 if the filter should be applied (i.e. success), GIT_PASSTHROUGH if the filter should not be applied, or an error code to fail out of the filter processing pipeline and return to the caller.

\n\n

The attr_values will be set to the values of any attributes given in the filter definition. See git_filter below for more detail.

\n\n

The payload will be a pointer to a reference payload for the filter. This will start as NULL, but check can assign to this pointer for later use by the apply callback. Note that the value should be heap allocated (not stack), so that it doesn't go away before the apply callback can use it. If a filter allocates and assigns a value to the payload, it will need a cleanup callback to free the payload.

\n" - }, - "git_filter_apply_fn": { - "type": "callback", - "file": "sys/filter.h", - "line": 193, - "lineto": 198, - "args": [ - { - "name": "self", - "type": "git_filter *", - "comment": null - }, - { - "name": "payload", - "type": "void **", - "comment": null - }, - { - "name": "to", - "type": "git_buf *", - "comment": null - }, - { - "name": "from", - "type": "const git_buf *", - "comment": null - }, - { - "name": "src", - "type": "const git_filter_source *", - "comment": null - } - ], - "argline": "git_filter *self, void **payload, git_buf *to, const git_buf *from, const git_filter_source *src", - "sig": "git_filter *::void **::git_buf *::const git_buf *::const git_filter_source *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Callback to actually perform the data filtering

\n", - "comments": "

Specified as filter.apply, this is the callback that actually filters data. If it successfully writes the output, it should return 0. Like check, it can return GIT_PASSTHROUGH to indicate that the filter doesn't want to run. Other error codes will stop filter processing and return to the caller.

\n\n

The payload value will refer to any payload that was set by the check callback. It may be read from or written to as needed.

\n" - }, - "git_filter_cleanup_fn": { - "type": "callback", - "file": "sys/filter.h", - "line": 215, - "lineto": 217, - "args": [ - { - "name": "self", - "type": "git_filter *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "git_filter *self, void *payload", - "sig": "git_filter *::void *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Callback to clean up after filtering has been applied

\n", - "comments": "

Specified as filter.cleanup, this is an optional callback invoked after the filter has been applied. If the check or apply callbacks allocated a payload to keep per-source filter state, use this callback to free that payload and release resources as required.

\n" - }, - "git_merge_driver_init_fn": { - "type": "callback", - "file": "sys/merge.h", - "line": 71, - "lineto": 71, - "args": [ - { - "name": "self", - "type": "int *", - "comment": null - } - ], - "argline": "int *self", - "sig": "int *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Initialize callback on merge driver

\n", - "comments": "

Specified as driver.initialize, this is an optional callback invoked before a merge driver is first used. It will be called once at most per library lifetime.

\n\n

If non-NULL, the merge driver's initialize callback will be invoked right before the first use of the driver, so you can defer expensive initialization operations (in case libgit2 is being used in a way that doesn't need the merge driver).

\n" - }, - "git_merge_driver_shutdown_fn": { - "type": "callback", - "file": "sys/merge.h", - "line": 83, - "lineto": 83, - "args": [ - { - "name": "self", - "type": "int *", - "comment": null - } - ], - "argline": "int *self", - "sig": "int *", - "return": { - "type": "void", - "comment": null - }, - "description": "

Shutdown callback on merge driver

\n", - "comments": "

Specified as driver.shutdown, this is an optional callback invoked when the merge driver is unregistered or when libgit2 is shutting down. It will be called once at most and should release resources as needed. This may be called even if the initialize callback was not made.

\n\n

Typically this function will free the git_merge_driver object itself.

\n" - }, - "git_merge_driver_apply_fn": { - "type": "callback", - "file": "sys/merge.h", - "line": 103, - "lineto": 109, - "args": [ - { - "name": "self", - "type": "int *", - "comment": null - }, - { - "name": "path_out", - "type": "const char **", - "comment": null - }, - { - "name": "mode_out", - "type": "int *", - "comment": null - }, - { - "name": "merged_out", - "type": "int *", - "comment": null - }, - { - "name": "filter_name", - "type": "const char *", - "comment": null - }, - { - "name": "src", - "type": "const git_merge_driver_source *", - "comment": null - } - ], - "argline": "int *self, const char **path_out, int *mode_out, int *merged_out, const char *filter_name, const git_merge_driver_source *src", - "sig": "int *::const char **::int *::int *::const char *::const git_merge_driver_source *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Callback to perform the merge.

\n", - "comments": "

Specified as driver.apply, this is the callback that actually does the merge. If it can successfully perform a merge, it should populate path_out with a pointer to the filename to accept, mode_out with the resultant mode, and merged_out with the buffer of the merged file and then return 0. If the driver returns GIT_PASSTHROUGH, then the default merge driver should instead be run. It can also return GIT_EMERGECONFLICT if the driver is not able to produce a merge result, and the file will remain conflicted. Any other errors will fail and return to the caller.

\n\n

The filter_name contains the name of the filter that was invoked, as specified by the file's attributes.

\n\n

The src contains the data about the file to be merged.

\n" - }, - "git_trace_callback": { - "type": "callback", - "file": "trace.h", - "line": 52, - "lineto": 52, - "args": [ - { - "name": "level", - "type": "git_trace_level_t", - "comment": null - }, - { - "name": "msg", - "type": "const char *", - "comment": null - } - ], - "argline": "git_trace_level_t level, const char *msg", - "sig": "git_trace_level_t::const char *", - "return": { - "type": "void", - "comment": null - }, - "description": "

An instance for a tracing function

\n", - "comments": "" - }, - "git_transport_cb": { - "type": "callback", - "file": "transport.h", - "line": 24, - "lineto": 24, - "args": [ - { - "name": "out", - "type": "git_transport **", - "comment": null - }, - { - "name": "owner", - "type": "git_remote *", - "comment": null - }, - { - "name": "param", - "type": "void *", - "comment": null - } - ], - "argline": "git_transport **out, git_remote *owner, void *param", - "sig": "git_transport **::git_remote *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Signature of a function which creates a transport

\n", - "comments": "" - }, - "git_cred_acquire_cb": { - "type": "callback", - "file": "transport.h", - "line": 333, - "lineto": 338, - "args": [ - { - "name": "cred", - "type": "git_cred **", - "comment": null - }, - { - "name": "url", - "type": "const char *", - "comment": null - }, - { - "name": "username_from_url", - "type": "const char *", - "comment": null - }, - { - "name": "allowed_types", - "type": "unsigned int", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "git_cred **cred, const char *url, const char *username_from_url, unsigned int allowed_types, void *payload", - "sig": "git_cred **::const char *::const char *::unsigned int::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Signature of a function which acquires a credential object.

\n", - "comments": "\n" - }, - "git_treebuilder_filter_cb": { - "type": "callback", - "file": "tree.h", - "line": 346, - "lineto": 347, - "args": [ - { - "name": "entry", - "type": "const git_tree_entry *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "const git_tree_entry *entry, void *payload", - "sig": "const git_tree_entry *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Callback for git_treebuilder_filter

\n", - "comments": "

The return value is treated as a boolean, with zero indicating that the entry should be left alone and any non-zero value meaning that the entry should be removed from the treebuilder list (i.e. filtered out).

\n" - }, - "git_treewalk_cb": { - "type": "callback", - "file": "tree.h", - "line": 393, - "lineto": 394, - "args": [ - { - "name": "root", - "type": "const char *", - "comment": null - }, - { - "name": "entry", - "type": "const git_tree_entry *", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "const char *root, const git_tree_entry *entry, void *payload", - "sig": "const char *::const git_tree_entry *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Callback for the tree traversal method

\n", - "comments": "" - }, - "git_transfer_progress_cb": { - "type": "callback", - "file": "types.h", - "line": 270, - "lineto": 270, - "args": [ - { - "name": "stats", - "type": "const git_transfer_progress *", - "comment": "Structure containing information about the state of the transfer" - }, - { - "name": "payload", - "type": "void *", - "comment": "Payload provided by caller" - } - ], - "argline": "const git_transfer_progress *stats, void *payload", - "sig": "const git_transfer_progress *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Type for progress callbacks during indexing. Return a value less than zero\n to cancel the transfer.

\n", - "comments": "" - }, - "git_transport_message_cb": { - "type": "callback", - "file": "types.h", - "line": 280, - "lineto": 280, - "args": [ - { - "name": "str", - "type": "const char *", - "comment": "The message from the transport" - }, - { - "name": "len", - "type": "int", - "comment": "The length of the message" - }, - { - "name": "payload", - "type": "void *", - "comment": "Payload provided by the caller" - } - ], - "argline": "const char *str, int len, void *payload", - "sig": "const char *::int::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Type for messages delivered by the transport. Return a negative value\n to cancel the network operation.

\n", - "comments": "" - }, - "git_transport_certificate_check_cb": { - "type": "callback", - "file": "types.h", - "line": 330, - "lineto": 330, - "args": [ - { - "name": "cert", - "type": "git_cert *", - "comment": "The host certificate" - }, - { - "name": "valid", - "type": "int", - "comment": "Whether the libgit2 checks (OpenSSL or WinHTTP) think\n this certificate is valid" - }, - { - "name": "host", - "type": "const char *", - "comment": "Hostname of the host libgit2 connected to" - }, - { - "name": "payload", - "type": "void *", - "comment": "Payload provided by the caller" - } - ], - "argline": "git_cert *cert, int valid, const char *host, void *payload", - "sig": "git_cert *::int::const char *::void *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Callback for the user's custom certificate checks.

\n", + "description": "

Callback for the tree traversal method.

\n", "comments": "" } }, "globals": {}, "types": [ [ - "git_annotated_commit", + "git_annotated_commit", + { + "decl": "git_annotated_commit", + "type": "struct", + "value": "git_annotated_commit", + "file": "git2/types.h", + "line": 214, + "lineto": 214, + "tdef": "typedef", + "description": " Annotated commits are commits with additional metadata about how the\n commit was resolved, which can be used for maintaining the user's\n \"intent\" through commands like merge and rebase.", + "comments": "

For example, if a user wants to conceptually "merge HEAD", then the commit portion of an annotated commit will point to the HEAD commit, but the annotation will denote the ref HEAD. This allows git to perform the internal bookkeeping so that the system knows both the content of what is being merged but also how the content was looked up so that it can be recorded in the reflog appropriately.

\n", + "used": { + "returns": [], + "needs": [ + "git_annotated_commit_free", + "git_annotated_commit_from_fetchhead", + "git_annotated_commit_from_ref", + "git_annotated_commit_from_revspec", + "git_annotated_commit_id", + "git_annotated_commit_lookup", + "git_annotated_commit_ref", + "git_branch_create_from_annotated", + "git_merge", + "git_merge_analysis", + "git_merge_analysis_for_ref", + "git_rebase_init", + "git_repository_set_head_detached_from_annotated", + "git_reset_from_annotated" + ] + } + } + ], + [ + "git_apply_flags_t", + { + "decl": ["GIT_APPLY_CHECK"], + "type": "enum", + "file": "git2/apply.h", + "line": 72, + "lineto": 78, + "block": "GIT_APPLY_CHECK", + "tdef": "typedef", + "description": " Flags controlling the behavior of `git_apply`.", + "comments": "

When the callback: - returns < 0, the apply process will be aborted. - returns > 0, the hunk will not be applied, but the apply process continues - returns 0, the hunk is applied, and the apply process continues.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_APPLY_CHECK", + "comments": "

Don't actually make changes, just test that the patch applies.\n This is the equivalent of git apply --check.

\n", + "value": 1 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_apply_location_t", + { + "decl": [ + "GIT_APPLY_LOCATION_WORKDIR", + "GIT_APPLY_LOCATION_INDEX", + "GIT_APPLY_LOCATION_BOTH" + ], + "type": "enum", + "file": "git2/apply.h", + "line": 148, + "lineto": 166, + "block": "GIT_APPLY_LOCATION_WORKDIR\nGIT_APPLY_LOCATION_INDEX\nGIT_APPLY_LOCATION_BOTH", + "tdef": "typedef", + "description": " Possible application locations for git_apply ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_APPLY_LOCATION_WORKDIR", + "comments": "

Apply the patch to the workdir, leaving the index untouched.\n This is the equivalent of git apply with no location argument.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_APPLY_LOCATION_INDEX", + "comments": "

Apply the patch to the index, leaving the working directory\n untouched. This is the equivalent of git apply --cached.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_APPLY_LOCATION_BOTH", + "comments": "

Apply the patch to both the working directory and the index.\n This is the equivalent of git apply --index.

\n", + "value": 2 + } + ], + "used": { "returns": [], "needs": ["git_apply"] } + } + ], + [ + "git_apply_options", + { + "decl": [ + "unsigned int version", + "git_apply_delta_cb delta_cb", + "git_apply_hunk_cb hunk_cb", + "void * payload", + "unsigned int flags" + ], + "type": "struct", + "value": "git_apply_options", + "file": "git2/apply.h", + "line": 95, + "lineto": 109, + "block": "unsigned int version\ngit_apply_delta_cb delta_cb\ngit_apply_hunk_cb hunk_cb\nvoid * payload\nunsigned int flags", + "tdef": "typedef", + "description": " Apply options structure.", + "comments": "

When the callback: - returns < 0, the apply process will be aborted. - returns > 0, the hunk will not be applied, but the apply process continues - returns 0, the hunk is applied, and the apply process continues.

\n\n

Initialize with GIT_APPLY_OPTIONS_INIT. Alternatively, you can use git_apply_options_init.

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": " The version " + }, + { + "type": "git_apply_delta_cb", + "name": "delta_cb", + "comments": " When applying a patch, callback that will be made per delta (file). " + }, + { + "type": "git_apply_hunk_cb", + "name": "hunk_cb", + "comments": " When applying a patch, callback that will be made per hunk. " + }, + { + "type": "void *", + "name": "payload", + "comments": " Payload passed to both `delta_cb` \n&\n `hunk_cb`. " + }, + { + "type": "unsigned int", + "name": "flags", + "comments": " Bitmask of `git_apply_flags_t` " + } + ], + "used": { + "returns": [], + "needs": ["git_apply", "git_apply_options_init", "git_apply_to_tree"] + } + } + ], + [ + "git_attr_options", { - "decl": "git_annotated_commit", + "decl": [ + "unsigned int version", + "unsigned int flags", + "git_oid * commit_id", + "git_oid attr_commit_id" + ], "type": "struct", - "value": "git_annotated_commit", - "file": "types.h", - "line": 178, - "lineto": 178, + "value": "git_attr_options", + "file": "git2/attr.h", + "line": 154, + "lineto": 171, + "block": "unsigned int version\nunsigned int flags\ngit_oid * commit_id\ngit_oid attr_commit_id", "tdef": "typedef", - "description": " Annotated commits, the input to merge and rebase. ", + "description": " An options structure for querying attributes.", "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "unsigned int", + "name": "flags", + "comments": " A combination of GIT_ATTR_CHECK flags " + }, + { "type": "git_oid *", "name": "commit_id", "comments": "" }, + { + "type": "git_oid", + "name": "attr_commit_id", + "comments": " The commit to load attributes from, when\n `GIT_ATTR_CHECK_INCLUDE_COMMIT` is specified." + } + ], "used": { "returns": [], "needs": [ - "git_annotated_commit_free", - "git_annotated_commit_from_fetchhead", - "git_annotated_commit_from_ref", - "git_annotated_commit_from_revspec", - "git_annotated_commit_id", - "git_annotated_commit_lookup", - "git_branch_create_from_annotated", - "git_merge", - "git_merge_analysis", - "git_rebase_init", - "git_repository_set_head_detached_from_annotated", - "git_reset_from_annotated" + "git_attr_foreach_ext", + "git_attr_get_ext", + "git_attr_get_many_ext" ] } } ], [ - "git_attr_t", + "git_attr_value_t", { "decl": [ - "GIT_ATTR_UNSPECIFIED_T", - "GIT_ATTR_TRUE_T", - "GIT_ATTR_FALSE_T", - "GIT_ATTR_VALUE_T" + "GIT_ATTR_VALUE_UNSPECIFIED", + "GIT_ATTR_VALUE_TRUE", + "GIT_ATTR_VALUE_FALSE", + "GIT_ATTR_VALUE_STRING" ], "type": "enum", - "file": "attr.h", - "line": 82, - "lineto": 87, - "block": "GIT_ATTR_UNSPECIFIED_T\nGIT_ATTR_TRUE_T\nGIT_ATTR_FALSE_T\nGIT_ATTR_VALUE_T", + "file": "git2/attr.h", + "line": 86, + "lineto": 91, + "block": "GIT_ATTR_VALUE_UNSPECIFIED\nGIT_ATTR_VALUE_TRUE\nGIT_ATTR_VALUE_FALSE\nGIT_ATTR_VALUE_STRING", "tdef": "typedef", "description": " Possible states for an attribute", "comments": "", "fields": [ { "type": "int", - "name": "GIT_ATTR_UNSPECIFIED_T", + "name": "GIT_ATTR_VALUE_UNSPECIFIED", "comments": "

The attribute has been left unspecified

\n", "value": 0 }, { "type": "int", - "name": "GIT_ATTR_TRUE_T", + "name": "GIT_ATTR_VALUE_TRUE", "comments": "

The attribute has been set

\n", "value": 1 }, { "type": "int", - "name": "GIT_ATTR_FALSE_T", + "name": "GIT_ATTR_VALUE_FALSE", "comments": "

The attribute has been unset

\n", "value": 2 }, { "type": "int", - "name": "GIT_ATTR_VALUE_T", + "name": "GIT_ATTR_VALUE_STRING", "comments": "

This attribute has a value

\n", "value": 3 } ], + "used": { "returns": ["git_attr_value"], "needs": [] } + } + ], + [ + "git_blame", + { + "decl": "git_blame", + "type": "struct", + "value": "git_blame", + "file": "git2/blame.h", + "line": 236, + "lineto": 236, + "tdef": "typedef", + "description": " Opaque structure to hold blame results ", + "comments": "", "used": { "returns": [ - "git_attr_value" + "git_blame_get_hunk_byindex", + "git_blame_get_hunk_byline", + "git_blame_hunk_byindex", + "git_blame_hunk_byline", + "git_blame_line_byindex" ], - "needs": [] + "needs": [ + "git_blame_buffer", + "git_blame_free", + "git_blame_get_hunk_byindex", + "git_blame_get_hunk_byline", + "git_blame_get_hunk_count", + "git_blame_hunk_byindex", + "git_blame_hunk_byline", + "git_blame_hunkcount", + "git_blame_init_options", + "git_blame_line_byindex", + "git_blame_linecount", + "git_blame_options_init" + ] } } ], @@ -25385,13 +25320,15 @@ "GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES", "GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES", "GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES", - "GIT_BLAME_FIRST_PARENT" + "GIT_BLAME_FIRST_PARENT", + "GIT_BLAME_USE_MAILMAP", + "GIT_BLAME_IGNORE_WHITESPACE" ], "type": "enum", - "file": "blame.h", - "line": 26, - "lineto": 46, - "block": "GIT_BLAME_NORMAL\nGIT_BLAME_TRACK_COPIES_SAME_FILE\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES\nGIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES\nGIT_BLAME_FIRST_PARENT", + "file": "git2/blame.h", + "line": 31, + "lineto": 82, + "block": "GIT_BLAME_NORMAL\nGIT_BLAME_TRACK_COPIES_SAME_FILE\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES\nGIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES\nGIT_BLAME_FIRST_PARENT\nGIT_BLAME_USE_MAILMAP\nGIT_BLAME_IGNORE_WHITESPACE", "tdef": "typedef", "description": " Flags for indicating option behavior for git_blame APIs.", "comments": "", @@ -25405,5432 +25342,5839 @@ { "type": "int", "name": "GIT_BLAME_TRACK_COPIES_SAME_FILE", - "comments": "

Track lines that have moved within a file (like git blame -M).\n NOT IMPLEMENTED.

\n", + "comments": "

Track lines that have moved within a file (like git blame -M).

\n\n

This is not yet implemented and reserved for future use.

\n", "value": 1 }, { "type": "int", "name": "GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES", - "comments": "

Track lines that have moved across files in the same commit (like git blame -C).\n NOT IMPLEMENTED.

\n", + "comments": "

Track lines that have moved across files in the same commit\n (like git blame -C).

\n\n

This is not yet implemented and reserved for future use.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES", + "comments": "

Track lines that have been copied from another file that exists\n in the same commit (like git blame -CC). Implies SAME_FILE.

\n\n

This is not yet implemented and reserved for future use.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES", + "comments": "

Track lines that have been copied from another file that exists in\n any commit (like git blame -CCC). Implies SAME_COMMIT_COPIES.

\n\n

This is not yet implemented and reserved for future use.

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_BLAME_FIRST_PARENT", + "comments": "

Restrict the search of commits to those reachable following only\n the first parents.

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_BLAME_USE_MAILMAP", + "comments": "

Use mailmap file to map author and committer names and email\n addresses to canonical real names and email addresses. The\n mailmap will be read from the working directory, or HEAD in a\n bare repository.

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_BLAME_IGNORE_WHITESPACE", + "comments": "

Ignore whitespace differences

\n", + "value": 64 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_blame_line", + { + "decl": ["const char * ptr", "size_t len"], + "type": "struct", + "value": "git_blame_line", + "file": "git2/blame.h", + "line": 230, + "lineto": 233, + "block": "const char * ptr\nsize_t len", + "tdef": "typedef", + "description": " Structure that represents a line in a blamed file.", + "comments": "", + "fields": [ + { "type": "const char *", "name": "ptr", "comments": "" }, + { "type": "size_t", "name": "len", "comments": "" } + ], + "used": { "returns": ["git_blame_line_byindex"], "needs": [] } + } + ], + [ + "git_blame_options", + { + "decl": [ + "unsigned int version", + "unsigned int flags", + "uint16_t min_match_characters", + "git_oid newest_commit", + "git_oid oldest_commit", + "size_t min_line", + "size_t max_line" + ], + "type": "struct", + "value": "git_blame_options", + "file": "git2/blame.h", + "line": 91, + "lineto": 128, + "block": "unsigned int version\nunsigned int flags\nuint16_t min_match_characters\ngit_oid newest_commit\ngit_oid oldest_commit\nsize_t min_line\nsize_t max_line", + "tdef": "typedef", + "description": " Blame options structure", + "comments": "

Initialize with GIT_BLAME_OPTIONS_INIT. Alternatively, you can use git_blame_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "unsigned int", + "name": "flags", + "comments": " A combination of `git_blame_flag_t` " + }, + { + "type": "uint16_t", + "name": "min_match_characters", + "comments": " The lower bound on the number of alphanumeric characters that\n must be detected as moving/copying within a file for it to\n associate those lines with the parent commit. The default value\n is 20.\n\n This value only takes effect if any of the `GIT_BLAME_TRACK_COPIES_*`\n flags are specified." + }, + { + "type": "git_oid", + "name": "newest_commit", + "comments": " The id of the newest commit to consider. The default is HEAD. " + }, + { + "type": "git_oid", + "name": "oldest_commit", + "comments": " The id of the oldest commit to consider.\n The default is the first commit encountered with a NULL parent." + }, + { + "type": "size_t", + "name": "min_line", + "comments": " The first line in the file to blame.\n The default is 1 (line numbers start with 1)." + }, + { + "type": "size_t", + "name": "max_line", + "comments": " The last line in the file to blame.\n The default is the last line of the file." + } + ], + "used": { + "returns": [], + "needs": ["git_blame_init_options", "git_blame_options_init"] + } + } + ], + [ + "git_blob", + { + "decl": "git_blob", + "type": "struct", + "value": "git_blob", + "file": "git2/types.h", + "line": 138, + "lineto": 138, + "tdef": "typedef", + "description": " In-memory representation of a blob object. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_blob_dup", + "git_blob_filter", + "git_blob_filter_options_init", + "git_blob_filtered_content", + "git_blob_free", + "git_blob_id", + "git_blob_is_binary", + "git_blob_lookup", + "git_blob_lookup_prefix", + "git_blob_owner", + "git_blob_rawcontent", + "git_blob_rawsize", + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_filter_list_apply_to_blob", + "git_filter_list_load", + "git_filter_list_load_ext", + "git_filter_list_stream_blob", + "git_patch_from_blob_and_buffer", + "git_patch_from_blobs" + ] + } + } + ], + [ + "git_blob_filter_flag_t", + { + "decl": [ + "GIT_BLOB_FILTER_CHECK_FOR_BINARY", + "GIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES", + "GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD", + "GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT" + ], + "type": "enum", + "file": "git2/blob.h", + "line": 111, + "lineto": 132, + "block": "GIT_BLOB_FILTER_CHECK_FOR_BINARY\nGIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES\nGIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD\nGIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT", + "tdef": "typedef", + "description": " Flags to control the functionality of `git_blob_filter`.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_BLOB_FILTER_CHECK_FOR_BINARY", + "comments": "

When set, filters will not be applied to binary files.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES", + "comments": "

When set, filters will not load configuration from the\n system-wide gitattributes in /etc (or system equivalent).

\n", "value": 2 }, { "type": "int", - "name": "GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES", - "comments": "

Track lines that have been copied from another file that exists in the\n same commit (like git blame -CC). Implies SAME_FILE.\n NOT IMPLEMENTED.

\n", - "value": 4 + "name": "GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD", + "comments": "

When set, filters will be loaded from a .gitattributes file\n in the HEAD commit.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT", + "comments": "

When set, filters will be loaded from a .gitattributes file\n in the specified commit.

\n", + "value": 8 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_blob_filter_options", + { + "decl": [ + "int version", + "uint32_t flags", + "git_oid * commit_id", + "git_oid attr_commit_id" + ], + "type": "struct", + "value": "git_blob_filter_options", + "file": "git2/blob.h", + "line": 144, + "lineto": 176, + "block": "int version\nuint32_t flags\ngit_oid * commit_id\ngit_oid attr_commit_id", + "tdef": "typedef", + "description": " The options used when applying filter options to a file.", + "comments": "

Initialize with GIT_BLOB_FILTER_OPTIONS_INIT. Alternatively, you can use git_blob_filter_options_init.

\n\n

[version] GIT_BLOB_FILTER_OPTIONS_VERSION [init_macro] GIT_BLOB_FILTER_OPTIONS_INIT [init_function] git_blob_filter_options_init

\n", + "fields": [ + { + "type": "int", + "name": "version", + "comments": " Version number of the options structure. " + }, + { + "type": "uint32_t", + "name": "flags", + "comments": " Flags to control the filtering process, see `git_blob_filter_flag_t` above.\n\n \n\n[flags] git_blob_filter_flag_t" + }, + { + "type": "git_oid *", + "name": "commit_id", + "comments": " This value is unused and reserved for API compatibility.\n\n " + }, + { + "type": "git_oid", + "name": "attr_commit_id", + "comments": " The commit to load attributes from, when\n `GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT` is specified." + } + ], + "used": { + "returns": [], + "needs": ["git_blob_filter", "git_blob_filter_options_init"] + } + } + ], + [ + "git_branch_iterator", + { + "decl": "git_branch_iterator", + "type": "struct", + "value": "git_branch_iterator", + "file": "git2/branch.h", + "line": 97, + "lineto": 97, + "tdef": "typedef", + "description": " Iterator type for branches ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_branch_iterator_free", + "git_branch_iterator_new", + "git_branch_next" + ] + } + } + ], + [ + "git_branch_t", + { + "decl": ["GIT_BRANCH_LOCAL", "GIT_BRANCH_REMOTE", "GIT_BRANCH_ALL"], + "type": "enum", + "file": "git2/types.h", + "line": 231, + "lineto": 235, + "block": "GIT_BRANCH_LOCAL\nGIT_BRANCH_REMOTE\nGIT_BRANCH_ALL", + "tdef": "typedef", + "description": " Basic type of any Git branch. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_BRANCH_LOCAL", + "comments": "", + "value": 1 }, { "type": "int", - "name": "GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES", - "comments": "

Track lines that have been copied from another file that exists in any\n commit (like git blame -CCC). Implies SAME_COMMIT_COPIES.\n NOT IMPLEMENTED.

\n", - "value": 8 + "name": "GIT_BRANCH_REMOTE", + "comments": "", + "value": 2 }, { "type": "int", - "name": "GIT_BLAME_FIRST_PARENT", - "comments": "

Restrict the search of commits to those reachable following only the\n first parents.

\n", - "value": 16 + "name": "GIT_BRANCH_ALL", + "comments": "", + "value": 3 } ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_branch_iterator_new", + "git_branch_lookup", + "git_branch_next" + ] } } ], [ - "git_blame_hunk", + "git_buf", { - "decl": [ - "size_t lines_in_hunk", - "git_oid final_commit_id", - "size_t final_start_line_number", - "git_signature * final_signature", - "git_oid orig_commit_id", - "const char * orig_path", - "size_t orig_start_line_number", - "git_signature * orig_signature", - "char boundary" - ], + "decl": ["char * ptr", "size_t reserved", "size_t size"], "type": "struct", - "value": "git_blame_hunk", - "file": "blame.h", - "line": 115, - "lineto": 128, - "block": "size_t lines_in_hunk\ngit_oid final_commit_id\nsize_t final_start_line_number\ngit_signature * final_signature\ngit_oid orig_commit_id\nconst char * orig_path\nsize_t orig_start_line_number\ngit_signature * orig_signature\nchar boundary", + "value": "git_buf", + "file": "git2/buffer.h", + "line": 36, + "lineto": 55, + "block": "char * ptr\nsize_t reserved\nsize_t size", "tdef": "typedef", - "description": " Structure that represents a blame hunk.", - "comments": "\n", + "description": " A data buffer for exporting data from libgit2", + "comments": "

Sometimes libgit2 wants to return an allocated data buffer to the caller and have the caller take responsibility for freeing that memory. To make ownership clear in these cases, libgit2 uses git_buf to return this data. Callers should use git_buf_dispose() to release the memory when they are done.

\n\n

A git_buf contains a pointer to a NUL-terminated C string, and the length of the string (not including the NUL terminator).

\n", "fields": [ { - "type": "size_t", - "name": "lines_in_hunk", - "comments": "" - }, - { - "type": "git_oid", - "name": "final_commit_id", - "comments": "" + "type": "char *", + "name": "ptr", + "comments": " The buffer contents. `ptr` points to the start of the buffer\n being returned. The buffer's length (in bytes) is specified\n by the `size` member of the structure, and contains a NUL\n terminator at position `(size + 1)`." }, { "type": "size_t", - "name": "final_start_line_number", - "comments": "" - }, - { - "type": "git_signature *", - "name": "final_signature", - "comments": "" - }, - { - "type": "git_oid", - "name": "orig_commit_id", - "comments": "" - }, - { - "type": "const char *", - "name": "orig_path", - "comments": "" + "name": "reserved", + "comments": " This field is reserved and unused." }, { "type": "size_t", - "name": "orig_start_line_number", - "comments": "" - }, - { - "type": "git_signature *", - "name": "orig_signature", - "comments": "" - }, + "name": "size", + "comments": " The length (in bytes) of the buffer pointed to by `ptr`,\n not including a NUL terminator." + } + ], + "used": { + "returns": [], + "needs": [ + "git_blob_filter", + "git_blob_filtered_content", + "git_branch_remote_name", + "git_branch_upstream_merge", + "git_branch_upstream_name", + "git_branch_upstream_remote", + "git_buf_contains_nul", + "git_buf_dispose", + "git_buf_free", + "git_buf_grow", + "git_buf_is_binary", + "git_buf_set", + "git_commit_create_buffer", + "git_commit_extract_signature", + "git_commit_header_field", + "git_commit_signing_cb", + "git_config_find_global", + "git_config_find_programdata", + "git_config_find_system", + "git_config_find_xdg", + "git_config_get_path", + "git_config_get_string_buf", + "git_config_parse_path", + "git_describe_format", + "git_diff_commit_as_email", + "git_diff_format_email", + "git_diff_stats_to_buf", + "git_diff_to_buf", + "git_email_create_from_commit", + "git_filter_list_apply_to_blob", + "git_filter_list_apply_to_buffer", + "git_filter_list_apply_to_data", + "git_filter_list_apply_to_file", + "git_filter_list_stream_data", + "git_message_prettify", + "git_object_short_id", + "git_packbuilder_write_buf", + "git_patch_to_buf", + "git_refspec_rtransform", + "git_refspec_transform", + "git_remote_default_branch", + "git_repository_discover", + "git_repository_item_path", + "git_repository_message", + "git_submodule_resolve_url", + "git_treebuilder_write_with_buffer", + "git_url_resolve_cb", + "git_worktree_is_locked" + ] + } + } + ], + [ + "git_cert", + { + "decl": "git_cert", + "type": "struct", + "value": "git_cert", + "file": "git2/types.h", + "line": 278, + "lineto": 278, + "block": "git_cert_t cert_type", + "tdef": "typedef", + "description": " Parent type for `git_cert_hostkey` and `git_cert_x509`.", + "comments": "", + "fields": [ { - "type": "char", - "name": "boundary", - "comments": "" + "type": "git_cert_t", + "name": "cert_type", + "comments": " Type of certificate. A `GIT_CERT_` value." } ], "used": { - "returns": [ - "git_blame_get_hunk_byindex", - "git_blame_get_hunk_byline" - ], - "needs": [] + "returns": [], + "needs": ["git_transport_certificate_check_cb"] } } ], [ - "git_blame_options", + "git_cert_hostkey", { "decl": [ - "unsigned int version", - "uint32_t flags", - "uint16_t min_match_characters", - "git_oid newest_commit", - "git_oid oldest_commit", - "size_t min_line", - "size_t max_line" + "git_cert parent", + "git_cert_ssh_t type", + "unsigned char [16] hash_md5", + "unsigned char [20] hash_sha1", + "unsigned char [32] hash_sha256", + "git_cert_ssh_raw_type_t raw_type", + "const char * hostkey", + "size_t hostkey_len" ], "type": "struct", - "value": "git_blame_options", - "file": "blame.h", - "line": 70, - "lineto": 79, - "block": "unsigned int version\nuint32_t flags\nuint16_t min_match_characters\ngit_oid newest_commit\ngit_oid oldest_commit\nsize_t min_line\nsize_t max_line", + "value": "git_cert_hostkey", + "file": "git2/cert.h", + "line": 108, + "lineto": 151, + "block": "git_cert parent\ngit_cert_ssh_t type\nunsigned char [16] hash_md5\nunsigned char [20] hash_sha1\nunsigned char [32] hash_sha256\ngit_cert_ssh_raw_type_t raw_type\nconst char * hostkey\nsize_t hostkey_len", "tdef": "typedef", - "description": " Blame options structure", - "comments": "

Use zeros to indicate default settings. It's easiest to use the GIT_BLAME_OPTIONS_INIT macro: git_blame_options opts = GIT_BLAME_OPTIONS_INIT;

\n\n\n", + "description": " Hostkey information taken from libssh2", + "comments": "", "fields": [ { - "type": "unsigned int", - "name": "version", - "comments": "" + "type": "git_cert", + "name": "parent", + "comments": " The parent cert " }, { - "type": "uint32_t", - "name": "flags", - "comments": "" + "type": "git_cert_ssh_t", + "name": "type", + "comments": " A bitmask containing the available fields." }, { - "type": "uint16_t", - "name": "min_match_characters", - "comments": "" + "type": "unsigned char [16]", + "name": "hash_md5", + "comments": " Hostkey hash. If `type` has `GIT_CERT_SSH_MD5` set, this will\n have the MD5 hash of the hostkey." }, { - "type": "git_oid", - "name": "newest_commit", - "comments": "" + "type": "unsigned char [20]", + "name": "hash_sha1", + "comments": " Hostkey hash. If `type` has `GIT_CERT_SSH_SHA1` set, this will\n have the SHA-1 hash of the hostkey." }, { - "type": "git_oid", - "name": "oldest_commit", - "comments": "" + "type": "unsigned char [32]", + "name": "hash_sha256", + "comments": " Hostkey hash. If `type` has `GIT_CERT_SSH_SHA256` set, this will\n have the SHA-256 hash of the hostkey." }, { - "type": "size_t", - "name": "min_line", - "comments": "" + "type": "git_cert_ssh_raw_type_t", + "name": "raw_type", + "comments": " Raw hostkey type. If `type` has `GIT_CERT_SSH_RAW` set, this will\n have the type of the raw hostkey." + }, + { + "type": "const char *", + "name": "hostkey", + "comments": " Pointer to the raw hostkey. If `type` has `GIT_CERT_SSH_RAW` set,\n this will have the raw contents of the hostkey." }, { "type": "size_t", - "name": "max_line", - "comments": "" + "name": "hostkey_len", + "comments": " Raw hostkey length. If `type` has `GIT_CERT_SSH_RAW` set, this will\n have the length of the raw contents of the hostkey." } ], - "used": { - "returns": [], - "needs": [ - "git_blame_file", - "git_blame_init_options" - ] - } - } - ], - [ - "git_blob", - { - "decl": "git_blob", - "type": "struct", - "value": "git_blob", - "file": "types.h", - "line": 117, - "lineto": 117, - "tdef": "typedef", - "description": " In-memory representation of a blob object. ", - "comments": "", - "used": { - "returns": [], - "needs": [ - "git_blob_dup", - "git_blob_filtered_content", - "git_blob_free", - "git_blob_id", - "git_blob_is_binary", - "git_blob_lookup", - "git_blob_lookup_prefix", - "git_blob_owner", - "git_blob_rawcontent", - "git_blob_rawsize", - "git_diff_blob_to_buffer", - "git_diff_blobs", - "git_filter_list_apply_to_blob", - "git_filter_list_load", - "git_filter_list_stream_blob", - "git_patch_from_blob_and_buffer", - "git_patch_from_blobs" - ] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_branch_iterator", + "git_cert_ssh_t", { - "decl": "git_branch_iterator", - "type": "struct", - "value": "git_branch_iterator", - "file": "branch.h", - "line": 88, - "lineto": 88, + "decl": [ + "GIT_CERT_SSH_MD5", + "GIT_CERT_SSH_SHA1", + "GIT_CERT_SSH_SHA256", + "GIT_CERT_SSH_RAW" + ], + "type": "enum", + "file": "git2/cert.h", + "line": 77, + "lineto": 86, + "block": "GIT_CERT_SSH_MD5\nGIT_CERT_SSH_SHA1\nGIT_CERT_SSH_SHA256\nGIT_CERT_SSH_RAW", "tdef": "typedef", - "description": " Iterator type for branches ", + "description": " Type of SSH host fingerprint", "comments": "", - "used": { - "returns": [], - "needs": [ - "git_branch_iterator_free", - "git_branch_iterator_new", - "git_branch_next" - ] - } + "fields": [ + { + "type": "int", + "name": "GIT_CERT_SSH_MD5", + "comments": "

MD5 is available

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CERT_SSH_SHA1", + "comments": "

SHA-1 is available

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CERT_SSH_SHA256", + "comments": "

SHA-256 is available

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_CERT_SSH_RAW", + "comments": "

Raw hostkey is available

\n", + "value": 8 + } + ], + "used": { "returns": [], "needs": [] } } ], [ - "git_branch_t", + "git_cert_t", { "decl": [ - "GIT_BRANCH_LOCAL", - "GIT_BRANCH_REMOTE", - "GIT_BRANCH_ALL" + "GIT_CERT_NONE", + "GIT_CERT_X509", + "GIT_CERT_HOSTKEY_LIBSSH2", + "GIT_CERT_STRARRAY" ], "type": "enum", - "file": "types.h", - "line": 198, - "lineto": 202, - "block": "GIT_BRANCH_LOCAL\nGIT_BRANCH_REMOTE\nGIT_BRANCH_ALL", + "file": "git2/cert.h", + "line": 25, + "lineto": 48, + "block": "GIT_CERT_NONE\nGIT_CERT_X509\nGIT_CERT_HOSTKEY_LIBSSH2\nGIT_CERT_STRARRAY\nGIT_CERT_NONE\nGIT_CERT_X509\nGIT_CERT_HOSTKEY_LIBSSH2\nGIT_CERT_STRARRAY", "tdef": "typedef", - "description": " Basic type of any Git branch. ", + "description": " Type of host certificate structure that is passed to the check callback", "comments": "", "fields": [ { "type": "int", - "name": "GIT_BRANCH_LOCAL", - "comments": "", + "name": "GIT_CERT_NONE", + "comments": "

No information about the certificate is available. This may\n happen when using curl.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_CERT_X509", + "comments": "

The data argument to the callback will be a pointer to\n the DER-encoded data.

\n", "value": 1 }, { "type": "int", - "name": "GIT_BRANCH_REMOTE", - "comments": "", + "name": "GIT_CERT_HOSTKEY_LIBSSH2", + "comments": "

The data argument to the callback will be a pointer to a\n git_cert_hostkey structure.

\n", "value": 2 }, { "type": "int", - "name": "GIT_BRANCH_ALL", - "comments": "", + "name": "GIT_CERT_STRARRAY", + "comments": "

The data argument to the callback will be a pointer to a\n git_strarray with name:content strings containing\n information about the certificate. This is used when using\n curl.

\n", "value": 3 } ], - "used": { - "returns": [], - "needs": [ - "git_branch_iterator_new", - "git_branch_lookup", - "git_branch_next" - ] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_buf", + "git_cert_x509", { - "decl": [ - "char * ptr", - "size_t asize", - "size_t size" - ], + "decl": ["git_cert parent", "void * data", "size_t len"], "type": "struct", - "value": "git_buf", - "file": "buffer.h", - "line": 52, - "lineto": 55, - "block": "char * ptr\nsize_t asize\nsize_t size", + "value": "git_cert_x509", + "file": "git2/cert.h", + "line": 156, + "lineto": 168, + "block": "git_cert parent\nvoid * data\nsize_t len", "tdef": "typedef", - "description": " A data buffer for exporting data from libgit2", - "comments": "

Sometimes libgit2 wants to return an allocated data buffer to the caller and have the caller take responsibility for freeing that memory. This can be awkward if the caller does not have easy access to the same allocation functions that libgit2 is using. In those cases, libgit2 will fill in a git_buf and the caller can use git_buf_free() to release it when they are done.

\n\n

A git_buf may also be used for the caller to pass in a reference to a block of memory they hold. In this case, libgit2 will not resize or free the memory, but will read from it as needed.

\n\n

A git_buf is a public structure with three fields:

\n\n\n\n

Some APIs may occasionally do something slightly unusual with a buffer, such as setting ptr to a value that was passed in by the user. In those cases, the behavior will be clearly documented by the API.

\n", + "description": " X.509 certificate information", + "comments": "", "fields": [ { - "type": "char *", - "name": "ptr", - "comments": "" + "type": "git_cert", + "name": "parent", + "comments": " The parent cert " }, { - "type": "size_t", - "name": "asize", - "comments": "" + "type": "void *", + "name": "data", + "comments": " Pointer to the X.509 certificate data" }, { "type": "size_t", - "name": "size", - "comments": "" + "name": "len", + "comments": " Length of the memory block pointed to by `data`." } ], - "used": { - "returns": [], - "needs": [ - "git_blob_filtered_content", - "git_buf_contains_nul", - "git_buf_free", - "git_buf_grow", - "git_buf_is_binary", - "git_buf_set", - "git_commit_create_buffer", - "git_commit_extract_signature", - "git_commit_header_field", - "git_config_find_global", - "git_config_find_programdata", - "git_config_find_system", - "git_config_find_xdg", - "git_config_get_path", - "git_config_get_string_buf", - "git_config_parse_path", - "git_describe_format", - "git_diff_commit_as_email", - "git_diff_format_email", - "git_diff_stats_to_buf", - "git_diff_to_buf", - "git_filter_apply_fn", - "git_filter_list_apply_to_blob", - "git_filter_list_apply_to_data", - "git_filter_list_apply_to_file", - "git_filter_list_stream_data", - "git_message_prettify", - "git_object_short_id", - "git_patch_to_buf", - "git_refspec_rtransform", - "git_refspec_transform", - "git_remote_default_branch", - "git_repository_discover", - "git_repository_message", - "git_submodule_resolve_url", - "git_treebuilder_write_with_buffer" - ] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_cert", + "git_checkout_notify_t", + { + "decl": [ + "GIT_CHECKOUT_NOTIFY_NONE", + "GIT_CHECKOUT_NOTIFY_CONFLICT", + "GIT_CHECKOUT_NOTIFY_DIRTY", + "GIT_CHECKOUT_NOTIFY_UPDATED", + "GIT_CHECKOUT_NOTIFY_UNTRACKED", + "GIT_CHECKOUT_NOTIFY_IGNORED", + "GIT_CHECKOUT_NOTIFY_ALL" + ], + "type": "enum", + "file": "git2/checkout.h", + "line": 224, + "lineto": 255, + "block": "GIT_CHECKOUT_NOTIFY_NONE\nGIT_CHECKOUT_NOTIFY_CONFLICT\nGIT_CHECKOUT_NOTIFY_DIRTY\nGIT_CHECKOUT_NOTIFY_UPDATED\nGIT_CHECKOUT_NOTIFY_UNTRACKED\nGIT_CHECKOUT_NOTIFY_IGNORED\nGIT_CHECKOUT_NOTIFY_ALL", + "tdef": "typedef", + "description": " Checkout notification flags", + "comments": "

Checkout will invoke an options notification callback (notify_cb) for certain cases - you pick which ones via notify_flags:

\n\n

Returning a non-zero value from this callback will cancel the checkout. The non-zero return value will be propagated back and returned by the git_checkout_... call.

\n\n

Notification callbacks are made prior to modifying any files on disk, so canceling on any notification will still happen prior to any files being modified.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_NONE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_CONFLICT", + "comments": "

Invokes checkout on conflicting paths.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_DIRTY", + "comments": "

Notifies about "dirty" files, i.e. those that do not need an update\n but no longer match the baseline. Core git displays these files when\n checkout runs, but won't stop the checkout.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_UPDATED", + "comments": "

Sends notification for any file changed.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_UNTRACKED", + "comments": "

Notifies about untracked files.

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_IGNORED", + "comments": "

Notifies about ignored files.

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_ALL", + "comments": "

Notifies about ignored files.

\n", + "value": 65535 + } + ], + "used": { "returns": [], "needs": ["git_checkout_notify_cb"] } + } + ], + [ + "git_checkout_options", { "decl": [ - "git_cert_t cert_type" + "unsigned int version", + "unsigned int checkout_strategy", + "int disable_filters", + "unsigned int dir_mode", + "unsigned int file_mode", + "int file_open_flags", + "unsigned int notify_flags", + "git_checkout_notify_cb notify_cb", + "void * notify_payload", + "git_checkout_progress_cb progress_cb", + "void * progress_payload", + "git_strarray paths", + "git_tree * baseline", + "git_index * baseline_index", + "const char * target_directory", + "const char * ancestor_label", + "const char * our_label", + "const char * their_label", + "git_checkout_perfdata_cb perfdata_cb", + "void * perfdata_payload" ], "type": "struct", - "value": "git_cert", - "file": "types.h", - "line": 314, - "lineto": 319, - "block": "git_cert_t cert_type", + "value": "git_checkout_options", + "file": "git2/checkout.h", + "line": 317, + "lineto": 391, + "block": "unsigned int version\nunsigned int checkout_strategy\nint disable_filters\nunsigned int dir_mode\nunsigned int file_mode\nint file_open_flags\nunsigned int notify_flags\ngit_checkout_notify_cb notify_cb\nvoid * notify_payload\ngit_checkout_progress_cb progress_cb\nvoid * progress_payload\ngit_strarray paths\ngit_tree * baseline\ngit_index * baseline_index\nconst char * target_directory\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_checkout_perfdata_cb perfdata_cb\nvoid * perfdata_payload", "tdef": "typedef", - "description": " Parent type for `git_cert_hostkey` and `git_cert_x509`.", - "comments": "", + "description": " Checkout options structure", + "comments": "

Initialize with GIT_CHECKOUT_OPTIONS_INIT. Alternatively, you can use git_checkout_options_init.

\n\n

[version] GIT_CHECKOUT_OPTIONS_VERSION [init_macro] GIT_CHECKOUT_OPTIONS_INIT [init_function] git_checkout_options_init

\n", "fields": [ { - "type": "git_cert_t", - "name": "cert_type", - "comments": " Type of certificate. A `GIT_CERT_` value." + "type": "unsigned int", + "name": "version", + "comments": " The version " + }, + { + "type": "unsigned int", + "name": "checkout_strategy", + "comments": " default will be a safe checkout " + }, + { + "type": "int", + "name": "disable_filters", + "comments": " don't apply filters like CRLF conversion " + }, + { + "type": "unsigned int", + "name": "dir_mode", + "comments": " default is 0755 " + }, + { + "type": "unsigned int", + "name": "file_mode", + "comments": " default is 0644 or 0755 as dictated by blob " + }, + { + "type": "int", + "name": "file_open_flags", + "comments": " default is O_CREAT | O_TRUNC | O_WRONLY " + }, + { + "type": "unsigned int", + "name": "notify_flags", + "comments": " Checkout notification flags specify what operations the notify\n callback is invoked for.\n\n \n\n[flags] git_checkout_notify_t" + }, + { + "type": "git_checkout_notify_cb", + "name": "notify_cb", + "comments": " Optional callback to get notifications on specific file states.\n " + }, + { + "type": "void *", + "name": "notify_payload", + "comments": " Payload passed to notify_cb " + }, + { + "type": "git_checkout_progress_cb", + "name": "progress_cb", + "comments": " Optional callback to notify the consumer of checkout progress. " + }, + { + "type": "void *", + "name": "progress_payload", + "comments": " Payload passed to progress_cb " + }, + { + "type": "git_strarray", + "name": "paths", + "comments": " A list of wildmatch patterns or paths.\n\n By default, all paths are processed. If you pass an array of wildmatch\n patterns, those will be used to filter which paths should be taken into\n account.\n\n Use GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH to treat as a simple list." + }, + { + "type": "git_tree *", + "name": "baseline", + "comments": " The expected content of the working directory; defaults to HEAD.\n\n If the working directory does not match this baseline information,\n that will produce a checkout conflict." + }, + { + "type": "git_index *", + "name": "baseline_index", + "comments": " Like `baseline` above, though expressed as an index. This\n option overrides `baseline`." + }, + { + "type": "const char *", + "name": "target_directory", + "comments": " alternative checkout path to workdir " + }, + { + "type": "const char *", + "name": "ancestor_label", + "comments": " the name of the common ancestor side of conflicts " + }, + { + "type": "const char *", + "name": "our_label", + "comments": " the name of the \"our\" side of conflicts " + }, + { + "type": "const char *", + "name": "their_label", + "comments": " the name of the \"their\" side of conflicts " + }, + { + "type": "git_checkout_perfdata_cb", + "name": "perfdata_cb", + "comments": " Optional callback to notify the consumer of performance data. " + }, + { + "type": "void *", + "name": "perfdata_payload", + "comments": " Payload passed to perfdata_cb " } ], "used": { "returns": [], "needs": [ - "git_transport_certificate_check_cb", - "git_transport_smart_certificate_check" + "git_checkout_head", + "git_checkout_index", + "git_checkout_options_init", + "git_checkout_tree", + "git_merge", + "git_reset", + "git_reset_from_annotated" ] } } ], [ - "git_cert_hostkey", + "git_checkout_perfdata", { "decl": [ - "git_cert parent", - "git_cert_ssh_t type", - "unsigned char [16] hash_md5", - "unsigned char [20] hash_sha1" + "size_t mkdir_calls", + "size_t stat_calls", + "size_t chmod_calls" ], "type": "struct", - "value": "git_cert_hostkey", - "file": "transport.h", - "line": 39, - "lineto": 59, - "block": "git_cert parent\ngit_cert_ssh_t type\nunsigned char [16] hash_md5\nunsigned char [20] hash_sha1", + "value": "git_checkout_perfdata", + "file": "git2/checkout.h", + "line": 258, + "lineto": 262, + "block": "size_t mkdir_calls\nsize_t stat_calls\nsize_t chmod_calls", "tdef": "typedef", - "description": " Hostkey information taken from libssh2", + "description": " Checkout performance-reporting structure ", "comments": "", "fields": [ - { - "type": "git_cert", - "name": "parent", - "comments": "" - }, - { - "type": "git_cert_ssh_t", - "name": "type", - "comments": " A hostkey type from libssh2, either\n `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1`" - }, - { - "type": "unsigned char [16]", - "name": "hash_md5", - "comments": " Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will\n have the MD5 hash of the hostkey." - }, - { - "type": "unsigned char [20]", - "name": "hash_sha1", - "comments": " Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will\n have the SHA-1 hash of the hostkey." - } + { "type": "size_t", "name": "mkdir_calls", "comments": "" }, + { "type": "size_t", "name": "stat_calls", "comments": "" }, + { "type": "size_t", "name": "chmod_calls", "comments": "" } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": ["git_checkout_perfdata_cb"] } } ], [ - "git_cert_ssh_t", + "git_checkout_strategy_t", { "decl": [ - "GIT_CERT_SSH_MD5", - "GIT_CERT_SSH_SHA1" + "GIT_CHECKOUT_SAFE", + "GIT_CHECKOUT_FORCE", + "GIT_CHECKOUT_RECREATE_MISSING", + "GIT_CHECKOUT_ALLOW_CONFLICTS", + "GIT_CHECKOUT_REMOVE_UNTRACKED", + "GIT_CHECKOUT_REMOVE_IGNORED", + "GIT_CHECKOUT_UPDATE_ONLY", + "GIT_CHECKOUT_DONT_UPDATE_INDEX", + "GIT_CHECKOUT_NO_REFRESH", + "GIT_CHECKOUT_SKIP_UNMERGED", + "GIT_CHECKOUT_USE_OURS", + "GIT_CHECKOUT_USE_THEIRS", + "GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH", + "GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES", + "GIT_CHECKOUT_DONT_OVERWRITE_IGNORED", + "GIT_CHECKOUT_CONFLICT_STYLE_MERGE", + "GIT_CHECKOUT_CONFLICT_STYLE_DIFF3", + "GIT_CHECKOUT_DONT_REMOVE_EXISTING", + "GIT_CHECKOUT_DONT_WRITE_INDEX", + "GIT_CHECKOUT_DRY_RUN", + "GIT_CHECKOUT_CONFLICT_STYLE_ZDIFF3", + "GIT_CHECKOUT_NONE", + "GIT_CHECKOUT_UPDATE_SUBMODULES", + "GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED" ], "type": "enum", - "file": "transport.h", - "line": 29, - "lineto": 34, - "block": "GIT_CERT_SSH_MD5\nGIT_CERT_SSH_SHA1", + "file": "git2/checkout.h", + "line": 113, + "lineto": 206, + "block": "GIT_CHECKOUT_SAFE\nGIT_CHECKOUT_FORCE\nGIT_CHECKOUT_RECREATE_MISSING\nGIT_CHECKOUT_ALLOW_CONFLICTS\nGIT_CHECKOUT_REMOVE_UNTRACKED\nGIT_CHECKOUT_REMOVE_IGNORED\nGIT_CHECKOUT_UPDATE_ONLY\nGIT_CHECKOUT_DONT_UPDATE_INDEX\nGIT_CHECKOUT_NO_REFRESH\nGIT_CHECKOUT_SKIP_UNMERGED\nGIT_CHECKOUT_USE_OURS\nGIT_CHECKOUT_USE_THEIRS\nGIT_CHECKOUT_DISABLE_PATHSPEC_MATCH\nGIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES\nGIT_CHECKOUT_DONT_OVERWRITE_IGNORED\nGIT_CHECKOUT_CONFLICT_STYLE_MERGE\nGIT_CHECKOUT_CONFLICT_STYLE_DIFF3\nGIT_CHECKOUT_DONT_REMOVE_EXISTING\nGIT_CHECKOUT_DONT_WRITE_INDEX\nGIT_CHECKOUT_DRY_RUN\nGIT_CHECKOUT_CONFLICT_STYLE_ZDIFF3\nGIT_CHECKOUT_NONE\nGIT_CHECKOUT_UPDATE_SUBMODULES\nGIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED", "tdef": "typedef", - "description": " Type of SSH host fingerprint", - "comments": "", + "description": " Checkout behavior flags", + "comments": "

In libgit2, checkout is used to update the working directory and index to match a target tree. Unlike git checkout, it does not move the HEAD commit for you - use git_repository_set_head or the like to do that.

\n\n

Checkout looks at (up to) four things: the "target" tree you want to check out, the "baseline" tree of what was checked out previously, the working directory for actual files, and the index for staged changes.

\n\n

You give checkout one of two strategies for update:

\n\n\n\n

To emulate git checkout, use GIT_CHECKOUT_SAFE with a checkout notification callback (see below) that displays information about dirty files. The default behavior will cancel checkout on conflicts.

\n\n

To emulate git checkout-index, use GIT_CHECKOUT_SAFE with a notification callback that cancels the operation if a dirty-but-existing file is found in the working directory. This core git command isn't quite "force" but is sensitive about some types of changes.

\n\n

To emulate git checkout -f, use GIT_CHECKOUT_FORCE.

\n\n

There are some additional flags to modify the behavior of checkout:

\n\n\n", "fields": [ { "type": "int", - "name": "GIT_CERT_SSH_MD5", - "comments": "

MD5 is available

\n", - "value": 1 + "name": "GIT_CHECKOUT_SAFE", + "comments": "

Allow safe updates that cannot overwrite uncommitted data.\n If the uncommitted changes don't conflict with the checked\n out files, the checkout will still proceed, leaving the\n changes intact.

\n", + "value": 0 }, { "type": "int", - "name": "GIT_CERT_SSH_SHA1", - "comments": "

SHA-1 is available

\n", + "name": "GIT_CHECKOUT_FORCE", + "comments": "

Allow all updates to force working directory to look like\n the index, potentially losing data in the process.

\n", "value": 2 - } - ], - "used": { - "returns": [], - "needs": [] - } - } - ], - [ - "git_cert_t", - { - "decl": [ - "GIT_CERT_NONE", - "GIT_CERT_X509", - "GIT_CERT_HOSTKEY_LIBSSH2", - "GIT_CERT_STRARRAY" - ], - "type": "enum", - "file": "types.h", - "line": 286, - "lineto": 309, - "block": "GIT_CERT_NONE\nGIT_CERT_X509\nGIT_CERT_HOSTKEY_LIBSSH2\nGIT_CERT_STRARRAY\nGIT_CERT_NONE\nGIT_CERT_X509\nGIT_CERT_HOSTKEY_LIBSSH2\nGIT_CERT_STRARRAY", - "tdef": "typedef", - "description": " Type of host certificate structure that is passed to the check callback", - "comments": "", - "fields": [ + }, { "type": "int", - "name": "GIT_CERT_NONE", - "comments": "

No information about the certificate is available. This may\n happen when using curl.

\n", - "value": 0 + "name": "GIT_CHECKOUT_RECREATE_MISSING", + "comments": "

Allow checkout to recreate missing files

\n", + "value": 4 }, { "type": "int", - "name": "GIT_CERT_X509", - "comments": "

The data argument to the callback will be a pointer to\n the DER-encoded data.

\n", - "value": 1 + "name": "GIT_CHECKOUT_ALLOW_CONFLICTS", + "comments": "

Allow checkout to make safe updates even if conflicts are found

\n", + "value": 16 }, { "type": "int", - "name": "GIT_CERT_HOSTKEY_LIBSSH2", - "comments": "

The data argument to the callback will be a pointer to a\n git_cert_hostkey structure.

\n", - "value": 2 + "name": "GIT_CHECKOUT_REMOVE_UNTRACKED", + "comments": "

Remove untracked files not in index (that are not ignored)

\n", + "value": 32 }, { "type": "int", - "name": "GIT_CERT_STRARRAY", - "comments": "

The data argument to the callback will be a pointer to a\n git_strarray with name:content strings containing\n information about the certificate. This is used when using\n curl.

\n", - "value": 3 - } - ], - "used": { - "returns": [], - "needs": [] - } - } - ], - [ - "git_cert_x509", - { - "decl": [ - "git_cert parent", - "void * data", - "size_t len" - ], - "type": "struct", - "value": "git_cert_x509", - "file": "transport.h", - "line": 64, - "lineto": 74, - "block": "git_cert parent\nvoid * data\nsize_t len", - "tdef": "typedef", - "description": " X.509 certificate information", - "comments": "", - "fields": [ + "name": "GIT_CHECKOUT_REMOVE_IGNORED", + "comments": "

Remove ignored files not in index

\n", + "value": 64 + }, { - "type": "git_cert", - "name": "parent", - "comments": "" + "type": "int", + "name": "GIT_CHECKOUT_UPDATE_ONLY", + "comments": "

Only update existing files, don't create new ones

\n", + "value": 128 }, { - "type": "void *", - "name": "data", - "comments": " Pointer to the X.509 certificate data" + "type": "int", + "name": "GIT_CHECKOUT_DONT_UPDATE_INDEX", + "comments": "

Normally checkout updates index entries as it goes; this stops that.\n Implies GIT_CHECKOUT_DONT_WRITE_INDEX.

\n", + "value": 256 }, { - "type": "size_t", - "name": "len", - "comments": " Length of the memory block pointed to by `data`." - } - ], - "used": { - "returns": [], - "needs": [] - } - } - ], - [ - "git_checkout_notify_t", - { - "decl": [ - "GIT_CHECKOUT_NOTIFY_NONE", - "GIT_CHECKOUT_NOTIFY_CONFLICT", - "GIT_CHECKOUT_NOTIFY_DIRTY", - "GIT_CHECKOUT_NOTIFY_UPDATED", - "GIT_CHECKOUT_NOTIFY_UNTRACKED", - "GIT_CHECKOUT_NOTIFY_IGNORED", - "GIT_CHECKOUT_NOTIFY_ALL" - ], - "type": "enum", - "file": "checkout.h", - "line": 205, - "lineto": 214, - "block": "GIT_CHECKOUT_NOTIFY_NONE\nGIT_CHECKOUT_NOTIFY_CONFLICT\nGIT_CHECKOUT_NOTIFY_DIRTY\nGIT_CHECKOUT_NOTIFY_UPDATED\nGIT_CHECKOUT_NOTIFY_UNTRACKED\nGIT_CHECKOUT_NOTIFY_IGNORED\nGIT_CHECKOUT_NOTIFY_ALL", - "tdef": "typedef", - "description": " Checkout notification flags", - "comments": "

Checkout will invoke an options notification callback (notify_cb) for certain cases - you pick which ones via notify_flags:

\n\n\n\n

Returning a non-zero value from this callback will cancel the checkout. The non-zero return value will be propagated back and returned by the git_checkout_... call.

\n\n

Notification callbacks are made prior to modifying any files on disk, so canceling on any notification will still happen prior to any files being modified.

\n", - "fields": [ + "type": "int", + "name": "GIT_CHECKOUT_NO_REFRESH", + "comments": "

Don't refresh index/config/etc before doing checkout

\n", + "value": 512 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_SKIP_UNMERGED", + "comments": "

Allow checkout to skip unmerged files

\n", + "value": 1024 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_USE_OURS", + "comments": "

For unmerged files, checkout stage 2 from index

\n", + "value": 2048 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_USE_THEIRS", + "comments": "

For unmerged files, checkout stage 3 from index

\n", + "value": 4096 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH", + "comments": "

Treat pathspec as simple list of exact match file paths

\n", + "value": 8192 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES", + "comments": "

Ignore directories in use, they will be left empty

\n", + "value": 262144 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_DONT_OVERWRITE_IGNORED", + "comments": "

Don't overwrite ignored files that exist in the checkout target

\n", + "value": 524288 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_CONFLICT_STYLE_MERGE", + "comments": "

Write normal merge files for conflicts

\n", + "value": 1048576 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_CONFLICT_STYLE_DIFF3", + "comments": "

Include common ancestor data in diff3 format files for conflicts

\n", + "value": 2097152 + }, { "type": "int", - "name": "GIT_CHECKOUT_NOTIFY_NONE", - "comments": "", - "value": 0 + "name": "GIT_CHECKOUT_DONT_REMOVE_EXISTING", + "comments": "

Don't overwrite existing files or folders

\n", + "value": 4194304 }, { "type": "int", - "name": "GIT_CHECKOUT_NOTIFY_CONFLICT", - "comments": "", - "value": 1 + "name": "GIT_CHECKOUT_DONT_WRITE_INDEX", + "comments": "

Normally checkout writes the index upon completion; this prevents that.

\n", + "value": 8388608 }, { "type": "int", - "name": "GIT_CHECKOUT_NOTIFY_DIRTY", - "comments": "", - "value": 2 + "name": "GIT_CHECKOUT_DRY_RUN", + "comments": "

Perform a "dry run", reporting what would be done but\n without actually making changes in the working directory\n or the index.

\n", + "value": 16777216 }, { "type": "int", - "name": "GIT_CHECKOUT_NOTIFY_UPDATED", - "comments": "", - "value": 4 + "name": "GIT_CHECKOUT_CONFLICT_STYLE_ZDIFF3", + "comments": "

Include common ancestor data in zdiff3 format for conflicts

\n", + "value": 33554432 }, { "type": "int", - "name": "GIT_CHECKOUT_NOTIFY_UNTRACKED", - "comments": "", - "value": 8 + "name": "GIT_CHECKOUT_NONE", + "comments": "

Do not do a checkout and do not fire callbacks; this is primarily\n useful only for internal functions that will perform the\n checkout themselves but need to pass checkout options into\n another function, for example, git_clone.

\n", + "value": 1073741824 }, { "type": "int", - "name": "GIT_CHECKOUT_NOTIFY_IGNORED", - "comments": "", - "value": 16 + "name": "GIT_CHECKOUT_UPDATE_SUBMODULES", + "comments": "

Recursively checkout submodules with same options (NOT IMPLEMENTED)

\n", + "value": 65536 }, { "type": "int", - "name": "GIT_CHECKOUT_NOTIFY_ALL", - "comments": "", - "value": 65535 + "name": "GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED", + "comments": "

Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED)

\n", + "value": 131072 } ], - "used": { - "returns": [], - "needs": [ - "git_checkout_notify_cb" - ] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_checkout_options", + "git_cherrypick_options", { "decl": [ "unsigned int version", - "unsigned int checkout_strategy", - "int disable_filters", - "unsigned int dir_mode", - "unsigned int file_mode", - "int file_open_flags", - "unsigned int notify_flags", - "git_checkout_notify_cb notify_cb", - "void * notify_payload", - "git_checkout_progress_cb progress_cb", - "void * progress_payload", - "git_strarray paths", - "git_tree * baseline", - "git_index * baseline_index", - "const char * target_directory", - "const char * ancestor_label", - "const char * our_label", - "const char * their_label", - "git_checkout_perfdata_cb perfdata_cb", - "void * perfdata_payload" + "unsigned int mainline", + "git_merge_options merge_opts", + "git_checkout_options checkout_opts" ], "type": "struct", - "value": "git_checkout_options", - "file": "checkout.h", - "line": 251, - "lineto": 295, - "block": "unsigned int version\nunsigned int checkout_strategy\nint disable_filters\nunsigned int dir_mode\nunsigned int file_mode\nint file_open_flags\nunsigned int notify_flags\ngit_checkout_notify_cb notify_cb\nvoid * notify_payload\ngit_checkout_progress_cb progress_cb\nvoid * progress_payload\ngit_strarray paths\ngit_tree * baseline\ngit_index * baseline_index\nconst char * target_directory\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_checkout_perfdata_cb perfdata_cb\nvoid * perfdata_payload", + "value": "git_cherrypick_options", + "file": "git2/cherrypick.h", + "line": 29, + "lineto": 37, + "block": "unsigned int version\nunsigned int mainline\ngit_merge_options merge_opts\ngit_checkout_options checkout_opts", "tdef": "typedef", - "description": " Checkout options structure", - "comments": "

Zero out for defaults. Initialize with GIT_CHECKOUT_OPTIONS_INIT macro to correctly set the version field. E.g.

\n\n
    git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;\n
\n", + "description": " Cherry-pick options", + "comments": "", "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, { "type": "unsigned int", - "name": "version", - "comments": "" - }, - { - "type": "unsigned int", - "name": "checkout_strategy", - "comments": " default will be a dry run " - }, - { - "type": "int", - "name": "disable_filters", - "comments": " don't apply filters like CRLF conversion " + "name": "mainline", + "comments": " For merge commits, the \"mainline\" is treated as the parent. " }, { - "type": "unsigned int", - "name": "dir_mode", - "comments": " default is 0755 " + "type": "git_merge_options", + "name": "merge_opts", + "comments": " Options for the merging " }, { - "type": "unsigned int", - "name": "file_mode", - "comments": " default is 0644 or 0755 as dictated by blob " - }, + "type": "git_checkout_options", + "name": "checkout_opts", + "comments": " Options for the checkout " + } + ], + "used": { + "returns": [], + "needs": ["git_cherrypick", "git_cherrypick_options_init"] + } + } + ], + [ + "git_clone_local_t", + { + "decl": [ + "GIT_CLONE_LOCAL_AUTO", + "GIT_CLONE_LOCAL", + "GIT_CLONE_NO_LOCAL", + "GIT_CLONE_LOCAL_NO_LINKS" + ], + "type": "enum", + "file": "git2/clone.h", + "line": 37, + "lineto": 57, + "block": "GIT_CLONE_LOCAL_AUTO\nGIT_CLONE_LOCAL\nGIT_CLONE_NO_LOCAL\nGIT_CLONE_LOCAL_NO_LINKS", + "tdef": "typedef", + "description": " Options for bypassing the git-aware transport on clone. Bypassing\n it means that instead of a fetch, libgit2 will copy the object\n database directory instead of figuring out what it needs, which is\n faster. If possible, it will hardlink the files to save space.", + "comments": "", + "fields": [ { "type": "int", - "name": "file_open_flags", - "comments": " default is O_CREAT | O_TRUNC | O_WRONLY " - }, - { - "type": "unsigned int", - "name": "notify_flags", - "comments": " see `git_checkout_notify_t` above " - }, - { - "type": "git_checkout_notify_cb", - "name": "notify_cb", - "comments": "" - }, - { - "type": "void *", - "name": "notify_payload", - "comments": "" - }, - { - "type": "git_checkout_progress_cb", - "name": "progress_cb", - "comments": " Optional callback to notify the consumer of checkout progress. " - }, - { - "type": "void *", - "name": "progress_payload", - "comments": "" - }, - { - "type": "git_strarray", - "name": "paths", - "comments": " When not zeroed out, array of fnmatch patterns specifying which\n paths should be taken into account, otherwise all files. Use\n GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH to treat as simple list." - }, - { - "type": "git_tree *", - "name": "baseline", - "comments": " The expected content of the working directory; defaults to HEAD.\n If the working directory does not match this baseline information,\n that will produce a checkout conflict." - }, - { - "type": "git_index *", - "name": "baseline_index", - "comments": " expected content of workdir, expressed as an index. " - }, - { - "type": "const char *", - "name": "target_directory", - "comments": " alternative checkout path to workdir " - }, - { - "type": "const char *", - "name": "ancestor_label", - "comments": " the name of the common ancestor side of conflicts " - }, - { - "type": "const char *", - "name": "our_label", - "comments": " the name of the \"our\" side of conflicts " + "name": "GIT_CLONE_LOCAL_AUTO", + "comments": "

Auto-detect (default), libgit2 will bypass the git-aware\n transport for local paths, but use a normal fetch for\n file:// urls.

\n", + "value": 0 }, { - "type": "const char *", - "name": "their_label", - "comments": " the name of the \"their\" side of conflicts " + "type": "int", + "name": "GIT_CLONE_LOCAL", + "comments": "

Bypass the git-aware transport even for a file:// url.

\n", + "value": 1 }, { - "type": "git_checkout_perfdata_cb", - "name": "perfdata_cb", - "comments": " Optional callback to notify the consumer of performance data. " + "type": "int", + "name": "GIT_CLONE_NO_LOCAL", + "comments": "

Do no bypass the git-aware transport

\n", + "value": 2 }, { - "type": "void *", - "name": "perfdata_payload", - "comments": "" + "type": "int", + "name": "GIT_CLONE_LOCAL_NO_LINKS", + "comments": "

Bypass the git-aware transport, but do not try to use\n hardlinks.

\n", + "value": 3 } ], - "used": { - "returns": [], - "needs": [ - "git_checkout_head", - "git_checkout_index", - "git_checkout_init_options", - "git_checkout_tree", - "git_merge", - "git_reset", - "git_reset_from_annotated" - ] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_checkout_strategy_t", + "git_clone_options", { "decl": [ - "GIT_CHECKOUT_NONE", - "GIT_CHECKOUT_SAFE", - "GIT_CHECKOUT_FORCE", - "GIT_CHECKOUT_RECREATE_MISSING", - "GIT_CHECKOUT_ALLOW_CONFLICTS", - "GIT_CHECKOUT_REMOVE_UNTRACKED", - "GIT_CHECKOUT_REMOVE_IGNORED", - "GIT_CHECKOUT_UPDATE_ONLY", - "GIT_CHECKOUT_DONT_UPDATE_INDEX", - "GIT_CHECKOUT_NO_REFRESH", - "GIT_CHECKOUT_SKIP_UNMERGED", - "GIT_CHECKOUT_USE_OURS", - "GIT_CHECKOUT_USE_THEIRS", - "GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH", - "GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES", - "GIT_CHECKOUT_DONT_OVERWRITE_IGNORED", - "GIT_CHECKOUT_CONFLICT_STYLE_MERGE", - "GIT_CHECKOUT_CONFLICT_STYLE_DIFF3", - "GIT_CHECKOUT_DONT_REMOVE_EXISTING", - "GIT_CHECKOUT_DONT_WRITE_INDEX", - "GIT_CHECKOUT_UPDATE_SUBMODULES", - "GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED" + "unsigned int version", + "git_checkout_options checkout_opts", + "git_fetch_options fetch_opts", + "int bare", + "git_clone_local_t local", + "const char * checkout_branch", + "git_repository_create_cb repository_cb", + "void * repository_cb_payload", + "git_remote_create_cb remote_cb", + "void * remote_cb_payload" ], - "type": "enum", - "file": "checkout.h", - "line": 106, - "lineto": 177, - "block": "GIT_CHECKOUT_NONE\nGIT_CHECKOUT_SAFE\nGIT_CHECKOUT_FORCE\nGIT_CHECKOUT_RECREATE_MISSING\nGIT_CHECKOUT_ALLOW_CONFLICTS\nGIT_CHECKOUT_REMOVE_UNTRACKED\nGIT_CHECKOUT_REMOVE_IGNORED\nGIT_CHECKOUT_UPDATE_ONLY\nGIT_CHECKOUT_DONT_UPDATE_INDEX\nGIT_CHECKOUT_NO_REFRESH\nGIT_CHECKOUT_SKIP_UNMERGED\nGIT_CHECKOUT_USE_OURS\nGIT_CHECKOUT_USE_THEIRS\nGIT_CHECKOUT_DISABLE_PATHSPEC_MATCH\nGIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES\nGIT_CHECKOUT_DONT_OVERWRITE_IGNORED\nGIT_CHECKOUT_CONFLICT_STYLE_MERGE\nGIT_CHECKOUT_CONFLICT_STYLE_DIFF3\nGIT_CHECKOUT_DONT_REMOVE_EXISTING\nGIT_CHECKOUT_DONT_WRITE_INDEX\nGIT_CHECKOUT_UPDATE_SUBMODULES\nGIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED", + "type": "struct", + "value": "git_clone_options", + "file": "git2/clone.h", + "line": 110, + "lineto": 171, + "block": "unsigned int version\ngit_checkout_options checkout_opts\ngit_fetch_options fetch_opts\nint bare\ngit_clone_local_t local\nconst char * checkout_branch\ngit_repository_create_cb repository_cb\nvoid * repository_cb_payload\ngit_remote_create_cb remote_cb\nvoid * remote_cb_payload", "tdef": "typedef", - "description": " Checkout behavior flags", - "comments": "

In libgit2, checkout is used to update the working directory and index to match a target tree. Unlike git checkout, it does not move the HEAD commit for you - use git_repository_set_head or the like to do that.

\n\n

Checkout looks at (up to) four things: the "target" tree you want to check out, the "baseline" tree of what was checked out previously, the working directory for actual files, and the index for staged changes.

\n\n

You give checkout one of three strategies for update:

\n\n\n\n

To emulate git checkout, use GIT_CHECKOUT_SAFE with a checkout notification callback (see below) that displays information about dirty files. The default behavior will cancel checkout on conflicts.

\n\n

To emulate git checkout-index, use GIT_CHECKOUT_SAFE with a notification callback that cancels the operation if a dirty-but-existing file is found in the working directory. This core git command isn't quite "force" but is sensitive about some types of changes.

\n\n

To emulate git checkout -f, use GIT_CHECKOUT_FORCE.

\n\n

There are some additional flags to modified the behavior of checkout:

\n\n\n", + "description": " Clone options structure", + "comments": "

Initialize with GIT_CLONE_OPTIONS_INIT. Alternatively, you can use git_clone_options_init.

\n\n

[version] GIT_CLONE_OPTIONS_VERSION [init_macro] GIT_CLONE_OPTIONS_INIT [init_function] git_clone_options_init

\n", "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, { - "type": "int", - "name": "GIT_CHECKOUT_NONE", - "comments": "

default is a dry run, no actual updates

\n", - "value": 0 - }, - { - "type": "int", - "name": "GIT_CHECKOUT_SAFE", - "comments": "

Allow safe updates that cannot overwrite uncommitted data

\n", - "value": 1 - }, - { - "type": "int", - "name": "GIT_CHECKOUT_FORCE", - "comments": "

Allow all updates to force working directory to look like index

\n", - "value": 2 - }, - { - "type": "int", - "name": "GIT_CHECKOUT_RECREATE_MISSING", - "comments": "

Allow checkout to recreate missing files

\n", - "value": 4 - }, - { - "type": "int", - "name": "GIT_CHECKOUT_ALLOW_CONFLICTS", - "comments": "

Allow checkout to make safe updates even if conflicts are found

\n", - "value": 16 + "type": "git_checkout_options", + "name": "checkout_opts", + "comments": " These options are passed to the checkout step. To disable\n checkout, set the `checkout_strategy` to `GIT_CHECKOUT_NONE`\n or `GIT_CHECKOUT_DRY_RUN`." }, { - "type": "int", - "name": "GIT_CHECKOUT_REMOVE_UNTRACKED", - "comments": "

Remove untracked files not in index (that are not ignored)

\n", - "value": 32 + "type": "git_fetch_options", + "name": "fetch_opts", + "comments": " Options which control the fetch, including callbacks.\n\n The callbacks are used for reporting fetch progress, and for acquiring\n credentials in the event they are needed." }, { "type": "int", - "name": "GIT_CHECKOUT_REMOVE_IGNORED", - "comments": "

Remove ignored files not in index

\n", - "value": 64 + "name": "bare", + "comments": " Set to zero (false) to create a standard repo, or non-zero\n for a bare repo" }, { - "type": "int", - "name": "GIT_CHECKOUT_UPDATE_ONLY", - "comments": "

Only update existing files, don't create new ones

\n", - "value": 128 + "type": "git_clone_local_t", + "name": "local", + "comments": " Whether to use a fetch or copy the object database." }, { - "type": "int", - "name": "GIT_CHECKOUT_DONT_UPDATE_INDEX", - "comments": "

Normally checkout updates index entries as it goes; this stops that.\n Implies GIT_CHECKOUT_DONT_WRITE_INDEX.

\n", - "value": 256 + "type": "const char *", + "name": "checkout_branch", + "comments": " The name of the branch to checkout. NULL means use the\n remote's default branch." }, { - "type": "int", - "name": "GIT_CHECKOUT_NO_REFRESH", - "comments": "

Don't refresh index/config/etc before doing checkout

\n", - "value": 512 + "type": "git_repository_create_cb", + "name": "repository_cb", + "comments": " A callback used to create the new repository into which to\n clone. If NULL, the 'bare' field will be used to determine\n whether to create a bare repository." }, { - "type": "int", - "name": "GIT_CHECKOUT_SKIP_UNMERGED", - "comments": "

Allow checkout to skip unmerged files

\n", - "value": 1024 + "type": "void *", + "name": "repository_cb_payload", + "comments": " An opaque payload to pass to the git_repository creation callback.\n This parameter is ignored unless repository_cb is non-NULL." }, { - "type": "int", - "name": "GIT_CHECKOUT_USE_OURS", - "comments": "

For unmerged files, checkout stage 2 from index

\n", - "value": 2048 + "type": "git_remote_create_cb", + "name": "remote_cb", + "comments": " A callback used to create the git_remote, prior to its being\n used to perform the clone operation. See the documentation for\n git_remote_create_cb for details. This parameter may be NULL,\n indicating that git_clone should provide default behavior." }, { - "type": "int", - "name": "GIT_CHECKOUT_USE_THEIRS", - "comments": "

For unmerged files, checkout stage 3 from index

\n", - "value": 4096 - }, + "type": "void *", + "name": "remote_cb_payload", + "comments": " An opaque payload to pass to the git_remote creation callback.\n This parameter is ignored unless remote_cb is non-NULL." + } + ], + "used": { + "returns": [], + "needs": ["git_clone", "git_clone_options_init"] + } + } + ], + [ + "git_commit", + { + "decl": "git_commit", + "type": "struct", + "value": "git_commit", + "file": "git2/types.h", + "line": 141, + "lineto": 141, + "tdef": "typedef", + "description": " Parsed representation of a commit object. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_branch_create", + "git_cherrypick", + "git_cherrypick_commit", + "git_commit_amend", + "git_commit_author", + "git_commit_author_with_mailmap", + "git_commit_body", + "git_commit_committer", + "git_commit_committer_with_mailmap", + "git_commit_create", + "git_commit_create_buffer", + "git_commit_create_cb", + "git_commit_create_from_stage", + "git_commit_dup", + "git_commit_free", + "git_commit_header_field", + "git_commit_id", + "git_commit_lookup", + "git_commit_lookup_prefix", + "git_commit_message", + "git_commit_message_encoding", + "git_commit_message_raw", + "git_commit_nth_gen_ancestor", + "git_commit_owner", + "git_commit_parent", + "git_commit_parent_id", + "git_commit_parentcount", + "git_commit_raw_header", + "git_commit_summary", + "git_commit_time", + "git_commit_time_offset", + "git_commit_tree", + "git_commit_tree_id", + "git_commitarray_dispose", + "git_diff_commit_as_email", + "git_email_create_from_commit", + "git_merge_commits", + "git_odb_set_commit_graph", + "git_repository_commit_parents", + "git_revert", + "git_revert_commit" + ] + } + } + ], + [ + "git_commit_graph", + { + "decl": "git_commit_graph", + "type": "struct", + "value": "git_commit_graph", + "file": "git2/types.h", + "line": 114, + "lineto": 114, + "tdef": "typedef", + "description": " A git commit-graph ", + "comments": "", + "used": { "returns": [], "needs": ["git_odb_set_commit_graph"] } + } + ], + [ + "git_commit_graph_split_strategy_t", + { + "decl": ["GIT_COMMIT_GRAPH_SPLIT_STRATEGY_SINGLE_FILE"], + "type": "enum", + "file": "git2/sys/commit_graph.h", + "line": 93, + "lineto": 99, + "block": "GIT_COMMIT_GRAPH_SPLIT_STRATEGY_SINGLE_FILE", + "tdef": "typedef", + "description": " The strategy to use when adding a new set of commits to a pre-existing\n commit-graph chain.", + "comments": "", + "fields": [ { "type": "int", - "name": "GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH", - "comments": "

Treat pathspec as simple list of exact match file paths

\n", - "value": 8192 - }, + "name": "GIT_COMMIT_GRAPH_SPLIT_STRATEGY_SINGLE_FILE", + "comments": "

Do not split commit-graph files. The other split strategy-related option\n fields are ignored.

\n", + "value": 0 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_commit_graph_writer", + { + "decl": "git_commit_graph_writer", + "type": "struct", + "value": "git_commit_graph_writer", + "file": "git2/types.h", + "line": 117, + "lineto": 117, + "tdef": "typedef", + "description": " a writer for commit-graph files. ", + "comments": "", + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_commitarray", + { + "decl": ["git_commit *const * commits", "size_t count"], + "type": "struct", + "value": "git_commitarray", + "file": "git2/commit.h", + "line": 655, + "lineto": 658, + "block": "git_commit *const * commits\nsize_t count", + "tdef": "typedef", + "description": " An array of commits returned from the library ", + "comments": "", + "fields": [ + { "type": "git_commit *const *", "name": "commits", "comments": "" }, + { "type": "size_t", "name": "count", "comments": "" } + ], + "used": { + "returns": [], + "needs": ["git_commitarray_dispose", "git_repository_commit_parents"] + } + } + ], + [ + "git_config", + { + "decl": "git_config", + "type": "struct", + "value": "git_config", + "file": "git2/types.h", + "line": 162, + "lineto": 162, + "tdef": "typedef", + "description": " Memory representation of a set of config files ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_config_add_file_ondisk", + "git_config_backend_foreach_match", + "git_config_delete_entry", + "git_config_delete_multivar", + "git_config_entry_free", + "git_config_foreach", + "git_config_foreach_cb", + "git_config_foreach_match", + "git_config_free", + "git_config_get_bool", + "git_config_get_entry", + "git_config_get_int32", + "git_config_get_int64", + "git_config_get_mapped", + "git_config_get_multivar_foreach", + "git_config_get_path", + "git_config_get_string", + "git_config_get_string_buf", + "git_config_iterator_free", + "git_config_iterator_glob_new", + "git_config_iterator_new", + "git_config_lock", + "git_config_lookup_map_value", + "git_config_multivar_iterator_new", + "git_config_new", + "git_config_next", + "git_config_open_default", + "git_config_open_global", + "git_config_open_level", + "git_config_open_ondisk", + "git_config_set_bool", + "git_config_set_int32", + "git_config_set_int64", + "git_config_set_multivar", + "git_config_set_string", + "git_config_set_writeorder", + "git_config_snapshot", + "git_repository_config", + "git_repository_config_snapshot" + ] + } + } + ], + [ + "git_config_backend", + { + "decl": "git_config_backend", + "type": "struct", + "value": "git_config_backend", + "file": "git2/types.h", + "line": 165, + "lineto": 165, + "tdef": "typedef", + "description": " Interface to access a configuration file ", + "comments": "", + "used": { "returns": [], "needs": ["git_config_backend_foreach_match"] } + } + ], + [ + "git_config_backend_memory_options", + { + "decl": [ + "unsigned int version", + "const char * backend_type", + "const char * origin_path" + ], + "type": "struct", + "value": "git_config_backend_memory_options", + "file": "git2/sys/config.h", + "line": 148, + "lineto": 162, + "block": "unsigned int version\nconst char * backend_type\nconst char * origin_path", + "tdef": "typedef", + "description": " Options for in-memory configuration backends. ", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, { - "type": "int", - "name": "GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES", - "comments": "

Ignore directories in use, they will be left empty

\n", - "value": 262144 + "type": "const char *", + "name": "backend_type", + "comments": " The type of this backend (eg, \"command line\"). If this is\n NULL, then this will be \"in-memory\"." }, { - "type": "int", - "name": "GIT_CHECKOUT_DONT_OVERWRITE_IGNORED", - "comments": "

Don't overwrite ignored files that exist in the checkout target

\n", - "value": 524288 - }, + "type": "const char *", + "name": "origin_path", + "comments": " The path to the origin; if this is NULL then it will be\n left unset in the resulting configuration entries." + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_config_entry", + { + "decl": [ + "const char * name", + "const char * value", + "const char * backend_type", + "const char * origin_path", + "unsigned int include_depth", + "git_config_level_t level" + ], + "type": "struct", + "value": "git_config_entry", + "file": "git2/config.h", + "line": 103, + "lineto": 124, + "block": "const char * name\nconst char * value\nconst char * backend_type\nconst char * origin_path\nunsigned int include_depth\ngit_config_level_t level", + "tdef": "typedef", + "description": " An entry in a configuration file", + "comments": "", + "fields": [ { - "type": "int", - "name": "GIT_CHECKOUT_CONFLICT_STYLE_MERGE", - "comments": "

Write normal merge files for conflicts

\n", - "value": 1048576 + "type": "const char *", + "name": "name", + "comments": " Name of the configuration entry (normalized). " }, { - "type": "int", - "name": "GIT_CHECKOUT_CONFLICT_STYLE_DIFF3", - "comments": "

Include common ancestor data in diff3 format files for conflicts

\n", - "value": 2097152 + "type": "const char *", + "name": "value", + "comments": " Literal (string) value of the entry. " }, { - "type": "int", - "name": "GIT_CHECKOUT_DONT_REMOVE_EXISTING", - "comments": "

Don't overwrite existing files or folders

\n", - "value": 4194304 + "type": "const char *", + "name": "backend_type", + "comments": " The type of backend that this entry exists in (eg, \"file\"). " }, { - "type": "int", - "name": "GIT_CHECKOUT_DONT_WRITE_INDEX", - "comments": "

Normally checkout writes the index upon completion; this prevents that.

\n", - "value": 8388608 + "type": "const char *", + "name": "origin_path", + "comments": " The path to the origin of this entry. For config files, this is\n the path to the file." }, { - "type": "int", - "name": "GIT_CHECKOUT_UPDATE_SUBMODULES", - "comments": "

Recursively checkout submodules with same options (NOT IMPLEMENTED)

\n", - "value": 65536 + "type": "unsigned int", + "name": "include_depth", + "comments": " Depth of includes where this variable was found. " }, { - "type": "int", - "name": "GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED", - "comments": "

Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED)

\n", - "value": 131072 + "type": "git_config_level_t", + "name": "level", + "comments": " Configuration level for the file this was found in. " } ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_config_entry_free", + "git_config_foreach_cb", + "git_config_get_entry", + "git_config_next" + ] } } ], [ - "git_cherrypick_options", + "git_config_iterator", { - "decl": [ - "unsigned int version", - "unsigned int mainline", - "git_merge_options merge_opts", - "git_checkout_options checkout_opts" - ], + "decl": "git_config_iterator", "type": "struct", - "value": "git_cherrypick_options", - "file": "cherrypick.h", - "line": 26, - "lineto": 34, - "block": "unsigned int version\nunsigned int mainline\ngit_merge_options merge_opts\ngit_checkout_options checkout_opts", + "value": "git_config_iterator", + "file": "git2/config.h", + "line": 145, + "lineto": 145, "tdef": "typedef", - "description": " Cherry-pick options", + "description": " An opaque structure for a configuration iterator.", "comments": "", - "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, - { - "type": "unsigned int", - "name": "mainline", - "comments": " For merge commits, the \"mainline\" is treated as the parent. " - }, - { - "type": "git_merge_options", - "name": "merge_opts", - "comments": " Options for the merging " - }, - { - "type": "git_checkout_options", - "name": "checkout_opts", - "comments": " Options for the checkout " - } - ], "used": { "returns": [], "needs": [ - "git_cherrypick", - "git_cherrypick_init_options" + "git_config_iterator_free", + "git_config_iterator_glob_new", + "git_config_iterator_new", + "git_config_multivar_iterator_new", + "git_config_next" ] } } ], [ - "git_clone_local_t", + "git_config_level_t", { "decl": [ - "GIT_CLONE_LOCAL_AUTO", - "GIT_CLONE_LOCAL", - "GIT_CLONE_NO_LOCAL", - "GIT_CLONE_LOCAL_NO_LINKS" + "GIT_CONFIG_LEVEL_PROGRAMDATA", + "GIT_CONFIG_LEVEL_SYSTEM", + "GIT_CONFIG_LEVEL_XDG", + "GIT_CONFIG_LEVEL_GLOBAL", + "GIT_CONFIG_LEVEL_LOCAL", + "GIT_CONFIG_LEVEL_WORKTREE", + "GIT_CONFIG_LEVEL_APP", + "GIT_CONFIG_HIGHEST_LEVEL" ], "type": "enum", - "file": "clone.h", - "line": 33, - "lineto": 53, - "block": "GIT_CLONE_LOCAL_AUTO\nGIT_CLONE_LOCAL\nGIT_CLONE_NO_LOCAL\nGIT_CLONE_LOCAL_NO_LINKS", + "file": "git2/config.h", + "line": 49, + "lineto": 98, + "block": "GIT_CONFIG_LEVEL_PROGRAMDATA\nGIT_CONFIG_LEVEL_SYSTEM\nGIT_CONFIG_LEVEL_XDG\nGIT_CONFIG_LEVEL_GLOBAL\nGIT_CONFIG_LEVEL_LOCAL\nGIT_CONFIG_LEVEL_WORKTREE\nGIT_CONFIG_LEVEL_APP\nGIT_CONFIG_HIGHEST_LEVEL", "tdef": "typedef", - "description": " Options for bypassing the git-aware transport on clone. Bypassing\n it means that instead of a fetch, libgit2 will copy the object\n database directory instead of figuring out what it needs, which is\n faster. If possible, it will hardlink the files to save space.", - "comments": "", + "description": " Priority level of a config file.", + "comments": "

These priority levels correspond to the natural escalation logic (from higher to lower) when reading or searching for config entries in git.git. Meaning that for the same key, the configuration in the local configuration is preferred over the configuration in the system configuration file.

\n\n

Callers can add their own custom configuration, beginning at the GIT_CONFIG_LEVEL_APP level.

\n\n

Writes, by default, occur in the highest priority level backend that is writable. This ordering can be overridden with git_config_set_writeorder.

\n\n

git_config_open_default() and git_repository_config() honor those priority levels as well.

\n", "fields": [ { "type": "int", - "name": "GIT_CLONE_LOCAL_AUTO", - "comments": "

Auto-detect (default), libgit2 will bypass the git-aware\n transport for local paths, but use a normal fetch for\n file:// urls.

\n", - "value": 0 - }, - { - "type": "int", - "name": "GIT_CLONE_LOCAL", - "comments": "

Bypass the git-aware transport even for a file:// url.

\n", + "name": "GIT_CONFIG_LEVEL_PROGRAMDATA", + "comments": "

System-wide on Windows, for compatibility with "Portable Git".

\n", "value": 1 }, { "type": "int", - "name": "GIT_CLONE_NO_LOCAL", - "comments": "

Do no bypass the git-aware transport

\n", + "name": "GIT_CONFIG_LEVEL_SYSTEM", + "comments": "

System-wide configuration file; /etc/gitconfig on Linux.

\n", "value": 2 }, { "type": "int", - "name": "GIT_CLONE_LOCAL_NO_LINKS", - "comments": "

Bypass the git-aware transport, but do not try to use\n hardlinks.

\n", + "name": "GIT_CONFIG_LEVEL_XDG", + "comments": "

XDG compatible configuration file; typically\n ~/.config/git/config.

\n", "value": 3 + }, + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_GLOBAL", + "comments": "

Global configuration file is the user-specific configuration;\n typically ~/.gitconfig.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_LOCAL", + "comments": "

Local configuration, the repository-specific configuration file;\n typically $GIT_DIR/config.

\n", + "value": 5 + }, + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_WORKTREE", + "comments": "

Worktree-specific configuration; typically\n $GIT_DIR/config.worktree.

\n", + "value": 6 + }, + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_APP", + "comments": "

Application-specific configuration file. Callers into libgit2\n can add their own configuration beginning at this level.

\n", + "value": 7 + }, + { + "type": "int", + "name": "GIT_CONFIG_HIGHEST_LEVEL", + "comments": "

Not a configuration level; callers can use this value when\n querying configuration levels to specify that they want to\n have data from the highest-level currently configuration.\n This can be used to indicate that callers want the most\n specific config file available that actually is loaded.

\n", + "value": -1 } ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_config_add_file_ondisk", + "git_config_open_level", + "git_config_set_writeorder" + ] } } ], [ - "git_clone_options", + "git_configmap", { "decl": [ - "unsigned int version", - "git_checkout_options checkout_opts", - "git_fetch_options fetch_opts", - "int bare", - "git_clone_local_t local", - "const char * checkout_branch", - "git_repository_create_cb repository_cb", - "void * repository_cb_payload", - "git_remote_create_cb remote_cb", - "void * remote_cb_payload" + "git_configmap_t type", + "const char * str_match", + "int map_value" ], "type": "struct", - "value": "git_clone_options", - "file": "clone.h", - "line": 103, + "value": "git_configmap", + "file": "git2/config.h", + "line": 160, "lineto": 164, - "block": "unsigned int version\ngit_checkout_options checkout_opts\ngit_fetch_options fetch_opts\nint bare\ngit_clone_local_t local\nconst char * checkout_branch\ngit_repository_create_cb repository_cb\nvoid * repository_cb_payload\ngit_remote_create_cb remote_cb\nvoid * remote_cb_payload", + "block": "git_configmap_t type\nconst char * str_match\nint map_value", "tdef": "typedef", - "description": " Clone options structure", - "comments": "

Use the GIT_CLONE_OPTIONS_INIT to get the default settings, like this:

\n\n
    git_clone_options opts = GIT_CLONE_OPTIONS_INIT;\n
\n", + "description": " Mapping from config variables to values.", + "comments": "", + "fields": [ + { "type": "git_configmap_t", "name": "type", "comments": "" }, + { "type": "const char *", "name": "str_match", "comments": "" }, + { "type": "int", "name": "map_value", "comments": "" } + ], + "used": { + "returns": [], + "needs": ["git_config_get_mapped", "git_config_lookup_map_value"] + } + } + ], + [ + "git_configmap_t", + { + "decl": [ + "GIT_CONFIGMAP_FALSE", + "GIT_CONFIGMAP_TRUE", + "GIT_CONFIGMAP_INT32", + "GIT_CONFIGMAP_STRING" + ], + "type": "enum", + "file": "git2/config.h", + "line": 150, + "lineto": 155, + "block": "GIT_CONFIGMAP_FALSE\nGIT_CONFIGMAP_TRUE\nGIT_CONFIGMAP_INT32\nGIT_CONFIGMAP_STRING", + "tdef": "typedef", + "description": " Config var type", + "comments": "", "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, - { - "type": "git_checkout_options", - "name": "checkout_opts", - "comments": " These options are passed to the checkout step. To disable\n checkout, set the `checkout_strategy` to\n `GIT_CHECKOUT_NONE`." - }, - { - "type": "git_fetch_options", - "name": "fetch_opts", - "comments": " Options which control the fetch, including callbacks.\n\n The callbacks are used for reporting fetch progress, and for acquiring\n credentials in the event they are needed." - }, { "type": "int", - "name": "bare", - "comments": " Set to zero (false) to create a standard repo, or non-zero\n for a bare repo" - }, - { - "type": "git_clone_local_t", - "name": "local", - "comments": " Whether to use a fetch or copy the object database." - }, - { - "type": "const char *", - "name": "checkout_branch", - "comments": " The name of the branch to checkout. NULL means use the\n remote's default branch." - }, - { - "type": "git_repository_create_cb", - "name": "repository_cb", - "comments": " A callback used to create the new repository into which to\n clone. If NULL, the 'bare' field will be used to determine\n whether to create a bare repository." + "name": "GIT_CONFIGMAP_FALSE", + "comments": "", + "value": 0 }, { - "type": "void *", - "name": "repository_cb_payload", - "comments": " An opaque payload to pass to the git_repository creation callback.\n This parameter is ignored unless repository_cb is non-NULL." + "type": "int", + "name": "GIT_CONFIGMAP_TRUE", + "comments": "", + "value": 1 }, - { - "type": "git_remote_create_cb", - "name": "remote_cb", - "comments": " A callback used to create the git_remote, prior to its being\n used to perform the clone operation. See the documentation for\n git_remote_create_cb for details. This parameter may be NULL,\n indicating that git_clone should provide default behavior." + { + "type": "int", + "name": "GIT_CONFIGMAP_INT32", + "comments": "", + "value": 2 }, { - "type": "void *", - "name": "remote_cb_payload", - "comments": " An opaque payload to pass to the git_remote creation callback.\n This parameter is ignored unless remote_cb is non-NULL." + "type": "int", + "name": "GIT_CONFIGMAP_STRING", + "comments": "", + "value": 3 } ], - "used": { - "returns": [], - "needs": [ - "git_clone", - "git_clone_init_options" - ] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_commit", + "git_credential", { - "decl": "git_commit", + "decl": "git_credential", "type": "struct", - "value": "git_commit", - "file": "types.h", - "line": 120, - "lineto": 120, + "value": "git_credential", + "file": "git2/credential.h", + "line": 87, + "lineto": 87, "tdef": "typedef", - "description": " Parsed representation of a commit object. ", + "description": " The base structure for all credential types", "comments": "", "used": { "returns": [], "needs": [ - "git_branch_create", - "git_cherrypick", - "git_cherrypick_commit", - "git_commit_amend", - "git_commit_author", - "git_commit_body", - "git_commit_committer", - "git_commit_create", - "git_commit_create_buffer", - "git_commit_create_from_callback", - "git_commit_dup", - "git_commit_free", - "git_commit_header_field", - "git_commit_id", - "git_commit_lookup", - "git_commit_lookup_prefix", - "git_commit_message", - "git_commit_message_encoding", - "git_commit_message_raw", - "git_commit_nth_gen_ancestor", - "git_commit_owner", - "git_commit_parent", - "git_commit_parent_id", - "git_commit_parentcount", - "git_commit_raw_header", - "git_commit_summary", - "git_commit_time", - "git_commit_time_offset", - "git_commit_tree", - "git_commit_tree_id", - "git_diff_commit_as_email", - "git_merge_commits", - "git_revert", - "git_revert_commit" + "git_credential_acquire_cb", + "git_credential_default_new", + "git_credential_free", + "git_credential_get_username", + "git_credential_has_username", + "git_credential_ssh_custom_new", + "git_credential_ssh_interactive_new", + "git_credential_ssh_key_from_agent", + "git_credential_ssh_key_memory_new", + "git_credential_ssh_key_new", + "git_credential_username_new", + "git_credential_userpass", + "git_credential_userpass_plaintext_new" ] } } ], [ - "git_config", + "git_credential_default", { - "decl": "git_config", + "decl": "git_credential_default", "type": "struct", - "value": "git_config", - "file": "types.h", - "line": 138, - "lineto": 138, + "value": "git_credential_default", + "file": "git2/credential.h", + "line": 95, + "lineto": 95, "tdef": "typedef", - "description": " Memory representation of a set of config files ", + "description": " A key for NTLM/Kerberos \"default\" credentials ", + "comments": "", + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_credential_ssh_custom", + { + "decl": "git_credential_ssh_custom", + "type": "struct", + "value": "git_credential_ssh_custom", + "file": "git2/credential.h", + "line": 110, + "lineto": 110, + "tdef": "typedef", + "description": " A key with a custom signature function", + "comments": "", + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_credential_ssh_interactive", + { + "decl": "git_credential_ssh_interactive", + "type": "struct", + "value": "git_credential_ssh_interactive", + "file": "git2/credential.h", + "line": 105, + "lineto": 105, + "tdef": "typedef", + "description": " Keyboard-interactive based ssh authentication", "comments": "", "used": { "returns": [], - "needs": [ - "git_config_add_backend", - "git_config_add_file_ondisk", - "git_config_backend_foreach_match", - "git_config_delete_entry", - "git_config_delete_multivar", - "git_config_entry_free", - "git_config_foreach", - "git_config_foreach_match", - "git_config_free", - "git_config_get_bool", - "git_config_get_entry", - "git_config_get_int32", - "git_config_get_int64", - "git_config_get_mapped", - "git_config_get_multivar_foreach", - "git_config_get_path", - "git_config_get_string", - "git_config_get_string_buf", - "git_config_init_backend", - "git_config_iterator_free", - "git_config_iterator_glob_new", - "git_config_iterator_new", - "git_config_lock", - "git_config_multivar_iterator_new", - "git_config_new", - "git_config_next", - "git_config_open_default", - "git_config_open_global", - "git_config_open_level", - "git_config_open_ondisk", - "git_config_set_bool", - "git_config_set_int32", - "git_config_set_int64", - "git_config_set_multivar", - "git_config_set_string", - "git_config_snapshot", - "git_repository_config", - "git_repository_config_snapshot", - "git_repository_set_config" - ] + "needs": ["git_credential_ssh_interactive_new"] } } ], [ - "git_config_backend", + "git_credential_ssh_key", { - "decl": "git_config_backend", + "decl": "git_credential_ssh_key", "type": "struct", - "value": "git_config_backend", - "file": "types.h", - "line": 141, - "lineto": 141, - "block": "unsigned int version\nint readonly\nstruct git_config * cfg\nint (*)(struct git_config_backend *, git_config_level_t) open\nint (*)(struct git_config_backend *, const char *, git_config_entry **) get\nint (*)(struct git_config_backend *, const char *, const char *) set\nint (*)(git_config_backend *, const char *, const char *, const char *) set_multivar\nint (*)(struct git_config_backend *, const char *) del\nint (*)(struct git_config_backend *, const char *, const char *) del_multivar\nint (*)(git_config_iterator **, struct git_config_backend *) iterator\nint (*)(struct git_config_backend **, struct git_config_backend *) snapshot\nint (*)(struct git_config_backend *) lock\nint (*)(struct git_config_backend *, int) unlock\nvoid (*)(struct git_config_backend *) free", + "value": "git_credential_ssh_key", + "file": "git2/credential.h", + "line": 100, + "lineto": 100, "tdef": "typedef", - "description": " Interface to access a configuration file ", + "description": " A ssh key from disk", "comments": "", + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_credential_t", + { + "decl": [ + "GIT_CREDENTIAL_USERPASS_PLAINTEXT", + "GIT_CREDENTIAL_SSH_KEY", + "GIT_CREDENTIAL_SSH_CUSTOM", + "GIT_CREDENTIAL_DEFAULT", + "GIT_CREDENTIAL_SSH_INTERACTIVE", + "GIT_CREDENTIAL_USERNAME", + "GIT_CREDENTIAL_SSH_MEMORY" + ], + "type": "enum", + "file": "git2/credential.h", + "line": 30, + "lineto": 82, + "block": "GIT_CREDENTIAL_USERPASS_PLAINTEXT\nGIT_CREDENTIAL_SSH_KEY\nGIT_CREDENTIAL_SSH_CUSTOM\nGIT_CREDENTIAL_DEFAULT\nGIT_CREDENTIAL_SSH_INTERACTIVE\nGIT_CREDENTIAL_USERNAME\nGIT_CREDENTIAL_SSH_MEMORY", + "tdef": "typedef", + "description": " Supported credential types", + "comments": "

This represents the various types of authentication methods supported by the library.

\n", "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, { "type": "int", - "name": "readonly", - "comments": " True if this backend is for a snapshot " - }, - { - "type": "struct git_config *", - "name": "cfg", - "comments": "" - }, - { - "type": "int (*)(struct git_config_backend *, git_config_level_t)", - "name": "open", - "comments": "" - }, - { - "type": "int (*)(struct git_config_backend *, const char *, git_config_entry **)", - "name": "get", - "comments": "" - }, - { - "type": "int (*)(struct git_config_backend *, const char *, const char *)", - "name": "set", - "comments": "" - }, - { - "type": "int (*)(git_config_backend *, const char *, const char *, const char *)", - "name": "set_multivar", - "comments": "" - }, - { - "type": "int (*)(struct git_config_backend *, const char *)", - "name": "del", - "comments": "" + "name": "GIT_CREDENTIAL_USERPASS_PLAINTEXT", + "comments": "

A vanilla user/password request

\n", + "value": 1 }, { - "type": "int (*)(struct git_config_backend *, const char *, const char *)", - "name": "del_multivar", - "comments": "" + "type": "int", + "name": "GIT_CREDENTIAL_SSH_KEY", + "comments": "

An SSH key-based authentication request

\n", + "value": 2 }, { - "type": "int (*)(git_config_iterator **, struct git_config_backend *)", - "name": "iterator", - "comments": "" + "type": "int", + "name": "GIT_CREDENTIAL_SSH_CUSTOM", + "comments": "

An SSH key-based authentication request, with a custom signature

\n", + "value": 4 }, { - "type": "int (*)(struct git_config_backend **, struct git_config_backend *)", - "name": "snapshot", - "comments": " Produce a read-only version of this backend " + "type": "int", + "name": "GIT_CREDENTIAL_DEFAULT", + "comments": "

An NTLM/Negotiate-based authentication request.

\n", + "value": 8 }, { - "type": "int (*)(struct git_config_backend *)", - "name": "lock", - "comments": " Lock this backend.\n\n Prevent any writes to the data store backing this\n backend. Any updates must not be visible to any other\n readers." + "type": "int", + "name": "GIT_CREDENTIAL_SSH_INTERACTIVE", + "comments": "

An SSH interactive authentication request

\n", + "value": 16 }, { - "type": "int (*)(struct git_config_backend *, int)", - "name": "unlock", - "comments": " Unlock the data store backing this backend. If success is\n true, the changes should be committed, otherwise rolled\n back." + "type": "int", + "name": "GIT_CREDENTIAL_USERNAME", + "comments": "

Username-only authentication request

\n\n

Used as a pre-authentication step if the underlying transport\n (eg. SSH, with no username in its URL) does not know which username\n to use.

\n", + "value": 32 }, { - "type": "void (*)(struct git_config_backend *)", - "name": "free", - "comments": "" + "type": "int", + "name": "GIT_CREDENTIAL_SSH_MEMORY", + "comments": "

An SSH key-based authentication request

\n\n

Allows credentials to be read from memory instead of files.\n Note that because of differences in crypto backend support, it might\n not be functional.

\n", + "value": 64 } ], - "used": { - "returns": [], - "needs": [ - "git_config_add_backend", - "git_config_backend_foreach_match", - "git_config_init_backend" - ] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_config_entry", + "git_credential_username", { - "decl": [ - "const char * name", - "const char * value", - "git_config_level_t level", - "void (*)(struct git_config_entry *) free", - "void * payload" - ], + "decl": "git_credential_username", "type": "struct", - "value": "git_config_entry", - "file": "config.h", - "line": 64, - "lineto": 70, - "block": "const char * name\nconst char * value\ngit_config_level_t level\nvoid (*)(struct git_config_entry *) free\nvoid * payload", + "value": "git_credential_username", + "file": "git2/credential.h", + "line": 92, + "lineto": 92, "tdef": "typedef", - "description": " An entry in a configuration file", + "description": " Username-only credential information ", + "comments": "", + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_credential_userpass_payload", + { + "decl": ["const char * username", "const char * password"], + "type": "struct", + "value": "git_credential_userpass_payload", + "file": "git2/credential_helpers.h", + "line": 24, + "lineto": 27, + "block": "const char * username\nconst char * password", + "tdef": "typedef", + "description": " Payload for git_credential_userpass_plaintext.", "comments": "", "fields": [ + { "type": "const char *", "name": "username", "comments": "" }, + { "type": "const char *", "name": "password", "comments": "" } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_delta_t", + { + "decl": [ + "GIT_DELTA_UNMODIFIED", + "GIT_DELTA_ADDED", + "GIT_DELTA_DELETED", + "GIT_DELTA_MODIFIED", + "GIT_DELTA_RENAMED", + "GIT_DELTA_COPIED", + "GIT_DELTA_IGNORED", + "GIT_DELTA_UNTRACKED", + "GIT_DELTA_TYPECHANGE", + "GIT_DELTA_UNREADABLE", + "GIT_DELTA_CONFLICTED" + ], + "type": "enum", + "file": "git2/diff.h", + "line": 224, + "lineto": 236, + "block": "GIT_DELTA_UNMODIFIED\nGIT_DELTA_ADDED\nGIT_DELTA_DELETED\nGIT_DELTA_MODIFIED\nGIT_DELTA_RENAMED\nGIT_DELTA_COPIED\nGIT_DELTA_IGNORED\nGIT_DELTA_UNTRACKED\nGIT_DELTA_TYPECHANGE\nGIT_DELTA_UNREADABLE\nGIT_DELTA_CONFLICTED", + "tdef": "typedef", + "description": " What type of change is described by a git_diff_delta?", + "comments": "

GIT_DELTA_RENAMED and GIT_DELTA_COPIED will only show up if you run git_diff_find_similar() on the diff object.

\n\n

GIT_DELTA_TYPECHANGE only shows up given GIT_DIFF_INCLUDE_TYPECHANGE in the option flags (otherwise type changes will be split into ADDED / DELETED pairs).

\n", + "fields": [ + { + "type": "int", + "name": "GIT_DELTA_UNMODIFIED", + "comments": "

no changes

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DELTA_ADDED", + "comments": "

entry does not exist in old version

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DELTA_DELETED", + "comments": "

entry does not exist in new version

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_DELTA_MODIFIED", + "comments": "

entry content changed between old and new

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_DELTA_RENAMED", + "comments": "

entry was renamed between old and new

\n", + "value": 4 + }, { - "type": "const char *", - "name": "name", - "comments": " Name of the entry (normalised) " + "type": "int", + "name": "GIT_DELTA_COPIED", + "comments": "

entry was copied from another old entry

\n", + "value": 5 }, { - "type": "const char *", - "name": "value", - "comments": " String value of the entry " + "type": "int", + "name": "GIT_DELTA_IGNORED", + "comments": "

entry is ignored item in workdir

\n", + "value": 6 }, { - "type": "git_config_level_t", - "name": "level", - "comments": " Which config file this was found in " + "type": "int", + "name": "GIT_DELTA_UNTRACKED", + "comments": "

entry is untracked item in workdir

\n", + "value": 7 }, { - "type": "void (*)(struct git_config_entry *)", - "name": "free", - "comments": " Free function for this entry " + "type": "int", + "name": "GIT_DELTA_TYPECHANGE", + "comments": "

type of entry changed between old and new

\n", + "value": 8 }, { - "type": "void *", - "name": "payload", - "comments": " Opaque value for the free function. Do not read or write " + "type": "int", + "name": "GIT_DELTA_UNREADABLE", + "comments": "

entry is unreadable

\n", + "value": 9 + }, + { + "type": "int", + "name": "GIT_DELTA_CONFLICTED", + "comments": "

entry in the index is conflicted

\n", + "value": 10 } ], "used": { "returns": [], - "needs": [ - "git_config_entry_free", - "git_config_get_entry", - "git_config_next" - ] + "needs": ["git_diff_num_deltas_of_type", "git_diff_status_char"] } } ], [ - "git_config_iterator", + "git_describe_format_options", { "decl": [ - "git_config_backend * backend", - "unsigned int flags", - "int (*)(git_config_entry **, git_config_iterator *) next", - "void (*)(git_config_iterator *) free" + "unsigned int version", + "unsigned int abbreviated_size", + "int always_use_long_format", + "const char * dirty_suffix" ], "type": "struct", - "value": "git_config_iterator", - "file": "sys/config.h", - "line": 34, - "lineto": 48, - "block": "git_config_backend * backend\nunsigned int flags\nint (*)(git_config_entry **, git_config_iterator *) next\nvoid (*)(git_config_iterator *) free", - "tdef": null, - "description": " Every iterator must have this struct as its first element, so the\n API can talk to it. You'd define your iterator as", - "comments": "
 struct my_iterator {             git_config_iterator parent;             ...     }\n
\n\n

and assign iter->parent.backend to your git_config_backend.

\n", + "value": "git_describe_format_options", + "file": "git2/describe.h", + "line": 100, + "lineto": 120, + "block": "unsigned int version\nunsigned int abbreviated_size\nint always_use_long_format\nconst char * dirty_suffix", + "tdef": "typedef", + "description": " Describe format options structure", + "comments": "

Initialize with GIT_DESCRIBE_FORMAT_OPTIONS_INIT. Alternatively, you can use git_describe_format_options_init.

\n", "fields": [ - { - "type": "git_config_backend *", - "name": "backend", - "comments": "" - }, + { "type": "unsigned int", "name": "version", "comments": "" }, { "type": "unsigned int", - "name": "flags", - "comments": "" + "name": "abbreviated_size", + "comments": " Size of the abbreviated commit id to use. This value is the\n lower bound for the length of the abbreviated string. The\n default is 7." }, { - "type": "int (*)(git_config_entry **, git_config_iterator *)", - "name": "next", - "comments": " Return the current entry and advance the iterator. The\n memory belongs to the library." + "type": "int", + "name": "always_use_long_format", + "comments": " Set to use the long format even when a shorter name could be used." }, { - "type": "void (*)(git_config_iterator *)", - "name": "free", - "comments": " Free the iterator" + "type": "const char *", + "name": "dirty_suffix", + "comments": " If the workdir is dirty and this is set, this string will\n be appended to the description string." } ], "used": { "returns": [], - "needs": [ - "git_config_iterator_free", - "git_config_iterator_glob_new", - "git_config_iterator_new", - "git_config_multivar_iterator_new", - "git_config_next" - ] + "needs": ["git_describe_format", "git_describe_format_options_init"] } } ], [ - "git_config_level_t", + "git_describe_options", { "decl": [ - "GIT_CONFIG_LEVEL_PROGRAMDATA", - "GIT_CONFIG_LEVEL_SYSTEM", - "GIT_CONFIG_LEVEL_XDG", - "GIT_CONFIG_LEVEL_GLOBAL", - "GIT_CONFIG_LEVEL_LOCAL", - "GIT_CONFIG_LEVEL_APP", - "GIT_CONFIG_HIGHEST_LEVEL" + "unsigned int version", + "unsigned int max_candidates_tags", + "unsigned int describe_strategy", + "const char * pattern", + "int only_follow_first_parent", + "int show_commit_oid_as_fallback" ], - "type": "enum", - "file": "config.h", - "line": 31, - "lineto": 59, - "block": "GIT_CONFIG_LEVEL_PROGRAMDATA\nGIT_CONFIG_LEVEL_SYSTEM\nGIT_CONFIG_LEVEL_XDG\nGIT_CONFIG_LEVEL_GLOBAL\nGIT_CONFIG_LEVEL_LOCAL\nGIT_CONFIG_LEVEL_APP\nGIT_CONFIG_HIGHEST_LEVEL", + "type": "struct", + "value": "git_describe_options", + "file": "git2/describe.h", + "line": 47, + "lineto": 65, + "block": "unsigned int version\nunsigned int max_candidates_tags\nunsigned int describe_strategy\nconst char * pattern\nint only_follow_first_parent\nint show_commit_oid_as_fallback", "tdef": "typedef", - "description": " Priority level of a config file.\n These priority levels correspond to the natural escalation logic\n (from higher to lower) when searching for config entries in git.git.", - "comments": "

git_config_open_default() and git_repository_config() honor those priority levels as well.

\n", + "description": " Describe options structure", + "comments": "

Initialize with GIT_DESCRIBE_OPTIONS_INIT. Alternatively, you can use git_describe_options_init.

\n", "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, { - "type": "int", - "name": "GIT_CONFIG_LEVEL_PROGRAMDATA", - "comments": "

System-wide on Windows, for compatibility with portable git

\n", - "value": 1 - }, - { - "type": "int", - "name": "GIT_CONFIG_LEVEL_SYSTEM", - "comments": "

System-wide configuration file; /etc/gitconfig on Linux systems

\n", - "value": 2 - }, - { - "type": "int", - "name": "GIT_CONFIG_LEVEL_XDG", - "comments": "

XDG compatible configuration file; typically ~/.config/git/config

\n", - "value": 3 - }, - { - "type": "int", - "name": "GIT_CONFIG_LEVEL_GLOBAL", - "comments": "

User-specific configuration file (also called Global configuration\n file); typically ~/.gitconfig

\n", - "value": 4 + "type": "unsigned int", + "name": "max_candidates_tags", + "comments": " default: 10 " }, { - "type": "int", - "name": "GIT_CONFIG_LEVEL_LOCAL", - "comments": "

Repository specific configuration file; $WORK_DIR/.git/config on\n non-bare repos

\n", - "value": 5 + "type": "unsigned int", + "name": "describe_strategy", + "comments": " default: GIT_DESCRIBE_DEFAULT " }, + { "type": "const char *", "name": "pattern", "comments": "" }, { "type": "int", - "name": "GIT_CONFIG_LEVEL_APP", - "comments": "

Application specific configuration file; freely defined by applications

\n", - "value": 6 + "name": "only_follow_first_parent", + "comments": " When calculating the distance from the matching tag or\n reference, only walk down the first-parent ancestry." }, { "type": "int", - "name": "GIT_CONFIG_HIGHEST_LEVEL", - "comments": "

Represents the highest level available config file (i.e. the most\n specific config file available that actually is loaded)

\n", - "value": -1 + "name": "show_commit_oid_as_fallback", + "comments": " If no matching tag or reference is found, the describe\n operation would normally fail. If this option is set, it\n will instead fall back to showing the full id of the\n commit." } ], "used": { "returns": [], "needs": [ - "git_config_add_backend", - "git_config_add_file_ondisk", - "git_config_open_level" + "git_describe_commit", + "git_describe_options_init", + "git_describe_workdir" ] } } ], [ - "git_cred_default", + "git_describe_result", { - "decl": "git_cred_default", + "decl": "git_describe_result", "type": "struct", - "value": "git_cred_default", - "file": "transport.h", - "line": 176, - "lineto": 176, + "value": "git_describe_result", + "file": "git2/describe.h", + "line": 146, + "lineto": 146, "tdef": "typedef", - "description": " A key for NTLM/Kerberos \"default\" credentials ", + "description": " A struct that stores the result of a describe operation.", "comments": "", "used": { "returns": [], - "needs": [] + "needs": [ + "git_describe_commit", + "git_describe_format", + "git_describe_result_free", + "git_describe_workdir" + ] } } ], [ - "git_cred_ssh_custom", + "git_describe_strategy_t", { "decl": [ - "git_cred parent", - "char * username", - "char * publickey", - "size_t publickey_len", - "git_cred_sign_callback sign_callback", - "void * payload" + "GIT_DESCRIBE_DEFAULT", + "GIT_DESCRIBE_TAGS", + "GIT_DESCRIBE_ALL" ], - "type": "struct", - "value": "git_cred_ssh_custom", - "file": "transport.h", - "line": 166, - "lineto": 173, - "block": "git_cred parent\nchar * username\nchar * publickey\nsize_t publickey_len\ngit_cred_sign_callback sign_callback\nvoid * payload", + "type": "enum", + "file": "git2/describe.h", + "line": 34, + "lineto": 38, + "block": "GIT_DESCRIBE_DEFAULT\nGIT_DESCRIBE_TAGS\nGIT_DESCRIBE_ALL", "tdef": "typedef", - "description": " A key with a custom signature function", - "comments": "", + "description": " Reference lookup strategy", + "comments": "

These behave like the --tags and --all options to git-describe, namely they say to look for any reference in either refs/tags/ or refs/ respectively.

\n", "fields": [ { - "type": "git_cred", - "name": "parent", - "comments": "" - }, - { - "type": "char *", - "name": "username", - "comments": "" - }, - { - "type": "char *", - "name": "publickey", - "comments": "" - }, - { - "type": "size_t", - "name": "publickey_len", - "comments": "" + "type": "int", + "name": "GIT_DESCRIBE_DEFAULT", + "comments": "", + "value": 0 }, { - "type": "git_cred_sign_callback", - "name": "sign_callback", - "comments": "" + "type": "int", + "name": "GIT_DESCRIBE_TAGS", + "comments": "", + "value": 1 }, { - "type": "void *", - "name": "payload", - "comments": "" + "type": "int", + "name": "GIT_DESCRIBE_ALL", + "comments": "", + "value": 2 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_cred_ssh_interactive", + "git_diff", { - "decl": [ - "git_cred parent", - "char * username", - "git_cred_ssh_interactive_callback prompt_callback", - "void * payload" - ], + "decl": "git_diff", "type": "struct", - "value": "git_cred_ssh_interactive", - "file": "transport.h", - "line": 156, - "lineto": 161, - "block": "git_cred parent\nchar * username\ngit_cred_ssh_interactive_callback prompt_callback\nvoid * payload", + "value": "git_diff", + "file": "git2/diff.h", + "line": 196, + "lineto": 196, "tdef": "typedef", - "description": " Keyboard-interactive based ssh authentication", - "comments": "", - "fields": [ - { - "type": "git_cred", - "name": "parent", - "comments": "" - }, - { - "type": "char *", - "name": "username", - "comments": "" - }, - { - "type": "git_cred_ssh_interactive_callback", - "name": "prompt_callback", - "comments": "" - }, - { - "type": "void *", - "name": "payload", - "comments": "" - } - ], + "description": " The diff object that contains all individual file deltas.", + "comments": "

A diff represents the cumulative list of differences between two snapshots of a repository (possibly filtered by a set of file name patterns).

\n\n

Calculating diffs is generally done in two phases: building a list of diffs then traversing it. This makes is easier to share logic across the various types of diffs (tree vs tree, workdir vs index, etc.), and also allows you to insert optional diff post-processing phases, such as rename detection, in between the steps. When you are done with a diff object, it must be freed.

\n\n

This is an opaque structure which will be allocated by one of the diff generator functions below (such as git_diff_tree_to_tree). You are responsible for releasing the object memory when done, using the git_diff_free() function.

\n", "used": { - "returns": [], + "returns": [ + "git_diff_get_delta", + "git_patch_get_delta", + "git_pathspec_match_list_diff_entry" + ], "needs": [ - "git_cred_ssh_interactive_new" + "git_apply", + "git_apply_delta_cb", + "git_apply_hunk_cb", + "git_apply_to_tree", + "git_checkout_notify_cb", + "git_diff_binary_cb", + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_commit_as_email", + "git_diff_file_cb", + "git_diff_find_options_init", + "git_diff_find_similar", + "git_diff_foreach", + "git_diff_format_email", + "git_diff_format_email_options_init", + "git_diff_free", + "git_diff_from_buffer", + "git_diff_get_delta", + "git_diff_get_stats", + "git_diff_hunk_cb", + "git_diff_index_to_index", + "git_diff_index_to_workdir", + "git_diff_is_sorted_icase", + "git_diff_line_cb", + "git_diff_merge", + "git_diff_notify_cb", + "git_diff_num_deltas", + "git_diff_num_deltas_of_type", + "git_diff_options_init", + "git_diff_patchid", + "git_diff_patchid_options_init", + "git_diff_print", + "git_diff_progress_cb", + "git_diff_stats_deletions", + "git_diff_stats_files_changed", + "git_diff_stats_free", + "git_diff_stats_insertions", + "git_diff_stats_to_buf", + "git_diff_to_buf", + "git_diff_tree_to_index", + "git_diff_tree_to_tree", + "git_diff_tree_to_workdir", + "git_diff_tree_to_workdir_with_index", + "git_patch_from_blob_and_buffer", + "git_patch_from_blobs", + "git_patch_from_buffers", + "git_patch_from_diff", + "git_patch_get_hunk", + "git_patch_get_line_in_hunk", + "git_patch_print", + "git_pathspec_match_diff" ] } } ], [ - "git_cred_ssh_key", + "git_diff_binary", { "decl": [ - "git_cred parent", - "char * username", - "char * publickey", - "char * privatekey", - "char * passphrase" + "unsigned int contains_data", + "git_diff_binary_file old_file", + "git_diff_binary_file new_file" ], "type": "struct", - "value": "git_cred_ssh_key", - "file": "transport.h", - "line": 145, - "lineto": 151, - "block": "git_cred parent\nchar * username\nchar * publickey\nchar * privatekey\nchar * passphrase", + "value": "git_diff_binary", + "file": "git2/diff.h", + "line": 553, + "lineto": 565, + "block": "unsigned int contains_data\ngit_diff_binary_file old_file\ngit_diff_binary_file new_file", "tdef": "typedef", - "description": " A ssh key from disk", - "comments": "", + "description": " Structure describing the binary contents of a diff.", + "comments": "

A binary file / delta is a file (or pair) for which no text diffs should be generated. A diff can contain delta entries that are binary, but no diff content will be output for those files. There is a base heuristic for binary detection and you can further tune the behavior with git attributes or diff flags and option settings.

\n", "fields": [ { - "type": "git_cred", - "name": "parent", - "comments": "" - }, - { - "type": "char *", - "name": "username", - "comments": "" - }, - { - "type": "char *", - "name": "publickey", - "comments": "" + "type": "unsigned int", + "name": "contains_data", + "comments": " Whether there is data in this binary structure or not.\n\n If this is `1`, then this was produced and included binary content.\n If this is `0` then this was generated knowing only that a binary\n file changed but without providing the data, probably from a patch\n that said `Binary files a/file.txt and b/file.txt differ`." }, { - "type": "char *", - "name": "privatekey", - "comments": "" + "type": "git_diff_binary_file", + "name": "old_file", + "comments": " The contents of the old file. " }, { - "type": "char *", - "name": "passphrase", - "comments": "" + "type": "git_diff_binary_file", + "name": "new_file", + "comments": " The contents of the new file. " } ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_diff_binary_cb", + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_foreach" + ] } } ], [ - "git_cred_username", + "git_diff_binary_file", { "decl": [ - "git_cred parent", - "char [1] username" + "git_diff_binary_t type", + "const char * data", + "size_t datalen", + "size_t inflatedlen" ], "type": "struct", - "value": "git_cred_username", - "file": "transport.h", - "line": 179, - "lineto": 182, - "block": "git_cred parent\nchar [1] username", + "value": "git_diff_binary_file", + "file": "git2/diff.h", + "line": 530, + "lineto": 542, + "block": "git_diff_binary_t type\nconst char * data\nsize_t datalen\nsize_t inflatedlen", "tdef": "typedef", - "description": " Username-only credential information ", + "description": " The contents of one of the files in a binary diff. ", "comments": "", "fields": [ { - "type": "git_cred", - "name": "parent", - "comments": "" + "type": "git_diff_binary_t", + "name": "type", + "comments": " The type of binary data for this file. " }, - { - "type": "char [1]", - "name": "username", - "comments": "" - } - ], - "used": { - "returns": [], - "needs": [] - } - } - ], - [ - "git_cred_userpass_payload", - { - "decl": [ - "const char * username", - "const char * password" - ], - "type": "struct", - "value": "git_cred_userpass_payload", - "file": "cred_helpers.h", - "line": 24, - "lineto": 27, - "block": "const char * username\nconst char * password", - "tdef": "typedef", - "description": " Payload for git_cred_stock_userpass_plaintext.", - "comments": "", - "fields": [ { "type": "const char *", - "name": "username", - "comments": "" + "name": "data", + "comments": " The binary data, deflated. " }, { - "type": "const char *", - "name": "password", - "comments": "" + "type": "size_t", + "name": "datalen", + "comments": " The length of the binary data. " + }, + { + "type": "size_t", + "name": "inflatedlen", + "comments": " The length of the binary data after inflation. " } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_cred_userpass_plaintext", + "git_diff_binary_t", { "decl": [ - "git_cred parent", - "char * username", - "char * password" + "GIT_DIFF_BINARY_NONE", + "GIT_DIFF_BINARY_LITERAL", + "GIT_DIFF_BINARY_DELTA" ], - "type": "struct", - "value": "git_cred_userpass_plaintext", - "file": "transport.h", - "line": 122, - "lineto": 126, - "block": "git_cred parent\nchar * username\nchar * password", + "type": "enum", + "file": "git2/diff.h", + "line": 518, + "lineto": 527, + "block": "GIT_DIFF_BINARY_NONE\nGIT_DIFF_BINARY_LITERAL\nGIT_DIFF_BINARY_DELTA", "tdef": "typedef", - "description": " A plaintext username and password ", + "description": " When producing a binary diff, the binary data returned will be\n either the deflated full (\"literal\") contents of the file, or\n the deflated binary delta between the two sides (whichever is\n smaller).", "comments": "", "fields": [ { - "type": "git_cred", - "name": "parent", - "comments": "" + "type": "int", + "name": "GIT_DIFF_BINARY_NONE", + "comments": "

There is no binary delta.

\n", + "value": 0 }, { - "type": "char *", - "name": "username", - "comments": "" + "type": "int", + "name": "GIT_DIFF_BINARY_LITERAL", + "comments": "

The binary data is the literal contents of the file.

\n", + "value": 1 }, { - "type": "char *", - "name": "password", - "comments": "" + "type": "int", + "name": "GIT_DIFF_BINARY_DELTA", + "comments": "

The binary data is the delta from one side to the other.

\n", + "value": 2 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_credtype_t", + "git_diff_delta", { "decl": [ - "GIT_CREDTYPE_USERPASS_PLAINTEXT", - "GIT_CREDTYPE_SSH_KEY", - "GIT_CREDTYPE_SSH_CUSTOM", - "GIT_CREDTYPE_DEFAULT", - "GIT_CREDTYPE_SSH_INTERACTIVE", - "GIT_CREDTYPE_USERNAME", - "GIT_CREDTYPE_SSH_MEMORY" + "git_delta_t status", + "uint32_t flags", + "uint16_t similarity", + "uint16_t nfiles", + "git_diff_file old_file", + "git_diff_file new_file" ], - "type": "enum", - "file": "transport.h", - "line": 81, - "lineto": 111, - "block": "GIT_CREDTYPE_USERPASS_PLAINTEXT\nGIT_CREDTYPE_SSH_KEY\nGIT_CREDTYPE_SSH_CUSTOM\nGIT_CREDTYPE_DEFAULT\nGIT_CREDTYPE_SSH_INTERACTIVE\nGIT_CREDTYPE_USERNAME\nGIT_CREDTYPE_SSH_MEMORY", + "type": "struct", + "value": "git_diff_delta", + "file": "git2/diff.h", + "line": 324, + "lineto": 331, + "block": "git_delta_t status\nuint32_t flags\nuint16_t similarity\nuint16_t nfiles\ngit_diff_file old_file\ngit_diff_file new_file", "tdef": "typedef", - "description": " Authentication type requested ", - "comments": "", + "description": " Description of changes to one entry.", + "comments": "

A delta is a file pair with an old and new revision. The old version may be absent if the file was just created and the new version may be absent if the file was deleted. A diff is mostly just a list of deltas.

\n\n

When iterating over a diff, this will be passed to most callbacks and you can use the contents to understand exactly what has changed.

\n\n

The old_file represents the "from" side of the diff and the new_file represents to "to" side of the diff. What those means depend on the function that was used to generate the diff and will be documented below. You can also use the GIT_DIFF_REVERSE flag to flip it around.

\n\n

Although the two sides of the delta are named "old_file" and "new_file", they actually may correspond to entries that represent a file, a symbolic link, a submodule commit id, or even a tree (if you are tracking type changes or ignored/untracked directories).

\n\n

Under some circumstances, in the name of efficiency, not all fields will be filled in, but we generally try to fill in as much as possible. One example is that the "flags" field may not have either the BINARY or the NOT_BINARY flag set to avoid examining file contents if you do not pass in hunk and/or line callbacks to the diff foreach iteration function. It will just use the git attributes for those files.

\n\n

The similarity score is zero unless you call git_diff_find_similar() which does a similarity analysis of files in the diff. Use that function to do rename and copy detection, and to split heavily modified files in add/delete pairs. After that call, deltas with a status of GIT_DELTA_RENAMED or GIT_DELTA_COPIED will have a similarity score between 0 and 100 indicating how similar the old and new sides are.

\n\n

If you ask git_diff_find_similar to find heavily modified files to break, but to not actually break the records, then GIT_DELTA_MODIFIED records may have a non-zero similarity score if the self-similarity is below the split threshold. To display this value like core Git, invert the score (a la printf("M%03d", 100 - delta->similarity)).

\n", "fields": [ + { "type": "git_delta_t", "name": "status", "comments": "" }, { - "type": "int", - "name": "GIT_CREDTYPE_USERPASS_PLAINTEXT", - "comments": "", - "value": 1 - }, - { - "type": "int", - "name": "GIT_CREDTYPE_SSH_KEY", - "comments": "", - "value": 2 - }, - { - "type": "int", - "name": "GIT_CREDTYPE_SSH_CUSTOM", - "comments": "", - "value": 4 - }, - { - "type": "int", - "name": "GIT_CREDTYPE_DEFAULT", - "comments": "", - "value": 8 + "type": "uint32_t", + "name": "flags", + "comments": " git_diff_flag_t values " }, { - "type": "int", - "name": "GIT_CREDTYPE_SSH_INTERACTIVE", - "comments": "", - "value": 16 + "type": "uint16_t", + "name": "similarity", + "comments": " for RENAMED and COPIED, value 0-100 " }, { - "type": "int", - "name": "GIT_CREDTYPE_USERNAME", - "comments": "

Username-only information

\n\n

If the SSH transport does not know which username to use,\n it will ask via this credential type.

\n", - "value": 32 + "type": "uint16_t", + "name": "nfiles", + "comments": " number of files in this delta " }, - { - "type": "int", - "name": "GIT_CREDTYPE_SSH_MEMORY", - "comments": "

Credentials read from memory.

\n\n

Only available for libssh2+OpenSSL for now.

\n", - "value": 64 - } + { "type": "git_diff_file", "name": "old_file", "comments": "" }, + { "type": "git_diff_file", "name": "new_file", "comments": "" } ], "used": { - "returns": [], - "needs": [] + "returns": [ + "git_diff_get_delta", + "git_patch_get_delta", + "git_pathspec_match_list_diff_entry" + ], + "needs": [ + "git_apply_delta_cb", + "git_diff_binary_cb", + "git_diff_file_cb", + "git_diff_hunk_cb", + "git_diff_line_cb", + "git_diff_notify_cb" + ] } } ], [ - "git_cvar_map", + "git_diff_file", { "decl": [ - "git_cvar_t cvar_type", - "const char * str_match", - "int map_value" + "git_oid id", + "const char * path", + "git_object_size_t size", + "uint32_t flags", + "uint16_t mode", + "uint16_t id_abbrev" ], "type": "struct", - "value": "git_cvar_map", - "file": "config.h", - "line": 93, - "lineto": 97, - "block": "git_cvar_t cvar_type\nconst char * str_match\nint map_value", + "value": "git_diff_file", + "file": "git2/diff.h", + "line": 245, + "lineto": 282, + "block": "git_oid id\nconst char * path\ngit_object_size_t size\nuint32_t flags\nuint16_t mode\nuint16_t id_abbrev", "tdef": "typedef", - "description": " Mapping from config variables to values.", - "comments": "", + "description": " Description of one side of a delta.", + "comments": "

Although this is called a "file", it could represent a file, a symbolic link, a submodule commit id, or even a tree (although that only if you are tracking type changes or ignored/untracked directories).

\n", "fields": [ { - "type": "git_cvar_t", - "name": "cvar_type", - "comments": "" + "type": "git_oid", + "name": "id", + "comments": " The `git_oid` of the item. If the entry represents an\n absent side of a diff (e.g. the `old_file` of a `GIT_DELTA_ADDED` delta),\n then the oid will be zeroes." }, { "type": "const char *", - "name": "str_match", - "comments": "" + "name": "path", + "comments": " The NUL-terminated path to the entry relative to the working\n directory of the repository." }, { - "type": "int", - "name": "map_value", - "comments": "" + "type": "git_object_size_t", + "name": "size", + "comments": " The size of the entry in bytes." + }, + { + "type": "uint32_t", + "name": "flags", + "comments": " A combination of the `git_diff_flag_t` types" + }, + { + "type": "uint16_t", + "name": "mode", + "comments": " Roughly, the stat() `st_mode` value for the item. This will\n be restricted to one of the `git_filemode_t` values." + }, + { + "type": "uint16_t", + "name": "id_abbrev", + "comments": " Represents the known length of the `id` field, when\n converted to a hex string. It is generally `GIT_OID_SHA1_HEXSIZE`, unless this\n delta was created from reading a patch file, in which case it may be\n abbreviated to something reasonable, like 7 characters." } ], "used": { "returns": [], "needs": [ - "git_config_get_mapped", - "git_config_lookup_map_value" + "git_checkout_notify_cb", + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_foreach" ] } } ], [ - "git_cvar_t", + "git_diff_find_options", { "decl": [ - "GIT_CVAR_FALSE", - "GIT_CVAR_TRUE", - "GIT_CVAR_INT32", - "GIT_CVAR_STRING" + "unsigned int version", + "uint32_t flags", + "uint16_t rename_threshold", + "uint16_t rename_from_rewrite_threshold", + "uint16_t copy_threshold", + "uint16_t break_rewrite_threshold", + "size_t rename_limit", + "git_diff_similarity_metric * metric" ], - "type": "enum", - "file": "config.h", - "line": 83, - "lineto": 88, - "block": "GIT_CVAR_FALSE\nGIT_CVAR_TRUE\nGIT_CVAR_INT32\nGIT_CVAR_STRING", + "type": "struct", + "value": "git_diff_find_options", + "file": "git2/diff.h", + "line": 774, + "lineto": 828, + "block": "unsigned int version\nuint32_t flags\nuint16_t rename_threshold\nuint16_t rename_from_rewrite_threshold\nuint16_t copy_threshold\nuint16_t break_rewrite_threshold\nsize_t rename_limit\ngit_diff_similarity_metric * metric", "tdef": "typedef", - "description": " Config var type", - "comments": "", + "description": " Control behavior of rename and copy detection", + "comments": "

These options mostly mimic parameters that can be passed to git-diff.

\n", "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "uint32_t", + "name": "flags", + "comments": " Combination of git_diff_find_t values (default GIT_DIFF_FIND_BY_CONFIG).\n NOTE: if you don't explicitly set this, `diff.renames` could be set\n to false, resulting in `git_diff_find_similar` doing nothing." + }, { - "type": "int", - "name": "GIT_CVAR_FALSE", - "comments": "", - "value": 0 + "type": "uint16_t", + "name": "rename_threshold", + "comments": " Threshold above which similar files will be considered renames.\n This is equivalent to the -M option. Defaults to 50." }, { - "type": "int", - "name": "GIT_CVAR_TRUE", - "comments": "", - "value": 1 + "type": "uint16_t", + "name": "rename_from_rewrite_threshold", + "comments": " Threshold below which similar files will be eligible to be a rename source.\n This is equivalent to the first part of the -B option. Defaults to 50." }, { - "type": "int", - "name": "GIT_CVAR_INT32", - "comments": "", - "value": 2 + "type": "uint16_t", + "name": "copy_threshold", + "comments": " Threshold above which similar files will be considered copies.\n This is equivalent to the -C option. Defaults to 50." }, { - "type": "int", - "name": "GIT_CVAR_STRING", - "comments": "", - "value": 3 + "type": "uint16_t", + "name": "break_rewrite_threshold", + "comments": " Threshold below which similar files will be split into a delete/add pair.\n This is equivalent to the last part of the -B option. Defaults to 60." + }, + { + "type": "size_t", + "name": "rename_limit", + "comments": " Maximum number of matches to consider for a particular file.\n\n This is a little different from the `-l` option from Git because we\n will still process up to this many matches before abandoning the search.\n Defaults to 1000." + }, + { + "type": "git_diff_similarity_metric *", + "name": "metric", + "comments": " The `metric` option allows you to plug in a custom similarity metric.\n\n Set it to NULL to use the default internal metric.\n\n The default metric is based on sampling hashes of ranges of data in\n the file, which is a pretty good similarity approximation that should\n work fairly well for both text and binary data while still being\n pretty fast with a fixed memory overhead." } ], "used": { "returns": [], - "needs": [] + "needs": ["git_diff_find_options_init", "git_diff_find_similar"] } } ], [ - "git_delta_t", + "git_diff_find_t", { "decl": [ - "GIT_DELTA_UNMODIFIED", - "GIT_DELTA_ADDED", - "GIT_DELTA_DELETED", - "GIT_DELTA_MODIFIED", - "GIT_DELTA_RENAMED", - "GIT_DELTA_COPIED", - "GIT_DELTA_IGNORED", - "GIT_DELTA_UNTRACKED", - "GIT_DELTA_TYPECHANGE", - "GIT_DELTA_UNREADABLE", - "GIT_DELTA_CONFLICTED" + "GIT_DIFF_FIND_BY_CONFIG", + "GIT_DIFF_FIND_RENAMES", + "GIT_DIFF_FIND_RENAMES_FROM_REWRITES", + "GIT_DIFF_FIND_COPIES", + "GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED", + "GIT_DIFF_FIND_REWRITES", + "GIT_DIFF_BREAK_REWRITES", + "GIT_DIFF_FIND_AND_BREAK_REWRITES", + "GIT_DIFF_FIND_FOR_UNTRACKED", + "GIT_DIFF_FIND_ALL", + "GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE", + "GIT_DIFF_FIND_IGNORE_WHITESPACE", + "GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE", + "GIT_DIFF_FIND_EXACT_MATCH_ONLY", + "GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY", + "GIT_DIFF_FIND_REMOVE_UNMODIFIED" ], "type": "enum", - "file": "diff.h", - "line": 246, - "lineto": 258, - "block": "GIT_DELTA_UNMODIFIED\nGIT_DELTA_ADDED\nGIT_DELTA_DELETED\nGIT_DELTA_MODIFIED\nGIT_DELTA_RENAMED\nGIT_DELTA_COPIED\nGIT_DELTA_IGNORED\nGIT_DELTA_UNTRACKED\nGIT_DELTA_TYPECHANGE\nGIT_DELTA_UNREADABLE\nGIT_DELTA_CONFLICTED", + "file": "git2/diff.h", + "line": 683, + "lineto": 752, + "block": "GIT_DIFF_FIND_BY_CONFIG\nGIT_DIFF_FIND_RENAMES\nGIT_DIFF_FIND_RENAMES_FROM_REWRITES\nGIT_DIFF_FIND_COPIES\nGIT_DIFF_FIND_COPIES_FROM_UNMODIFIED\nGIT_DIFF_FIND_REWRITES\nGIT_DIFF_BREAK_REWRITES\nGIT_DIFF_FIND_AND_BREAK_REWRITES\nGIT_DIFF_FIND_FOR_UNTRACKED\nGIT_DIFF_FIND_ALL\nGIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE\nGIT_DIFF_FIND_IGNORE_WHITESPACE\nGIT_DIFF_FIND_DONT_IGNORE_WHITESPACE\nGIT_DIFF_FIND_EXACT_MATCH_ONLY\nGIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY\nGIT_DIFF_FIND_REMOVE_UNMODIFIED", "tdef": "typedef", - "description": " What type of change is described by a git_diff_delta?", - "comments": "

GIT_DELTA_RENAMED and GIT_DELTA_COPIED will only show up if you run git_diff_find_similar() on the diff object.

\n\n

GIT_DELTA_TYPECHANGE only shows up given GIT_DIFF_INCLUDE_TYPECHANGE in the option flags (otherwise type changes will be split into ADDED / DELETED pairs).

\n", + "description": " Flags to control the behavior of diff rename/copy detection.", + "comments": "", "fields": [ { "type": "int", - "name": "GIT_DELTA_UNMODIFIED", - "comments": "

no changes

\n", + "name": "GIT_DIFF_FIND_BY_CONFIG", + "comments": "

Obey diff.renames. Overridden by any other GIT_DIFF_FIND_... flag.

\n", "value": 0 }, { "type": "int", - "name": "GIT_DELTA_ADDED", - "comments": "

entry does not exist in old version

\n", + "name": "GIT_DIFF_FIND_RENAMES", + "comments": "

Look for renames? (--find-renames)

\n", "value": 1 }, { "type": "int", - "name": "GIT_DELTA_DELETED", - "comments": "

entry does not exist in new version

\n", + "name": "GIT_DIFF_FIND_RENAMES_FROM_REWRITES", + "comments": "

Consider old side of MODIFIED for renames? (--break-rewrites=N)

\n", "value": 2 }, { "type": "int", - "name": "GIT_DELTA_MODIFIED", - "comments": "

entry content changed between old and new

\n", - "value": 3 - }, - { - "type": "int", - "name": "GIT_DELTA_RENAMED", - "comments": "

entry was renamed between old and new

\n", + "name": "GIT_DIFF_FIND_COPIES", + "comments": "

Look for copies? (a la --find-copies).

\n", "value": 4 }, { "type": "int", - "name": "GIT_DELTA_COPIED", - "comments": "

entry was copied from another old entry

\n", - "value": 5 + "name": "GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED", + "comments": "

Consider UNMODIFIED as copy sources? (--find-copies-harder).

\n\n

For this to work correctly, use GIT_DIFF_INCLUDE_UNMODIFIED when\n the initial git_diff is being generated.

\n", + "value": 8 }, { "type": "int", - "name": "GIT_DELTA_IGNORED", - "comments": "

entry is ignored item in workdir

\n", - "value": 6 + "name": "GIT_DIFF_FIND_REWRITES", + "comments": "

Mark significant rewrites for split (--break-rewrites=/M)

\n", + "value": 16 }, { "type": "int", - "name": "GIT_DELTA_UNTRACKED", - "comments": "

entry is untracked item in workdir

\n", - "value": 7 + "name": "GIT_DIFF_BREAK_REWRITES", + "comments": "

Actually split large rewrites into delete/add pairs

\n", + "value": 32 }, { "type": "int", - "name": "GIT_DELTA_TYPECHANGE", - "comments": "

type of entry changed between old and new

\n", - "value": 8 + "name": "GIT_DIFF_FIND_AND_BREAK_REWRITES", + "comments": "

Mark rewrites for split and break into delete/add pairs

\n", + "value": 48 }, { "type": "int", - "name": "GIT_DELTA_UNREADABLE", - "comments": "

entry is unreadable

\n", - "value": 9 + "name": "GIT_DIFF_FIND_FOR_UNTRACKED", + "comments": "

Find renames/copies for UNTRACKED items in working directory.

\n\n

For this to work correctly, use GIT_DIFF_INCLUDE_UNTRACKED when the\n initial git_diff is being generated (and obviously the diff must\n be against the working directory for this to make sense).

\n", + "value": 64 }, { "type": "int", - "name": "GIT_DELTA_CONFLICTED", - "comments": "

entry in the index is conflicted

\n", - "value": 10 - } - ], - "used": { - "returns": [], - "needs": [ - "git_diff_num_deltas_of_type", - "git_diff_status_char" - ] - } - } - ], - [ - "git_describe_format_options", - { - "decl": [ - "unsigned int version", - "unsigned int abbreviated_size", - "int always_use_long_format", - "const char * dirty_suffix" - ], - "type": "struct", - "value": "git_describe_format_options", - "file": "describe.h", - "line": 78, - "lineto": 98, - "block": "unsigned int version\nunsigned int abbreviated_size\nint always_use_long_format\nconst char * dirty_suffix", - "tdef": "typedef", - "description": " Options for formatting the describe string", - "comments": "", - "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, - { - "type": "unsigned int", - "name": "abbreviated_size", - "comments": " Size of the abbreviated commit id to use. This value is the\n lower bound for the length of the abbreviated string. The\n default is 7." + "name": "GIT_DIFF_FIND_ALL", + "comments": "

Turn on all finding features.

\n", + "value": 255 }, { "type": "int", - "name": "always_use_long_format", - "comments": " Set to use the long format even when a shorter name could be used." - }, - { - "type": "const char *", - "name": "dirty_suffix", - "comments": " If the workdir is dirty and this is set, this string will\n be appended to the description string." - } - ], - "used": { - "returns": [], - "needs": [ - "git_describe_format" - ] - } - } - ], - [ - "git_describe_options", - { - "decl": [ - "unsigned int version", - "unsigned int max_candidates_tags", - "unsigned int describe_strategy", - "const char * pattern", - "int only_follow_first_parent", - "int show_commit_oid_as_fallback" - ], - "type": "struct", - "value": "git_describe_options", - "file": "describe.h", - "line": 44, - "lineto": 62, - "block": "unsigned int version\nunsigned int max_candidates_tags\nunsigned int describe_strategy\nconst char * pattern\nint only_follow_first_parent\nint show_commit_oid_as_fallback", - "tdef": "typedef", - "description": " Describe options structure", - "comments": "

Initialize with GIT_DESCRIBE_OPTIONS_INIT macro to correctly set the version field. E.g.

\n\n
    git_describe_options opts = GIT_DESCRIBE_OPTIONS_INIT;\n
\n", - "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, - { - "type": "unsigned int", - "name": "max_candidates_tags", - "comments": " default: 10 " - }, - { - "type": "unsigned int", - "name": "describe_strategy", - "comments": " default: GIT_DESCRIBE_DEFAULT " + "name": "GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE", + "comments": "

Measure similarity ignoring leading whitespace (default)

\n", + "value": 0 }, { - "type": "const char *", - "name": "pattern", - "comments": "" + "type": "int", + "name": "GIT_DIFF_FIND_IGNORE_WHITESPACE", + "comments": "

Measure similarity ignoring all whitespace

\n", + "value": 4096 }, { "type": "int", - "name": "only_follow_first_parent", - "comments": " When calculating the distance from the matching tag or\n reference, only walk down the first-parent ancestry." + "name": "GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE", + "comments": "

Measure similarity including all data

\n", + "value": 8192 }, { "type": "int", - "name": "show_commit_oid_as_fallback", - "comments": " If no matching tag or reference is found, the describe\n operation would normally fail. If this option is set, it\n will instead fall back to showing the full id of the\n commit." - } - ], - "used": { - "returns": [], - "needs": [ - "git_describe_commit", - "git_describe_workdir" - ] - } - } - ], - [ - "git_describe_result", - { - "decl": "git_describe_result", - "type": "struct", - "value": "git_describe_result", - "file": "describe.h", - "line": 111, - "lineto": 111, - "tdef": "typedef", - "description": " A struct that stores the result of a describe operation.", - "comments": "", - "used": { - "returns": [], - "needs": [ - "git_describe_commit", - "git_describe_format", - "git_describe_result_free", - "git_describe_workdir" - ] - } + "name": "GIT_DIFF_FIND_EXACT_MATCH_ONLY", + "comments": "

Measure similarity only by comparing SHAs (fast and cheap)

\n", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY", + "comments": "

Do not break rewrites unless they contribute to a rename.

\n\n

Normally, GIT_DIFF_FIND_AND_BREAK_REWRITES will measure the self-\n similarity of modified files and split the ones that have changed a\n lot into a DELETE / ADD pair. Then the sides of that pair will be\n considered candidates for rename and copy detection.

\n\n

If you add this flag in and the split pair is not used for an\n actual rename or copy, then the modified record will be restored to\n a regular MODIFIED record instead of being split.

\n", + "value": 32768 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_REMOVE_UNMODIFIED", + "comments": "

Remove any UNMODIFIED deltas after find_similar is done.

\n\n

Using GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED to emulate the\n --find-copies-harder behavior requires building a diff with the\n GIT_DIFF_INCLUDE_UNMODIFIED flag. If you do not want UNMODIFIED\n records in the final result, pass this flag to have them removed.

\n", + "value": 65536 + } + ], + "used": { "returns": [], "needs": [] } } ], [ - "git_describe_strategy_t", + "git_diff_flag_t", { "decl": [ - "GIT_DESCRIBE_DEFAULT", - "GIT_DESCRIBE_TAGS", - "GIT_DESCRIBE_ALL" + "GIT_DIFF_FLAG_BINARY", + "GIT_DIFF_FLAG_NOT_BINARY", + "GIT_DIFF_FLAG_VALID_ID", + "GIT_DIFF_FLAG_EXISTS", + "GIT_DIFF_FLAG_VALID_SIZE" ], "type": "enum", - "file": "describe.h", - "line": 30, - "lineto": 34, - "block": "GIT_DESCRIBE_DEFAULT\nGIT_DESCRIBE_TAGS\nGIT_DESCRIBE_ALL", + "file": "git2/diff.h", + "line": 206, + "lineto": 212, + "block": "GIT_DIFF_FLAG_BINARY\nGIT_DIFF_FLAG_NOT_BINARY\nGIT_DIFF_FLAG_VALID_ID\nGIT_DIFF_FLAG_EXISTS\nGIT_DIFF_FLAG_VALID_SIZE", "tdef": "typedef", - "description": " Reference lookup strategy", - "comments": "

These behave like the --tags and --all optios to git-describe, namely they say to look for any reference in either refs/tags/ or refs/ respectively.

\n", + "description": " Flags for the delta object and the file objects on each side.", + "comments": "

These flags are used for both the flags value of the git_diff_delta and the flags for the git_diff_file objects representing the old and new sides of the delta. Values outside of this public range should be considered reserved for internal or future use.

\n", "fields": [ { "type": "int", - "name": "GIT_DESCRIBE_DEFAULT", - "comments": "", - "value": 0 + "name": "GIT_DIFF_FLAG_BINARY", + "comments": "

file(s) treated as binary data

\n", + "value": 1 }, { "type": "int", - "name": "GIT_DESCRIBE_TAGS", - "comments": "", - "value": 1 + "name": "GIT_DIFF_FLAG_NOT_BINARY", + "comments": "

file(s) treated as text data

\n", + "value": 2 }, { "type": "int", - "name": "GIT_DESCRIBE_ALL", - "comments": "", - "value": 2 + "name": "GIT_DIFF_FLAG_VALID_ID", + "comments": "

id value is known correct

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_DIFF_FLAG_EXISTS", + "comments": "

file exists at this side of the delta

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_DIFF_FLAG_VALID_SIZE", + "comments": "

file size value is known correct

\n", + "value": 16 } ], - "used": { - "returns": [], - "needs": [] - } - } - ], - [ - "git_diff", - { - "decl": "git_diff", - "type": "struct", - "value": "git_diff", - "file": "diff.h", - "line": 219, - "lineto": 219, - "tdef": "typedef", - "description": " The diff object that contains all individual file deltas.", - "comments": "

This is an opaque structure which will be allocated by one of the diff generator functions below (such as git_diff_tree_to_tree). You are responsible for releasing the object memory when done, using the git_diff_free() function.

\n", - "used": { - "returns": [ - "git_diff_get_delta", - "git_patch_get_delta", - "git_pathspec_match_list_diff_entry" - ], - "needs": [ - "git_checkout_notify_cb", - "git_diff_binary_cb", - "git_diff_blob_to_buffer", - "git_diff_blobs", - "git_diff_buffers", - "git_diff_commit_as_email", - "git_diff_file_cb", - "git_diff_find_init_options", - "git_diff_find_similar", - "git_diff_foreach", - "git_diff_format_email", - "git_diff_format_email_init_options", - "git_diff_free", - "git_diff_from_buffer", - "git_diff_get_delta", - "git_diff_get_perfdata", - "git_diff_get_stats", - "git_diff_hunk_cb", - "git_diff_index_to_index", - "git_diff_index_to_workdir", - "git_diff_init_options", - "git_diff_is_sorted_icase", - "git_diff_line_cb", - "git_diff_merge", - "git_diff_notify_cb", - "git_diff_num_deltas", - "git_diff_num_deltas_of_type", - "git_diff_print", - "git_diff_print_callback__to_buf", - "git_diff_print_callback__to_file_handle", - "git_diff_progress_cb", - "git_diff_stats_deletions", - "git_diff_stats_files_changed", - "git_diff_stats_free", - "git_diff_stats_insertions", - "git_diff_stats_to_buf", - "git_diff_to_buf", - "git_diff_tree_to_index", - "git_diff_tree_to_tree", - "git_diff_tree_to_workdir", - "git_diff_tree_to_workdir_with_index", - "git_patch_from_blob_and_buffer", - "git_patch_from_blobs", - "git_patch_from_buffers", - "git_patch_from_diff", - "git_patch_get_hunk", - "git_patch_get_line_in_hunk", - "git_patch_print", - "git_pathspec_match_diff", - "git_status_list_get_perfdata" - ] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_diff_binary", + "git_diff_format_email_flags_t", { "decl": [ - "unsigned int contains_data", - "git_diff_binary_file old_file", - "git_diff_binary_file new_file" + "GIT_DIFF_FORMAT_EMAIL_NONE", + "GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER" ], - "type": "struct", - "value": "git_diff_binary", - "file": "diff.h", - "line": 492, - "lineto": 503, - "block": "unsigned int contains_data\ngit_diff_binary_file old_file\ngit_diff_binary_file new_file", + "type": "enum", + "file": "git2/deprecated.h", + "line": 325, + "lineto": 331, + "block": "GIT_DIFF_FORMAT_EMAIL_NONE\nGIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER", "tdef": "typedef", - "description": " Structure describing the binary contents of a diff. ", + "description": " Formatting options for diff e-mail generation", "comments": "", "fields": [ { - "type": "unsigned int", - "name": "contains_data", - "comments": " Whether there is data in this binary structure or not. If this\n is `1`, then this was produced and included binary content. If\n this is `0` then this was generated knowing only that a binary\n file changed but without providing the data, probably from a patch\n that said `Binary files a/file.txt and b/file.txt differ`." - }, - { - "type": "git_diff_binary_file", - "name": "old_file", - "comments": " The contents of the old file. " + "type": "int", + "name": "GIT_DIFF_FORMAT_EMAIL_NONE", + "comments": "

Normal patch, the default

\n", + "value": 0 }, { - "type": "git_diff_binary_file", - "name": "new_file", - "comments": " The contents of the new file. " + "type": "int", + "name": "GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER", + "comments": "

Don't insert "[PATCH]" in the subject header

\n", + "value": 1 } ], - "used": { - "returns": [], - "needs": [ - "git_diff_binary_cb", - "git_diff_blob_to_buffer", - "git_diff_blobs", - "git_diff_buffers", - "git_diff_foreach" - ] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_diff_binary_file", + "git_diff_format_email_options", { "decl": [ - "git_diff_binary_t type", - "const char * data", - "size_t datalen", - "size_t inflatedlen" + "unsigned int version", + "uint32_t flags", + "size_t patch_no", + "size_t total_patches", + "const git_oid * id", + "const char * summary", + "const char * body", + "const git_signature * author" ], "type": "struct", - "value": "git_diff_binary_file", - "file": "diff.h", - "line": 477, - "lineto": 489, - "block": "git_diff_binary_t type\nconst char * data\nsize_t datalen\nsize_t inflatedlen", + "value": "git_diff_format_email_options", + "file": "git2/deprecated.h", + "line": 338, + "lineto": 361, + "block": "unsigned int version\nuint32_t flags\nsize_t patch_no\nsize_t total_patches\nconst git_oid * id\nconst char * summary\nconst char * body\nconst git_signature * author", "tdef": "typedef", - "description": " The contents of one of the files in a binary diff. ", + "description": " Options for controlling the formatting of the generated e-mail.", "comments": "", "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, { - "type": "git_diff_binary_t", - "name": "type", - "comments": " The type of binary data for this file. " + "type": "uint32_t", + "name": "flags", + "comments": " see `git_diff_format_email_flags_t` above " }, { - "type": "const char *", - "name": "data", - "comments": " The binary data, deflated. " + "type": "size_t", + "name": "patch_no", + "comments": " This patch number " }, { "type": "size_t", - "name": "datalen", - "comments": " The length of the binary data. " + "name": "total_patches", + "comments": " Total number of patches in this series " }, { - "type": "size_t", - "name": "inflatedlen", - "comments": " The length of the binary data after inflation. " + "type": "const git_oid *", + "name": "id", + "comments": " id to use for the commit " + }, + { + "type": "const char *", + "name": "summary", + "comments": " Summary of the change " + }, + { + "type": "const char *", + "name": "body", + "comments": " Commit message's body " + }, + { + "type": "const git_signature *", + "name": "author", + "comments": " Author of the change " } ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_diff_format_email", + "git_diff_format_email_options_init" + ] } } ], [ - "git_diff_binary_t", + "git_diff_format_t", { "decl": [ - "GIT_DIFF_BINARY_NONE", - "GIT_DIFF_BINARY_LITERAL", - "GIT_DIFF_BINARY_DELTA" + "GIT_DIFF_FORMAT_PATCH", + "GIT_DIFF_FORMAT_PATCH_HEADER", + "GIT_DIFF_FORMAT_RAW", + "GIT_DIFF_FORMAT_NAME_ONLY", + "GIT_DIFF_FORMAT_NAME_STATUS", + "GIT_DIFF_FORMAT_PATCH_ID" ], "type": "enum", - "file": "diff.h", - "line": 465, - "lineto": 474, - "block": "GIT_DIFF_BINARY_NONE\nGIT_DIFF_BINARY_LITERAL\nGIT_DIFF_BINARY_DELTA", + "file": "git2/diff.h", + "line": 1156, + "lineto": 1163, + "block": "GIT_DIFF_FORMAT_PATCH\nGIT_DIFF_FORMAT_PATCH_HEADER\nGIT_DIFF_FORMAT_RAW\nGIT_DIFF_FORMAT_NAME_ONLY\nGIT_DIFF_FORMAT_NAME_STATUS\nGIT_DIFF_FORMAT_PATCH_ID", "tdef": "typedef", - "description": " When producing a binary diff, the binary data returned will be\n either the deflated full (\"literal\") contents of the file, or\n the deflated binary delta between the two sides (whichever is\n smaller).", + "description": " Possible output formats for diff data", "comments": "", "fields": [ { "type": "int", - "name": "GIT_DIFF_BINARY_NONE", - "comments": "

There is no binary delta.

\n", - "value": 0 + "name": "GIT_DIFF_FORMAT_PATCH", + "comments": "

full git diff

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DIFF_FORMAT_PATCH_HEADER", + "comments": "

just the file headers of patch

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_DIFF_FORMAT_RAW", + "comments": "

like git diff --raw

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_DIFF_FORMAT_NAME_ONLY", + "comments": "

like git diff --name-only

\n", + "value": 4 }, { "type": "int", - "name": "GIT_DIFF_BINARY_LITERAL", - "comments": "

The binary data is the literal contents of the file.

\n", - "value": 1 + "name": "GIT_DIFF_FORMAT_NAME_STATUS", + "comments": "

like git diff --name-status

\n", + "value": 5 }, { "type": "int", - "name": "GIT_DIFF_BINARY_DELTA", - "comments": "

The binary data is the delta from one side to the other.

\n", - "value": 2 + "name": "GIT_DIFF_FORMAT_PATCH_ID", + "comments": "

git diff as used by git patch-id

\n", + "value": 6 } ], "used": { "returns": [], - "needs": [] + "needs": ["git_diff_print", "git_diff_to_buf"] } } ], [ - "git_diff_delta", + "git_diff_hunk", { "decl": [ - "git_delta_t status", - "uint32_t flags", - "uint16_t similarity", - "uint16_t nfiles", - "git_diff_file old_file", - "git_diff_file new_file" + "int old_start", + "int old_lines", + "int new_start", + "int new_lines", + "size_t header_len", + "char [128] header" ], "type": "struct", - "value": "git_diff_delta", - "file": "diff.h", - "line": 331, - "lineto": 338, - "block": "git_delta_t status\nuint32_t flags\nuint16_t similarity\nuint16_t nfiles\ngit_diff_file old_file\ngit_diff_file new_file", + "value": "git_diff_hunk", + "file": "git2/diff.h", + "line": 590, + "lineto": 597, + "block": "int old_start\nint old_lines\nint new_start\nint new_lines\nsize_t header_len\nchar [128] header", "tdef": "typedef", - "description": " Description of changes to one entry.", - "comments": "

When iterating over a diff, this will be passed to most callbacks and you can use the contents to understand exactly what has changed.

\n\n

The old_file represents the "from" side of the diff and the new_file represents to "to" side of the diff. What those means depend on the function that was used to generate the diff and will be documented below. You can also use the GIT_DIFF_REVERSE flag to flip it around.

\n\n

Although the two sides of the delta are named "old_file" and "new_file", they actually may correspond to entries that represent a file, a symbolic link, a submodule commit id, or even a tree (if you are tracking type changes or ignored/untracked directories).

\n\n

Under some circumstances, in the name of efficiency, not all fields will be filled in, but we generally try to fill in as much as possible. One example is that the "flags" field may not have either the BINARY or the NOT_BINARY flag set to avoid examining file contents if you do not pass in hunk and/or line callbacks to the diff foreach iteration function. It will just use the git attributes for those files.

\n\n

The similarity score is zero unless you call git_diff_find_similar() which does a similarity analysis of files in the diff. Use that function to do rename and copy detection, and to split heavily modified files in add/delete pairs. After that call, deltas with a status of GIT_DELTA_RENAMED or GIT_DELTA_COPIED will have a similarity score between 0 and 100 indicating how similar the old and new sides are.

\n\n

If you ask git_diff_find_similar to find heavily modified files to break, but to not actually break the records, then GIT_DELTA_MODIFIED records may have a non-zero similarity score if the self-similarity is below the split threshold. To display this value like core Git, invert the score (a la printf("M%03d", 100 - delta->similarity)).

\n", + "description": " Structure describing a hunk of a diff.", + "comments": "

A hunk is a span of modified lines in a delta along with some stable surrounding context. You can configure the amount of context and other properties of how hunks are generated. Each hunk also comes with a header that described where it starts and ends in both the old and new versions in the delta.

\n", "fields": [ { - "type": "git_delta_t", - "name": "status", - "comments": "" + "type": "int", + "name": "old_start", + "comments": " Starting line number in old_file " }, { - "type": "uint32_t", - "name": "flags", - "comments": " git_diff_flag_t values " + "type": "int", + "name": "old_lines", + "comments": " Number of lines in old_file " }, { - "type": "uint16_t", - "name": "similarity", - "comments": " for RENAMED and COPIED, value 0-100 " + "type": "int", + "name": "new_start", + "comments": " Starting line number in new_file " }, { - "type": "uint16_t", - "name": "nfiles", - "comments": " number of files in this delta " + "type": "int", + "name": "new_lines", + "comments": " Number of lines in new_file " }, { - "type": "git_diff_file", - "name": "old_file", - "comments": "" + "type": "size_t", + "name": "header_len", + "comments": " Number of bytes in header text " }, { - "type": "git_diff_file", - "name": "new_file", - "comments": "" + "type": "char [128]", + "name": "header", + "comments": " Header text, NUL-byte terminated " } ], "used": { - "returns": [ - "git_diff_get_delta", - "git_patch_get_delta", - "git_pathspec_match_list_diff_entry" - ], + "returns": [], "needs": [ - "git_diff_binary_cb", - "git_diff_file_cb", + "git_apply_hunk_cb", + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_foreach", "git_diff_hunk_cb", "git_diff_line_cb", - "git_diff_notify_cb", - "git_diff_print_callback__to_buf", - "git_diff_print_callback__to_file_handle" + "git_patch_get_hunk" ] } } ], [ - "git_diff_file", + "git_diff_line", { "decl": [ - "git_oid id", - "const char * path", - "git_off_t size", - "uint32_t flags", - "uint16_t mode", - "uint16_t id_abbrev" + "char origin", + "int old_lineno", + "int new_lineno", + "int num_lines", + "size_t content_len", + "git_off_t content_offset", + "const char * content" ], "type": "struct", - "value": "git_diff_file", - "file": "diff.h", - "line": 286, - "lineto": 293, - "block": "git_oid id\nconst char * path\ngit_off_t size\nuint32_t flags\nuint16_t mode\nuint16_t id_abbrev", + "value": "git_diff_line", + "file": "git2/diff.h", + "line": 650, + "lineto": 658, + "block": "char origin\nint old_lineno\nint new_lineno\nint num_lines\nsize_t content_len\ngit_off_t content_offset\nconst char * content", "tdef": "typedef", - "description": " Description of one side of a delta.", - "comments": "

Although this is called a "file", it could represent a file, a symbolic link, a submodule commit id, or even a tree (although that only if you are tracking type changes or ignored/untracked directories).

\n\n

The id is the git_oid of the item. If the entry represents an absent side of a diff (e.g. the old_file of a GIT_DELTA_ADDED delta), then the oid will be zeroes.

\n\n

path is the NUL-terminated path to the entry relative to the working directory of the repository.

\n\n

size is the size of the entry in bytes.

\n\n

flags is a combination of the git_diff_flag_t types

\n\n

mode is, roughly, the stat() st_mode value for the item. This will be restricted to one of the git_filemode_t values.

\n\n

The id_abbrev represents the known length of the id field, when converted to a hex string. It is generally GIT_OID_HEXSZ, unless this delta was created from reading a patch file, in which case it may be abbreviated to something reasonable, like 7 characters.

\n", + "description": " Structure describing a line (or data span) of a diff.", + "comments": "

A line is a range of characters inside a hunk. It could be a context line (i.e. in both old and new versions), an added line (i.e. only in the new version), or a removed line (i.e. only in the old version). Unfortunately, we don't know anything about the encoding of data in the file being diffed, so we cannot tell you much about the line content. Line data will not be NUL-byte terminated, however, because it will be just a span of bytes inside the larger file.

\n", "fields": [ { - "type": "git_oid", - "name": "id", - "comments": "" + "type": "char", + "name": "origin", + "comments": " A git_diff_line_t value " }, { - "type": "const char *", - "name": "path", - "comments": "" + "type": "int", + "name": "old_lineno", + "comments": " Line number in old file or -1 for added line " }, { - "type": "git_off_t", - "name": "size", - "comments": "" + "type": "int", + "name": "new_lineno", + "comments": " Line number in new file or -1 for deleted line " }, { - "type": "uint32_t", - "name": "flags", - "comments": "" + "type": "int", + "name": "num_lines", + "comments": " Number of newline characters in content " }, { - "type": "uint16_t", - "name": "mode", - "comments": "" + "type": "size_t", + "name": "content_len", + "comments": " Number of bytes of data " }, { - "type": "uint16_t", - "name": "id_abbrev", - "comments": "" + "type": "git_off_t", + "name": "content_offset", + "comments": " Offset in the original file to the content " + }, + { + "type": "const char *", + "name": "content", + "comments": " Pointer to diff text, not NUL-byte terminated " } ], "used": { "returns": [], "needs": [ - "git_checkout_notify_cb", "git_diff_blob_to_buffer", "git_diff_blobs", "git_diff_buffers", - "git_diff_foreach" + "git_diff_foreach", + "git_diff_line_cb", + "git_diff_print", + "git_patch_get_line_in_hunk", + "git_patch_print" ] } } ], [ - "git_diff_find_options", + "git_diff_line_t", { "decl": [ - "unsigned int version", - "uint32_t flags", - "uint16_t rename_threshold", - "uint16_t rename_from_rewrite_threshold", - "uint16_t copy_threshold", - "uint16_t break_rewrite_threshold", - "size_t rename_limit", - "git_diff_similarity_metric * metric" + "GIT_DIFF_LINE_CONTEXT", + "GIT_DIFF_LINE_ADDITION", + "GIT_DIFF_LINE_DELETION", + "GIT_DIFF_LINE_CONTEXT_EOFNL", + "GIT_DIFF_LINE_ADD_EOFNL", + "GIT_DIFF_LINE_DEL_EOFNL", + "GIT_DIFF_LINE_FILE_HDR", + "GIT_DIFF_LINE_HUNK_HDR", + "GIT_DIFF_LINE_BINARY" ], - "type": "struct", - "value": "git_diff_find_options", - "file": "diff.h", - "line": 697, - "lineto": 723, - "block": "unsigned int version\nuint32_t flags\nuint16_t rename_threshold\nuint16_t rename_from_rewrite_threshold\nuint16_t copy_threshold\nuint16_t break_rewrite_threshold\nsize_t rename_limit\ngit_diff_similarity_metric * metric", + "type": "enum", + "file": "git2/diff.h", + "line": 621, + "lineto": 637, + "block": "GIT_DIFF_LINE_CONTEXT\nGIT_DIFF_LINE_ADDITION\nGIT_DIFF_LINE_DELETION\nGIT_DIFF_LINE_CONTEXT_EOFNL\nGIT_DIFF_LINE_ADD_EOFNL\nGIT_DIFF_LINE_DEL_EOFNL\nGIT_DIFF_LINE_FILE_HDR\nGIT_DIFF_LINE_HUNK_HDR\nGIT_DIFF_LINE_BINARY", "tdef": "typedef", - "description": " Control behavior of rename and copy detection", - "comments": "

These options mostly mimic parameters that can be passed to git-diff.

\n\n\n\n

The metric option allows you to plug in a custom similarity metric. Set it to NULL for the default internal metric which is based on sampling hashes of ranges of data in the file. The default metric is a pretty good similarity approximation that should work fairly well for both text and binary data, and is pretty fast with fixed memory overhead.

\n", + "description": " Line origin constants.", + "comments": "

These values describe where a line came from and will be passed to the git_diff_line_cb when iterating over a diff. There are some special origin constants at the end that are used for the text output callbacks to demarcate lines that are actually part of the file or hunk headers.

\n", "fields": [ { - "type": "unsigned int", - "name": "version", - "comments": "" + "type": "int", + "name": "GIT_DIFF_LINE_CONTEXT", + "comments": "", + "value": 32 }, { - "type": "uint32_t", - "name": "flags", - "comments": " Combination of git_diff_find_t values (default GIT_DIFF_FIND_BY_CONFIG).\n NOTE: if you don't explicitly set this, `diff.renames` could be set\n to false, resulting in `git_diff_find_similar` doing nothing." + "type": "int", + "name": "GIT_DIFF_LINE_ADDITION", + "comments": "", + "value": 43 }, { - "type": "uint16_t", - "name": "rename_threshold", - "comments": " Similarity to consider a file renamed (default 50) " + "type": "int", + "name": "GIT_DIFF_LINE_DELETION", + "comments": "", + "value": 45 }, { - "type": "uint16_t", - "name": "rename_from_rewrite_threshold", - "comments": " Similarity of modified to be eligible rename source (default 50) " + "type": "int", + "name": "GIT_DIFF_LINE_CONTEXT_EOFNL", + "comments": "

Both files have no LF at end

\n", + "value": 61 }, { - "type": "uint16_t", - "name": "copy_threshold", - "comments": " Similarity to consider a file a copy (default 50) " + "type": "int", + "name": "GIT_DIFF_LINE_ADD_EOFNL", + "comments": "

Old has no LF at end, new does

\n", + "value": 62 }, { - "type": "uint16_t", - "name": "break_rewrite_threshold", - "comments": " Similarity to split modify into delete/add pair (default 60) " + "type": "int", + "name": "GIT_DIFF_LINE_DEL_EOFNL", + "comments": "

Old has LF at end, new does not

\n", + "value": 60 }, { - "type": "size_t", - "name": "rename_limit", - "comments": " Maximum similarity sources to examine for a file (somewhat like\n git-diff's `-l` option or `diff.renameLimit` config) (default 200)" + "type": "int", + "name": "GIT_DIFF_LINE_FILE_HDR", + "comments": "", + "value": 70 }, { - "type": "git_diff_similarity_metric *", - "name": "metric", - "comments": " Pluggable similarity metric; pass NULL to use internal metric " + "type": "int", + "name": "GIT_DIFF_LINE_HUNK_HDR", + "comments": "", + "value": 72 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_BINARY", + "comments": "

For "Binary files x and y differ"

\n", + "value": 66 } ], - "used": { - "returns": [], - "needs": [ - "git_diff_find_init_options", - "git_diff_find_similar" - ] - } - } - ], - [ - "git_diff_find_t", - { - "decl": [ - "GIT_DIFF_FIND_BY_CONFIG", - "GIT_DIFF_FIND_RENAMES", - "GIT_DIFF_FIND_RENAMES_FROM_REWRITES", - "GIT_DIFF_FIND_COPIES", - "GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED", - "GIT_DIFF_FIND_REWRITES", - "GIT_DIFF_BREAK_REWRITES", - "GIT_DIFF_FIND_AND_BREAK_REWRITES", - "GIT_DIFF_FIND_FOR_UNTRACKED", - "GIT_DIFF_FIND_ALL", - "GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE", - "GIT_DIFF_FIND_IGNORE_WHITESPACE", - "GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE", - "GIT_DIFF_FIND_EXACT_MATCH_ONLY", - "GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY", - "GIT_DIFF_FIND_REMOVE_UNMODIFIED" + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_diff_option_t", + { + "decl": [ + "GIT_DIFF_NORMAL", + "GIT_DIFF_REVERSE", + "GIT_DIFF_INCLUDE_IGNORED", + "GIT_DIFF_RECURSE_IGNORED_DIRS", + "GIT_DIFF_INCLUDE_UNTRACKED", + "GIT_DIFF_RECURSE_UNTRACKED_DIRS", + "GIT_DIFF_INCLUDE_UNMODIFIED", + "GIT_DIFF_INCLUDE_TYPECHANGE", + "GIT_DIFF_INCLUDE_TYPECHANGE_TREES", + "GIT_DIFF_IGNORE_FILEMODE", + "GIT_DIFF_IGNORE_SUBMODULES", + "GIT_DIFF_IGNORE_CASE", + "GIT_DIFF_INCLUDE_CASECHANGE", + "GIT_DIFF_DISABLE_PATHSPEC_MATCH", + "GIT_DIFF_SKIP_BINARY_CHECK", + "GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS", + "GIT_DIFF_UPDATE_INDEX", + "GIT_DIFF_INCLUDE_UNREADABLE", + "GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED", + "GIT_DIFF_INDENT_HEURISTIC", + "GIT_DIFF_IGNORE_BLANK_LINES", + "GIT_DIFF_FORCE_TEXT", + "GIT_DIFF_FORCE_BINARY", + "GIT_DIFF_IGNORE_WHITESPACE", + "GIT_DIFF_IGNORE_WHITESPACE_CHANGE", + "GIT_DIFF_IGNORE_WHITESPACE_EOL", + "GIT_DIFF_SHOW_UNTRACKED_CONTENT", + "GIT_DIFF_SHOW_UNMODIFIED", + "GIT_DIFF_PATIENCE", + "GIT_DIFF_MINIMAL", + "GIT_DIFF_SHOW_BINARY" ], "type": "enum", - "file": "diff.h", - "line": 591, - "lineto": 660, - "block": "GIT_DIFF_FIND_BY_CONFIG\nGIT_DIFF_FIND_RENAMES\nGIT_DIFF_FIND_RENAMES_FROM_REWRITES\nGIT_DIFF_FIND_COPIES\nGIT_DIFF_FIND_COPIES_FROM_UNMODIFIED\nGIT_DIFF_FIND_REWRITES\nGIT_DIFF_BREAK_REWRITES\nGIT_DIFF_FIND_AND_BREAK_REWRITES\nGIT_DIFF_FIND_FOR_UNTRACKED\nGIT_DIFF_FIND_ALL\nGIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE\nGIT_DIFF_FIND_IGNORE_WHITESPACE\nGIT_DIFF_FIND_DONT_IGNORE_WHITESPACE\nGIT_DIFF_FIND_EXACT_MATCH_ONLY\nGIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY\nGIT_DIFF_FIND_REMOVE_UNMODIFIED", + "file": "git2/diff.h", + "line": 28, + "lineto": 174, + "block": "GIT_DIFF_NORMAL\nGIT_DIFF_REVERSE\nGIT_DIFF_INCLUDE_IGNORED\nGIT_DIFF_RECURSE_IGNORED_DIRS\nGIT_DIFF_INCLUDE_UNTRACKED\nGIT_DIFF_RECURSE_UNTRACKED_DIRS\nGIT_DIFF_INCLUDE_UNMODIFIED\nGIT_DIFF_INCLUDE_TYPECHANGE\nGIT_DIFF_INCLUDE_TYPECHANGE_TREES\nGIT_DIFF_IGNORE_FILEMODE\nGIT_DIFF_IGNORE_SUBMODULES\nGIT_DIFF_IGNORE_CASE\nGIT_DIFF_INCLUDE_CASECHANGE\nGIT_DIFF_DISABLE_PATHSPEC_MATCH\nGIT_DIFF_SKIP_BINARY_CHECK\nGIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS\nGIT_DIFF_UPDATE_INDEX\nGIT_DIFF_INCLUDE_UNREADABLE\nGIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED\nGIT_DIFF_INDENT_HEURISTIC\nGIT_DIFF_IGNORE_BLANK_LINES\nGIT_DIFF_FORCE_TEXT\nGIT_DIFF_FORCE_BINARY\nGIT_DIFF_IGNORE_WHITESPACE\nGIT_DIFF_IGNORE_WHITESPACE_CHANGE\nGIT_DIFF_IGNORE_WHITESPACE_EOL\nGIT_DIFF_SHOW_UNTRACKED_CONTENT\nGIT_DIFF_SHOW_UNMODIFIED\nGIT_DIFF_PATIENCE\nGIT_DIFF_MINIMAL\nGIT_DIFF_SHOW_BINARY", "tdef": "typedef", - "description": " Flags to control the behavior of diff rename/copy detection.", + "description": " Flags for diff options. A combination of these flags can be passed\n in via the `flags` value in the `git_diff_options`.", "comments": "", "fields": [ { "type": "int", - "name": "GIT_DIFF_FIND_BY_CONFIG", - "comments": "

Obey diff.renames. Overridden by any other GIT_DIFF_FIND_... flag.

\n", + "name": "GIT_DIFF_NORMAL", + "comments": "

Normal diff, the default

\n", "value": 0 }, { "type": "int", - "name": "GIT_DIFF_FIND_RENAMES", - "comments": "

Look for renames? (--find-renames)

\n", + "name": "GIT_DIFF_REVERSE", + "comments": "

Reverse the sides of the diff

\n", "value": 1 }, { "type": "int", - "name": "GIT_DIFF_FIND_RENAMES_FROM_REWRITES", - "comments": "

Consider old side of MODIFIED for renames? (--break-rewrites=N)

\n", + "name": "GIT_DIFF_INCLUDE_IGNORED", + "comments": "

Include ignored files in the diff

\n", "value": 2 }, { "type": "int", - "name": "GIT_DIFF_FIND_COPIES", - "comments": "

Look for copies? (a la --find-copies).

\n", + "name": "GIT_DIFF_RECURSE_IGNORED_DIRS", + "comments": "

Even with GIT_DIFF_INCLUDE_IGNORED, an entire ignored directory\n will be marked with only a single entry in the diff; this flag\n adds all files under the directory as IGNORED entries, too.

\n", "value": 4 }, { "type": "int", - "name": "GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED", - "comments": "

Consider UNMODIFIED as copy sources? (--find-copies-harder).

\n\n

For this to work correctly, use GIT_DIFF_INCLUDE_UNMODIFIED when\n the initial git_diff is being generated.

\n", + "name": "GIT_DIFF_INCLUDE_UNTRACKED", + "comments": "

Include untracked files in the diff

\n", "value": 8 }, { "type": "int", - "name": "GIT_DIFF_FIND_REWRITES", - "comments": "

Mark significant rewrites for split (--break-rewrites=/M)

\n", + "name": "GIT_DIFF_RECURSE_UNTRACKED_DIRS", + "comments": "

Even with GIT_DIFF_INCLUDE_UNTRACKED, an entire untracked\n directory will be marked with only a single entry in the diff\n (a la what core Git does in git status); this flag adds all\n files under untracked directories as UNTRACKED entries, too.

\n", "value": 16 }, { "type": "int", - "name": "GIT_DIFF_BREAK_REWRITES", - "comments": "

Actually split large rewrites into delete/add pairs

\n", + "name": "GIT_DIFF_INCLUDE_UNMODIFIED", + "comments": "

Include unmodified files in the diff

\n", "value": 32 }, { "type": "int", - "name": "GIT_DIFF_FIND_AND_BREAK_REWRITES", - "comments": "

Mark rewrites for split and break into delete/add pairs

\n", - "value": 48 + "name": "GIT_DIFF_INCLUDE_TYPECHANGE", + "comments": "

Normally, a type change between files will be converted into a\n DELETED record for the old and an ADDED record for the new; this\n options enabled the generation of TYPECHANGE delta records.

\n", + "value": 64 }, { "type": "int", - "name": "GIT_DIFF_FIND_FOR_UNTRACKED", - "comments": "

Find renames/copies for UNTRACKED items in working directory.

\n\n

For this to work correctly, use GIT_DIFF_INCLUDE_UNTRACKED when the\n initial git_diff is being generated (and obviously the diff must\n be against the working directory for this to make sense).

\n", - "value": 64 + "name": "GIT_DIFF_INCLUDE_TYPECHANGE_TREES", + "comments": "

Even with GIT_DIFF_INCLUDE_TYPECHANGE, blob->tree changes still\n generally show as a DELETED blob. This flag tries to correctly\n label blob->tree transitions as TYPECHANGE records with new_file's\n mode set to tree. Note: the tree SHA will not be available.

\n", + "value": 128 }, { "type": "int", - "name": "GIT_DIFF_FIND_ALL", - "comments": "

Turn on all finding features.

\n", - "value": 255 + "name": "GIT_DIFF_IGNORE_FILEMODE", + "comments": "

Ignore file mode changes

\n", + "value": 256 }, { "type": "int", - "name": "GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE", - "comments": "

Measure similarity ignoring leading whitespace (default)

\n", - "value": 0 + "name": "GIT_DIFF_IGNORE_SUBMODULES", + "comments": "

Treat all submodules as unmodified

\n", + "value": 512 }, { "type": "int", - "name": "GIT_DIFF_FIND_IGNORE_WHITESPACE", - "comments": "

Measure similarity ignoring all whitespace

\n", + "name": "GIT_DIFF_IGNORE_CASE", + "comments": "

Use case insensitive filename comparisons

\n", + "value": 1024 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_CASECHANGE", + "comments": "

May be combined with GIT_DIFF_IGNORE_CASE to specify that a file\n that has changed case will be returned as an add/delete pair.

\n", + "value": 2048 + }, + { + "type": "int", + "name": "GIT_DIFF_DISABLE_PATHSPEC_MATCH", + "comments": "

If the pathspec is set in the diff options, this flags indicates\n that the paths will be treated as literal paths instead of\n fnmatch patterns. Each path in the list must either be a full\n path to a file or a directory. (A trailing slash indicates that\n the path will only match a directory). If a directory is\n specified, all children will be included.

\n", "value": 4096 }, { "type": "int", - "name": "GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE", - "comments": "

Measure similarity including all data

\n", + "name": "GIT_DIFF_SKIP_BINARY_CHECK", + "comments": "

Disable updating of the binary flag in delta records. This is\n useful when iterating over a diff if you don't need hunk and data\n callbacks and want to avoid having to load file completely.

\n", "value": 8192 }, { "type": "int", - "name": "GIT_DIFF_FIND_EXACT_MATCH_ONLY", - "comments": "

Measure similarity only by comparing SHAs (fast and cheap)

\n", + "name": "GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS", + "comments": "

When diff finds an untracked directory, to match the behavior of\n core Git, it scans the contents for IGNORED and UNTRACKED files.\n If all contents are IGNORED, then the directory is IGNORED; if\n any contents are not IGNORED, then the directory is UNTRACKED.\n This is extra work that may not matter in many cases. This flag\n turns off that scan and immediately labels an untracked directory\n as UNTRACKED (changing the behavior to not match core Git).

\n", "value": 16384 }, { "type": "int", - "name": "GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY", - "comments": "

Do not break rewrites unless they contribute to a rename.

\n\n

Normally, GIT_DIFF_FIND_AND_BREAK_REWRITES will measure the self-\n similarity of modified files and split the ones that have changed a\n lot into a DELETE / ADD pair. Then the sides of that pair will be\n considered candidates for rename and copy detection.

\n\n

If you add this flag in and the split pair is not used for an\n actual rename or copy, then the modified record will be restored to\n a regular MODIFIED record instead of being split.

\n", + "name": "GIT_DIFF_UPDATE_INDEX", + "comments": "

When diff finds a file in the working directory with stat\n information different from the index, but the OID ends up being the\n same, write the correct stat information into the index. Note:\n without this flag, diff will always leave the index untouched.

\n", "value": 32768 }, { "type": "int", - "name": "GIT_DIFF_FIND_REMOVE_UNMODIFIED", - "comments": "

Remove any UNMODIFIED deltas after find_similar is done.

\n\n

Using GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED to emulate the\n --find-copies-harder behavior requires building a diff with the\n GIT_DIFF_INCLUDE_UNMODIFIED flag. If you do not want UNMODIFIED\n records in the final result, pass this flag to have them removed.

\n", + "name": "GIT_DIFF_INCLUDE_UNREADABLE", + "comments": "

Include unreadable files in the diff

\n", "value": 65536 - } - ], - "used": { - "returns": [], - "needs": [] - } - } - ], - [ - "git_diff_flag_t", - { - "decl": [ - "GIT_DIFF_FLAG_BINARY", - "GIT_DIFF_FLAG_NOT_BINARY", - "GIT_DIFF_FLAG_VALID_ID", - "GIT_DIFF_FLAG_EXISTS" - ], - "type": "enum", - "file": "diff.h", - "line": 229, - "lineto": 234, - "block": "GIT_DIFF_FLAG_BINARY\nGIT_DIFF_FLAG_NOT_BINARY\nGIT_DIFF_FLAG_VALID_ID\nGIT_DIFF_FLAG_EXISTS", - "tdef": "typedef", - "description": " Flags for the delta object and the file objects on each side.", - "comments": "

These flags are used for both the flags value of the git_diff_delta and the flags for the git_diff_file objects representing the old and new sides of the delta. Values outside of this public range should be considered reserved for internal or future use.

\n", - "fields": [ + }, { "type": "int", - "name": "GIT_DIFF_FLAG_BINARY", - "comments": "

file(s) treated as binary data

\n", - "value": 1 + "name": "GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED", + "comments": "

Include unreadable files in the diff

\n", + "value": 131072 }, { "type": "int", - "name": "GIT_DIFF_FLAG_NOT_BINARY", - "comments": "

file(s) treated as text data

\n", - "value": 2 + "name": "GIT_DIFF_INDENT_HEURISTIC", + "comments": "

Use a heuristic that takes indentation and whitespace into account\n which generally can produce better diffs when dealing with ambiguous\n diff hunks.

\n", + "value": 262144 }, { "type": "int", - "name": "GIT_DIFF_FLAG_VALID_ID", - "comments": "

id value is known correct

\n", - "value": 4 + "name": "GIT_DIFF_IGNORE_BLANK_LINES", + "comments": "

Ignore blank lines

\n", + "value": 524288 }, { "type": "int", - "name": "GIT_DIFF_FLAG_EXISTS", - "comments": "

file exists at this side of the delta

\n", - "value": 8 - } - ], - "used": { - "returns": [], - "needs": [] - } - } - ], - [ - "git_diff_format_email_flags_t", - { - "decl": [ - "GIT_DIFF_FORMAT_EMAIL_NONE", - "GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER" - ], - "type": "enum", - "file": "diff.h", - "line": 1315, - "lineto": 1322, - "block": "GIT_DIFF_FORMAT_EMAIL_NONE\nGIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER", - "tdef": "typedef", - "description": " Formatting options for diff e-mail generation", - "comments": "", - "fields": [ + "name": "GIT_DIFF_FORCE_TEXT", + "comments": "

Treat all files as text, disabling binary attributes \n&\n detection

\n", + "value": 1048576 + }, { "type": "int", - "name": "GIT_DIFF_FORMAT_EMAIL_NONE", - "comments": "

Normal patch, the default

\n", - "value": 0 + "name": "GIT_DIFF_FORCE_BINARY", + "comments": "

Treat all files as binary, disabling text diffs

\n", + "value": 2097152 }, { "type": "int", - "name": "GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER", - "comments": "

Don't insert "[PATCH]" in the subject header

\n", - "value": 1 + "name": "GIT_DIFF_IGNORE_WHITESPACE", + "comments": "

Ignore all whitespace

\n", + "value": 4194304 + }, + { + "type": "int", + "name": "GIT_DIFF_IGNORE_WHITESPACE_CHANGE", + "comments": "

Ignore changes in amount of whitespace

\n", + "value": 8388608 + }, + { + "type": "int", + "name": "GIT_DIFF_IGNORE_WHITESPACE_EOL", + "comments": "

Ignore whitespace at end of line

\n", + "value": 16777216 + }, + { + "type": "int", + "name": "GIT_DIFF_SHOW_UNTRACKED_CONTENT", + "comments": "

When generating patch text, include the content of untracked\n files. This automatically turns on GIT_DIFF_INCLUDE_UNTRACKED but\n it does not turn on GIT_DIFF_RECURSE_UNTRACKED_DIRS. Add that\n flag if you want the content of every single UNTRACKED file.

\n", + "value": 33554432 + }, + { + "type": "int", + "name": "GIT_DIFF_SHOW_UNMODIFIED", + "comments": "

When generating output, include the names of unmodified files if\n they are included in the git_diff. Normally these are skipped in\n the formats that list files (e.g. name-only, name-status, raw).\n Even with this, these will not be included in patch format.

\n", + "value": 67108864 + }, + { + "type": "int", + "name": "GIT_DIFF_PATIENCE", + "comments": "

Use the "patience diff" algorithm

\n", + "value": 268435456 + }, + { + "type": "int", + "name": "GIT_DIFF_MINIMAL", + "comments": "

Take extra time to find minimal diff

\n", + "value": 536870912 + }, + { + "type": "int", + "name": "GIT_DIFF_SHOW_BINARY", + "comments": "

Include the necessary deflate / delta information so that git-apply\n can apply given diff information to binary files.

\n", + "value": 1073741824 } ], - "used": { - "returns": [], - "needs": [ - "git_diff_commit_as_email" - ] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_diff_format_email_options", + "git_diff_options", { "decl": [ "unsigned int version", - "git_diff_format_email_flags_t flags", - "size_t patch_no", - "size_t total_patches", - "const git_oid * id", - "const char * summary", - "const char * body", - "const git_signature * author" + "uint32_t flags", + "git_submodule_ignore_t ignore_submodules", + "git_strarray pathspec", + "git_diff_notify_cb notify_cb", + "git_diff_progress_cb progress_cb", + "void * payload", + "uint32_t context_lines", + "uint32_t interhunk_lines", + "git_oid_t oid_type", + "uint16_t id_abbrev", + "git_off_t max_size", + "const char * old_prefix", + "const char * new_prefix" ], "type": "struct", - "value": "git_diff_format_email_options", - "file": "diff.h", - "line": 1327, - "lineto": 1349, - "block": "unsigned int version\ngit_diff_format_email_flags_t flags\nsize_t patch_no\nsize_t total_patches\nconst git_oid * id\nconst char * summary\nconst char * body\nconst git_signature * author", + "value": "git_diff_options", + "file": "git2/diff.h", + "line": 383, + "lineto": 471, + "block": "unsigned int version\nuint32_t flags\ngit_submodule_ignore_t ignore_submodules\ngit_strarray pathspec\ngit_diff_notify_cb notify_cb\ngit_diff_progress_cb progress_cb\nvoid * payload\nuint32_t context_lines\nuint32_t interhunk_lines\ngit_oid_t oid_type\nuint16_t id_abbrev\ngit_off_t max_size\nconst char * old_prefix\nconst char * new_prefix", "tdef": "typedef", - "description": " Options for controlling the formatting of the generated e-mail.", - "comments": "", + "description": " Structure describing options about how the diff should be executed.", + "comments": "

Setting all values of the structure to zero will yield the default values. Similarly, passing NULL for the options structure will give the defaults. The default values are marked below.

\n", "fields": [ { "type": "unsigned int", "name": "version", - "comments": "" + "comments": " version for the struct " }, { - "type": "git_diff_format_email_flags_t", + "type": "uint32_t", "name": "flags", - "comments": "" + "comments": " A combination of `git_diff_option_t` values above.\n Defaults to GIT_DIFF_NORMAL" }, { - "type": "size_t", - "name": "patch_no", - "comments": " This patch number " + "type": "git_submodule_ignore_t", + "name": "ignore_submodules", + "comments": " Overrides the submodule ignore setting for all submodules in the diff. " }, { - "type": "size_t", - "name": "total_patches", - "comments": " Total number of patches in this series " + "type": "git_strarray", + "name": "pathspec", + "comments": " An array of paths / fnmatch patterns to constrain diff.\n All paths are included by default." }, { - "type": "const git_oid *", - "name": "id", - "comments": " id to use for the commit " + "type": "git_diff_notify_cb", + "name": "notify_cb", + "comments": " An optional callback function, notifying the consumer of changes to\n the diff as new deltas are added." }, { - "type": "const char *", - "name": "summary", - "comments": " Summary of the change " + "type": "git_diff_progress_cb", + "name": "progress_cb", + "comments": " An optional callback function, notifying the consumer of which files\n are being examined as the diff is generated." }, { - "type": "const char *", - "name": "body", - "comments": " Commit message's body " + "type": "void *", + "name": "payload", + "comments": " The payload to pass to the callback functions. " }, { - "type": "const git_signature *", - "name": "author", - "comments": " Author of the change " - } - ], - "used": { - "returns": [], - "needs": [ - "git_diff_format_email", - "git_diff_format_email_init_options" - ] - } - } - ], - [ - "git_diff_format_t", - { - "decl": [ - "GIT_DIFF_FORMAT_PATCH", - "GIT_DIFF_FORMAT_PATCH_HEADER", - "GIT_DIFF_FORMAT_RAW", - "GIT_DIFF_FORMAT_NAME_ONLY", - "GIT_DIFF_FORMAT_NAME_STATUS" - ], - "type": "enum", - "file": "diff.h", - "line": 1039, - "lineto": 1045, - "block": "GIT_DIFF_FORMAT_PATCH\nGIT_DIFF_FORMAT_PATCH_HEADER\nGIT_DIFF_FORMAT_RAW\nGIT_DIFF_FORMAT_NAME_ONLY\nGIT_DIFF_FORMAT_NAME_STATUS", - "tdef": "typedef", - "description": " Possible output formats for diff data", - "comments": "", - "fields": [ + "type": "uint32_t", + "name": "context_lines", + "comments": " The number of unchanged lines that define the boundary of a hunk\n (and to display before and after). Defaults to 3." + }, { - "type": "int", - "name": "GIT_DIFF_FORMAT_PATCH", - "comments": "

full git diff

\n", - "value": 1 + "type": "uint32_t", + "name": "interhunk_lines", + "comments": " The maximum number of unchanged lines between hunk boundaries before\n the hunks will be merged into one. Defaults to 0." }, { - "type": "int", - "name": "GIT_DIFF_FORMAT_PATCH_HEADER", - "comments": "

just the file headers of patch

\n", - "value": 2 + "type": "git_oid_t", + "name": "oid_type", + "comments": " The object ID type to emit in diffs; this is used by functions\n that operate without a repository - namely `git_diff_buffers`,\n or `git_diff_blobs` and `git_diff_blob_to_buffer` when one blob\n is `NULL`.\n\n This may be omitted (set to `0`). If a repository is available,\n the object ID format of the repository will be used. If no\n repository is available then the default is `GIT_OID_SHA`.\n\n If this is specified and a repository is available, then the\n specified `oid_type` must match the repository's object ID\n format." }, { - "type": "int", - "name": "GIT_DIFF_FORMAT_RAW", - "comments": "

like git diff --raw

\n", - "value": 3 + "type": "uint16_t", + "name": "id_abbrev", + "comments": " The abbreviation length to use when formatting object ids.\n Defaults to the value of 'core.abbrev' from the config, or 7 if unset." }, { - "type": "int", - "name": "GIT_DIFF_FORMAT_NAME_ONLY", - "comments": "

like git diff --name-only

\n", - "value": 4 + "type": "git_off_t", + "name": "max_size", + "comments": " A size (in bytes) above which a blob will be marked as binary\n automatically; pass a negative value to disable.\n Defaults to 512MB." }, { - "type": "int", - "name": "GIT_DIFF_FORMAT_NAME_STATUS", - "comments": "

like git diff --name-status

\n", - "value": 5 + "type": "const char *", + "name": "old_prefix", + "comments": " The virtual \"directory\" prefix for old file names in hunk headers.\n Default is \"a\"." + }, + { + "type": "const char *", + "name": "new_prefix", + "comments": " The virtual \"directory\" prefix for new file names in hunk headers.\n Defaults to \"b\"." } ], "used": { "returns": [], "needs": [ - "git_diff_print", - "git_diff_to_buf" + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_commit_as_email", + "git_diff_index_to_index", + "git_diff_index_to_workdir", + "git_diff_options_init", + "git_diff_tree_to_index", + "git_diff_tree_to_tree", + "git_diff_tree_to_workdir", + "git_diff_tree_to_workdir_with_index", + "git_patch_from_blob_and_buffer", + "git_patch_from_blobs", + "git_patch_from_buffers" ] } } ], [ - "git_diff_hunk", + "git_diff_parse_options", { - "decl": [ - "int old_start", - "int old_lines", - "int new_start", - "int new_lines", - "size_t header_len", - "char [128] header" - ], + "decl": ["unsigned int version", "git_oid_t oid_type"], "type": "struct", - "value": "git_diff_hunk", - "file": "diff.h", - "line": 517, - "lineto": 524, - "block": "int old_start\nint old_lines\nint new_start\nint new_lines\nsize_t header_len\nchar [128] header", + "value": "git_diff_parse_options", + "file": "git2/diff.h", + "line": 1322, + "lineto": 1325, + "block": "unsigned int version\ngit_oid_t oid_type", "tdef": "typedef", - "description": " Structure describing a hunk of a diff.", + "description": " Options for parsing a diff / patch file.", "comments": "", "fields": [ - { - "type": "int", - "name": "old_start", - "comments": "" - }, - { - "type": "int", - "name": "old_lines", - "comments": " Starting line number in old_file " - }, - { - "type": "int", - "name": "new_start", - "comments": " Number of lines in old_file " - }, - { - "type": "int", - "name": "new_lines", - "comments": " Starting line number in new_file " - }, - { - "type": "size_t", - "name": "header_len", - "comments": " Number of lines in new_file " - }, - { - "type": "char [128]", - "name": "header", - "comments": " Number of bytes in header text " - } + { "type": "unsigned int", "name": "version", "comments": "" }, + { "type": "git_oid_t", "name": "oid_type", "comments": "" } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_diff_patchid_options", + { + "decl": ["unsigned int version"], + "type": "struct", + "value": "git_diff_patchid_options", + "file": "git2/diff.h", + "line": 1459, + "lineto": 1461, + "block": "unsigned int version", + "tdef": "typedef", + "description": " Patch ID options structure", + "comments": "

Initialize with GIT_PATCHID_OPTIONS_INIT. Alternatively, you can use git_diff_patchid_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" } ], "used": { "returns": [], - "needs": [ - "git_diff_blob_to_buffer", - "git_diff_blobs", - "git_diff_buffers", - "git_diff_foreach", - "git_diff_hunk_cb", - "git_diff_line_cb", - "git_diff_print_callback__to_buf", - "git_diff_print_callback__to_file_handle", - "git_patch_get_hunk" - ] + "needs": ["git_diff_patchid", "git_diff_patchid_options_init"] } } ], [ - "git_diff_line", + "git_diff_similarity_metric", { "decl": [ - "char origin", - "int old_lineno", - "int new_lineno", - "int num_lines", - "size_t content_len", - "git_off_t content_offset", - "const char * content" + "int (*)(void **, const git_diff_file *, const char *, void *) file_signature", + "int (*)(void **, const git_diff_file *, const char *, size_t, void *) buffer_signature", + "void (*)(void *, void *) free_signature", + "int (*)(int *, void *, void *, void *) similarity", + "void * payload" ], "type": "struct", - "value": "git_diff_line", - "file": "diff.h", - "line": 564, - "lineto": 572, - "block": "char origin\nint old_lineno\nint new_lineno\nint num_lines\nsize_t content_len\ngit_off_t content_offset\nconst char * content", + "value": "git_diff_similarity_metric", + "file": "git2/diff.h", + "line": 757, + "lineto": 767, + "block": "int (*)(void **, const git_diff_file *, const char *, void *) file_signature\nint (*)(void **, const git_diff_file *, const char *, size_t, void *) buffer_signature\nvoid (*)(void *, void *) free_signature\nint (*)(int *, void *, void *, void *) similarity\nvoid * payload", "tdef": "typedef", - "description": " Structure describing a line (or data span) of a diff.", + "description": " Pluggable similarity metric", "comments": "", "fields": [ { - "type": "char", - "name": "origin", - "comments": " A git_diff_line_t value " - }, - { - "type": "int", - "name": "old_lineno", - "comments": " Line number in old file or -1 for added line " - }, - { - "type": "int", - "name": "new_lineno", - "comments": " Line number in new file or -1 for deleted line " + "type": "int (*)(void **, const git_diff_file *, const char *, void *)", + "name": "file_signature", + "comments": "" }, { - "type": "int", - "name": "num_lines", - "comments": " Number of newline characters in content " + "type": "int (*)(void **, const git_diff_file *, const char *, size_t, void *)", + "name": "buffer_signature", + "comments": "" }, { - "type": "size_t", - "name": "content_len", - "comments": " Number of bytes of data " + "type": "void (*)(void *, void *)", + "name": "free_signature", + "comments": "" }, { - "type": "git_off_t", - "name": "content_offset", - "comments": " Offset in the original file to the content " + "type": "int (*)(int *, void *, void *, void *)", + "name": "similarity", + "comments": "" }, - { - "type": "const char *", - "name": "content", - "comments": " Pointer to diff text, not NUL-byte terminated " - } + { "type": "void *", "name": "payload", "comments": "" } ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_diff_stats", + { + "decl": "git_diff_stats", + "type": "struct", + "value": "git_diff_stats", + "file": "git2/diff.h", + "line": 1369, + "lineto": 1369, + "tdef": "typedef", + "description": " This is an opaque structure which is allocated by `git_diff_get_stats`.\n You are responsible for releasing the object memory when done, using the\n `git_diff_stats_free()` function.", + "comments": "", "used": { "returns": [], "needs": [ - "git_diff_blob_to_buffer", - "git_diff_blobs", - "git_diff_buffers", - "git_diff_foreach", - "git_diff_line_cb", - "git_diff_print", - "git_diff_print_callback__to_buf", - "git_diff_print_callback__to_file_handle", - "git_patch_get_line_in_hunk", - "git_patch_print" + "git_diff_get_stats", + "git_diff_stats_deletions", + "git_diff_stats_files_changed", + "git_diff_stats_free", + "git_diff_stats_insertions", + "git_diff_stats_to_buf" ] } } ], [ - "git_diff_line_t", + "git_diff_stats_format_t", { "decl": [ - "GIT_DIFF_LINE_CONTEXT", - "GIT_DIFF_LINE_ADDITION", - "GIT_DIFF_LINE_DELETION", - "GIT_DIFF_LINE_CONTEXT_EOFNL", - "GIT_DIFF_LINE_ADD_EOFNL", - "GIT_DIFF_LINE_DEL_EOFNL", - "GIT_DIFF_LINE_FILE_HDR", - "GIT_DIFF_LINE_HUNK_HDR", - "GIT_DIFF_LINE_BINARY" + "GIT_DIFF_STATS_NONE", + "GIT_DIFF_STATS_FULL", + "GIT_DIFF_STATS_SHORT", + "GIT_DIFF_STATS_NUMBER", + "GIT_DIFF_STATS_INCLUDE_SUMMARY" ], "type": "enum", - "file": "diff.h", - "line": 543, - "lineto": 559, - "block": "GIT_DIFF_LINE_CONTEXT\nGIT_DIFF_LINE_ADDITION\nGIT_DIFF_LINE_DELETION\nGIT_DIFF_LINE_CONTEXT_EOFNL\nGIT_DIFF_LINE_ADD_EOFNL\nGIT_DIFF_LINE_DEL_EOFNL\nGIT_DIFF_LINE_FILE_HDR\nGIT_DIFF_LINE_HUNK_HDR\nGIT_DIFF_LINE_BINARY", + "file": "git2/diff.h", + "line": 1374, + "lineto": 1389, + "block": "GIT_DIFF_STATS_NONE\nGIT_DIFF_STATS_FULL\nGIT_DIFF_STATS_SHORT\nGIT_DIFF_STATS_NUMBER\nGIT_DIFF_STATS_INCLUDE_SUMMARY", "tdef": "typedef", - "description": " Line origin constants.", - "comments": "

These values describe where a line came from and will be passed to the git_diff_line_cb when iterating over a diff. There are some special origin constants at the end that are used for the text output callbacks to demarcate lines that are actually part of the file or hunk headers.

\n", + "description": " Formatting options for diff stats", + "comments": "", "fields": [ { "type": "int", - "name": "GIT_DIFF_LINE_CONTEXT", - "comments": "", - "value": 32 - }, - { - "type": "int", - "name": "GIT_DIFF_LINE_ADDITION", - "comments": "", - "value": 43 + "name": "GIT_DIFF_STATS_NONE", + "comments": "

No stats

\n", + "value": 0 }, { "type": "int", - "name": "GIT_DIFF_LINE_DELETION", - "comments": "", - "value": 45 + "name": "GIT_DIFF_STATS_FULL", + "comments": "

Full statistics, equivalent of --stat

\n", + "value": 1 }, { "type": "int", - "name": "GIT_DIFF_LINE_CONTEXT_EOFNL", - "comments": "

Both files have no LF at end

\n", - "value": 61 + "name": "GIT_DIFF_STATS_SHORT", + "comments": "

Short statistics, equivalent of --shortstat

\n", + "value": 2 }, { "type": "int", - "name": "GIT_DIFF_LINE_ADD_EOFNL", - "comments": "

Old has no LF at end, new does

\n", - "value": 62 + "name": "GIT_DIFF_STATS_NUMBER", + "comments": "

Number statistics, equivalent of --numstat

\n", + "value": 4 }, { "type": "int", - "name": "GIT_DIFF_LINE_DEL_EOFNL", - "comments": "

Old has LF at end, new does not

\n", - "value": 60 - }, + "name": "GIT_DIFF_STATS_INCLUDE_SUMMARY", + "comments": "

Extended header information such as creations, renames and mode changes, equivalent of --summary

\n", + "value": 8 + } + ], + "used": { "returns": [], "needs": ["git_diff_stats_to_buf"] } + } + ], + [ + "git_direction", + { + "decl": ["GIT_DIRECTION_FETCH", "GIT_DIRECTION_PUSH"], + "type": "enum", + "file": "git2/net.h", + "line": 32, + "lineto": 35, + "block": "GIT_DIRECTION_FETCH\nGIT_DIRECTION_PUSH", + "tdef": "typedef", + "description": " Direction of the connection.", + "comments": "

We need this because we need to know whether we should call git-upload-pack or git-receive-pack on the remote end when get_refs gets called.

\n", + "fields": [ { "type": "int", - "name": "GIT_DIFF_LINE_FILE_HDR", + "name": "GIT_DIRECTION_FETCH", "comments": "", - "value": 70 + "value": 0 }, { "type": "int", - "name": "GIT_DIFF_LINE_HUNK_HDR", + "name": "GIT_DIRECTION_PUSH", "comments": "", - "value": 72 - }, - { - "type": "int", - "name": "GIT_DIFF_LINE_BINARY", - "comments": "

For "Binary files x and y differ"

\n", - "value": 66 + "value": 1 } ], "used": { - "returns": [], - "needs": [] + "returns": ["git_refspec_direction"], + "needs": ["git_remote_connect", "git_remote_connect_ext"] } } ], [ - "git_diff_option_t", + "git_email_create_flags_t", { "decl": [ - "GIT_DIFF_NORMAL", - "GIT_DIFF_REVERSE", - "GIT_DIFF_INCLUDE_IGNORED", - "GIT_DIFF_RECURSE_IGNORED_DIRS", - "GIT_DIFF_INCLUDE_UNTRACKED", - "GIT_DIFF_RECURSE_UNTRACKED_DIRS", - "GIT_DIFF_INCLUDE_UNMODIFIED", - "GIT_DIFF_INCLUDE_TYPECHANGE", - "GIT_DIFF_INCLUDE_TYPECHANGE_TREES", - "GIT_DIFF_IGNORE_FILEMODE", - "GIT_DIFF_IGNORE_SUBMODULES", - "GIT_DIFF_IGNORE_CASE", - "GIT_DIFF_INCLUDE_CASECHANGE", - "GIT_DIFF_DISABLE_PATHSPEC_MATCH", - "GIT_DIFF_SKIP_BINARY_CHECK", - "GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS", - "GIT_DIFF_UPDATE_INDEX", - "GIT_DIFF_INCLUDE_UNREADABLE", - "GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED", - "GIT_DIFF_FORCE_TEXT", - "GIT_DIFF_FORCE_BINARY", - "GIT_DIFF_IGNORE_WHITESPACE", - "GIT_DIFF_IGNORE_WHITESPACE_CHANGE", - "GIT_DIFF_IGNORE_WHITESPACE_EOL", - "GIT_DIFF_SHOW_UNTRACKED_CONTENT", - "GIT_DIFF_SHOW_UNMODIFIED", - "GIT_DIFF_PATIENCE", - "GIT_DIFF_MINIMAL", - "GIT_DIFF_SHOW_BINARY" + "GIT_EMAIL_CREATE_DEFAULT", + "GIT_EMAIL_CREATE_OMIT_NUMBERS", + "GIT_EMAIL_CREATE_ALWAYS_NUMBER", + "GIT_EMAIL_CREATE_NO_RENAMES" ], "type": "enum", - "file": "diff.h", - "line": 72, - "lineto": 209, - "block": "GIT_DIFF_NORMAL\nGIT_DIFF_REVERSE\nGIT_DIFF_INCLUDE_IGNORED\nGIT_DIFF_RECURSE_IGNORED_DIRS\nGIT_DIFF_INCLUDE_UNTRACKED\nGIT_DIFF_RECURSE_UNTRACKED_DIRS\nGIT_DIFF_INCLUDE_UNMODIFIED\nGIT_DIFF_INCLUDE_TYPECHANGE\nGIT_DIFF_INCLUDE_TYPECHANGE_TREES\nGIT_DIFF_IGNORE_FILEMODE\nGIT_DIFF_IGNORE_SUBMODULES\nGIT_DIFF_IGNORE_CASE\nGIT_DIFF_INCLUDE_CASECHANGE\nGIT_DIFF_DISABLE_PATHSPEC_MATCH\nGIT_DIFF_SKIP_BINARY_CHECK\nGIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS\nGIT_DIFF_UPDATE_INDEX\nGIT_DIFF_INCLUDE_UNREADABLE\nGIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED\nGIT_DIFF_FORCE_TEXT\nGIT_DIFF_FORCE_BINARY\nGIT_DIFF_IGNORE_WHITESPACE\nGIT_DIFF_IGNORE_WHITESPACE_CHANGE\nGIT_DIFF_IGNORE_WHITESPACE_EOL\nGIT_DIFF_SHOW_UNTRACKED_CONTENT\nGIT_DIFF_SHOW_UNMODIFIED\nGIT_DIFF_PATIENCE\nGIT_DIFF_MINIMAL\nGIT_DIFF_SHOW_BINARY", + "file": "git2/email.h", + "line": 24, + "lineto": 39, + "block": "GIT_EMAIL_CREATE_DEFAULT\nGIT_EMAIL_CREATE_OMIT_NUMBERS\nGIT_EMAIL_CREATE_ALWAYS_NUMBER\nGIT_EMAIL_CREATE_NO_RENAMES", "tdef": "typedef", - "description": " Flags for diff options. A combination of these flags can be passed\n in via the `flags` value in the `git_diff_options`.", + "description": " Formatting options for diff e-mail generation", "comments": "", "fields": [ { "type": "int", - "name": "GIT_DIFF_NORMAL", - "comments": "

Normal diff, the default

\n", + "name": "GIT_EMAIL_CREATE_DEFAULT", + "comments": "

Normal patch, the default

\n", "value": 0 }, { "type": "int", - "name": "GIT_DIFF_REVERSE", - "comments": "

Reverse the sides of the diff

\n", + "name": "GIT_EMAIL_CREATE_OMIT_NUMBERS", + "comments": "

Do not include patch numbers in the subject prefix.

\n", "value": 1 }, { "type": "int", - "name": "GIT_DIFF_INCLUDE_IGNORED", - "comments": "

Include ignored files in the diff

\n", + "name": "GIT_EMAIL_CREATE_ALWAYS_NUMBER", + "comments": "

Include numbers in the subject prefix even when the\n patch is for a single commit (1/1).

\n", "value": 2 }, { "type": "int", - "name": "GIT_DIFF_RECURSE_IGNORED_DIRS", - "comments": "

Even with GIT_DIFF_INCLUDE_IGNORED, an entire ignored directory\n will be marked with only a single entry in the diff; this flag\n adds all files under the directory as IGNORED entries, too.

\n", + "name": "GIT_EMAIL_CREATE_NO_RENAMES", + "comments": "

Do not perform rename or similarity detection.

\n", "value": 4 - }, - { - "type": "int", - "name": "GIT_DIFF_INCLUDE_UNTRACKED", - "comments": "

Include untracked files in the diff

\n", - "value": 8 - }, + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_email_create_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "git_diff_options diff_opts", + "git_diff_find_options diff_find_opts", + "const char * subject_prefix", + "size_t start_number", + "size_t reroll_number" + ], + "type": "struct", + "value": "git_email_create_options", + "file": "git2/email.h", + "line": 44, + "lineto": 72, + "block": "unsigned int version\nuint32_t flags\ngit_diff_options diff_opts\ngit_diff_find_options diff_find_opts\nconst char * subject_prefix\nsize_t start_number\nsize_t reroll_number", + "tdef": "typedef", + "description": " Options for controlling the formatting of the generated e-mail.", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, { - "type": "int", - "name": "GIT_DIFF_RECURSE_UNTRACKED_DIRS", - "comments": "

Even with GIT_DIFF_INCLUDE_UNTRACKED, an entire untracked\n directory will be marked with only a single entry in the diff\n (a la what core Git does in git status); this flag adds all\n files under untracked directories as UNTRACKED entries, too.

\n", - "value": 16 + "type": "uint32_t", + "name": "flags", + "comments": " see `git_email_create_flags_t` above " }, { - "type": "int", - "name": "GIT_DIFF_INCLUDE_UNMODIFIED", - "comments": "

Include unmodified files in the diff

\n", - "value": 32 + "type": "git_diff_options", + "name": "diff_opts", + "comments": " Options to use when creating diffs " }, { - "type": "int", - "name": "GIT_DIFF_INCLUDE_TYPECHANGE", - "comments": "

Normally, a type change between files will be converted into a\n DELETED record for the old and an ADDED record for the new; this\n options enabled the generation of TYPECHANGE delta records.

\n", - "value": 64 + "type": "git_diff_find_options", + "name": "diff_find_opts", + "comments": " Options for finding similarities within diffs " }, { - "type": "int", - "name": "GIT_DIFF_INCLUDE_TYPECHANGE_TREES", - "comments": "

Even with GIT_DIFF_INCLUDE_TYPECHANGE, blob->tree changes still\n generally show as a DELETED blob. This flag tries to correctly\n label blob->tree transitions as TYPECHANGE records with new_file's\n mode set to tree. Note: the tree SHA will not be available.

\n", - "value": 128 + "type": "const char *", + "name": "subject_prefix", + "comments": " The subject prefix, by default \"PATCH\". If set to an empty\n string (\"\") then only the patch numbers will be shown in the\n prefix. If the subject_prefix is empty and patch numbers\n are not being shown, the prefix will be omitted entirely." }, { - "type": "int", - "name": "GIT_DIFF_IGNORE_FILEMODE", - "comments": "

Ignore file mode changes

\n", - "value": 256 + "type": "size_t", + "name": "start_number", + "comments": " The starting patch number; this cannot be 0. By default,\n this is 1." }, { - "type": "int", - "name": "GIT_DIFF_IGNORE_SUBMODULES", - "comments": "

Treat all submodules as unmodified

\n", - "value": 512 - }, + "type": "size_t", + "name": "reroll_number", + "comments": " The \"re-roll\" number. By default, there is no re-roll. " + } + ], + "used": { "returns": [], "needs": ["git_email_create_from_commit"] } + } + ], + [ + "git_error", + { + "decl": ["char * message", "int klass"], + "type": "struct", + "value": "git_error", + "file": "git2/errors.h", + "line": 125, + "lineto": 128, + "block": "char * message\nint klass", + "tdef": "typedef", + "description": " Structure to store extra details of the last error that occurred.", + "comments": "

This is kept on a per-thread basis if GIT_THREADS was defined when the library was build, otherwise one is kept globally for the library

\n", + "fields": [ { - "type": "int", - "name": "GIT_DIFF_IGNORE_CASE", - "comments": "

Use case insensitive filename comparisons

\n", - "value": 1024 + "type": "char *", + "name": "message", + "comments": " The error message for the last error. " }, { "type": "int", - "name": "GIT_DIFF_INCLUDE_CASECHANGE", - "comments": "

May be combined with GIT_DIFF_IGNORE_CASE to specify that a file\n that has changed case will be returned as an add/delete pair.

\n", - "value": 2048 - }, + "name": "klass", + "comments": " The category of the last error. \n\n git_error_t " + } + ], + "used": { "returns": ["git_error_last", "giterr_last"], "needs": [] } + } + ], + [ + "git_error_code", + { + "decl": [ + "GIT_OK", + "GIT_ERROR", + "GIT_ENOTFOUND", + "GIT_EEXISTS", + "GIT_EAMBIGUOUS", + "GIT_EBUFS", + "GIT_EUSER", + "GIT_EBAREREPO", + "GIT_EUNBORNBRANCH", + "GIT_EUNMERGED", + "GIT_ENONFASTFORWARD", + "GIT_EINVALIDSPEC", + "GIT_ECONFLICT", + "GIT_ELOCKED", + "GIT_EMODIFIED", + "GIT_EAUTH", + "GIT_ECERTIFICATE", + "GIT_EAPPLIED", + "GIT_EPEEL", + "GIT_EEOF", + "GIT_EINVALID", + "GIT_EUNCOMMITTED", + "GIT_EDIRECTORY", + "GIT_EMERGECONFLICT", + "GIT_PASSTHROUGH", + "GIT_ITEROVER", + "GIT_RETRY", + "GIT_EMISMATCH", + "GIT_EINDEXDIRTY", + "GIT_EAPPLYFAIL", + "GIT_EOWNER", + "GIT_TIMEOUT", + "GIT_EUNCHANGED", + "GIT_ENOTSUPPORTED", + "GIT_EREADONLY" + ], + "type": "enum", + "file": "git2/errors.h", + "line": 21, + "lineto": 73, + "block": "GIT_OK\nGIT_ERROR\nGIT_ENOTFOUND\nGIT_EEXISTS\nGIT_EAMBIGUOUS\nGIT_EBUFS\nGIT_EUSER\nGIT_EBAREREPO\nGIT_EUNBORNBRANCH\nGIT_EUNMERGED\nGIT_ENONFASTFORWARD\nGIT_EINVALIDSPEC\nGIT_ECONFLICT\nGIT_ELOCKED\nGIT_EMODIFIED\nGIT_EAUTH\nGIT_ECERTIFICATE\nGIT_EAPPLIED\nGIT_EPEEL\nGIT_EEOF\nGIT_EINVALID\nGIT_EUNCOMMITTED\nGIT_EDIRECTORY\nGIT_EMERGECONFLICT\nGIT_PASSTHROUGH\nGIT_ITEROVER\nGIT_RETRY\nGIT_EMISMATCH\nGIT_EINDEXDIRTY\nGIT_EAPPLYFAIL\nGIT_EOWNER\nGIT_TIMEOUT\nGIT_EUNCHANGED\nGIT_ENOTSUPPORTED\nGIT_EREADONLY", + "tdef": "typedef", + "description": " Generic return codes ", + "comments": "", + "fields": [ { "type": "int", - "name": "GIT_DIFF_DISABLE_PATHSPEC_MATCH", - "comments": "

If the pathspec is set in the diff options, this flags indicates\n that the paths will be treated as literal paths instead of\n fnmatch patterns. Each path in the list must either be a full\n path to a file or a directory. (A trailing slash indicates that\n the path will only match a directory). If a directory is\n specified, all children will be included.

\n", - "value": 4096 + "name": "GIT_OK", + "comments": "

No error occurred; the call was successful.

\n", + "value": 0 }, { "type": "int", - "name": "GIT_DIFF_SKIP_BINARY_CHECK", - "comments": "

Disable updating of the binary flag in delta records. This is\n useful when iterating over a diff if you don't need hunk and data\n callbacks and want to avoid having to load file completely.

\n", - "value": 8192 + "name": "GIT_ERROR", + "comments": "

An error occurred; call git_error_last for more information.

\n", + "value": -1 }, { "type": "int", - "name": "GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS", - "comments": "

When diff finds an untracked directory, to match the behavior of\n core Git, it scans the contents for IGNORED and UNTRACKED files.\n If all contents are IGNORED, then the directory is IGNORED; if\n any contents are not IGNORED, then the directory is UNTRACKED.\n This is extra work that may not matter in many cases. This flag\n turns off that scan and immediately labels an untracked directory\n as UNTRACKED (changing the behavior to not match core Git).

\n", - "value": 16384 + "name": "GIT_ENOTFOUND", + "comments": "

Requested object could not be found.

\n", + "value": -3 }, { "type": "int", - "name": "GIT_DIFF_UPDATE_INDEX", - "comments": "

When diff finds a file in the working directory with stat\n information different from the index, but the OID ends up being the\n same, write the correct stat information into the index. Note:\n without this flag, diff will always leave the index untouched.

\n", - "value": 32768 + "name": "GIT_EEXISTS", + "comments": "

Object exists preventing operation.

\n", + "value": -4 }, { "type": "int", - "name": "GIT_DIFF_INCLUDE_UNREADABLE", - "comments": "

Include unreadable files in the diff

\n", - "value": 65536 + "name": "GIT_EAMBIGUOUS", + "comments": "

More than one object matches.

\n", + "value": -5 }, { "type": "int", - "name": "GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED", - "comments": "

Include unreadable files in the diff

\n", - "value": 131072 + "name": "GIT_EBUFS", + "comments": "

Output buffer too short to hold data.

\n", + "value": -6 }, { "type": "int", - "name": "GIT_DIFF_FORCE_TEXT", - "comments": "

Treat all files as text, disabling binary attributes \n&\n detection

\n", - "value": 1048576 + "name": "GIT_EUSER", + "comments": "

GIT_EUSER is a special error that is never generated by libgit2\n code. You can return it from a callback (e.g to stop an iteration)\n to know that it was generated by the callback and not by libgit2.

\n", + "value": -7 }, { "type": "int", - "name": "GIT_DIFF_FORCE_BINARY", - "comments": "

Treat all files as binary, disabling text diffs

\n", - "value": 2097152 + "name": "GIT_EBAREREPO", + "comments": "

Operation not allowed on bare repository.

\n", + "value": -8 }, { "type": "int", - "name": "GIT_DIFF_IGNORE_WHITESPACE", - "comments": "

Ignore all whitespace

\n", - "value": 4194304 + "name": "GIT_EUNBORNBRANCH", + "comments": "

HEAD refers to branch with no commits.

\n", + "value": -9 }, { "type": "int", - "name": "GIT_DIFF_IGNORE_WHITESPACE_CHANGE", - "comments": "

Ignore changes in amount of whitespace

\n", - "value": 8388608 + "name": "GIT_EUNMERGED", + "comments": "

Merge in progress prevented operation

\n", + "value": -10 }, { "type": "int", - "name": "GIT_DIFF_IGNORE_WHITESPACE_EOL", - "comments": "

Ignore whitespace at end of line

\n", - "value": 16777216 + "name": "GIT_ENONFASTFORWARD", + "comments": "

Reference was not fast-forwardable

\n", + "value": -11 }, { "type": "int", - "name": "GIT_DIFF_SHOW_UNTRACKED_CONTENT", - "comments": "

When generating patch text, include the content of untracked\n files. This automatically turns on GIT_DIFF_INCLUDE_UNTRACKED but\n it does not turn on GIT_DIFF_RECURSE_UNTRACKED_DIRS. Add that\n flag if you want the content of every single UNTRACKED file.

\n", - "value": 33554432 + "name": "GIT_EINVALIDSPEC", + "comments": "

Name/ref spec was not in a valid format

\n", + "value": -12 }, { "type": "int", - "name": "GIT_DIFF_SHOW_UNMODIFIED", - "comments": "

When generating output, include the names of unmodified files if\n they are included in the git_diff. Normally these are skipped in\n the formats that list files (e.g. name-only, name-status, raw).\n Even with this, these will not be included in patch format.

\n", - "value": 67108864 + "name": "GIT_ECONFLICT", + "comments": "

Checkout conflicts prevented operation

\n", + "value": -13 }, { "type": "int", - "name": "GIT_DIFF_PATIENCE", - "comments": "

Use the "patience diff" algorithm

\n", - "value": 268435456 + "name": "GIT_ELOCKED", + "comments": "

Lock file prevented operation

\n", + "value": -14 }, { "type": "int", - "name": "GIT_DIFF_MINIMAL", - "comments": "

Take extra time to find minimal diff

\n", - "value": 536870912 + "name": "GIT_EMODIFIED", + "comments": "

Reference value does not match expected

\n", + "value": -15 }, { "type": "int", - "name": "GIT_DIFF_SHOW_BINARY", - "comments": "

Include the necessary deflate / delta information so that git-apply\n can apply given diff information to binary files.

\n", - "value": 1073741824 - } - ], - "used": { - "returns": [], - "needs": [] - } - } - ], - [ - "git_diff_options", - { - "decl": [ - "unsigned int version", - "uint32_t flags", - "git_submodule_ignore_t ignore_submodules", - "git_strarray pathspec", - "git_diff_notify_cb notify_cb", - "git_diff_progress_cb progress_cb", - "void * payload", - "uint32_t context_lines", - "uint32_t interhunk_lines", - "uint16_t id_abbrev", - "git_off_t max_size", - "const char * old_prefix", - "const char * new_prefix" - ], - "type": "struct", - "value": "git_diff_options", - "file": "diff.h", - "line": 402, - "lineto": 422, - "block": "unsigned int version\nuint32_t flags\ngit_submodule_ignore_t ignore_submodules\ngit_strarray pathspec\ngit_diff_notify_cb notify_cb\ngit_diff_progress_cb progress_cb\nvoid * payload\nuint32_t context_lines\nuint32_t interhunk_lines\nuint16_t id_abbrev\ngit_off_t max_size\nconst char * old_prefix\nconst char * new_prefix", - "tdef": "typedef", - "description": " Structure describing options about how the diff should be executed.", - "comments": "

Setting all values of the structure to zero will yield the default values. Similarly, passing NULL for the options structure will give the defaults. The default values are marked below.

\n\n\n", - "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": " version for the struct " + "name": "GIT_EAUTH", + "comments": "

Authentication error

\n", + "value": -16 }, { - "type": "uint32_t", - "name": "flags", - "comments": " defaults to GIT_DIFF_NORMAL " + "type": "int", + "name": "GIT_ECERTIFICATE", + "comments": "

Server certificate is invalid

\n", + "value": -17 }, { - "type": "git_submodule_ignore_t", - "name": "ignore_submodules", - "comments": " submodule ignore rule " + "type": "int", + "name": "GIT_EAPPLIED", + "comments": "

Patch/merge has already been applied

\n", + "value": -18 }, { - "type": "git_strarray", - "name": "pathspec", - "comments": " defaults to include all paths " + "type": "int", + "name": "GIT_EPEEL", + "comments": "

The requested peel operation is not possible

\n", + "value": -19 }, { - "type": "git_diff_notify_cb", - "name": "notify_cb", - "comments": "" + "type": "int", + "name": "GIT_EEOF", + "comments": "

Unexpected EOF

\n", + "value": -20 }, { - "type": "git_diff_progress_cb", - "name": "progress_cb", - "comments": "" + "type": "int", + "name": "GIT_EINVALID", + "comments": "

Invalid operation or input

\n", + "value": -21 }, { - "type": "void *", - "name": "payload", - "comments": "" + "type": "int", + "name": "GIT_EUNCOMMITTED", + "comments": "

Uncommitted changes in index prevented operation

\n", + "value": -22 }, { - "type": "uint32_t", - "name": "context_lines", - "comments": " defaults to 3 " + "type": "int", + "name": "GIT_EDIRECTORY", + "comments": "

The operation is not valid for a directory

\n", + "value": -23 }, { - "type": "uint32_t", - "name": "interhunk_lines", - "comments": " defaults to 0 " + "type": "int", + "name": "GIT_EMERGECONFLICT", + "comments": "

A merge conflict exists and cannot continue

\n", + "value": -24 }, { - "type": "uint16_t", - "name": "id_abbrev", - "comments": " default 'core.abbrev' or 7 if unset " + "type": "int", + "name": "GIT_PASSTHROUGH", + "comments": "

A user-configured callback refused to act

\n", + "value": -30 }, { - "type": "git_off_t", - "name": "max_size", - "comments": " defaults to 512MB " + "type": "int", + "name": "GIT_ITEROVER", + "comments": "

Signals end of iteration with iterator

\n", + "value": -31 }, { - "type": "const char *", - "name": "old_prefix", - "comments": " defaults to \"a\" " + "type": "int", + "name": "GIT_RETRY", + "comments": "

Internal only

\n", + "value": -32 }, { - "type": "const char *", - "name": "new_prefix", - "comments": " defaults to \"b\" " - } - ], - "used": { - "returns": [], - "needs": [ - "git_diff_blob_to_buffer", - "git_diff_blobs", - "git_diff_buffers", - "git_diff_commit_as_email", - "git_diff_index_to_index", - "git_diff_index_to_workdir", - "git_diff_init_options", - "git_diff_tree_to_index", - "git_diff_tree_to_tree", - "git_diff_tree_to_workdir", - "git_diff_tree_to_workdir_with_index", - "git_patch_from_blob_and_buffer", - "git_patch_from_blobs", - "git_patch_from_buffers" - ] - } - } - ], - [ - "git_diff_perfdata", - { - "decl": [ - "unsigned int version", - "size_t stat_calls", - "size_t oid_calculations" - ], - "type": "struct", - "value": "git_diff_perfdata", - "file": "sys/diff.h", - "line": 67, - "lineto": 71, - "block": "unsigned int version\nsize_t stat_calls\nsize_t oid_calculations", - "tdef": "typedef", - "description": " Performance data from diffing", - "comments": "", - "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" + "type": "int", + "name": "GIT_EMISMATCH", + "comments": "

Hashsum mismatch in object

\n", + "value": -33 }, { - "type": "size_t", - "name": "stat_calls", - "comments": " Number of stat() calls performed " + "type": "int", + "name": "GIT_EINDEXDIRTY", + "comments": "

Unsaved changes in the index would be overwritten

\n", + "value": -34 }, { - "type": "size_t", - "name": "oid_calculations", - "comments": " Number of ID calculations " - } - ], - "used": { - "returns": [], - "needs": [ - "git_diff_get_perfdata", - "git_status_list_get_perfdata" - ] - } - } - ], - [ - "git_diff_similarity_metric", - { - "decl": [ - "int (*)(void **, const git_diff_file *, const char *, void *) file_signature", - "int (*)(void **, const git_diff_file *, const char *, size_t, void *) buffer_signature", - "void (*)(void *, void *) free_signature", - "int (*)(int *, void *, void *, void *) similarity", - "void * payload" - ], - "type": "struct", - "value": "git_diff_similarity_metric", - "file": "diff.h", - "line": 665, - "lineto": 675, - "block": "int (*)(void **, const git_diff_file *, const char *, void *) file_signature\nint (*)(void **, const git_diff_file *, const char *, size_t, void *) buffer_signature\nvoid (*)(void *, void *) free_signature\nint (*)(int *, void *, void *, void *) similarity\nvoid * payload", - "tdef": "typedef", - "description": " Pluggable similarity metric", - "comments": "", - "fields": [ - { - "type": "int (*)(void **, const git_diff_file *, const char *, void *)", - "name": "file_signature", - "comments": "" + "type": "int", + "name": "GIT_EAPPLYFAIL", + "comments": "

Patch application failed

\n", + "value": -35 }, { - "type": "int (*)(void **, const git_diff_file *, const char *, size_t, void *)", - "name": "buffer_signature", - "comments": "" + "type": "int", + "name": "GIT_EOWNER", + "comments": "

The object is not owned by the current user

\n", + "value": -36 }, { - "type": "void (*)(void *, void *)", - "name": "free_signature", - "comments": "" + "type": "int", + "name": "GIT_TIMEOUT", + "comments": "

The operation timed out

\n", + "value": -37 }, { - "type": "int (*)(int *, void *, void *, void *)", - "name": "similarity", - "comments": "" + "type": "int", + "name": "GIT_EUNCHANGED", + "comments": "

There were no changes

\n", + "value": -38 }, { - "type": "void *", - "name": "payload", - "comments": "" + "type": "int", + "name": "GIT_ENOTSUPPORTED", + "comments": "

An option is not supported

\n", + "value": -39 + }, + { + "type": "int", + "name": "GIT_EREADONLY", + "comments": "

The subject is read-only

\n", + "value": -40 } ], - "used": { - "returns": [], - "needs": [] - } - } - ], - [ - "git_diff_stats", - { - "decl": "git_diff_stats", - "type": "struct", - "value": "git_diff_stats", - "file": "diff.h", - "line": 1229, - "lineto": 1229, - "tdef": "typedef", - "description": " This is an opaque structure which is allocated by `git_diff_get_stats`.\n You are responsible for releasing the object memory when done, using the\n `git_diff_stats_free()` function.", - "comments": "", - "used": { - "returns": [], - "needs": [ - "git_diff_get_stats", - "git_diff_stats_deletions", - "git_diff_stats_files_changed", - "git_diff_stats_free", - "git_diff_stats_insertions", - "git_diff_stats_to_buf" - ] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_diff_stats_format_t", + "git_error_t", { "decl": [ - "GIT_DIFF_STATS_NONE", - "GIT_DIFF_STATS_FULL", - "GIT_DIFF_STATS_SHORT", - "GIT_DIFF_STATS_NUMBER", - "GIT_DIFF_STATS_INCLUDE_SUMMARY" + "GIT_ERROR_NONE", + "GIT_ERROR_NOMEMORY", + "GIT_ERROR_OS", + "GIT_ERROR_INVALID", + "GIT_ERROR_REFERENCE", + "GIT_ERROR_ZLIB", + "GIT_ERROR_REPOSITORY", + "GIT_ERROR_CONFIG", + "GIT_ERROR_REGEX", + "GIT_ERROR_ODB", + "GIT_ERROR_INDEX", + "GIT_ERROR_OBJECT", + "GIT_ERROR_NET", + "GIT_ERROR_TAG", + "GIT_ERROR_TREE", + "GIT_ERROR_INDEXER", + "GIT_ERROR_SSL", + "GIT_ERROR_SUBMODULE", + "GIT_ERROR_THREAD", + "GIT_ERROR_STASH", + "GIT_ERROR_CHECKOUT", + "GIT_ERROR_FETCHHEAD", + "GIT_ERROR_MERGE", + "GIT_ERROR_SSH", + "GIT_ERROR_FILTER", + "GIT_ERROR_REVERT", + "GIT_ERROR_CALLBACK", + "GIT_ERROR_CHERRYPICK", + "GIT_ERROR_DESCRIBE", + "GIT_ERROR_REBASE", + "GIT_ERROR_FILESYSTEM", + "GIT_ERROR_PATCH", + "GIT_ERROR_WORKTREE", + "GIT_ERROR_SHA", + "GIT_ERROR_HTTP", + "GIT_ERROR_INTERNAL", + "GIT_ERROR_GRAFTS" ], "type": "enum", - "file": "diff.h", - "line": 1234, - "lineto": 1249, - "block": "GIT_DIFF_STATS_NONE\nGIT_DIFF_STATS_FULL\nGIT_DIFF_STATS_SHORT\nGIT_DIFF_STATS_NUMBER\nGIT_DIFF_STATS_INCLUDE_SUMMARY", + "file": "git2/errors.h", + "line": 79, + "lineto": 117, + "block": "GIT_ERROR_NONE\nGIT_ERROR_NOMEMORY\nGIT_ERROR_OS\nGIT_ERROR_INVALID\nGIT_ERROR_REFERENCE\nGIT_ERROR_ZLIB\nGIT_ERROR_REPOSITORY\nGIT_ERROR_CONFIG\nGIT_ERROR_REGEX\nGIT_ERROR_ODB\nGIT_ERROR_INDEX\nGIT_ERROR_OBJECT\nGIT_ERROR_NET\nGIT_ERROR_TAG\nGIT_ERROR_TREE\nGIT_ERROR_INDEXER\nGIT_ERROR_SSL\nGIT_ERROR_SUBMODULE\nGIT_ERROR_THREAD\nGIT_ERROR_STASH\nGIT_ERROR_CHECKOUT\nGIT_ERROR_FETCHHEAD\nGIT_ERROR_MERGE\nGIT_ERROR_SSH\nGIT_ERROR_FILTER\nGIT_ERROR_REVERT\nGIT_ERROR_CALLBACK\nGIT_ERROR_CHERRYPICK\nGIT_ERROR_DESCRIBE\nGIT_ERROR_REBASE\nGIT_ERROR_FILESYSTEM\nGIT_ERROR_PATCH\nGIT_ERROR_WORKTREE\nGIT_ERROR_SHA\nGIT_ERROR_HTTP\nGIT_ERROR_INTERNAL\nGIT_ERROR_GRAFTS", "tdef": "typedef", - "description": " Formatting options for diff stats", + "description": " Error classes are the category of error. They reflect the area of the\n code where an error occurred.", "comments": "", "fields": [ { "type": "int", - "name": "GIT_DIFF_STATS_NONE", - "comments": "

No stats

\n", + "name": "GIT_ERROR_NONE", + "comments": "", "value": 0 }, { "type": "int", - "name": "GIT_DIFF_STATS_FULL", - "comments": "

Full statistics, equivalent of --stat

\n", + "name": "GIT_ERROR_NOMEMORY", + "comments": "", "value": 1 }, + { "type": "int", "name": "GIT_ERROR_OS", "comments": "", "value": 2 }, { "type": "int", - "name": "GIT_DIFF_STATS_SHORT", - "comments": "

Short statistics, equivalent of --shortstat

\n", - "value": 2 + "name": "GIT_ERROR_INVALID", + "comments": "", + "value": 3 }, { "type": "int", - "name": "GIT_DIFF_STATS_NUMBER", - "comments": "

Number statistics, equivalent of --numstat

\n", + "name": "GIT_ERROR_REFERENCE", + "comments": "", "value": 4 }, { "type": "int", - "name": "GIT_DIFF_STATS_INCLUDE_SUMMARY", - "comments": "

Extended header information such as creations, renames and mode changes, equivalent of --summary

\n", + "name": "GIT_ERROR_ZLIB", + "comments": "", + "value": 5 + }, + { + "type": "int", + "name": "GIT_ERROR_REPOSITORY", + "comments": "", + "value": 6 + }, + { + "type": "int", + "name": "GIT_ERROR_CONFIG", + "comments": "", + "value": 7 + }, + { + "type": "int", + "name": "GIT_ERROR_REGEX", + "comments": "", "value": 8 - } - ], - "used": { - "returns": [], - "needs": [ - "git_diff_stats_to_buf" - ] - } - } - ], - [ - "git_direction", - { - "decl": [ - "GIT_DIRECTION_FETCH", - "GIT_DIRECTION_PUSH" - ], - "type": "enum", - "file": "net.h", - "line": 31, - "lineto": 34, - "block": "GIT_DIRECTION_FETCH\nGIT_DIRECTION_PUSH", - "tdef": "typedef", - "description": " Direction of the connection.", - "comments": "

We need this because we need to know whether we should call git-upload-pack or git-receive-pack on the remote end when get_refs gets called.

\n", - "fields": [ + }, { "type": "int", - "name": "GIT_DIRECTION_FETCH", + "name": "GIT_ERROR_ODB", "comments": "", - "value": 0 + "value": 9 }, { "type": "int", - "name": "GIT_DIRECTION_PUSH", + "name": "GIT_ERROR_INDEX", "comments": "", - "value": 1 - } - ], - "used": { - "returns": [ - "git_refspec_direction" - ], - "needs": [ - "git_remote_connect" - ] - } - } - ], - [ - "git_error", - { - "decl": [ - "char * message", - "int klass" - ], - "type": "struct", - "value": "git_error", - "file": "errors.h", - "line": 64, - "lineto": 67, - "block": "char * message\nint klass", - "tdef": "typedef", - "description": " Structure to store extra details of the last error that occurred.", - "comments": "

This is kept on a per-thread basis if GIT_THREADS was defined when the library was build, otherwise one is kept globally for the library

\n", - "fields": [ + "value": 10 + }, { - "type": "char *", - "name": "message", - "comments": "" + "type": "int", + "name": "GIT_ERROR_OBJECT", + "comments": "", + "value": 11 }, { "type": "int", - "name": "klass", - "comments": "" - } - ], - "used": { - "returns": [ - "giterr_last" - ], - "needs": [] - } - } - ], - [ - "git_error_code", - { - "decl": [ - "GIT_OK", - "GIT_ERROR", - "GIT_ENOTFOUND", - "GIT_EEXISTS", - "GIT_EAMBIGUOUS", - "GIT_EBUFS", - "GIT_EUSER", - "GIT_EBAREREPO", - "GIT_EUNBORNBRANCH", - "GIT_EUNMERGED", - "GIT_ENONFASTFORWARD", - "GIT_EINVALIDSPEC", - "GIT_ECONFLICT", - "GIT_ELOCKED", - "GIT_EMODIFIED", - "GIT_EAUTH", - "GIT_ECERTIFICATE", - "GIT_EAPPLIED", - "GIT_EPEEL", - "GIT_EEOF", - "GIT_EINVALID", - "GIT_EUNCOMMITTED", - "GIT_EDIRECTORY", - "GIT_EMERGECONFLICT", - "GIT_PASSTHROUGH", - "GIT_ITEROVER" - ], - "type": "enum", - "file": "errors.h", - "line": 21, - "lineto": 56, - "block": "GIT_OK\nGIT_ERROR\nGIT_ENOTFOUND\nGIT_EEXISTS\nGIT_EAMBIGUOUS\nGIT_EBUFS\nGIT_EUSER\nGIT_EBAREREPO\nGIT_EUNBORNBRANCH\nGIT_EUNMERGED\nGIT_ENONFASTFORWARD\nGIT_EINVALIDSPEC\nGIT_ECONFLICT\nGIT_ELOCKED\nGIT_EMODIFIED\nGIT_EAUTH\nGIT_ECERTIFICATE\nGIT_EAPPLIED\nGIT_EPEEL\nGIT_EEOF\nGIT_EINVALID\nGIT_EUNCOMMITTED\nGIT_EDIRECTORY\nGIT_EMERGECONFLICT\nGIT_PASSTHROUGH\nGIT_ITEROVER", - "tdef": "typedef", - "description": " Generic return codes ", - "comments": "", - "fields": [ + "name": "GIT_ERROR_NET", + "comments": "", + "value": 12 + }, { "type": "int", - "name": "GIT_OK", - "comments": "

No error

\n", - "value": 0 + "name": "GIT_ERROR_TAG", + "comments": "", + "value": 13 }, { "type": "int", - "name": "GIT_ERROR", - "comments": "

Generic error

\n", - "value": -1 + "name": "GIT_ERROR_TREE", + "comments": "", + "value": 14 + }, + { + "type": "int", + "name": "GIT_ERROR_INDEXER", + "comments": "", + "value": 15 + }, + { + "type": "int", + "name": "GIT_ERROR_SSL", + "comments": "", + "value": 16 + }, + { + "type": "int", + "name": "GIT_ERROR_SUBMODULE", + "comments": "", + "value": 17 + }, + { + "type": "int", + "name": "GIT_ERROR_THREAD", + "comments": "", + "value": 18 + }, + { + "type": "int", + "name": "GIT_ERROR_STASH", + "comments": "", + "value": 19 + }, + { + "type": "int", + "name": "GIT_ERROR_CHECKOUT", + "comments": "", + "value": 20 + }, + { + "type": "int", + "name": "GIT_ERROR_FETCHHEAD", + "comments": "", + "value": 21 + }, + { + "type": "int", + "name": "GIT_ERROR_MERGE", + "comments": "", + "value": 22 + }, + { + "type": "int", + "name": "GIT_ERROR_SSH", + "comments": "", + "value": 23 + }, + { + "type": "int", + "name": "GIT_ERROR_FILTER", + "comments": "", + "value": 24 }, { "type": "int", - "name": "GIT_ENOTFOUND", - "comments": "

Requested object could not be found

\n", - "value": -3 + "name": "GIT_ERROR_REVERT", + "comments": "", + "value": 25 }, { "type": "int", - "name": "GIT_EEXISTS", - "comments": "

Object exists preventing operation

\n", - "value": -4 + "name": "GIT_ERROR_CALLBACK", + "comments": "", + "value": 26 }, { "type": "int", - "name": "GIT_EAMBIGUOUS", - "comments": "

More than one object matches

\n", - "value": -5 + "name": "GIT_ERROR_CHERRYPICK", + "comments": "", + "value": 27 }, { "type": "int", - "name": "GIT_EBUFS", - "comments": "

Output buffer too short to hold data

\n", - "value": -6 + "name": "GIT_ERROR_DESCRIBE", + "comments": "", + "value": 28 }, { "type": "int", - "name": "GIT_EUSER", + "name": "GIT_ERROR_REBASE", "comments": "", - "value": -7 + "value": 29 }, { "type": "int", - "name": "GIT_EBAREREPO", - "comments": "

Operation not allowed on bare repository

\n", - "value": -8 + "name": "GIT_ERROR_FILESYSTEM", + "comments": "", + "value": 30 }, { "type": "int", - "name": "GIT_EUNBORNBRANCH", - "comments": "

HEAD refers to branch with no commits

\n", - "value": -9 + "name": "GIT_ERROR_PATCH", + "comments": "", + "value": 31 }, { "type": "int", - "name": "GIT_EUNMERGED", - "comments": "

Merge in progress prevented operation

\n", - "value": -10 + "name": "GIT_ERROR_WORKTREE", + "comments": "", + "value": 32 }, { "type": "int", - "name": "GIT_ENONFASTFORWARD", - "comments": "

Reference was not fast-forwardable

\n", - "value": -11 + "name": "GIT_ERROR_SHA", + "comments": "", + "value": 33 }, { "type": "int", - "name": "GIT_EINVALIDSPEC", - "comments": "

Name/ref spec was not in a valid format

\n", - "value": -12 + "name": "GIT_ERROR_HTTP", + "comments": "", + "value": 34 }, { "type": "int", - "name": "GIT_ECONFLICT", - "comments": "

Checkout conflicts prevented operation

\n", - "value": -13 + "name": "GIT_ERROR_INTERNAL", + "comments": "", + "value": 35 }, { "type": "int", - "name": "GIT_ELOCKED", - "comments": "

Lock file prevented operation

\n", - "value": -14 - }, + "name": "GIT_ERROR_GRAFTS", + "comments": "", + "value": 36 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_feature_t", + { + "decl": [ + "GIT_FEATURE_THREADS", + "GIT_FEATURE_HTTPS", + "GIT_FEATURE_SSH", + "GIT_FEATURE_NSEC", + "GIT_FEATURE_HTTP_PARSER", + "GIT_FEATURE_REGEX", + "GIT_FEATURE_I18N", + "GIT_FEATURE_AUTH_NTLM", + "GIT_FEATURE_AUTH_NEGOTIATE", + "GIT_FEATURE_COMPRESSION", + "GIT_FEATURE_SHA1", + "GIT_FEATURE_SHA256" + ], + "type": "enum", + "file": "git2/common.h", + "line": 138, + "lineto": 177, + "block": "GIT_FEATURE_THREADS\nGIT_FEATURE_HTTPS\nGIT_FEATURE_SSH\nGIT_FEATURE_NSEC\nGIT_FEATURE_HTTP_PARSER\nGIT_FEATURE_REGEX\nGIT_FEATURE_I18N\nGIT_FEATURE_AUTH_NTLM\nGIT_FEATURE_AUTH_NEGOTIATE\nGIT_FEATURE_COMPRESSION\nGIT_FEATURE_SHA1\nGIT_FEATURE_SHA256", + "tdef": "typedef", + "description": " Configurable features of libgit2; either optional settings (like\n threading), or features that can be enabled by one of a number of\n different backend \"providers\" (like HTTPS, which can be provided by\n OpenSSL, mbedTLS, or system libraries).", + "comments": "", + "fields": [ { "type": "int", - "name": "GIT_EMODIFIED", - "comments": "

Reference value does not match expected

\n", - "value": -15 + "name": "GIT_FEATURE_THREADS", + "comments": "

libgit2 is thread-aware and can be used from multiple threads\n (as described in the documentation).

\n", + "value": 1 }, { "type": "int", - "name": "GIT_EAUTH", - "comments": "

Authentication error

\n", - "value": -16 + "name": "GIT_FEATURE_HTTPS", + "comments": "

HTTPS remotes

\n", + "value": 2 }, { "type": "int", - "name": "GIT_ECERTIFICATE", - "comments": "

Server certificate is invalid

\n", - "value": -17 + "name": "GIT_FEATURE_SSH", + "comments": "

SSH remotes

\n", + "value": 4 }, { "type": "int", - "name": "GIT_EAPPLIED", - "comments": "

Patch/merge has already been applied

\n", - "value": -18 + "name": "GIT_FEATURE_NSEC", + "comments": "

Sub-second resolution in index timestamps

\n", + "value": 8 }, { "type": "int", - "name": "GIT_EPEEL", - "comments": "

The requested peel operation is not possible

\n", - "value": -19 + "name": "GIT_FEATURE_HTTP_PARSER", + "comments": "

HTTP parsing; always available

\n", + "value": 16 }, { "type": "int", - "name": "GIT_EEOF", - "comments": "

Unexpected EOF

\n", - "value": -20 + "name": "GIT_FEATURE_REGEX", + "comments": "

Regular expression support; always available

\n", + "value": 32 }, { "type": "int", - "name": "GIT_EINVALID", - "comments": "

Invalid operation or input

\n", - "value": -21 + "name": "GIT_FEATURE_I18N", + "comments": "

Internationalization support for filename translation

\n", + "value": 64 }, { "type": "int", - "name": "GIT_EUNCOMMITTED", - "comments": "

Uncommitted changes in index prevented operation

\n", - "value": -22 + "name": "GIT_FEATURE_AUTH_NTLM", + "comments": "

NTLM support over HTTPS

\n", + "value": 128 }, { "type": "int", - "name": "GIT_EDIRECTORY", - "comments": "

The operation is not valid for a directory

\n", - "value": -23 + "name": "GIT_FEATURE_AUTH_NEGOTIATE", + "comments": "

Kerberos (SPNEGO) authentication support over HTTPS

\n", + "value": 256 }, { "type": "int", - "name": "GIT_EMERGECONFLICT", - "comments": "

A merge conflict exists and cannot continue

\n", - "value": -24 + "name": "GIT_FEATURE_COMPRESSION", + "comments": "

zlib support; always available

\n", + "value": 512 }, { "type": "int", - "name": "GIT_PASSTHROUGH", - "comments": "

Internal only

\n", - "value": -30 + "name": "GIT_FEATURE_SHA1", + "comments": "

SHA1 object support; always available

\n", + "value": 1024 }, { "type": "int", - "name": "GIT_ITEROVER", - "comments": "

Signals end of iteration with iterator

\n", - "value": -31 + "name": "GIT_FEATURE_SHA256", + "comments": "

SHA256 object support

\n", + "value": 2048 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": ["git_libgit2_feature_backend"] } } ], [ - "git_error_t", + "git_fetch_depth_t", { - "decl": [ - "GITERR_NONE", - "GITERR_NOMEMORY", - "GITERR_OS", - "GITERR_INVALID", - "GITERR_REFERENCE", - "GITERR_ZLIB", - "GITERR_REPOSITORY", - "GITERR_CONFIG", - "GITERR_REGEX", - "GITERR_ODB", - "GITERR_INDEX", - "GITERR_OBJECT", - "GITERR_NET", - "GITERR_TAG", - "GITERR_TREE", - "GITERR_INDEXER", - "GITERR_SSL", - "GITERR_SUBMODULE", - "GITERR_THREAD", - "GITERR_STASH", - "GITERR_CHECKOUT", - "GITERR_FETCHHEAD", - "GITERR_MERGE", - "GITERR_SSH", - "GITERR_FILTER", - "GITERR_REVERT", - "GITERR_CALLBACK", - "GITERR_CHERRYPICK", - "GITERR_DESCRIBE", - "GITERR_REBASE", - "GITERR_FILESYSTEM", - "GITERR_PATCH" - ], + "decl": ["GIT_FETCH_DEPTH_FULL", "GIT_FETCH_DEPTH_UNSHALLOW"], "type": "enum", - "file": "errors.h", - "line": 70, - "lineto": 103, - "block": "GITERR_NONE\nGITERR_NOMEMORY\nGITERR_OS\nGITERR_INVALID\nGITERR_REFERENCE\nGITERR_ZLIB\nGITERR_REPOSITORY\nGITERR_CONFIG\nGITERR_REGEX\nGITERR_ODB\nGITERR_INDEX\nGITERR_OBJECT\nGITERR_NET\nGITERR_TAG\nGITERR_TREE\nGITERR_INDEXER\nGITERR_SSL\nGITERR_SUBMODULE\nGITERR_THREAD\nGITERR_STASH\nGITERR_CHECKOUT\nGITERR_FETCHHEAD\nGITERR_MERGE\nGITERR_SSH\nGITERR_FILTER\nGITERR_REVERT\nGITERR_CALLBACK\nGITERR_CHERRYPICK\nGITERR_DESCRIBE\nGITERR_REBASE\nGITERR_FILESYSTEM\nGITERR_PATCH", + "file": "git2/remote.h", + "line": 760, + "lineto": 766, + "block": "GIT_FETCH_DEPTH_FULL\nGIT_FETCH_DEPTH_UNSHALLOW", "tdef": "typedef", - "description": " Error classes ", + "description": " Constants for fetch depth (shallowness of fetch). ", "comments": "", "fields": [ { "type": "int", - "name": "GITERR_NONE", - "comments": "", + "name": "GIT_FETCH_DEPTH_FULL", + "comments": "

The fetch is "full" (not shallow). This is the default.

\n", "value": 0 }, { "type": "int", - "name": "GITERR_NOMEMORY", - "comments": "", - "value": 1 + "name": "GIT_FETCH_DEPTH_UNSHALLOW", + "comments": "

The fetch should "unshallow" and fetch missing data.

\n", + "value": 2147483647 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_fetch_options", + { + "decl": [ + "int version", + "git_remote_callbacks callbacks", + "git_fetch_prune_t prune", + "unsigned int update_fetchhead", + "git_remote_autotag_option_t download_tags", + "git_proxy_options proxy_opts", + "int depth", + "git_remote_redirect_t follow_redirects", + "git_strarray custom_headers" + ], + "type": "struct", + "value": "git_fetch_options", + "file": "git2/remote.h", + "line": 776, + "lineto": 828, + "block": "int version\ngit_remote_callbacks callbacks\ngit_fetch_prune_t prune\nunsigned int update_fetchhead\ngit_remote_autotag_option_t download_tags\ngit_proxy_options proxy_opts\nint depth\ngit_remote_redirect_t follow_redirects\ngit_strarray custom_headers", + "tdef": "typedef", + "description": " Fetch options structure.", + "comments": "

Zero out for defaults. Initialize with GIT_FETCH_OPTIONS_INIT macro to correctly set the version field. E.g.

\n\n
    git_fetch_options opts = GIT_FETCH_OPTIONS_INIT;\n
\n", + "fields": [ + { "type": "int", "name": "version", "comments": "" }, + { + "type": "git_remote_callbacks", + "name": "callbacks", + "comments": " Callbacks to use for this fetch operation" }, { - "type": "int", - "name": "GITERR_OS", - "comments": "", - "value": 2 + "type": "git_fetch_prune_t", + "name": "prune", + "comments": " Whether to perform a prune after the fetch" }, { - "type": "int", - "name": "GITERR_INVALID", - "comments": "", - "value": 3 + "type": "unsigned int", + "name": "update_fetchhead", + "comments": " How to handle reference updates; see `git_remote_update_flags`." + }, + { + "type": "git_remote_autotag_option_t", + "name": "download_tags", + "comments": " Determines how to behave regarding tags on the remote, such\n as auto-downloading tags for objects we're downloading or\n downloading all of them.\n\n The default is to auto-follow tags." + }, + { + "type": "git_proxy_options", + "name": "proxy_opts", + "comments": " Proxy options to use, by default no proxy is used." }, { "type": "int", - "name": "GITERR_REFERENCE", - "comments": "", - "value": 4 + "name": "depth", + "comments": " Depth of the fetch to perform, or `GIT_FETCH_DEPTH_FULL`\n (or `0`) for full history, or `GIT_FETCH_DEPTH_UNSHALLOW`\n to \"unshallow\" a shallow repository.\n\n The default is full (`GIT_FETCH_DEPTH_FULL` or `0`)." + }, + { + "type": "git_remote_redirect_t", + "name": "follow_redirects", + "comments": " Whether to allow off-site redirects. If this is not\n specified, the `http.followRedirects` configuration setting\n will be consulted." }, + { + "type": "git_strarray", + "name": "custom_headers", + "comments": " Extra headers for this fetch operation" + } + ], + "used": { + "returns": [], + "needs": [ + "git_fetch_options_init", + "git_remote_download", + "git_remote_fetch" + ] + } + } + ], + [ + "git_fetch_prune_t", + { + "decl": [ + "GIT_FETCH_PRUNE_UNSPECIFIED", + "GIT_FETCH_PRUNE", + "GIT_FETCH_NO_PRUNE" + ], + "type": "enum", + "file": "git2/remote.h", + "line": 719, + "lineto": 732, + "block": "GIT_FETCH_PRUNE_UNSPECIFIED\nGIT_FETCH_PRUNE\nGIT_FETCH_NO_PRUNE", + "tdef": "typedef", + "description": " Acceptable prune settings when fetching ", + "comments": "", + "fields": [ { "type": "int", - "name": "GITERR_ZLIB", - "comments": "", - "value": 5 + "name": "GIT_FETCH_PRUNE_UNSPECIFIED", + "comments": "

Use the setting from the configuration

\n", + "value": 0 }, { "type": "int", - "name": "GITERR_REPOSITORY", - "comments": "", - "value": 6 + "name": "GIT_FETCH_PRUNE", + "comments": "

Force pruning on

\n", + "value": 1 }, { "type": "int", - "name": "GITERR_CONFIG", + "name": "GIT_FETCH_NO_PRUNE", + "comments": "

Force pruning off

\n", + "value": 2 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_filemode_t", + { + "decl": [ + "GIT_FILEMODE_UNREADABLE", + "GIT_FILEMODE_TREE", + "GIT_FILEMODE_BLOB", + "GIT_FILEMODE_BLOB_EXECUTABLE", + "GIT_FILEMODE_LINK", + "GIT_FILEMODE_COMMIT" + ], + "type": "enum", + "file": "git2/types.h", + "line": 238, + "lineto": 245, + "block": "GIT_FILEMODE_UNREADABLE\nGIT_FILEMODE_TREE\nGIT_FILEMODE_BLOB\nGIT_FILEMODE_BLOB_EXECUTABLE\nGIT_FILEMODE_LINK\nGIT_FILEMODE_COMMIT", + "tdef": "typedef", + "description": " Valid modes for index and tree entries. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_FILEMODE_UNREADABLE", "comments": "", - "value": 7 + "value": 0 }, { "type": "int", - "name": "GITERR_REGEX", + "name": "GIT_FILEMODE_TREE", "comments": "", - "value": 8 + "value": 16384 }, { "type": "int", - "name": "GITERR_ODB", + "name": "GIT_FILEMODE_BLOB", "comments": "", - "value": 9 + "value": 33188 }, { "type": "int", - "name": "GITERR_INDEX", + "name": "GIT_FILEMODE_BLOB_EXECUTABLE", "comments": "", - "value": 10 + "value": 33261 }, { "type": "int", - "name": "GITERR_OBJECT", + "name": "GIT_FILEMODE_LINK", "comments": "", - "value": 11 + "value": 40960 }, { "type": "int", - "name": "GITERR_NET", + "name": "GIT_FILEMODE_COMMIT", "comments": "", - "value": 12 - }, + "value": 57344 + } + ], + "used": { + "returns": ["git_tree_entry_filemode", "git_tree_entry_filemode_raw"], + "needs": ["git_treebuilder_insert"] + } + } + ], + [ + "git_filter", + { + "decl": "git_filter", + "type": "struct", + "value": "git_filter", + "file": "git2/filter.h", + "line": 109, + "lineto": 109, + "tdef": "typedef", + "description": " A filter that can transform file data", + "comments": "

This represents a filter that can be used to transform or even replace file data. Libgit2 includes one built in filter and it is possible to write your own (see git2/sys/filter.h for information on that).

\n\n

The two builtin filters are:

\n\n\n", + "used": { + "returns": [], + "needs": [ + "git_filter_list_apply_to_blob", + "git_filter_list_apply_to_buffer", + "git_filter_list_apply_to_data", + "git_filter_list_apply_to_file", + "git_filter_list_contains", + "git_filter_list_free", + "git_filter_list_load", + "git_filter_list_load_ext", + "git_filter_list_stream_blob", + "git_filter_list_stream_buffer", + "git_filter_list_stream_data", + "git_filter_list_stream_file" + ] + } + } + ], + [ + "git_filter_flag_t", + { + "decl": [ + "GIT_FILTER_DEFAULT", + "GIT_FILTER_ALLOW_UNSAFE", + "GIT_FILTER_NO_SYSTEM_ATTRIBUTES", + "GIT_FILTER_ATTRIBUTES_FROM_HEAD", + "GIT_FILTER_ATTRIBUTES_FROM_COMMIT" + ], + "type": "enum", + "file": "git2/filter.h", + "line": 47, + "lineto": 64, + "block": "GIT_FILTER_DEFAULT\nGIT_FILTER_ALLOW_UNSAFE\nGIT_FILTER_NO_SYSTEM_ATTRIBUTES\nGIT_FILTER_ATTRIBUTES_FROM_HEAD\nGIT_FILTER_ATTRIBUTES_FROM_COMMIT", + "tdef": "typedef", + "description": " Filter option flags.", + "comments": "", + "fields": [ { "type": "int", - "name": "GITERR_TAG", + "name": "GIT_FILTER_DEFAULT", "comments": "", - "value": 13 + "value": 0 }, { "type": "int", - "name": "GITERR_TREE", - "comments": "", - "value": 14 + "name": "GIT_FILTER_ALLOW_UNSAFE", + "comments": "

Don't error for safecrlf violations, allow them to continue.

\n", + "value": 1 }, { "type": "int", - "name": "GITERR_INDEXER", - "comments": "", - "value": 15 + "name": "GIT_FILTER_NO_SYSTEM_ATTRIBUTES", + "comments": "

Don't load /etc/gitattributes (or the system equivalent)

\n", + "value": 2 }, { "type": "int", - "name": "GITERR_SSL", - "comments": "", - "value": 16 + "name": "GIT_FILTER_ATTRIBUTES_FROM_HEAD", + "comments": "

Load attributes from .gitattributes in the root of HEAD

\n", + "value": 4 }, { "type": "int", - "name": "GITERR_SUBMODULE", - "comments": "", - "value": 17 - }, + "name": "GIT_FILTER_ATTRIBUTES_FROM_COMMIT", + "comments": "

Load attributes from .gitattributes in a given commit.\n This can only be specified in a git_filter_options.

\n", + "value": 8 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_filter_list", + { + "decl": "git_filter_list", + "type": "struct", + "value": "git_filter_list", + "file": "git2/filter.h", + "line": 121, + "lineto": 121, + "tdef": "typedef", + "description": " List of filters to be applied", + "comments": "

This represents a list of filters to be applied to a file / blob. You can build the list with one call, apply it with another, and dispose it with a third. In typical usage, there are not many occasions where a git_filter_list is needed directly since the library will generally handle conversions for you, but it can be convenient to be able to build and apply the list sometimes.

\n", + "used": { + "returns": [], + "needs": [ + "git_filter_list_apply_to_blob", + "git_filter_list_apply_to_buffer", + "git_filter_list_apply_to_data", + "git_filter_list_apply_to_file", + "git_filter_list_contains", + "git_filter_list_free", + "git_filter_list_load", + "git_filter_list_load_ext", + "git_filter_list_stream_blob", + "git_filter_list_stream_buffer", + "git_filter_list_stream_data", + "git_filter_list_stream_file" + ] + } + } + ], + [ + "git_filter_mode_t", + { + "decl": [ + "GIT_FILTER_TO_WORKTREE", + "GIT_FILTER_SMUDGE", + "GIT_FILTER_TO_ODB", + "GIT_FILTER_CLEAN" + ], + "type": "enum", + "file": "git2/filter.h", + "line": 37, + "lineto": 42, + "block": "GIT_FILTER_TO_WORKTREE\nGIT_FILTER_SMUDGE\nGIT_FILTER_TO_ODB\nGIT_FILTER_CLEAN", + "tdef": "typedef", + "description": " Filters are applied in one of two directions: smudging - which is\n exporting a file from the Git object database to the working directory,\n and cleaning - which is importing a file from the working directory to\n the Git object database. These values control which direction of\n change is being applied.", + "comments": "", + "fields": [ { "type": "int", - "name": "GITERR_THREAD", + "name": "GIT_FILTER_TO_WORKTREE", "comments": "", - "value": 18 + "value": 0 }, { "type": "int", - "name": "GITERR_STASH", + "name": "GIT_FILTER_SMUDGE", "comments": "", - "value": 19 + "value": 0 }, { "type": "int", - "name": "GITERR_CHECKOUT", + "name": "GIT_FILTER_TO_ODB", "comments": "", - "value": 20 + "value": 1 }, { "type": "int", - "name": "GITERR_FETCHHEAD", + "name": "GIT_FILTER_CLEAN", "comments": "", - "value": 21 - }, + "value": 1 + } + ], + "used": { + "returns": [], + "needs": ["git_filter_list_load", "git_filter_list_load_ext"] + } + } + ], + [ + "git_filter_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "git_oid * commit_id", + "git_oid attr_commit_id" + ], + "type": "struct", + "value": "git_filter_options", + "file": "git2/filter.h", + "line": 69, + "lineto": 86, + "block": "unsigned int version\nuint32_t flags\ngit_oid * commit_id\ngit_oid attr_commit_id", + "tdef": "typedef", + "description": " Filtering options", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, { - "type": "int", - "name": "GITERR_MERGE", - "comments": "", - "value": 22 + "type": "uint32_t", + "name": "flags", + "comments": " See `git_filter_flag_t` above " }, + { "type": "git_oid *", "name": "commit_id", "comments": "" }, { - "type": "int", - "name": "GITERR_SSH", - "comments": "", - "value": 23 - }, + "type": "git_oid", + "name": "attr_commit_id", + "comments": " The commit to load attributes from, when\n `GIT_FILTER_ATTRIBUTES_FROM_COMMIT` is specified." + } + ], + "used": { "returns": [], "needs": ["git_filter_list_load_ext"] } + } + ], + [ + "git_filter_source", + { + "decl": "git_filter_source", + "type": "struct", + "value": "git_filter_source", + "file": "git2/sys/filter.h", + "line": 109, + "lineto": 109, + "tdef": "typedef", + "description": " A filter source represents a file/blob to be processed", + "comments": "", + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_hashsig_option_t", + { + "decl": [ + "GIT_HASHSIG_NORMAL", + "GIT_HASHSIG_IGNORE_WHITESPACE", + "GIT_HASHSIG_SMART_WHITESPACE", + "GIT_HASHSIG_ALLOW_SMALL_FILES" + ], + "type": "enum", + "file": "git2/sys/hashsig.h", + "line": 35, + "lineto": 55, + "block": "GIT_HASHSIG_NORMAL\nGIT_HASHSIG_IGNORE_WHITESPACE\nGIT_HASHSIG_SMART_WHITESPACE\nGIT_HASHSIG_ALLOW_SMALL_FILES", + "tdef": "typedef", + "description": " Options for hashsig computation", + "comments": "

The options GIT_HASHSIG_NORMAL, GIT_HASHSIG_IGNORE_WHITESPACE, GIT_HASHSIG_SMART_WHITESPACE are exclusive and should not be combined.

\n", + "fields": [ { "type": "int", - "name": "GITERR_FILTER", - "comments": "", - "value": 24 + "name": "GIT_HASHSIG_NORMAL", + "comments": "

Use all data

\n", + "value": 0 }, { "type": "int", - "name": "GITERR_REVERT", - "comments": "", - "value": 25 + "name": "GIT_HASHSIG_IGNORE_WHITESPACE", + "comments": "

Ignore whitespace

\n", + "value": 1 }, { "type": "int", - "name": "GITERR_CALLBACK", - "comments": "", - "value": 26 + "name": "GIT_HASHSIG_SMART_WHITESPACE", + "comments": "

Ignore

\n\n

and all space after

\n", + "value": 2 }, { "type": "int", - "name": "GITERR_CHERRYPICK", - "comments": "", - "value": 27 - }, + "name": "GIT_HASHSIG_ALLOW_SMALL_FILES", + "comments": "

Allow hashing of small files

\n", + "value": 4 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_index", + { + "decl": "git_index", + "type": "struct", + "value": "git_index", + "file": "git2/types.h", + "line": 153, + "lineto": 153, + "tdef": "typedef", + "description": " Memory representation of an index file. ", + "comments": "", + "used": { + "returns": [ + "git_index_get_byindex", + "git_index_get_bypath", + "git_remote_stats" + ], + "needs": [ + "git_apply_to_tree", + "git_checkout_index", + "git_cherrypick_commit", + "git_diff_index_to_index", + "git_diff_index_to_workdir", + "git_diff_tree_to_index", + "git_index_add", + "git_index_add_all", + "git_index_add_bypath", + "git_index_add_from_buffer", + "git_index_caps", + "git_index_checksum", + "git_index_clear", + "git_index_conflict_add", + "git_index_conflict_cleanup", + "git_index_conflict_get", + "git_index_conflict_iterator_free", + "git_index_conflict_iterator_new", + "git_index_conflict_next", + "git_index_conflict_remove", + "git_index_entry_is_conflict", + "git_index_entry_stage", + "git_index_entrycount", + "git_index_find", + "git_index_find_prefix", + "git_index_free", + "git_index_get_byindex", + "git_index_get_bypath", + "git_index_has_conflicts", + "git_index_iterator_free", + "git_index_iterator_new", + "git_index_iterator_next", + "git_index_new", + "git_index_open", + "git_index_owner", + "git_index_path", + "git_index_read", + "git_index_read_tree", + "git_index_remove", + "git_index_remove_all", + "git_index_remove_bypath", + "git_index_remove_directory", + "git_index_set_caps", + "git_index_set_version", + "git_index_update_all", + "git_index_version", + "git_index_write", + "git_index_write_tree", + "git_index_write_tree_to", + "git_indexer_append", + "git_indexer_commit", + "git_indexer_free", + "git_indexer_hash", + "git_indexer_name", + "git_indexer_new", + "git_indexer_options_init", + "git_indexer_progress_cb", + "git_merge_commits", + "git_merge_file_from_index", + "git_merge_trees", + "git_odb_write_pack", + "git_packbuilder_write", + "git_pathspec_match_index", + "git_rebase_inmemory_index", + "git_repository_index", + "git_revert_commit" + ] + } + } + ], + [ + "git_index_add_option_t", + { + "decl": [ + "GIT_INDEX_ADD_DEFAULT", + "GIT_INDEX_ADD_FORCE", + "GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH", + "GIT_INDEX_ADD_CHECK_PATHSPEC" + ], + "type": "enum", + "file": "git2/index.h", + "line": 162, + "lineto": 167, + "block": "GIT_INDEX_ADD_DEFAULT\nGIT_INDEX_ADD_FORCE\nGIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH\nGIT_INDEX_ADD_CHECK_PATHSPEC", + "tdef": "typedef", + "description": " Flags for APIs that add files matching pathspec ", + "comments": "", + "fields": [ { "type": "int", - "name": "GITERR_DESCRIBE", + "name": "GIT_INDEX_ADD_DEFAULT", "comments": "", - "value": 28 + "value": 0 }, { "type": "int", - "name": "GITERR_REBASE", + "name": "GIT_INDEX_ADD_FORCE", "comments": "", - "value": 29 + "value": 1 }, { "type": "int", - "name": "GITERR_FILESYSTEM", + "name": "GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH", "comments": "", - "value": 30 + "value": 2 }, { "type": "int", - "name": "GITERR_PATCH", + "name": "GIT_INDEX_ADD_CHECK_PATHSPEC", "comments": "", - "value": 31 + "value": 4 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_feature_t", + "git_index_capability_t", { "decl": [ - "GIT_FEATURE_THREADS", - "GIT_FEATURE_HTTPS", - "GIT_FEATURE_SSH", - "GIT_FEATURE_NSEC" + "GIT_INDEX_CAPABILITY_IGNORE_CASE", + "GIT_INDEX_CAPABILITY_NO_FILEMODE", + "GIT_INDEX_CAPABILITY_NO_SYMLINKS", + "GIT_INDEX_CAPABILITY_FROM_OWNER" ], "type": "enum", - "file": "common.h", - "line": 111, - "lineto": 134, - "block": "GIT_FEATURE_THREADS\nGIT_FEATURE_HTTPS\nGIT_FEATURE_SSH\nGIT_FEATURE_NSEC", + "file": "git2/index.h", + "line": 142, + "lineto": 147, + "block": "GIT_INDEX_CAPABILITY_IGNORE_CASE\nGIT_INDEX_CAPABILITY_NO_FILEMODE\nGIT_INDEX_CAPABILITY_NO_SYMLINKS\nGIT_INDEX_CAPABILITY_FROM_OWNER", "tdef": "typedef", - "description": " Combinations of these values describe the features with which libgit2\n was compiled", + "description": " Capabilities of system that affect index actions. ", "comments": "", "fields": [ { "type": "int", - "name": "GIT_FEATURE_THREADS", - "comments": "

If set, libgit2 was built thread-aware and can be safely used from multiple\n threads.

\n", + "name": "GIT_INDEX_CAPABILITY_IGNORE_CASE", + "comments": "", "value": 1 }, { "type": "int", - "name": "GIT_FEATURE_HTTPS", - "comments": "

If set, libgit2 was built with and linked against a TLS implementation.\n Custom TLS streams may still be added by the user to support HTTPS\n regardless of this.

\n", + "name": "GIT_INDEX_CAPABILITY_NO_FILEMODE", + "comments": "", "value": 2 }, { "type": "int", - "name": "GIT_FEATURE_SSH", - "comments": "

If set, libgit2 was built with and linked against libssh2. A custom\n transport may still be added by the user to support libssh2 regardless of\n this.

\n", + "name": "GIT_INDEX_CAPABILITY_NO_SYMLINKS", + "comments": "", "value": 4 }, { "type": "int", - "name": "GIT_FEATURE_NSEC", - "comments": "

If set, libgit2 was built with support for sub-second resolution in file\n modification times.

\n", - "value": 8 + "name": "GIT_INDEX_CAPABILITY_FROM_OWNER", + "comments": "", + "value": -1 } ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_index_conflict_iterator", + { + "decl": "git_index_conflict_iterator", + "type": "struct", + "value": "git_index_conflict_iterator", + "file": "git2/types.h", + "line": 159, + "lineto": 159, + "tdef": "typedef", + "description": " An iterator for conflicts in the index. ", + "comments": "", "used": { "returns": [], - "needs": [] + "needs": [ + "git_index_conflict_iterator_free", + "git_index_conflict_iterator_new", + "git_index_conflict_next" + ] } } ], [ - "git_fetch_options", + "git_index_entry", { "decl": [ - "int version", - "git_remote_callbacks callbacks", - "git_fetch_prune_t prune", - "int update_fetchhead", - "git_remote_autotag_option_t download_tags", - "git_proxy_options proxy_opts", - "git_strarray custom_headers" + "git_index_time ctime", + "git_index_time mtime", + "uint32_t dev", + "uint32_t ino", + "uint32_t mode", + "uint32_t uid", + "uint32_t gid", + "uint32_t file_size", + "git_oid id", + "uint16_t flags", + "uint16_t flags_extended", + "const char * path" ], "type": "struct", - "value": "git_fetch_options", - "file": "remote.h", - "line": 525, - "lineto": 562, - "block": "int version\ngit_remote_callbacks callbacks\ngit_fetch_prune_t prune\nint update_fetchhead\ngit_remote_autotag_option_t download_tags\ngit_proxy_options proxy_opts\ngit_strarray custom_headers", + "value": "git_index_entry", + "file": "git2/index.h", + "line": 58, + "lineto": 75, + "block": "git_index_time ctime\ngit_index_time mtime\nuint32_t dev\nuint32_t ino\nuint32_t mode\nuint32_t uid\nuint32_t gid\nuint32_t file_size\ngit_oid id\nuint16_t flags\nuint16_t flags_extended\nconst char * path", "tdef": "typedef", - "description": " Fetch options structure.", - "comments": "

Zero out for defaults. Initialize with GIT_FETCH_OPTIONS_INIT macro to correctly set the version field. E.g.

\n\n
    git_fetch_options opts = GIT_FETCH_OPTIONS_INIT;\n
\n", + "description": " In-memory representation of a file entry in the index.", + "comments": "

This is a public structure that represents a file entry in the index. The meaning of the fields corresponds to core Git's documentation (in "Documentation/technical/index-format.txt").

\n\n

The flags field consists of a number of bit fields which can be accessed via the first set of GIT_INDEX_ENTRY_... bitmasks below. These flags are all read from and persisted to disk.

\n\n

The flags_extended field also has a number of bit fields which can be accessed via the later GIT_INDEX_ENTRY_... bitmasks below. Some of these flags are read from and written to disk, but some are set aside for in-memory only reference.

\n\n

Note that the time and size fields are truncated to 32 bits. This is enough to detect changes, which is enough for the index to function as a cache, but it should not be taken as an authoritative source for that data.

\n", "fields": [ - { - "type": "int", - "name": "version", - "comments": "" - }, - { - "type": "git_remote_callbacks", - "name": "callbacks", - "comments": " Callbacks to use for this fetch operation" - }, - { - "type": "git_fetch_prune_t", - "name": "prune", - "comments": " Whether to perform a prune after the fetch" - }, - { - "type": "int", - "name": "update_fetchhead", - "comments": " Whether to write the results to FETCH_HEAD. Defaults to\n on. Leave this default in order to behave like git." - }, - { - "type": "git_remote_autotag_option_t", - "name": "download_tags", - "comments": " Determines how to behave regarding tags on the remote, such\n as auto-downloading tags for objects we're downloading or\n downloading all of them.\n\n The default is to auto-follow tags." - }, - { - "type": "git_proxy_options", - "name": "proxy_opts", - "comments": " Proxy options to use, by default no proxy is used." - }, - { - "type": "git_strarray", - "name": "custom_headers", - "comments": " Extra headers for this fetch operation" - } + { "type": "git_index_time", "name": "ctime", "comments": "" }, + { "type": "git_index_time", "name": "mtime", "comments": "" }, + { "type": "uint32_t", "name": "dev", "comments": "" }, + { "type": "uint32_t", "name": "ino", "comments": "" }, + { "type": "uint32_t", "name": "mode", "comments": "" }, + { "type": "uint32_t", "name": "uid", "comments": "" }, + { "type": "uint32_t", "name": "gid", "comments": "" }, + { "type": "uint32_t", "name": "file_size", "comments": "" }, + { "type": "git_oid", "name": "id", "comments": "" }, + { "type": "uint16_t", "name": "flags", "comments": "" }, + { "type": "uint16_t", "name": "flags_extended", "comments": "" }, + { "type": "const char *", "name": "path", "comments": "" } ], "used": { - "returns": [], + "returns": ["git_index_get_byindex", "git_index_get_bypath"], "needs": [ - "git_fetch_init_options", - "git_remote_download", - "git_remote_fetch" + "git_index_add", + "git_index_add_from_buffer", + "git_index_conflict_add", + "git_index_conflict_get", + "git_index_conflict_next", + "git_index_entry_is_conflict", + "git_index_entry_stage", + "git_index_iterator_next", + "git_merge_file_from_index" ] } } ], [ - "git_filemode_t", + "git_index_entry_extended_flag_t", { "decl": [ - "GIT_FILEMODE_UNREADABLE", - "GIT_FILEMODE_TREE", - "GIT_FILEMODE_BLOB", - "GIT_FILEMODE_BLOB_EXECUTABLE", - "GIT_FILEMODE_LINK", - "GIT_FILEMODE_COMMIT" + "GIT_INDEX_ENTRY_INTENT_TO_ADD", + "GIT_INDEX_ENTRY_SKIP_WORKTREE", + "GIT_INDEX_ENTRY_EXTENDED_FLAGS", + "GIT_INDEX_ENTRY_UPTODATE" ], "type": "enum", - "file": "types.h", - "line": 205, - "lineto": 212, - "block": "GIT_FILEMODE_UNREADABLE\nGIT_FILEMODE_TREE\nGIT_FILEMODE_BLOB\nGIT_FILEMODE_BLOB_EXECUTABLE\nGIT_FILEMODE_LINK\nGIT_FILEMODE_COMMIT", + "file": "git2/index.h", + "line": 132, + "lineto": 139, + "block": "GIT_INDEX_ENTRY_INTENT_TO_ADD\nGIT_INDEX_ENTRY_SKIP_WORKTREE\nGIT_INDEX_ENTRY_EXTENDED_FLAGS\nGIT_INDEX_ENTRY_UPTODATE", "tdef": "typedef", - "description": " Valid modes for index and tree entries. ", - "comments": "", + "description": " Bitmasks for on-disk fields of `git_index_entry`'s `flags_extended`", + "comments": "

In memory, the flags_extended fields are divided into two parts: the fields that are read from and written to disk, and other fields that in-memory only and used by libgit2. Only the flags in GIT_INDEX_ENTRY_EXTENDED_FLAGS will get saved on-disk.

\n\n

Thee first three bitmasks match the three fields in the git_index_entry flags_extended value that belong on disk. You can use them to interpret the data in the flags_extended.

\n\n

The rest of the bitmasks match the other fields in the git_index_entry flags_extended value that are only used in-memory by libgit2. You can use them to interpret the data in the flags_extended.

\n", "fields": [ { "type": "int", - "name": "GIT_FILEMODE_UNREADABLE", + "name": "GIT_INDEX_ENTRY_INTENT_TO_ADD", "comments": "", - "value": 0 + "value": 8192 }, { "type": "int", - "name": "GIT_FILEMODE_TREE", + "name": "GIT_INDEX_ENTRY_SKIP_WORKTREE", "comments": "", "value": 16384 }, { "type": "int", - "name": "GIT_FILEMODE_BLOB", - "comments": "", - "value": 33188 - }, - { - "type": "int", - "name": "GIT_FILEMODE_BLOB_EXECUTABLE", - "comments": "", - "value": 33261 - }, - { - "type": "int", - "name": "GIT_FILEMODE_LINK", + "name": "GIT_INDEX_ENTRY_EXTENDED_FLAGS", "comments": "", - "value": 40960 + "value": 24576 }, { "type": "int", - "name": "GIT_FILEMODE_COMMIT", + "name": "GIT_INDEX_ENTRY_UPTODATE", "comments": "", - "value": 57344 - } - ], - "used": { - "returns": [ - "git_tree_entry_filemode", - "git_tree_entry_filemode_raw" - ], - "needs": [ - "git_treebuilder_insert" - ] - } - } - ], - [ - "git_filter", - { - "decl": [ - "unsigned int version", - "const char * attributes", - "git_filter_init_fn initialize", - "git_filter_shutdown_fn shutdown", - "git_filter_check_fn check", - "git_filter_apply_fn apply", - "git_filter_stream_fn stream", - "git_filter_cleanup_fn cleanup" - ], - "type": "struct", - "value": "git_filter", - "file": "sys/filter.h", - "line": 226, - "lineto": 271, - "tdef": null, - "description": " Filter structure used to register custom filters.", - "comments": "

To associate extra data with a filter, allocate extra data and put the git_filter struct at the start of your data buffer, then cast the self pointer to your larger structure when your callback is invoked.

\n", - "block": "unsigned int version\nconst char * attributes\ngit_filter_init_fn initialize\ngit_filter_shutdown_fn shutdown\ngit_filter_check_fn check\ngit_filter_apply_fn apply\ngit_filter_stream_fn stream\ngit_filter_cleanup_fn cleanup", - "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": " The `version` field should be set to `GIT_FILTER_VERSION`. " - }, - { - "type": "const char *", - "name": "attributes", - "comments": " A whitespace-separated list of attribute names to check for this\n filter (e.g. \"eol crlf text\"). If the attribute name is bare, it\n will be simply loaded and passed to the `check` callback. If it\n has a value (i.e. \"name=value\"), the attribute must match that\n value for the filter to be applied. The value may be a wildcard\n (eg, \"name=*\"), in which case the filter will be invoked for any\n value for the given attribute name. See the attribute parameter\n of the `check` callback for the attribute value that was specified." - }, - { - "type": "git_filter_init_fn", - "name": "initialize", - "comments": " Called when the filter is first used for any file. " - }, - { - "type": "git_filter_shutdown_fn", - "name": "shutdown", - "comments": " Called when the filter is removed or unregistered from the system. " - }, - { - "type": "git_filter_check_fn", - "name": "check", - "comments": " Called to determine whether the filter should be invoked for a\n given file. If this function returns `GIT_PASSTHROUGH` then the\n `apply` function will not be invoked and the contents will be passed\n through unmodified." - }, - { - "type": "git_filter_apply_fn", - "name": "apply", - "comments": " Called to actually apply the filter to file contents. If this\n function returns `GIT_PASSTHROUGH` then the contents will be passed\n through unmodified." - }, - { - "type": "git_filter_stream_fn", - "name": "stream", - "comments": " Called to apply the filter in a streaming manner. If this is not\n specified then the system will call `apply` with the whole buffer." - }, - { - "type": "git_filter_cleanup_fn", - "name": "cleanup", - "comments": " Called when the system is done filtering for a file. " + "value": 4 } ], - "used": { - "returns": [ - "git_filter_lookup", - "git_filter_source_mode" - ], - "needs": [ - "git_filter_apply_fn", - "git_filter_check_fn", - "git_filter_cleanup_fn", - "git_filter_init_fn", - "git_filter_list_apply_to_blob", - "git_filter_list_apply_to_data", - "git_filter_list_apply_to_file", - "git_filter_list_contains", - "git_filter_list_free", - "git_filter_list_length", - "git_filter_list_load", - "git_filter_list_new", - "git_filter_list_push", - "git_filter_list_stream_blob", - "git_filter_list_stream_data", - "git_filter_list_stream_file", - "git_filter_register", - "git_filter_shutdown_fn", - "git_filter_source_filemode", - "git_filter_source_flags", - "git_filter_source_id", - "git_filter_source_mode", - "git_filter_source_path", - "git_filter_source_repo" - ] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_filter_flag_t", + "git_index_entry_flag_t", { - "decl": [ - "GIT_FILTER_DEFAULT", - "GIT_FILTER_ALLOW_UNSAFE" - ], + "decl": ["GIT_INDEX_ENTRY_EXTENDED", "GIT_INDEX_ENTRY_VALID"], "type": "enum", - "file": "filter.h", - "line": 41, - "lineto": 44, - "block": "GIT_FILTER_DEFAULT\nGIT_FILTER_ALLOW_UNSAFE", + "file": "git2/index.h", + "line": 95, + "lineto": 98, + "block": "GIT_INDEX_ENTRY_EXTENDED\nGIT_INDEX_ENTRY_VALID", "tdef": "typedef", - "description": " Filter option flags.", + "description": " Flags for index entries", "comments": "", "fields": [ { "type": "int", - "name": "GIT_FILTER_DEFAULT", + "name": "GIT_INDEX_ENTRY_EXTENDED", "comments": "", - "value": 0 + "value": 16384 }, { "type": "int", - "name": "GIT_FILTER_ALLOW_UNSAFE", + "name": "GIT_INDEX_ENTRY_VALID", "comments": "", - "value": 1 + "value": 32768 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_filter_list", + "git_index_iterator", { - "decl": "git_filter_list", + "decl": "git_index_iterator", "type": "struct", - "value": "git_filter_list", - "file": "filter.h", - "line": 73, - "lineto": 73, + "value": "git_index_iterator", + "file": "git2/types.h", + "line": 156, + "lineto": 156, "tdef": "typedef", - "description": " List of filters to be applied", - "comments": "

This represents a list of filters to be applied to a file / blob. You can build the list with one call, apply it with another, and dispose it with a third. In typical usage, there are not many occasions where a git_filter_list is needed directly since the library will generally handle conversions for you, but it can be convenient to be able to build and apply the list sometimes.

\n", + "description": " An iterator for entries in the index. ", + "comments": "", "used": { "returns": [], "needs": [ - "git_filter_list_apply_to_blob", - "git_filter_list_apply_to_data", - "git_filter_list_apply_to_file", - "git_filter_list_contains", - "git_filter_list_free", - "git_filter_list_length", - "git_filter_list_load", - "git_filter_list_new", - "git_filter_list_push", - "git_filter_list_stream_blob", - "git_filter_list_stream_data", - "git_filter_list_stream_file" + "git_index_iterator_free", + "git_index_iterator_new", + "git_index_iterator_next" ] } } ], [ - "git_filter_mode_t", + "git_index_stage_t", { "decl": [ - "GIT_FILTER_TO_WORKTREE", - "GIT_FILTER_SMUDGE", - "GIT_FILTER_TO_ODB", - "GIT_FILTER_CLEAN" + "GIT_INDEX_STAGE_ANY", + "GIT_INDEX_STAGE_NORMAL", + "GIT_INDEX_STAGE_ANCESTOR", + "GIT_INDEX_STAGE_OURS", + "GIT_INDEX_STAGE_THEIRS" ], "type": "enum", - "file": "filter.h", - "line": 31, - "lineto": 36, - "block": "GIT_FILTER_TO_WORKTREE\nGIT_FILTER_SMUDGE\nGIT_FILTER_TO_ODB\nGIT_FILTER_CLEAN", + "file": "git2/index.h", + "line": 170, + "lineto": 190, + "block": "GIT_INDEX_STAGE_ANY\nGIT_INDEX_STAGE_NORMAL\nGIT_INDEX_STAGE_ANCESTOR\nGIT_INDEX_STAGE_OURS\nGIT_INDEX_STAGE_THEIRS", "tdef": "typedef", - "description": " Filters are applied in one of two directions: smudging - which is\n exporting a file from the Git object database to the working directory,\n and cleaning - which is importing a file from the working directory to\n the Git object database. These values control which direction of\n change is being applied.", + "description": " Git index stage states ", "comments": "", "fields": [ { "type": "int", - "name": "GIT_FILTER_TO_WORKTREE", - "comments": "", - "value": 0 + "name": "GIT_INDEX_STAGE_ANY", + "comments": "

Match any index stage.

\n\n

Some index APIs take a stage to match; pass this value to match\n any entry matching the path regardless of stage.

\n", + "value": -1 }, { "type": "int", - "name": "GIT_FILTER_SMUDGE", - "comments": "", + "name": "GIT_INDEX_STAGE_NORMAL", + "comments": "

A normal staged file in the index.

\n", "value": 0 }, { "type": "int", - "name": "GIT_FILTER_TO_ODB", - "comments": "", + "name": "GIT_INDEX_STAGE_ANCESTOR", + "comments": "

The ancestor side of a conflict.

\n", "value": 1 }, { "type": "int", - "name": "GIT_FILTER_CLEAN", - "comments": "", - "value": 1 + "name": "GIT_INDEX_STAGE_OURS", + "comments": "

The "ours" side of a conflict.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_INDEX_STAGE_THEIRS", + "comments": "

The "theirs" side of a conflict.

\n", + "value": 3 } ], - "used": { - "returns": [ - "git_filter_source_mode" - ], - "needs": [ - "git_filter_list_load", - "git_filter_list_new" - ] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_filter_source", + "git_index_time", { - "decl": "git_filter_source", + "decl": ["int32_t seconds", "uint32_t nanoseconds"], "type": "struct", - "value": "git_filter_source", - "file": "sys/filter.h", - "line": 95, - "lineto": 95, + "value": "git_index_time", + "file": "git2/index.h", + "line": 31, + "lineto": 35, + "block": "int32_t seconds\nuint32_t nanoseconds", "tdef": "typedef", - "description": " A filter source represents a file/blob to be processed", + "description": " Time structure used in a git index entry ", "comments": "", - "used": { - "returns": [], - "needs": [ - "git_filter_apply_fn", - "git_filter_check_fn", - "git_filter_source_filemode", - "git_filter_source_flags", - "git_filter_source_id", - "git_filter_source_mode", - "git_filter_source_path", - "git_filter_source_repo" - ] - } + "fields": [ + { "type": "int32_t", "name": "seconds", "comments": "" }, + { "type": "uint32_t", "name": "nanoseconds", "comments": "" } + ], + "used": { "returns": [], "needs": [] } } ], [ - "git_hashsig", + "git_indexer", { - "decl": "git_hashsig", + "decl": "git_indexer", "type": "struct", - "value": "git_hashsig", - "file": "sys/hashsig.h", - "line": 17, - "lineto": 17, + "value": "git_indexer", + "file": "git2/indexer.h", + "line": 27, + "lineto": 27, "tdef": "typedef", - "description": " Similarity signature of arbitrary text content based on line hashes", + "description": " A git indexer object ", "comments": "", "used": { - "returns": [], + "returns": ["git_remote_stats"], "needs": [ - "git_hashsig_compare", - "git_hashsig_create", - "git_hashsig_create_fromfile", - "git_hashsig_free" + "git_indexer_append", + "git_indexer_commit", + "git_indexer_free", + "git_indexer_hash", + "git_indexer_name", + "git_indexer_new", + "git_indexer_options_init", + "git_indexer_progress_cb", + "git_odb_write_pack", + "git_packbuilder_write" ] } } ], [ - "git_hashsig_option_t", + "git_indexer_options", { "decl": [ - "GIT_HASHSIG_NORMAL", - "GIT_HASHSIG_IGNORE_WHITESPACE", - "GIT_HASHSIG_SMART_WHITESPACE", - "GIT_HASHSIG_ALLOW_SMALL_FILES" + "unsigned int version", + "git_indexer_progress_cb progress_cb", + "void * progress_cb_payload", + "unsigned char verify" ], - "type": "enum", - "file": "sys/hashsig.h", - "line": 25, - "lineto": 45, - "block": "GIT_HASHSIG_NORMAL\nGIT_HASHSIG_IGNORE_WHITESPACE\nGIT_HASHSIG_SMART_WHITESPACE\nGIT_HASHSIG_ALLOW_SMALL_FILES", + "type": "struct", + "value": "git_indexer_options", + "file": "git2/indexer.h", + "line": 73, + "lineto": 100, + "block": "unsigned int version\ngit_indexer_progress_cb progress_cb\nvoid * progress_cb_payload\nunsigned char verify", "tdef": "typedef", - "description": " Options for hashsig computation", - "comments": "

The options GIT_HASHSIG_NORMAL, GIT_HASHSIG_IGNORE_WHITESPACE, GIT_HASHSIG_SMART_WHITESPACE are exclusive and should not be combined.

\n", + "description": " Options for indexer configuration", + "comments": "", "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, { - "type": "int", - "name": "GIT_HASHSIG_NORMAL", - "comments": "

Use all data

\n", - "value": 0 - }, - { - "type": "int", - "name": "GIT_HASHSIG_IGNORE_WHITESPACE", - "comments": "

Ignore whitespace

\n", - "value": 1 + "type": "git_indexer_progress_cb", + "name": "progress_cb", + "comments": " progress_cb function to call with progress information " }, { - "type": "int", - "name": "GIT_HASHSIG_SMART_WHITESPACE", - "comments": "

Ignore

\n\n

and all space after

\n", - "value": 2 + "type": "void *", + "name": "progress_cb_payload", + "comments": " progress_cb_payload payload for the progress callback " }, { - "type": "int", - "name": "GIT_HASHSIG_ALLOW_SMALL_FILES", - "comments": "

Allow hashing of small files

\n", - "value": 4 + "type": "unsigned char", + "name": "verify", + "comments": " Do connectivity checks for the received pack " } ], "used": { "returns": [], - "needs": [ - "git_hashsig_create", - "git_hashsig_create_fromfile" - ] + "needs": ["git_indexer_new", "git_indexer_options_init"] } } ], [ - "git_idxentry_extended_flag_t", + "git_indexer_progress", { "decl": [ - "GIT_IDXENTRY_INTENT_TO_ADD", - "GIT_IDXENTRY_SKIP_WORKTREE", - "GIT_IDXENTRY_EXTENDED2", - "GIT_IDXENTRY_EXTENDED_FLAGS", - "GIT_IDXENTRY_UPDATE", - "GIT_IDXENTRY_REMOVE", - "GIT_IDXENTRY_UPTODATE", - "GIT_IDXENTRY_ADDED", - "GIT_IDXENTRY_HASHED", - "GIT_IDXENTRY_UNHASHED", - "GIT_IDXENTRY_WT_REMOVE", - "GIT_IDXENTRY_CONFLICTED", - "GIT_IDXENTRY_UNPACKED", - "GIT_IDXENTRY_NEW_SKIP_WORKTREE" + "unsigned int total_objects", + "unsigned int indexed_objects", + "unsigned int received_objects", + "unsigned int local_objects", + "unsigned int total_deltas", + "unsigned int indexed_deltas", + "size_t received_bytes" ], - "type": "enum", - "file": "index.h", - "line": 115, - "lineto": 135, - "block": "GIT_IDXENTRY_INTENT_TO_ADD\nGIT_IDXENTRY_SKIP_WORKTREE\nGIT_IDXENTRY_EXTENDED2\nGIT_IDXENTRY_EXTENDED_FLAGS\nGIT_IDXENTRY_UPDATE\nGIT_IDXENTRY_REMOVE\nGIT_IDXENTRY_UPTODATE\nGIT_IDXENTRY_ADDED\nGIT_IDXENTRY_HASHED\nGIT_IDXENTRY_UNHASHED\nGIT_IDXENTRY_WT_REMOVE\nGIT_IDXENTRY_CONFLICTED\nGIT_IDXENTRY_UNPACKED\nGIT_IDXENTRY_NEW_SKIP_WORKTREE", + "type": "struct", + "value": "git_indexer_progress", + "file": "git2/indexer.h", + "line": 34, + "lineto": 58, + "block": "unsigned int total_objects\nunsigned int indexed_objects\nunsigned int received_objects\nunsigned int local_objects\nunsigned int total_deltas\nunsigned int indexed_deltas\nsize_t received_bytes", "tdef": "typedef", - "description": " Bitmasks for on-disk fields of `git_index_entry`'s `flags_extended`", - "comments": "

In memory, the flags_extended fields are divided into two parts: the fields that are read from and written to disk, and other fields that in-memory only and used by libgit2. Only the flags in GIT_IDXENTRY_EXTENDED_FLAGS will get saved on-disk.

\n\n

Thee first three bitmasks match the three fields in the git_index_entry flags_extended value that belong on disk. You can use them to interpret the data in the flags_extended.

\n\n

The rest of the bitmasks match the other fields in the git_index_entry flags_extended value that are only used in-memory by libgit2. You can use them to interpret the data in the flags_extended.

\n", + "description": " This structure is used to provide callers information about the\n progress of indexing a packfile, either directly or part of a\n fetch or clone that downloads a packfile.", + "comments": "", "fields": [ { - "type": "int", - "name": "GIT_IDXENTRY_INTENT_TO_ADD", - "comments": "", - "value": 8192 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_SKIP_WORKTREE", - "comments": "", - "value": 16384 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_EXTENDED2", - "comments": "

Reserved for future extension

\n", - "value": 32768 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_EXTENDED_FLAGS", - "comments": "

Reserved for future extension

\n", - "value": 24576 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_UPDATE", - "comments": "

Reserved for future extension

\n", - "value": 1 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_REMOVE", - "comments": "

Reserved for future extension

\n", - "value": 2 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_UPTODATE", - "comments": "

Reserved for future extension

\n", - "value": 4 - }, - { - "type": "int", - "name": "GIT_IDXENTRY_ADDED", - "comments": "

Reserved for future extension

\n", - "value": 8 + "type": "unsigned int", + "name": "total_objects", + "comments": " number of objects in the packfile being indexed " }, { - "type": "int", - "name": "GIT_IDXENTRY_HASHED", - "comments": "

Reserved for future extension

\n", - "value": 16 + "type": "unsigned int", + "name": "indexed_objects", + "comments": " received objects that have been hashed " }, { - "type": "int", - "name": "GIT_IDXENTRY_UNHASHED", - "comments": "

Reserved for future extension

\n", - "value": 32 + "type": "unsigned int", + "name": "received_objects", + "comments": " received_objects: objects which have been downloaded " }, { - "type": "int", - "name": "GIT_IDXENTRY_WT_REMOVE", - "comments": "

remove in work directory

\n", - "value": 64 + "type": "unsigned int", + "name": "local_objects", + "comments": " locally-available objects that have been injected in order\n to fix a thin pack" }, { - "type": "int", - "name": "GIT_IDXENTRY_CONFLICTED", - "comments": "", - "value": 128 + "type": "unsigned int", + "name": "total_deltas", + "comments": " number of deltas in the packfile being indexed " }, { - "type": "int", - "name": "GIT_IDXENTRY_UNPACKED", - "comments": "", - "value": 256 + "type": "unsigned int", + "name": "indexed_deltas", + "comments": " received deltas that have been indexed " }, { - "type": "int", - "name": "GIT_IDXENTRY_NEW_SKIP_WORKTREE", - "comments": "", - "value": 512 - } - ], - "used": { - "returns": [], - "needs": [] - } - } - ], - [ - "git_index", - { - "decl": "git_index", - "type": "struct", - "value": "git_index", - "file": "types.h", - "line": 132, - "lineto": 132, - "tdef": "typedef", - "description": " Memory representation of an index file. ", - "comments": "", - "used": { - "returns": [ - "git_index_get_byindex", - "git_index_get_bypath" - ], - "needs": [ - "git_checkout_index", - "git_cherrypick_commit", - "git_diff_index_to_index", - "git_diff_index_to_workdir", - "git_diff_tree_to_index", - "git_index_add", - "git_index_add_all", - "git_index_add_bypath", - "git_index_add_frombuffer", - "git_index_caps", - "git_index_checksum", - "git_index_clear", - "git_index_conflict_add", - "git_index_conflict_cleanup", - "git_index_conflict_get", - "git_index_conflict_iterator_free", - "git_index_conflict_iterator_new", - "git_index_conflict_next", - "git_index_conflict_remove", - "git_index_entry_is_conflict", - "git_index_entry_stage", - "git_index_entrycount", - "git_index_find", - "git_index_find_prefix", - "git_index_free", - "git_index_get_byindex", - "git_index_get_bypath", - "git_index_has_conflicts", - "git_index_new", - "git_index_open", - "git_index_owner", - "git_index_path", - "git_index_read", - "git_index_read_tree", - "git_index_remove", - "git_index_remove_all", - "git_index_remove_bypath", - "git_index_remove_directory", - "git_index_set_caps", - "git_index_set_version", - "git_index_update_all", - "git_index_version", - "git_index_write", - "git_index_write_tree", - "git_index_write_tree_to", + "type": "size_t", + "name": "received_bytes", + "comments": " size of the packfile received up to now " + } + ], + "used": { + "returns": ["git_remote_stats"], + "needs": [ "git_indexer_append", "git_indexer_commit", - "git_indexer_free", - "git_indexer_hash", - "git_indexer_new", - "git_merge_commits", - "git_merge_file_from_index", - "git_merge_trees", - "git_pathspec_match_index", - "git_rebase_inmemory_index", - "git_repository_index", - "git_repository_set_index", - "git_revert_commit" + "git_indexer_progress_cb", + "git_odb_write_pack", + "git_packbuilder_write" ] } } ], [ - "git_index_add_option_t", + "git_libgit2_opt_t", { "decl": [ - "GIT_INDEX_ADD_DEFAULT", - "GIT_INDEX_ADD_FORCE", - "GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH", - "GIT_INDEX_ADD_CHECK_PATHSPEC" + "GIT_OPT_GET_MWINDOW_SIZE", + "GIT_OPT_SET_MWINDOW_SIZE", + "GIT_OPT_GET_MWINDOW_MAPPED_LIMIT", + "GIT_OPT_SET_MWINDOW_MAPPED_LIMIT", + "GIT_OPT_GET_SEARCH_PATH", + "GIT_OPT_SET_SEARCH_PATH", + "GIT_OPT_SET_CACHE_OBJECT_LIMIT", + "GIT_OPT_SET_CACHE_MAX_SIZE", + "GIT_OPT_ENABLE_CACHING", + "GIT_OPT_GET_CACHED_MEMORY", + "GIT_OPT_GET_TEMPLATE_PATH", + "GIT_OPT_SET_TEMPLATE_PATH", + "GIT_OPT_SET_SSL_CERT_LOCATIONS", + "GIT_OPT_SET_USER_AGENT", + "GIT_OPT_ENABLE_STRICT_OBJECT_CREATION", + "GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION", + "GIT_OPT_SET_SSL_CIPHERS", + "GIT_OPT_GET_USER_AGENT", + "GIT_OPT_ENABLE_OFS_DELTA", + "GIT_OPT_ENABLE_FSYNC_GITDIR", + "GIT_OPT_GET_WINDOWS_SHAREMODE", + "GIT_OPT_SET_WINDOWS_SHAREMODE", + "GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION", + "GIT_OPT_SET_ALLOCATOR", + "GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY", + "GIT_OPT_GET_PACK_MAX_OBJECTS", + "GIT_OPT_SET_PACK_MAX_OBJECTS", + "GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS", + "GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE", + "GIT_OPT_GET_MWINDOW_FILE_LIMIT", + "GIT_OPT_SET_MWINDOW_FILE_LIMIT", + "GIT_OPT_SET_ODB_PACKED_PRIORITY", + "GIT_OPT_SET_ODB_LOOSE_PRIORITY", + "GIT_OPT_GET_EXTENSIONS", + "GIT_OPT_SET_EXTENSIONS", + "GIT_OPT_GET_OWNER_VALIDATION", + "GIT_OPT_SET_OWNER_VALIDATION", + "GIT_OPT_GET_HOMEDIR", + "GIT_OPT_SET_HOMEDIR", + "GIT_OPT_SET_SERVER_CONNECT_TIMEOUT", + "GIT_OPT_GET_SERVER_CONNECT_TIMEOUT", + "GIT_OPT_SET_SERVER_TIMEOUT", + "GIT_OPT_GET_SERVER_TIMEOUT", + "GIT_OPT_SET_USER_AGENT_PRODUCT", + "GIT_OPT_GET_USER_AGENT_PRODUCT", + "GIT_OPT_ADD_SSL_X509_CERT" ], "type": "enum", - "file": "index.h", - "line": 150, - "lineto": 155, - "block": "GIT_INDEX_ADD_DEFAULT\nGIT_INDEX_ADD_FORCE\nGIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH\nGIT_INDEX_ADD_CHECK_PATHSPEC", + "file": "git2/common.h", + "line": 214, + "lineto": 261, + "block": "GIT_OPT_GET_MWINDOW_SIZE\nGIT_OPT_SET_MWINDOW_SIZE\nGIT_OPT_GET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_SET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_GET_SEARCH_PATH\nGIT_OPT_SET_SEARCH_PATH\nGIT_OPT_SET_CACHE_OBJECT_LIMIT\nGIT_OPT_SET_CACHE_MAX_SIZE\nGIT_OPT_ENABLE_CACHING\nGIT_OPT_GET_CACHED_MEMORY\nGIT_OPT_GET_TEMPLATE_PATH\nGIT_OPT_SET_TEMPLATE_PATH\nGIT_OPT_SET_SSL_CERT_LOCATIONS\nGIT_OPT_SET_USER_AGENT\nGIT_OPT_ENABLE_STRICT_OBJECT_CREATION\nGIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION\nGIT_OPT_SET_SSL_CIPHERS\nGIT_OPT_GET_USER_AGENT\nGIT_OPT_ENABLE_OFS_DELTA\nGIT_OPT_ENABLE_FSYNC_GITDIR\nGIT_OPT_GET_WINDOWS_SHAREMODE\nGIT_OPT_SET_WINDOWS_SHAREMODE\nGIT_OPT_ENABLE_STRICT_HASH_VERIFICATION\nGIT_OPT_SET_ALLOCATOR\nGIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY\nGIT_OPT_GET_PACK_MAX_OBJECTS\nGIT_OPT_SET_PACK_MAX_OBJECTS\nGIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS\nGIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE\nGIT_OPT_GET_MWINDOW_FILE_LIMIT\nGIT_OPT_SET_MWINDOW_FILE_LIMIT\nGIT_OPT_SET_ODB_PACKED_PRIORITY\nGIT_OPT_SET_ODB_LOOSE_PRIORITY\nGIT_OPT_GET_EXTENSIONS\nGIT_OPT_SET_EXTENSIONS\nGIT_OPT_GET_OWNER_VALIDATION\nGIT_OPT_SET_OWNER_VALIDATION\nGIT_OPT_GET_HOMEDIR\nGIT_OPT_SET_HOMEDIR\nGIT_OPT_SET_SERVER_CONNECT_TIMEOUT\nGIT_OPT_GET_SERVER_CONNECT_TIMEOUT\nGIT_OPT_SET_SERVER_TIMEOUT\nGIT_OPT_GET_SERVER_TIMEOUT\nGIT_OPT_SET_USER_AGENT_PRODUCT\nGIT_OPT_GET_USER_AGENT_PRODUCT\nGIT_OPT_ADD_SSL_X509_CERT", "tdef": "typedef", - "description": " Flags for APIs that add files matching pathspec ", - "comments": "", + "description": " Global library options", + "comments": "

These are used to select which global option to set or get and are used in git_libgit2_opts().

\n", "fields": [ { "type": "int", - "name": "GIT_INDEX_ADD_DEFAULT", + "name": "GIT_OPT_GET_MWINDOW_SIZE", "comments": "", "value": 0 }, { "type": "int", - "name": "GIT_INDEX_ADD_FORCE", + "name": "GIT_OPT_SET_MWINDOW_SIZE", "comments": "", "value": 1 }, { "type": "int", - "name": "GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH", + "name": "GIT_OPT_GET_MWINDOW_MAPPED_LIMIT", "comments": "", "value": 2 }, { "type": "int", - "name": "GIT_INDEX_ADD_CHECK_PATHSPEC", + "name": "GIT_OPT_SET_MWINDOW_MAPPED_LIMIT", + "comments": "", + "value": 3 + }, + { + "type": "int", + "name": "GIT_OPT_GET_SEARCH_PATH", "comments": "", "value": 4 - } - ], - "used": { - "returns": [], - "needs": [] - } - } - ], - [ - "git_index_conflict_iterator", - { - "decl": "git_index_conflict_iterator", - "type": "struct", - "value": "git_index_conflict_iterator", - "file": "types.h", - "line": 135, - "lineto": 135, - "tdef": "typedef", - "description": " An iterator for conflicts in the index. ", - "comments": "", - "used": { - "returns": [], - "needs": [ - "git_index_conflict_iterator_free", - "git_index_conflict_iterator_new", - "git_index_conflict_next" - ] - } - } - ], - [ - "git_index_entry", - { - "decl": [ - "git_index_time ctime", - "git_index_time mtime", - "uint32_t dev", - "uint32_t ino", - "uint32_t mode", - "uint32_t uid", - "uint32_t gid", - "uint32_t file_size", - "git_oid id", - "uint16_t flags", - "uint16_t flags_extended", - "const char * path" - ], - "type": "struct", - "value": "git_index_entry", - "file": "index.h", - "line": 53, - "lineto": 70, - "block": "git_index_time ctime\ngit_index_time mtime\nuint32_t dev\nuint32_t ino\nuint32_t mode\nuint32_t uid\nuint32_t gid\nuint32_t file_size\ngit_oid id\nuint16_t flags\nuint16_t flags_extended\nconst char * path", - "tdef": "typedef", - "description": " In-memory representation of a file entry in the index.", - "comments": "

This is a public structure that represents a file entry in the index. The meaning of the fields corresponds to core Git's documentation (in "Documentation/technical/index-format.txt").

\n\n

The flags field consists of a number of bit fields which can be accessed via the first set of GIT_IDXENTRY_... bitmasks below. These flags are all read from and persisted to disk.

\n\n

The flags_extended field also has a number of bit fields which can be accessed via the later GIT_IDXENTRY_... bitmasks below. Some of these flags are read from and written to disk, but some are set aside for in-memory only reference.

\n\n

Note that the time and size fields are truncated to 32 bits. This is enough to detect changes, which is enough for the index to function as a cache, but it should not be taken as an authoritative source for that data.

\n", - "fields": [ + }, { - "type": "git_index_time", - "name": "ctime", - "comments": "" + "type": "int", + "name": "GIT_OPT_SET_SEARCH_PATH", + "comments": "", + "value": 5 }, { - "type": "git_index_time", - "name": "mtime", - "comments": "" + "type": "int", + "name": "GIT_OPT_SET_CACHE_OBJECT_LIMIT", + "comments": "", + "value": 6 }, { - "type": "uint32_t", - "name": "dev", - "comments": "" + "type": "int", + "name": "GIT_OPT_SET_CACHE_MAX_SIZE", + "comments": "", + "value": 7 }, { - "type": "uint32_t", - "name": "ino", - "comments": "" + "type": "int", + "name": "GIT_OPT_ENABLE_CACHING", + "comments": "", + "value": 8 }, { - "type": "uint32_t", - "name": "mode", - "comments": "" + "type": "int", + "name": "GIT_OPT_GET_CACHED_MEMORY", + "comments": "", + "value": 9 }, { - "type": "uint32_t", - "name": "uid", - "comments": "" + "type": "int", + "name": "GIT_OPT_GET_TEMPLATE_PATH", + "comments": "", + "value": 10 }, { - "type": "uint32_t", - "name": "gid", - "comments": "" + "type": "int", + "name": "GIT_OPT_SET_TEMPLATE_PATH", + "comments": "", + "value": 11 }, { - "type": "uint32_t", - "name": "file_size", - "comments": "" + "type": "int", + "name": "GIT_OPT_SET_SSL_CERT_LOCATIONS", + "comments": "", + "value": 12 }, { - "type": "git_oid", - "name": "id", - "comments": "" + "type": "int", + "name": "GIT_OPT_SET_USER_AGENT", + "comments": "", + "value": 13 }, { - "type": "uint16_t", - "name": "flags", - "comments": "" + "type": "int", + "name": "GIT_OPT_ENABLE_STRICT_OBJECT_CREATION", + "comments": "", + "value": 14 }, { - "type": "uint16_t", - "name": "flags_extended", - "comments": "" + "type": "int", + "name": "GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION", + "comments": "", + "value": 15 }, { - "type": "const char *", - "name": "path", - "comments": "" - } - ], - "used": { - "returns": [ - "git_index_get_byindex", - "git_index_get_bypath" - ], - "needs": [ - "git_index_add", - "git_index_add_frombuffer", - "git_index_conflict_add", - "git_index_conflict_get", - "git_index_conflict_next", - "git_index_entry_is_conflict", - "git_index_entry_stage", - "git_merge_file_from_index" - ] - } - } - ], - [ - "git_index_time", - { - "decl": [ - "int32_t seconds", - "uint32_t nanoseconds" - ], - "type": "struct", - "value": "git_index_time", - "file": "index.h", - "line": 26, - "lineto": 30, - "block": "int32_t seconds\nuint32_t nanoseconds", - "tdef": "typedef", - "description": " Time structure used in a git index entry ", - "comments": "", - "fields": [ + "type": "int", + "name": "GIT_OPT_SET_SSL_CIPHERS", + "comments": "", + "value": 16 + }, { - "type": "int32_t", - "name": "seconds", - "comments": "" + "type": "int", + "name": "GIT_OPT_GET_USER_AGENT", + "comments": "", + "value": 17 }, { - "type": "uint32_t", - "name": "nanoseconds", - "comments": "" - } - ], - "used": { - "returns": [], - "needs": [] - } - } - ], - [ - "git_indexcap_t", - { - "decl": [ - "GIT_INDEXCAP_IGNORE_CASE", - "GIT_INDEXCAP_NO_FILEMODE", - "GIT_INDEXCAP_NO_SYMLINKS", - "GIT_INDEXCAP_FROM_OWNER" - ], - "type": "enum", - "file": "index.h", - "line": 138, - "lineto": 143, - "block": "GIT_INDEXCAP_IGNORE_CASE\nGIT_INDEXCAP_NO_FILEMODE\nGIT_INDEXCAP_NO_SYMLINKS\nGIT_INDEXCAP_FROM_OWNER", - "tdef": "typedef", - "description": " Capabilities of system that affect index actions. ", - "comments": "", - "fields": [ + "type": "int", + "name": "GIT_OPT_ENABLE_OFS_DELTA", + "comments": "", + "value": 18 + }, + { + "type": "int", + "name": "GIT_OPT_ENABLE_FSYNC_GITDIR", + "comments": "", + "value": 19 + }, + { + "type": "int", + "name": "GIT_OPT_GET_WINDOWS_SHAREMODE", + "comments": "", + "value": 20 + }, { "type": "int", - "name": "GIT_INDEXCAP_IGNORE_CASE", + "name": "GIT_OPT_SET_WINDOWS_SHAREMODE", "comments": "", - "value": 1 + "value": 21 }, { "type": "int", - "name": "GIT_INDEXCAP_NO_FILEMODE", + "name": "GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION", "comments": "", - "value": 2 + "value": 22 }, { "type": "int", - "name": "GIT_INDEXCAP_NO_SYMLINKS", + "name": "GIT_OPT_SET_ALLOCATOR", "comments": "", - "value": 4 + "value": 23 }, { "type": "int", - "name": "GIT_INDEXCAP_FROM_OWNER", + "name": "GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY", "comments": "", - "value": -1 - } - ], - "used": { - "returns": [], - "needs": [] - } - } - ], - [ - "git_indxentry_flag_t", - { - "decl": [ - "GIT_IDXENTRY_EXTENDED", - "GIT_IDXENTRY_VALID" - ], - "type": "enum", - "file": "index.h", - "line": 86, - "lineto": 89, - "block": "GIT_IDXENTRY_EXTENDED\nGIT_IDXENTRY_VALID", - "tdef": "typedef", - "description": " Flags for index entries", - "comments": "", - "fields": [ + "value": 24 + }, { "type": "int", - "name": "GIT_IDXENTRY_EXTENDED", + "name": "GIT_OPT_GET_PACK_MAX_OBJECTS", "comments": "", - "value": 16384 + "value": 25 }, { "type": "int", - "name": "GIT_IDXENTRY_VALID", + "name": "GIT_OPT_SET_PACK_MAX_OBJECTS", "comments": "", - "value": 32768 - } - ], - "used": { - "returns": [], - "needs": [] - } - } - ], - [ - "git_libgit2_opt_t", - { - "decl": [ - "GIT_OPT_GET_MWINDOW_SIZE", - "GIT_OPT_SET_MWINDOW_SIZE", - "GIT_OPT_GET_MWINDOW_MAPPED_LIMIT", - "GIT_OPT_SET_MWINDOW_MAPPED_LIMIT", - "GIT_OPT_GET_SEARCH_PATH", - "GIT_OPT_SET_SEARCH_PATH", - "GIT_OPT_SET_CACHE_OBJECT_LIMIT", - "GIT_OPT_SET_CACHE_MAX_SIZE", - "GIT_OPT_ENABLE_CACHING", - "GIT_OPT_GET_CACHED_MEMORY", - "GIT_OPT_GET_TEMPLATE_PATH", - "GIT_OPT_SET_TEMPLATE_PATH", - "GIT_OPT_SET_SSL_CERT_LOCATIONS", - "GIT_OPT_SET_USER_AGENT", - "GIT_OPT_ENABLE_STRICT_OBJECT_CREATION", - "GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION", - "GIT_OPT_SET_SSL_CIPHERS", - "GIT_OPT_GET_USER_AGENT" - ], - "type": "enum", - "file": "common.h", - "line": 162, - "lineto": 181, - "block": "GIT_OPT_GET_MWINDOW_SIZE\nGIT_OPT_SET_MWINDOW_SIZE\nGIT_OPT_GET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_SET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_GET_SEARCH_PATH\nGIT_OPT_SET_SEARCH_PATH\nGIT_OPT_SET_CACHE_OBJECT_LIMIT\nGIT_OPT_SET_CACHE_MAX_SIZE\nGIT_OPT_ENABLE_CACHING\nGIT_OPT_GET_CACHED_MEMORY\nGIT_OPT_GET_TEMPLATE_PATH\nGIT_OPT_SET_TEMPLATE_PATH\nGIT_OPT_SET_SSL_CERT_LOCATIONS\nGIT_OPT_SET_USER_AGENT\nGIT_OPT_ENABLE_STRICT_OBJECT_CREATION\nGIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION\nGIT_OPT_SET_SSL_CIPHERS\nGIT_OPT_GET_USER_AGENT", - "tdef": "typedef", - "description": " Global library options", - "comments": "

These are used to select which global option to set or get and are used in git_libgit2_opts().

\n", - "fields": [ + "value": 26 + }, { "type": "int", - "name": "GIT_OPT_GET_MWINDOW_SIZE", + "name": "GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS", "comments": "", - "value": 0 + "value": 27 }, { "type": "int", - "name": "GIT_OPT_SET_MWINDOW_SIZE", + "name": "GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE", "comments": "", - "value": 1 + "value": 28 }, { "type": "int", - "name": "GIT_OPT_GET_MWINDOW_MAPPED_LIMIT", + "name": "GIT_OPT_GET_MWINDOW_FILE_LIMIT", "comments": "", - "value": 2 + "value": 29 }, { "type": "int", - "name": "GIT_OPT_SET_MWINDOW_MAPPED_LIMIT", + "name": "GIT_OPT_SET_MWINDOW_FILE_LIMIT", "comments": "", - "value": 3 + "value": 30 }, { "type": "int", - "name": "GIT_OPT_GET_SEARCH_PATH", + "name": "GIT_OPT_SET_ODB_PACKED_PRIORITY", "comments": "", - "value": 4 + "value": 31 }, { "type": "int", - "name": "GIT_OPT_SET_SEARCH_PATH", + "name": "GIT_OPT_SET_ODB_LOOSE_PRIORITY", "comments": "", - "value": 5 + "value": 32 }, { "type": "int", - "name": "GIT_OPT_SET_CACHE_OBJECT_LIMIT", + "name": "GIT_OPT_GET_EXTENSIONS", "comments": "", - "value": 6 + "value": 33 }, { "type": "int", - "name": "GIT_OPT_SET_CACHE_MAX_SIZE", + "name": "GIT_OPT_SET_EXTENSIONS", "comments": "", - "value": 7 + "value": 34 }, { "type": "int", - "name": "GIT_OPT_ENABLE_CACHING", + "name": "GIT_OPT_GET_OWNER_VALIDATION", "comments": "", - "value": 8 + "value": 35 }, { "type": "int", - "name": "GIT_OPT_GET_CACHED_MEMORY", + "name": "GIT_OPT_SET_OWNER_VALIDATION", "comments": "", - "value": 9 + "value": 36 }, { "type": "int", - "name": "GIT_OPT_GET_TEMPLATE_PATH", + "name": "GIT_OPT_GET_HOMEDIR", "comments": "", - "value": 10 + "value": 37 }, { "type": "int", - "name": "GIT_OPT_SET_TEMPLATE_PATH", + "name": "GIT_OPT_SET_HOMEDIR", "comments": "", - "value": 11 + "value": 38 }, { "type": "int", - "name": "GIT_OPT_SET_SSL_CERT_LOCATIONS", + "name": "GIT_OPT_SET_SERVER_CONNECT_TIMEOUT", "comments": "", - "value": 12 + "value": 39 }, { "type": "int", - "name": "GIT_OPT_SET_USER_AGENT", + "name": "GIT_OPT_GET_SERVER_CONNECT_TIMEOUT", "comments": "", - "value": 13 + "value": 40 }, { "type": "int", - "name": "GIT_OPT_ENABLE_STRICT_OBJECT_CREATION", + "name": "GIT_OPT_SET_SERVER_TIMEOUT", "comments": "", - "value": 14 + "value": 41 }, { "type": "int", - "name": "GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION", + "name": "GIT_OPT_GET_SERVER_TIMEOUT", "comments": "", - "value": 15 + "value": 42 }, { "type": "int", - "name": "GIT_OPT_SET_SSL_CIPHERS", + "name": "GIT_OPT_SET_USER_AGENT_PRODUCT", "comments": "", - "value": 16 + "value": 43 }, { "type": "int", - "name": "GIT_OPT_GET_USER_AGENT", + "name": "GIT_OPT_GET_USER_AGENT_PRODUCT", "comments": "", - "value": 17 + "value": 44 + }, + { + "type": "int", + "name": "GIT_OPT_ADD_SSL_X509_CERT", + "comments": "", + "value": 45 } ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_mailmap", + { + "decl": "git_mailmap", + "type": "struct", + "value": "git_mailmap", + "file": "git2/types.h", + "line": 382, + "lineto": 382, + "tdef": "typedef", + "description": " Representation of .mailmap file state. ", + "comments": "", "used": { "returns": [], - "needs": [] + "needs": [ + "git_commit_author_with_mailmap", + "git_commit_committer_with_mailmap", + "git_mailmap_add_entry", + "git_mailmap_free", + "git_mailmap_from_buffer", + "git_mailmap_from_repository", + "git_mailmap_new", + "git_mailmap_resolve", + "git_mailmap_resolve_signature" + ] } } ], @@ -30845,9 +31189,9 @@ "GIT_MERGE_ANALYSIS_UNBORN" ], "type": "enum", - "file": "merge.h", - "line": 312, - "lineto": 341, + "file": "git2/merge.h", + "line": 347, + "lineto": 376, "block": "GIT_MERGE_ANALYSIS_NONE\nGIT_MERGE_ANALYSIS_NORMAL\nGIT_MERGE_ANALYSIS_UP_TO_DATE\nGIT_MERGE_ANALYSIS_FASTFORWARD\nGIT_MERGE_ANALYSIS_UNBORN", "tdef": "typedef", "description": " The results of `git_merge_analysis` indicate the merge opportunities.", @@ -30886,57 +31230,7 @@ ], "used": { "returns": [], - "needs": [ - "git_merge_analysis" - ] - } - } - ], - [ - "git_merge_driver", - { - "decl": [ - "unsigned int version", - "git_merge_driver_init_fn initialize", - "git_merge_driver_shutdown_fn shutdown", - "git_merge_driver_apply_fn apply" - ], - "type": "struct", - "value": "git_merge_driver", - "file": "sys/merge.h", - "line": 118, - "lineto": 135, - "block": "unsigned int version\ngit_merge_driver_init_fn initialize\ngit_merge_driver_shutdown_fn shutdown\ngit_merge_driver_apply_fn apply", - "tdef": null, - "description": " Merge driver structure used to register custom merge drivers.", - "comments": "

To associate extra data with a driver, allocate extra data and put the git_merge_driver struct at the start of your data buffer, then cast the self pointer to your larger structure when your callback is invoked.

\n", - "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": " The `version` should be set to `GIT_MERGE_DRIVER_VERSION`. " - }, - { - "type": "git_merge_driver_init_fn", - "name": "initialize", - "comments": " Called when the merge driver is first used for any file. " - }, - { - "type": "git_merge_driver_shutdown_fn", - "name": "shutdown", - "comments": " Called when the merge driver is unregistered from the system. " - }, - { - "type": "git_merge_driver_apply_fn", - "name": "apply", - "comments": " Called to merge the contents of a conflict. If this function\n returns `GIT_PASSTHROUGH` then the default (`text`) merge driver\n will instead be invoked. If this function returns\n `GIT_EMERGECONFLICT` then the file will remain conflicted." - } - ], - "used": { - "returns": [], - "needs": [ - "git_merge_driver_apply_fn" - ] + "needs": ["git_merge_analysis", "git_merge_analysis_for_ref"] } } ], @@ -30946,18 +31240,13 @@ "decl": "git_merge_driver_source", "type": "struct", "value": "git_merge_driver_source", - "file": "sys/merge.h", - "line": 36, - "lineto": 36, + "file": "git2/sys/merge.h", + "line": 49, + "lineto": 49, "tdef": "typedef", "description": " A merge driver source represents the file to be merged", "comments": "", - "used": { - "returns": [], - "needs": [ - "git_merge_driver_apply_fn" - ] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -30970,9 +31259,9 @@ "GIT_MERGE_FILE_FAVOR_UNION" ], "type": "enum", - "file": "merge.h", - "line": 101, - "lineto": 131, + "file": "git2/merge.h", + "line": 115, + "lineto": 145, "block": "GIT_MERGE_FILE_FAVOR_NORMAL\nGIT_MERGE_FILE_FAVOR_OURS\nGIT_MERGE_FILE_FAVOR_THEIRS\nGIT_MERGE_FILE_FAVOR_UNION", "tdef": "typedef", "description": " Merge file favor options for `git_merge_options` instruct the file-level\n merging functionality how to deal with conflicting regions of the files.", @@ -31003,10 +31292,7 @@ "value": 3 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -31021,13 +31307,15 @@ "GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE", "GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL", "GIT_MERGE_FILE_DIFF_PATIENCE", - "GIT_MERGE_FILE_DIFF_MINIMAL" + "GIT_MERGE_FILE_DIFF_MINIMAL", + "GIT_MERGE_FILE_STYLE_ZDIFF3", + "GIT_MERGE_FILE_ACCEPT_CONFLICTS" ], "type": "enum", - "file": "merge.h", - "line": 136, - "lineto": 163, - "block": "GIT_MERGE_FILE_DEFAULT\nGIT_MERGE_FILE_STYLE_MERGE\nGIT_MERGE_FILE_STYLE_DIFF3\nGIT_MERGE_FILE_SIMPLIFY_ALNUM\nGIT_MERGE_FILE_IGNORE_WHITESPACE\nGIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE\nGIT_MERGE_FILE_IGNORE_WHITESPACE_EOL\nGIT_MERGE_FILE_DIFF_PATIENCE\nGIT_MERGE_FILE_DIFF_MINIMAL", + "file": "git2/merge.h", + "line": 150, + "lineto": 187, + "block": "GIT_MERGE_FILE_DEFAULT\nGIT_MERGE_FILE_STYLE_MERGE\nGIT_MERGE_FILE_STYLE_DIFF3\nGIT_MERGE_FILE_SIMPLIFY_ALNUM\nGIT_MERGE_FILE_IGNORE_WHITESPACE\nGIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE\nGIT_MERGE_FILE_IGNORE_WHITESPACE_EOL\nGIT_MERGE_FILE_DIFF_PATIENCE\nGIT_MERGE_FILE_DIFF_MINIMAL\nGIT_MERGE_FILE_STYLE_ZDIFF3\nGIT_MERGE_FILE_ACCEPT_CONFLICTS", "tdef": "typedef", "description": " File merging flags", "comments": "", @@ -31085,12 +31373,21 @@ "name": "GIT_MERGE_FILE_DIFF_MINIMAL", "comments": "

Take extra time to find minimal diff

\n", "value": 128 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_STYLE_ZDIFF3", + "comments": "

Create zdiff3 ("zealous diff3")-style files

\n", + "value": 256 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_ACCEPT_CONFLICTS", + "comments": "

Do not produce file conflicts when common regions have\n changed; keep the conflict markers in the file and accept\n that as the merge result.

\n", + "value": 512 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -31105,19 +31402,15 @@ ], "type": "struct", "value": "git_merge_file_input", - "file": "merge.h", - "line": 32, - "lineto": 46, + "file": "git2/merge.h", + "line": 35, + "lineto": 49, "block": "unsigned int version\nconst char * ptr\nsize_t size\nconst char * path\nunsigned int mode", "tdef": "typedef", "description": " The file inputs to `git_merge_file`. Callers should populate the\n `git_merge_file_input` structure with descriptions of the files in\n each side of the conflict for use in producing the merge file.", "comments": "", "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, + { "type": "unsigned int", "name": "version", "comments": "" }, { "type": "const char *", "name": "ptr", @@ -31141,10 +31434,7 @@ ], "used": { "returns": [], - "needs": [ - "git_merge_file", - "git_merge_file_init_input" - ] + "needs": ["git_merge_file", "git_merge_file_input_init"] } } ], @@ -31157,23 +31447,20 @@ "const char * our_label", "const char * their_label", "git_merge_file_favor_t favor", - "git_merge_file_flag_t flags" + "uint32_t flags", + "unsigned short marker_size" ], "type": "struct", "value": "git_merge_file_options", - "file": "merge.h", - "line": 168, - "lineto": 194, - "block": "unsigned int version\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_merge_file_favor_t favor\ngit_merge_file_flag_t flags", + "file": "git2/merge.h", + "line": 195, + "lineto": 225, + "block": "unsigned int version\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_merge_file_favor_t favor\nuint32_t flags\nunsigned short marker_size", "tdef": "typedef", "description": " Options for merging a file", "comments": "", "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, + { "type": "unsigned int", "name": "version", "comments": "" }, { "type": "const char *", "name": "ancestor_label", @@ -31195,9 +31482,14 @@ "comments": " The file to favor in region conflicts. " }, { - "type": "git_merge_file_flag_t", + "type": "uint32_t", "name": "flags", "comments": " see `git_merge_file_flag_t` above " + }, + { + "type": "unsigned short", + "name": "marker_size", + "comments": " The size of conflict markers (eg, \"\n<\n<\n<\n<\n<\n<\n<\n\"). Default is\n GIT_MERGE_CONFLICT_MARKER_SIZE. " } ], "used": { @@ -31205,7 +31497,7 @@ "needs": [ "git_merge_file", "git_merge_file_from_index", - "git_merge_file_init_options" + "git_merge_file_options_init" ] } } @@ -31222,9 +31514,9 @@ ], "type": "struct", "value": "git_merge_file_result", - "file": "merge.h", - "line": 215, - "lineto": 236, + "file": "git2/merge.h", + "line": 248, + "lineto": 269, "block": "unsigned int automergeable\nconst char * path\nunsigned int mode\nconst char * ptr\nsize_t len", "tdef": "typedef", "description": " Information about file-level merging", @@ -31273,13 +31565,14 @@ "GIT_MERGE_FIND_RENAMES", "GIT_MERGE_FAIL_ON_CONFLICT", "GIT_MERGE_SKIP_REUC", - "GIT_MERGE_NO_RECURSIVE" + "GIT_MERGE_NO_RECURSIVE", + "GIT_MERGE_VIRTUAL_BASE" ], "type": "enum", - "file": "merge.h", - "line": 68, - "lineto": 95, - "block": "GIT_MERGE_FIND_RENAMES\nGIT_MERGE_FAIL_ON_CONFLICT\nGIT_MERGE_SKIP_REUC\nGIT_MERGE_NO_RECURSIVE", + "file": "git2/merge.h", + "line": 74, + "lineto": 109, + "block": "GIT_MERGE_FIND_RENAMES\nGIT_MERGE_FAIL_ON_CONFLICT\nGIT_MERGE_SKIP_REUC\nGIT_MERGE_NO_RECURSIVE\nGIT_MERGE_VIRTUAL_BASE", "tdef": "typedef", "description": " Flags for `git_merge` options. A combination of these flags can be\n passed in via the `flags` value in the `git_merge_options`.", "comments": "", @@ -31307,12 +31600,15 @@ "name": "GIT_MERGE_NO_RECURSIVE", "comments": "

If the commits being merged have multiple merge bases, do not build\n a recursive merge base (by merging the multiple merge bases),\n instead simply use the first base. This flag provides a similar\n merge base to git-merge-resolve.

\n", "value": 8 + }, + { + "type": "int", + "name": "GIT_MERGE_VIRTUAL_BASE", + "comments": "

Treat this merge as if it is to produce the virtual base\n of a recursive merge. This will ensure that there are\n no conflicts, any conflicting regions will keep conflict\n markers in the merge result.

\n", + "value": 16 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -31320,32 +31616,28 @@ { "decl": [ "unsigned int version", - "git_merge_flag_t flags", + "uint32_t flags", "unsigned int rename_threshold", "unsigned int target_limit", "git_diff_similarity_metric * metric", "unsigned int recursion_limit", "const char * default_driver", "git_merge_file_favor_t file_favor", - "git_merge_file_flag_t file_flags" + "uint32_t file_flags" ], "type": "struct", "value": "git_merge_options", - "file": "merge.h", - "line": 241, - "lineto": 290, - "block": "unsigned int version\ngit_merge_flag_t flags\nunsigned int rename_threshold\nunsigned int target_limit\ngit_diff_similarity_metric * metric\nunsigned int recursion_limit\nconst char * default_driver\ngit_merge_file_favor_t file_favor\ngit_merge_file_flag_t file_flags", + "file": "git2/merge.h", + "line": 274, + "lineto": 323, + "block": "unsigned int version\nuint32_t flags\nunsigned int rename_threshold\nunsigned int target_limit\ngit_diff_similarity_metric * metric\nunsigned int recursion_limit\nconst char * default_driver\ngit_merge_file_favor_t file_favor\nuint32_t file_flags", "tdef": "typedef", "description": " Merging options", "comments": "", "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, { - "type": "unsigned int", - "name": "version", - "comments": "" - }, - { - "type": "git_merge_flag_t", + "type": "uint32_t", "name": "flags", "comments": " See `git_merge_flag_t` above " }, @@ -31380,7 +31672,7 @@ "comments": " Flags for handling conflicting content, to be used with the standard\n (`text`) merge driver." }, { - "type": "git_merge_file_flag_t", + "type": "uint32_t", "name": "file_flags", "comments": " see `git_merge_file_flag_t` above " } @@ -31391,7 +31683,7 @@ "git_cherrypick_commit", "git_merge", "git_merge_commits", - "git_merge_init_options", + "git_merge_options_init", "git_merge_trees", "git_revert_commit" ] @@ -31407,9 +31699,9 @@ "GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY" ], "type": "enum", - "file": "merge.h", - "line": 346, - "lineto": 364, + "file": "git2/merge.h", + "line": 381, + "lineto": 399, "block": "GIT_MERGE_PREFERENCE_NONE\nGIT_MERGE_PREFERENCE_NO_FASTFORWARD\nGIT_MERGE_PREFERENCE_FASTFORWARD_ONLY", "tdef": "typedef", "description": " The user's stated preference for merges.", @@ -31427,37 +31719,87 @@ "comments": "

There is a merge.ff=false configuration setting, suggesting that\n the user does not want to allow a fast-forward merge.

\n", "value": 1 }, - { - "type": "int", - "name": "GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY", - "comments": "

There is a merge.ff=only configuration setting, suggesting that\n the user only wants fast-forward merges.

\n", - "value": 2 - } + { + "type": "int", + "name": "GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY", + "comments": "

There is a merge.ff=only configuration setting, suggesting that\n the user only wants fast-forward merges.

\n", + "value": 2 + } + ], + "used": { + "returns": [], + "needs": ["git_merge_analysis", "git_merge_analysis_for_ref"] + } + } + ], + [ + "git_message_trailer", + { + "decl": ["const char * key", "const char * value"], + "type": "struct", + "value": "git_message_trailer", + "file": "git2/message.h", + "line": 43, + "lineto": 46, + "block": "const char * key\nconst char * value", + "tdef": "typedef", + "description": " Represents a single git message trailer.", + "comments": "", + "fields": [ + { "type": "const char *", "name": "key", "comments": "" }, + { "type": "const char *", "name": "value", "comments": "" } + ], + "used": { + "returns": [], + "needs": ["git_message_trailer_array_free", "git_message_trailers"] + } + } + ], + [ + "git_message_trailer_array", + { + "decl": [ + "git_message_trailer * trailers", + "size_t count", + "char * _trailer_block" + ], + "type": "struct", + "value": "git_message_trailer_array", + "file": "git2/message.h", + "line": 54, + "lineto": 60, + "block": "git_message_trailer * trailers\nsize_t count\nchar * _trailer_block", + "tdef": "typedef", + "description": " Represents an array of git message trailers.", + "comments": "

Struct members under the private comment are private, subject to change and should not be used by callers.

\n", + "fields": [ + { + "type": "git_message_trailer *", + "name": "trailers", + "comments": "" + }, + { "type": "size_t", "name": "count", "comments": "" }, + { "type": "char *", "name": "_trailer_block", "comments": "" } ], "used": { "returns": [], - "needs": [ - "git_merge_analysis" - ] + "needs": ["git_message_trailer_array_free", "git_message_trailers"] } } ], [ - "git_merge_result", + "git_midx_writer", { - "decl": "git_merge_result", + "decl": "git_midx_writer", "type": "struct", - "value": "git_merge_result", - "file": "types.h", - "line": 181, - "lineto": 181, + "value": "git_midx_writer", + "file": "git2/types.h", + "line": 105, + "lineto": 105, "tdef": "typedef", - "description": " Merge result ", + "description": " a writer for multi-pack-index files. ", "comments": "", - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -31466,26 +31808,15 @@ "decl": "git_note", "type": "struct", "value": "git_note", - "file": "types.h", - "line": 150, - "lineto": 150, + "file": "git2/types.h", + "line": 174, + "lineto": 174, "tdef": "typedef", "description": " Representation of a git note ", "comments": "", "used": { "returns": [], - "needs": [ - "git_note_author", - "git_note_committer", - "git_note_foreach", - "git_note_free", - "git_note_id", - "git_note_iterator_free", - "git_note_iterator_new", - "git_note_message", - "git_note_next", - "git_note_read" - ] + "needs": ["git_note_iterator_free", "git_note_next"] } } ], @@ -31495,19 +31826,15 @@ "decl": "git_note_iterator", "type": "struct", "value": "git_note_iterator", - "file": "notes.h", - "line": 35, - "lineto": 35, + "file": "git2/notes.h", + "line": 37, + "lineto": 37, "tdef": "typedef", "description": " note iterator", "comments": "", "used": { "returns": [], - "needs": [ - "git_note_iterator_free", - "git_note_iterator_new", - "git_note_next" - ] + "needs": ["git_note_iterator_free", "git_note_next"] } } ], @@ -31517,17 +31844,25 @@ "decl": "git_object", "type": "struct", "value": "git_object", - "file": "types.h", - "line": 108, - "lineto": 108, + "file": "git2/types.h", + "line": 129, + "lineto": 129, "tdef": "typedef", "description": " Representation of a generic object in a repository ", "comments": "", "used": { - "returns": [], + "returns": [ + "git_blob_rawsize", + "git_object_string2type", + "git_object_type", + "git_odb_object_type", + "git_tag_target_type", + "git_tree_entry_type" + ], "needs": [ "git_checkout_tree", "git_describe_commit", + "git_object__size", "git_object_dup", "git_object_free", "git_object_id", @@ -31536,9 +31871,19 @@ "git_object_lookup_prefix", "git_object_owner", "git_object_peel", + "git_object_rawcontent_is_valid", "git_object_short_id", "git_object_type", + "git_object_type2string", + "git_object_typeisloose", + "git_odb_hash", + "git_odb_hashfile", + "git_odb_open_rstream", + "git_odb_open_wstream", + "git_odb_read_header", + "git_odb_write", "git_reference_peel", + "git_repository_hashfile", "git_reset", "git_reset_default", "git_revparse_ext", @@ -31553,24 +31898,122 @@ } } ], + [ + "git_object_t", + { + "decl": [ + "GIT_OBJECT_ANY", + "GIT_OBJECT_INVALID", + "GIT_OBJECT_COMMIT", + "GIT_OBJECT_TREE", + "GIT_OBJECT_BLOB", + "GIT_OBJECT_TAG", + "GIT_OBJECT_OFS_DELTA", + "GIT_OBJECT_REF_DELTA" + ], + "type": "enum", + "file": "git2/types.h", + "line": 73, + "lineto": 82, + "block": "GIT_OBJECT_ANY\nGIT_OBJECT_INVALID\nGIT_OBJECT_COMMIT\nGIT_OBJECT_TREE\nGIT_OBJECT_BLOB\nGIT_OBJECT_TAG\nGIT_OBJECT_OFS_DELTA\nGIT_OBJECT_REF_DELTA", + "tdef": "typedef", + "description": " Basic type (loose or packed) of any Git object. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_OBJECT_ANY", + "comments": "

Object can be any of the following

\n", + "value": -2 + }, + { + "type": "int", + "name": "GIT_OBJECT_INVALID", + "comments": "

Object is invalid.

\n", + "value": -1 + }, + { + "type": "int", + "name": "GIT_OBJECT_COMMIT", + "comments": "

A commit object.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_OBJECT_TREE", + "comments": "

A tree (directory listing) object.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_OBJECT_BLOB", + "comments": "

A file revision object.

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_OBJECT_TAG", + "comments": "

An annotated tag object.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_OBJECT_OFS_DELTA", + "comments": "

A delta, base is given by an offset.

\n", + "value": 6 + }, + { + "type": "int", + "name": "GIT_OBJECT_REF_DELTA", + "comments": "

A delta, base is given by object id.

\n", + "value": 7 + } + ], + "used": { + "returns": [ + "git_object_string2type", + "git_object_type", + "git_odb_object_type", + "git_tag_target_type", + "git_tree_entry_type" + ], + "needs": [ + "git_object__size", + "git_object_lookup", + "git_object_lookup_bypath", + "git_object_lookup_prefix", + "git_object_peel", + "git_object_rawcontent_is_valid", + "git_object_type2string", + "git_object_typeisloose", + "git_odb_hash", + "git_odb_hashfile", + "git_odb_open_rstream", + "git_odb_open_wstream", + "git_odb_read_header", + "git_odb_write", + "git_reference_peel", + "git_repository_hashfile" + ] + } + } + ], [ "git_odb", { "decl": "git_odb", "type": "struct", "value": "git_odb", - "file": "types.h", - "line": 81, - "lineto": 81, + "file": "git2/types.h", + "line": 88, + "lineto": 88, "tdef": "typedef", - "description": " An open object database handle. ", + "description": " An object database stores the objects (commit, trees, blobs, tags,\n etc) for a repository.", "comments": "", "used": { "returns": [], "needs": [ "git_indexer_new", - "git_mempack_new", - "git_mempack_reset", "git_odb_add_alternate", "git_odb_add_backend", "git_odb_add_disk_alternate", @@ -31578,12 +32021,12 @@ "git_odb_backend_one_pack", "git_odb_backend_pack", "git_odb_exists", + "git_odb_exists_ext", "git_odb_exists_prefix", "git_odb_expand_ids", "git_odb_foreach", "git_odb_free", "git_odb_get_backend", - "git_odb_init_backend", "git_odb_new", "git_odb_num_backends", "git_odb_object_data", @@ -31599,14 +32042,15 @@ "git_odb_read_header", "git_odb_read_prefix", "git_odb_refresh", + "git_odb_set_commit_graph", "git_odb_stream_finalize_write", "git_odb_stream_free", "git_odb_stream_read", "git_odb_stream_write", "git_odb_write", + "git_odb_write_multi_pack_index", "git_odb_write_pack", "git_repository_odb", - "git_repository_set_odb", "git_repository_wrap_odb" ] } @@ -31618,120 +32062,118 @@ "decl": "git_odb_backend", "type": "struct", "value": "git_odb_backend", - "file": "types.h", - "line": 84, - "lineto": 84, - "block": "unsigned int version\ngit_odb * odb\nint (*)(void **, size_t *, git_otype *, git_odb_backend *, const git_oid *) read\nint (*)(git_oid *, void **, size_t *, git_otype *, git_odb_backend *, const git_oid *, size_t) read_prefix\nint (*)(size_t *, git_otype *, git_odb_backend *, const git_oid *) read_header\nint (*)(git_odb_backend *, const git_oid *, const void *, size_t, git_otype) write\nint (*)(git_odb_stream **, git_odb_backend *, git_off_t, git_otype) writestream\nint (*)(git_odb_stream **, git_odb_backend *, const git_oid *) readstream\nint (*)(git_odb_backend *, const git_oid *) exists\nint (*)(git_oid *, git_odb_backend *, const git_oid *, size_t) exists_prefix\nint (*)(git_odb_backend *) refresh\nint (*)(git_odb_backend *, git_odb_foreach_cb, void *) foreach\nint (*)(git_odb_writepack **, git_odb_backend *, git_odb *, git_transfer_progress_cb, void *) writepack\nint (*)(git_odb_backend *, const git_oid *) freshen\nvoid (*)(git_odb_backend *) free", + "file": "git2/types.h", + "line": 91, + "lineto": 91, "tdef": "typedef", "description": " A custom backend in an ODB ", "comments": "", + "used": { + "returns": [], + "needs": [ + "git_odb_add_alternate", + "git_odb_add_backend", + "git_odb_backend_loose", + "git_odb_backend_one_pack", + "git_odb_backend_pack", + "git_odb_get_backend" + ] + } + } + ], + [ + "git_odb_backend_loose_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "int compression_level", + "unsigned int dir_mode", + "unsigned int file_mode", + "git_oid_t oid_type" + ], + "type": "struct", + "value": "git_odb_backend_loose_options", + "file": "git2/odb_backend.h", + "line": 49, + "lineto": 75, + "block": "unsigned int version\nuint32_t flags\nint compression_level\nunsigned int dir_mode\nunsigned int file_mode\ngit_oid_t oid_type", + "tdef": "typedef", + "description": " Options for configuring a loose object backend. ", + "comments": "", "fields": [ { "type": "unsigned int", "name": "version", - "comments": "" - }, - { - "type": "git_odb *", - "name": "odb", - "comments": "" - }, - { - "type": "int (*)(void **, size_t *, git_otype *, git_odb_backend *, const git_oid *)", - "name": "read", - "comments": "" - }, - { - "type": "int (*)(git_oid *, void **, size_t *, git_otype *, git_odb_backend *, const git_oid *, size_t)", - "name": "read_prefix", - "comments": "" - }, - { - "type": "int (*)(size_t *, git_otype *, git_odb_backend *, const git_oid *)", - "name": "read_header", - "comments": "" - }, - { - "type": "int (*)(git_odb_backend *, const git_oid *, const void *, size_t, git_otype)", - "name": "write", - "comments": " Write an object into the backend. The id of the object has\n already been calculated and is passed in." - }, - { - "type": "int (*)(git_odb_stream **, git_odb_backend *, git_off_t, git_otype)", - "name": "writestream", - "comments": "" - }, - { - "type": "int (*)(git_odb_stream **, git_odb_backend *, const git_oid *)", - "name": "readstream", - "comments": "" + "comments": " version for the struct " }, { - "type": "int (*)(git_odb_backend *, const git_oid *)", - "name": "exists", - "comments": "" + "type": "uint32_t", + "name": "flags", + "comments": " A combination of the `git_odb_backend_loose_flag_t` types. " }, { - "type": "int (*)(git_oid *, git_odb_backend *, const git_oid *, size_t)", - "name": "exists_prefix", - "comments": "" + "type": "int", + "name": "compression_level", + "comments": " zlib compression level to use (0-9), where 1 is the fastest\n at the expense of larger files, and 9 produces the best\n compression at the expense of speed. 0 indicates that no\n compression should be performed. -1 is the default (currently\n optimizing for speed)." }, { - "type": "int (*)(git_odb_backend *)", - "name": "refresh", - "comments": " If the backend implements a refreshing mechanism, it should be exposed\n through this endpoint. Each call to `git_odb_refresh()` will invoke it.\n\n However, the backend implementation should try to stay up-to-date as much\n as possible by itself as libgit2 will not automatically invoke\n `git_odb_refresh()`. For instance, a potential strategy for the backend\n implementation to achieve this could be to internally invoke this\n endpoint on failed lookups (ie. `exists()`, `read()`, `read_header()`)." + "type": "unsigned int", + "name": "dir_mode", + "comments": " Permissions to use creating a directory or 0 for defaults " }, { - "type": "int (*)(git_odb_backend *, git_odb_foreach_cb, void *)", - "name": "foreach", - "comments": "" + "type": "unsigned int", + "name": "file_mode", + "comments": " Permissions to use creating a file or 0 for defaults " }, { - "type": "int (*)(git_odb_writepack **, git_odb_backend *, git_odb *, git_transfer_progress_cb, void *)", - "name": "writepack", - "comments": "" - }, + "type": "git_oid_t", + "name": "oid_type", + "comments": " Type of object IDs to use for this object database, or\n 0 for default (currently SHA1)." + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_odb_backend_pack_options", + { + "decl": ["unsigned int version", "git_oid_t oid_type"], + "type": "struct", + "value": "git_odb_backend_pack_options", + "file": "git2/odb_backend.h", + "line": 24, + "lineto": 32, + "block": "unsigned int version\ngit_oid_t oid_type", + "tdef": "typedef", + "description": " Options for configuring a packfile object backend. ", + "comments": "", + "fields": [ { - "type": "int (*)(git_odb_backend *, const git_oid *)", - "name": "freshen", - "comments": " \"Freshens\" an already existing object, updating its last-used\n time. This occurs when `git_odb_write` was called, but the\n object already existed (and will not be re-written). The\n underlying implementation may want to update last-used timestamps.\n\n If callers implement this, they should return `0` if the object\n exists and was freshened, and non-zero otherwise." + "type": "unsigned int", + "name": "version", + "comments": " version for the struct " }, { - "type": "void (*)(git_odb_backend *)", - "name": "free", - "comments": " Frees any resources held by the odb (including the `git_odb_backend`\n itself). An odb backend implementation must provide this function." + "type": "git_oid_t", + "name": "oid_type", + "comments": " Type of object IDs to use for this object database, or\n 0 for default (currently SHA1)." } ], - "used": { - "returns": [], - "needs": [ - "git_mempack_new", - "git_mempack_reset", - "git_odb_add_alternate", - "git_odb_add_backend", - "git_odb_backend_loose", - "git_odb_backend_one_pack", - "git_odb_backend_pack", - "git_odb_get_backend", - "git_odb_init_backend" - ] - } + "used": { "returns": [], "needs": [] } } ], [ "git_odb_expand_id", { - "decl": [ - "git_oid id", - "unsigned short length", - "git_otype type" - ], + "decl": ["git_oid id", "unsigned short length", "git_object_t type"], "type": "struct", "value": "git_odb_expand_id", - "file": "odb.h", - "line": 180, - "lineto": 195, - "block": "git_oid id\nunsigned short length\ngit_otype type", + "file": "git2/odb.h", + "line": 250, + "lineto": 265, + "block": "git_oid id\nunsigned short length\ngit_object_t type", "tdef": "typedef", "description": " The information about object IDs to query in `git_odb_expand_ids`,\n which will be populated upon return.", "comments": "", @@ -31747,17 +32189,35 @@ "comments": " The length of the object ID (in nibbles, or packets of 4 bits; the\n number of hex characters)" }, { - "type": "git_otype", + "type": "git_object_t", "name": "type", - "comments": " The (optional) type of the object to search for; leave as `0` or set\n to `GIT_OBJ_ANY` to query for any object matching the ID." + "comments": " The (optional) type of the object to search for; leave as `0` or set\n to `GIT_OBJECT_ANY` to query for any object matching the ID." } ], - "used": { - "returns": [], - "needs": [ - "git_odb_expand_ids" - ] - } + "used": { "returns": [], "needs": ["git_odb_expand_ids"] } + } + ], + [ + "git_odb_lookup_flags_t", + { + "decl": ["GIT_ODB_LOOKUP_NO_REFRESH"], + "type": "enum", + "file": "git2/odb.h", + "line": 26, + "lineto": 34, + "block": "GIT_ODB_LOOKUP_NO_REFRESH", + "tdef": "typedef", + "description": " Flags controlling the behavior of ODB lookup operations ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_ODB_LOOKUP_NO_REFRESH", + "comments": "

Don't call git_odb_refresh if the lookup fails. Useful when doing\n a batch of lookup operations for objects that may legitimately not\n exist. When using this flag, you may wish to manually call\n git_odb_refresh before processing a batch of objects.

\n", + "value": 1 + } + ], + "used": { "returns": [], "needs": [] } } ], [ @@ -31766,11 +32226,11 @@ "decl": "git_odb_object", "type": "struct", "value": "git_odb_object", - "file": "types.h", - "line": 87, - "lineto": 87, + "file": "git2/types.h", + "line": 96, + "lineto": 96, "tdef": "typedef", - "description": " An object read from the ODB ", + "description": " A \"raw\" object read from the object database.", "comments": "", "used": { "returns": [], @@ -31787,64 +32247,80 @@ } } ], + [ + "git_odb_options", + { + "decl": ["unsigned int version", "git_oid_t oid_type"], + "type": "struct", + "value": "git_odb_options", + "file": "git2/odb.h", + "line": 46, + "lineto": 54, + "block": "unsigned int version\ngit_oid_t oid_type", + "tdef": "typedef", + "description": " Options for configuring a loose object backend. ", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": " version for the struct " + }, + { + "type": "git_oid_t", + "name": "oid_type", + "comments": " Type of object IDs to use for this object database, or\n 0 for default (currently SHA1)." + } + ], + "used": { "returns": [], "needs": [] } + } + ], [ "git_odb_stream", { "decl": "git_odb_stream", "type": "struct", "value": "git_odb_stream", - "file": "types.h", - "line": 90, - "lineto": 90, - "block": "git_odb_backend * backend\nunsigned int mode\nvoid * hash_ctx\ngit_off_t declared_size\ngit_off_t received_bytes\nint (*)(git_odb_stream *, char *, size_t) read\nint (*)(git_odb_stream *, const char *, size_t) write\nint (*)(git_odb_stream *, const int *) finalize_write\nvoid (*)(git_odb_stream *) free", + "file": "git2/types.h", + "line": 99, + "lineto": 99, + "block": "git_odb_backend * backend\nunsigned int mode\nvoid * hash_ctx\ngit_object_size_t declared_size\ngit_object_size_t received_bytes\nint (*)(git_odb_stream *, char *, size_t) read\nint (*)(git_odb_stream *, const char *, size_t) write\nint (*)(git_odb_stream *, const git_oid *) finalize_write\nvoid (*)(git_odb_stream *) free", "tdef": "typedef", "description": " A stream to read/write from the ODB ", "comments": "", "fields": [ + { "type": "git_odb_backend *", "name": "backend", "comments": "" }, + { "type": "unsigned int", "name": "mode", "comments": "" }, + { "type": "void *", "name": "hash_ctx", "comments": "" }, { - "type": "git_odb_backend *", - "name": "backend", - "comments": "" - }, - { - "type": "unsigned int", - "name": "mode", - "comments": "" - }, - { - "type": "void *", - "name": "hash_ctx", - "comments": "" - }, - { - "type": "git_off_t", + "type": "git_object_size_t", "name": "declared_size", "comments": "" }, { - "type": "git_off_t", + "type": "git_object_size_t", "name": "received_bytes", "comments": "" }, { "type": "int (*)(git_odb_stream *, char *, size_t)", "name": "read", - "comments": " Write at most `len` bytes into `buffer` and advance the stream." + "comments": "" }, { "type": "int (*)(git_odb_stream *, const char *, size_t)", "name": "write", - "comments": " Write `len` bytes from `buffer` into the stream." + "comments": "" }, { - "type": "int (*)(git_odb_stream *, const int *)", + "type": "int (*)(git_odb_stream *, const git_oid *)", "name": "finalize_write", - "comments": " Store the contents of the stream as an object with the id\n specified in `oid`.\n\n This method might not be invoked if:\n - an error occurs earlier with the `write` callback,\n - the object referred to by `oid` already exists in any backend, or\n - the final number of received bytes differs from the size declared\n with `git_odb_open_wstream()`" + "comments": "" }, { "type": "void (*)(git_odb_stream *)", "name": "free", - "comments": " Free the stream's memory.\n\n This method might be called without a call to `finalize_write` if\n an error occurs or if the object is already present in the ODB." + "comments": "" } ], "used": { @@ -31863,15 +32339,11 @@ [ "git_odb_stream_t", { - "decl": [ - "GIT_STREAM_RDONLY", - "GIT_STREAM_WRONLY", - "GIT_STREAM_RW" - ], + "decl": ["GIT_STREAM_RDONLY", "GIT_STREAM_WRONLY", "GIT_STREAM_RW"], "type": "enum", - "file": "odb_backend.h", - "line": 70, - "lineto": 74, + "file": "git2/odb_backend.h", + "line": 182, + "lineto": 186, "block": "GIT_STREAM_RDONLY\nGIT_STREAM_WRONLY\nGIT_STREAM_RW", "tdef": "typedef", "description": " Streaming mode ", @@ -31889,17 +32361,9 @@ "comments": "", "value": 4 }, - { - "type": "int", - "name": "GIT_STREAM_RW", - "comments": "", - "value": 6 - } + { "type": "int", "name": "GIT_STREAM_RW", "comments": "", "value": 6 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -31908,26 +32372,22 @@ "decl": "git_odb_writepack", "type": "struct", "value": "git_odb_writepack", - "file": "types.h", - "line": 93, - "lineto": 93, - "block": "git_odb_backend * backend\nint (*)(git_odb_writepack *, const void *, size_t, git_transfer_progress *) append\nint (*)(git_odb_writepack *, git_transfer_progress *) commit\nvoid (*)(git_odb_writepack *) free", + "file": "git2/types.h", + "line": 102, + "lineto": 102, + "block": "git_odb_backend * backend\nint (*)(git_odb_writepack *, const void *, size_t, git_indexer_progress *) append\nint (*)(git_odb_writepack *, git_indexer_progress *) commit\nvoid (*)(git_odb_writepack *) free", "tdef": "typedef", "description": " A stream to write a packfile to the ODB ", "comments": "", "fields": [ + { "type": "git_odb_backend *", "name": "backend", "comments": "" }, { - "type": "git_odb_backend *", - "name": "backend", - "comments": "" - }, - { - "type": "int (*)(git_odb_writepack *, const void *, size_t, git_transfer_progress *)", + "type": "int (*)(git_odb_writepack *, const void *, size_t, git_indexer_progress *)", "name": "append", "comments": "" }, { - "type": "int (*)(git_odb_writepack *, git_transfer_progress *)", + "type": "int (*)(git_odb_writepack *, git_indexer_progress *)", "name": "commit", "comments": "" }, @@ -31937,25 +32397,18 @@ "comments": "" } ], - "used": { - "returns": [], - "needs": [ - "git_odb_write_pack" - ] - } + "used": { "returns": [], "needs": ["git_odb_write_pack"] } } ], [ "git_oid", { - "decl": [ - "unsigned char [20] id" - ], + "decl": ["unsigned char [20] id"], "type": "struct", "value": "git_oid", - "file": "oid.h", - "line": 33, - "lineto": 36, + "file": "git2/oid.h", + "line": 103, + "lineto": 112, "block": "unsigned char [20] id", "tdef": "typedef", "description": " Unique identity of any object (commit, tree, blob, tag). ", @@ -31974,18 +32427,19 @@ "git_commit_id", "git_commit_parent_id", "git_commit_tree_id", - "git_filter_source_id", "git_index_checksum", "git_indexer_hash", - "git_note_id", "git_object_id", "git_odb_object_id", "git_oid_shorten_new", "git_packbuilder_hash", + "git_rebase_onto_id", + "git_rebase_orig_head_id", "git_reference_target", "git_reference_target_peel", "git_reflog_entry_id_new", "git_reflog_entry_id_old", + "git_repository_oid_type", "git_submodule_head_id", "git_submodule_index_id", "git_submodule_wd_id", @@ -31997,23 +32451,25 @@ "needs": [ "git_annotated_commit_from_fetchhead", "git_annotated_commit_lookup", - "git_blob_create_frombuffer", - "git_blob_create_fromdisk", - "git_blob_create_fromstream_commit", - "git_blob_create_fromworkdir", + "git_blob_create_from_buffer", + "git_blob_create_from_disk", + "git_blob_create_from_stream_commit", + "git_blob_create_from_workdir", "git_blob_lookup", "git_blob_lookup_prefix", "git_commit_amend", "git_commit_create", - "git_commit_create_from_callback", - "git_commit_create_from_ids", + "git_commit_create_cb", + "git_commit_create_from_stage", "git_commit_create_v", "git_commit_create_with_signature", "git_commit_extract_signature", "git_commit_lookup", "git_commit_lookup_prefix", + "git_diff_patchid", "git_graph_ahead_behind", "git_graph_descendant_of", + "git_graph_reachable_from_any", "git_index_write_tree", "git_index_write_tree_to", "git_merge_base", @@ -32021,14 +32477,12 @@ "git_merge_base_octopus", "git_merge_bases", "git_merge_bases_many", - "git_note_create", "git_note_foreach_cb", "git_note_next", - "git_note_read", - "git_note_remove", "git_object_lookup", "git_object_lookup_prefix", "git_odb_exists", + "git_odb_exists_ext", "git_odb_exists_prefix", "git_odb_foreach_cb", "git_odb_hash", @@ -32047,7 +32501,7 @@ "git_oid_fromstr", "git_oid_fromstrn", "git_oid_fromstrp", - "git_oid_iszero", + "git_oid_is_zero", "git_oid_ncmp", "git_oid_nfmt", "git_oid_pathfmt", @@ -32057,30 +32511,37 @@ "git_oid_streq", "git_oid_tostr", "git_oid_tostr_s", + "git_oidarray_dispose", "git_oidarray_free", "git_packbuilder_insert", "git_packbuilder_insert_commit", "git_packbuilder_insert_recur", "git_packbuilder_insert_tree", "git_rebase_commit", - "git_reference__alloc", "git_reference_create", "git_reference_create_matching", "git_reference_name_to_id", "git_reference_set_target", "git_reflog_append", + "git_repository_fetchhead_foreach_cb", "git_repository_hashfile", + "git_repository_mergehead_foreach_cb", "git_repository_set_head_detached", "git_revwalk_hide", "git_revwalk_hide_cb", "git_revwalk_next", "git_revwalk_push", + "git_stash_cb", + "git_stash_save", + "git_stash_save_with_opts", "git_tag_annotation_create", "git_tag_create", - "git_tag_create_frombuffer", + "git_tag_create_from_buffer", "git_tag_create_lightweight", + "git_tag_foreach_cb", "git_tag_lookup", "git_tag_lookup_prefix", + "git_transaction_set_target", "git_tree_create_updated", "git_tree_entry_byid", "git_tree_lookup", @@ -32098,169 +32559,65 @@ "decl": "git_oid_shorten", "type": "struct", "value": "git_oid_shorten", - "file": "oid.h", - "line": 215, - "lineto": 215, + "file": "git2/oid.h", + "line": 317, + "lineto": 317, "tdef": "typedef", "description": " OID Shortener object", "comments": "", "used": { - "returns": [ - "git_oid_shorten_new" - ], - "needs": [ - "git_oid_shorten_add", - "git_oid_shorten_free" - ] + "returns": ["git_oid_shorten_new"], + "needs": ["git_oid_shorten_add", "git_oid_shorten_free"] } } ], [ - "git_oidarray", + "git_oid_t", { - "decl": [ - "git_oid * ids", - "size_t count" - ], - "type": "struct", - "value": "git_oidarray", - "file": "oidarray.h", - "line": 16, - "lineto": 19, - "block": "git_oid * ids\nsize_t count", + "decl": ["GIT_OID_SHA1"], + "type": "enum", + "file": "git2/oid.h", + "line": 23, + "lineto": 32, + "block": "GIT_OID_SHA1", "tdef": "typedef", - "description": " Array of object ids ", + "description": " The type of object id. ", "comments": "", "fields": [ { - "type": "git_oid *", - "name": "ids", - "comments": "" - }, - { - "type": "size_t", - "name": "count", - "comments": "" + "type": "int", + "name": "GIT_OID_SHA1", + "comments": "

SHA1

\n", + "value": 1 } ], - "used": { - "returns": [], - "needs": [ - "git_merge_bases", - "git_merge_bases_many", - "git_oidarray_free" - ] - } + "used": { "returns": ["git_repository_oid_type"], "needs": [] } } ], [ - "git_otype", + "git_oidarray", { - "decl": [ - "GIT_OBJ_ANY", - "GIT_OBJ_BAD", - "GIT_OBJ__EXT1", - "GIT_OBJ_COMMIT", - "GIT_OBJ_TREE", - "GIT_OBJ_BLOB", - "GIT_OBJ_TAG", - "GIT_OBJ__EXT2", - "GIT_OBJ_OFS_DELTA", - "GIT_OBJ_REF_DELTA" - ], - "type": "enum", - "file": "types.h", - "line": 67, - "lineto": 78, - "block": "GIT_OBJ_ANY\nGIT_OBJ_BAD\nGIT_OBJ__EXT1\nGIT_OBJ_COMMIT\nGIT_OBJ_TREE\nGIT_OBJ_BLOB\nGIT_OBJ_TAG\nGIT_OBJ__EXT2\nGIT_OBJ_OFS_DELTA\nGIT_OBJ_REF_DELTA", + "decl": ["git_oid * ids", "size_t count"], + "type": "struct", + "value": "git_oidarray", + "file": "git2/oidarray.h", + "line": 23, + "lineto": 26, + "block": "git_oid * ids\nsize_t count", "tdef": "typedef", - "description": " Basic type (loose or packed) of any Git object. ", + "description": " Array of object ids ", "comments": "", "fields": [ - { - "type": "int", - "name": "GIT_OBJ_ANY", - "comments": "

Object can be any of the following

\n", - "value": -2 - }, - { - "type": "int", - "name": "GIT_OBJ_BAD", - "comments": "

Object is invalid.

\n", - "value": -1 - }, - { - "type": "int", - "name": "GIT_OBJ__EXT1", - "comments": "

Reserved for future use.

\n", - "value": 0 - }, - { - "type": "int", - "name": "GIT_OBJ_COMMIT", - "comments": "

A commit object.

\n", - "value": 1 - }, - { - "type": "int", - "name": "GIT_OBJ_TREE", - "comments": "

A tree (directory listing) object.

\n", - "value": 2 - }, - { - "type": "int", - "name": "GIT_OBJ_BLOB", - "comments": "

A file revision object.

\n", - "value": 3 - }, - { - "type": "int", - "name": "GIT_OBJ_TAG", - "comments": "

An annotated tag object.

\n", - "value": 4 - }, - { - "type": "int", - "name": "GIT_OBJ__EXT2", - "comments": "

Reserved for future use.

\n", - "value": 5 - }, - { - "type": "int", - "name": "GIT_OBJ_OFS_DELTA", - "comments": "

A delta, base is given by an offset.

\n", - "value": 6 - }, - { - "type": "int", - "name": "GIT_OBJ_REF_DELTA", - "comments": "

A delta, base is given by object id.

\n", - "value": 7 - } + { "type": "git_oid *", "name": "ids", "comments": "" }, + { "type": "size_t", "name": "count", "comments": "" } ], "used": { - "returns": [ - "git_object_string2type", - "git_object_type", - "git_odb_object_type", - "git_tag_target_type", - "git_tree_entry_type" - ], + "returns": [], "needs": [ - "git_object__size", - "git_object_lookup", - "git_object_lookup_bypath", - "git_object_lookup_prefix", - "git_object_peel", - "git_object_type2string", - "git_object_typeisloose", - "git_odb_hash", - "git_odb_hashfile", - "git_odb_open_wstream", - "git_odb_read_header", - "git_odb_write", - "git_reference_peel", - "git_repository_hashfile" + "git_merge_bases", + "git_merge_bases_many", + "git_oidarray_dispose", + "git_oidarray_free" ] } } @@ -32271,9 +32628,9 @@ "decl": "git_packbuilder", "type": "struct", "value": "git_packbuilder", - "file": "types.h", - "line": 153, - "lineto": 153, + "file": "git2/types.h", + "line": 177, + "lineto": 177, "tdef": "typedef", "description": " Representation of a git packbuilder ", "comments": "", @@ -32288,11 +32645,13 @@ "git_packbuilder_insert_recur", "git_packbuilder_insert_tree", "git_packbuilder_insert_walk", + "git_packbuilder_name", "git_packbuilder_new", "git_packbuilder_object_count", "git_packbuilder_set_callbacks", "git_packbuilder_set_threads", "git_packbuilder_write", + "git_packbuilder_write_buf", "git_packbuilder_written" ] } @@ -32306,9 +32665,9 @@ "GIT_PACKBUILDER_DELTAFICATION" ], "type": "enum", - "file": "pack.h", - "line": 51, - "lineto": 54, + "file": "git2/pack.h", + "line": 52, + "lineto": 55, "block": "GIT_PACKBUILDER_ADDING_OBJECTS\nGIT_PACKBUILDER_DELTAFICATION", "tdef": "typedef", "description": " Stages that are reported by the packbuilder progress callback.", @@ -32327,10 +32686,7 @@ "value": 1 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -32339,7 +32695,7 @@ "decl": "git_patch", "type": "struct", "value": "git_patch", - "file": "patch.h", + "file": "git2/patch.h", "line": 29, "lineto": 29, "tdef": "typedef", @@ -32359,6 +32715,7 @@ "git_patch_line_stats", "git_patch_num_hunks", "git_patch_num_lines_in_hunk", + "git_patch_owner", "git_patch_print", "git_patch_size", "git_patch_to_buf" @@ -32366,15 +32723,50 @@ } } ], + [ + "git_path_fs", + { + "decl": ["GIT_PATH_FS_GENERIC", "GIT_PATH_FS_NTFS", "GIT_PATH_FS_HFS"], + "type": "enum", + "file": "git2/sys/path.h", + "line": 44, + "lineto": 51, + "block": "GIT_PATH_FS_GENERIC\nGIT_PATH_FS_NTFS\nGIT_PATH_FS_HFS", + "tdef": "typedef", + "description": " The kinds of checks to perform according to which filesystem we are trying to\n protect.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_PATH_FS_GENERIC", + "comments": "

Do both NTFS- and HFS-specific checks

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_PATH_FS_NTFS", + "comments": "

Do NTFS-specific checks only

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_PATH_FS_HFS", + "comments": "

Do HFS-specific checks only

\n", + "value": 2 + } + ], + "used": { "returns": [], "needs": [] } + } + ], [ "git_pathspec", { "decl": "git_pathspec", "type": "struct", "value": "git_pathspec", - "file": "pathspec.h", - "line": 20, - "lineto": 20, + "file": "git2/pathspec.h", + "line": 27, + "lineto": 27, "tdef": "typedef", "description": " Compiled pathspec", "comments": "", @@ -32411,13 +32803,13 @@ "GIT_PATHSPEC_FAILURES_ONLY" ], "type": "enum", - "file": "pathspec.h", - "line": 48, - "lineto": 56, + "file": "git2/pathspec.h", + "line": 37, + "lineto": 80, "block": "GIT_PATHSPEC_DEFAULT\nGIT_PATHSPEC_IGNORE_CASE\nGIT_PATHSPEC_USE_CASE\nGIT_PATHSPEC_NO_GLOB\nGIT_PATHSPEC_NO_MATCH_ERROR\nGIT_PATHSPEC_FIND_FAILURES\nGIT_PATHSPEC_FAILURES_ONLY", "tdef": "typedef", "description": " Options controlling how pathspec match should be executed", - "comments": "\n", + "comments": "", "fields": [ { "type": "int", @@ -32428,44 +32820,41 @@ { "type": "int", "name": "GIT_PATHSPEC_IGNORE_CASE", - "comments": "", + "comments": "

GIT_PATHSPEC_IGNORE_CASE forces match to ignore case; otherwise\n match will use native case sensitivity of platform filesystem

\n", "value": 1 }, { "type": "int", "name": "GIT_PATHSPEC_USE_CASE", - "comments": "", + "comments": "

GIT_PATHSPEC_USE_CASE forces case sensitive match; otherwise\n match will use native case sensitivity of platform filesystem

\n", "value": 2 }, { "type": "int", "name": "GIT_PATHSPEC_NO_GLOB", - "comments": "", + "comments": "

GIT_PATHSPEC_NO_GLOB disables glob patterns and just uses simple\n string comparison for matching

\n", "value": 4 }, { "type": "int", "name": "GIT_PATHSPEC_NO_MATCH_ERROR", - "comments": "", + "comments": "

GIT_PATHSPEC_NO_MATCH_ERROR means the match functions return error\n code GIT_ENOTFOUND if no matches are found; otherwise no matches is\n still success (return 0) but git_pathspec_match_list_entrycount\n will indicate 0 matches.

\n", "value": 8 }, { "type": "int", "name": "GIT_PATHSPEC_FIND_FAILURES", - "comments": "", + "comments": "

GIT_PATHSPEC_FIND_FAILURES means that the git_pathspec_match_list\n should track which patterns matched which files so that at the end of\n the match we can identify patterns that did not match any files.

\n", "value": 16 }, { "type": "int", "name": "GIT_PATHSPEC_FAILURES_ONLY", - "comments": "", + "comments": "

GIT_PATHSPEC_FAILURES_ONLY means that the git_pathspec_match_list\n does not need to keep the actual matching filenames. Use this to\n just test if there were any matches at all or in combination with\n GIT_PATHSPEC_FIND_FAILURES to validate a pathspec.

\n", "value": 32 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -32474,9 +32863,9 @@ "decl": "git_pathspec_match_list", "type": "struct", "value": "git_pathspec_match_list", - "file": "pathspec.h", - "line": 25, - "lineto": 25, + "file": "git2/pathspec.h", + "line": 32, + "lineto": 32, "tdef": "typedef", "description": " List of filenames matching a pathspec", "comments": "", @@ -32504,25 +32893,21 @@ "unsigned int version", "git_proxy_t type", "const char * url", - "git_cred_acquire_cb credentials", + "git_credential_acquire_cb credentials", "git_transport_certificate_check_cb certificate_check", "void * payload" ], "type": "struct", "value": "git_proxy_options", - "file": "proxy.h", - "line": 42, - "lineto": 77, - "block": "unsigned int version\ngit_proxy_t type\nconst char * url\ngit_cred_acquire_cb credentials\ngit_transport_certificate_check_cb certificate_check\nvoid * payload", + "file": "git2/proxy.h", + "line": 50, + "lineto": 85, + "block": "unsigned int version\ngit_proxy_t type\nconst char * url\ngit_credential_acquire_cb credentials\ngit_transport_certificate_check_cb certificate_check\nvoid * payload", "tdef": "typedef", "description": " Options for connecting through a proxy", "comments": "

Note that not all types may be supported, depending on the platform and compilation options.

\n", "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, + { "type": "unsigned int", "name": "version", "comments": "" }, { "type": "git_proxy_t", "name": "type", @@ -32534,14 +32919,14 @@ "comments": " The URL of the proxy." }, { - "type": "git_cred_acquire_cb", + "type": "git_credential_acquire_cb", "name": "credentials", "comments": " This will be called if the remote host requires\n authentication in order to connect to it.\n\n Returning GIT_PASSTHROUGH will make libgit2 behave as\n though this field isn't set." }, { "type": "git_transport_certificate_check_cb", "name": "certificate_check", - "comments": " If cert verification fails, this will be called to let the\n user make the final decision of whether to allow the\n connection to proceed. Returns 1 to allow the connection, 0\n to disallow it or a negative value to indicate an error." + "comments": " If cert verification fails, this will be called to let the\n user make the final decision of whether to allow the\n connection to proceed. Returns 0 to allow the connection\n or a negative value to indicate an error." }, { "type": "void *", @@ -32551,25 +32936,18 @@ ], "used": { "returns": [], - "needs": [ - "git_proxy_init_options", - "git_remote_connect" - ] + "needs": ["git_proxy_options_init", "git_remote_connect"] } } ], [ "git_proxy_t", { - "decl": [ - "GIT_PROXY_NONE", - "GIT_PROXY_AUTO", - "GIT_PROXY_SPECIFIED" - ], + "decl": ["GIT_PROXY_NONE", "GIT_PROXY_AUTO", "GIT_PROXY_SPECIFIED"], "type": "enum", - "file": "proxy.h", - "line": 18, - "lineto": 34, + "file": "git2/proxy.h", + "line": 26, + "lineto": 42, "block": "GIT_PROXY_NONE\nGIT_PROXY_AUTO\nGIT_PROXY_SPECIFIED", "tdef": "typedef", "description": " The type of proxy to use.", @@ -32594,10 +32972,7 @@ "value": 2 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -32606,17 +32981,17 @@ "decl": "git_push", "type": "struct", "value": "git_push", - "file": "types.h", - "line": 236, - "lineto": 236, + "file": "git2/types.h", + "line": 269, + "lineto": 269, "tdef": "typedef", "description": " Preparation for a push operation. Can be used to configure what to\n push and the level of parallelism of the packfile builder.", "comments": "", "used": { "returns": [], "needs": [ - "git_push_init_options", "git_push_negotiation", + "git_push_options_init", "git_remote_push", "git_remote_upload" ] @@ -32631,23 +33006,21 @@ "unsigned int pb_parallelism", "git_remote_callbacks callbacks", "git_proxy_options proxy_opts", - "git_strarray custom_headers" + "git_remote_redirect_t follow_redirects", + "git_strarray custom_headers", + "git_strarray remote_push_options" ], "type": "struct", "value": "git_push_options", - "file": "remote.h", - "line": 585, - "lineto": 612, - "block": "unsigned int version\nunsigned int pb_parallelism\ngit_remote_callbacks callbacks\ngit_proxy_options proxy_opts\ngit_strarray custom_headers", + "file": "git2/remote.h", + "line": 860, + "lineto": 899, + "block": "unsigned int version\nunsigned int pb_parallelism\ngit_remote_callbacks callbacks\ngit_proxy_options proxy_opts\ngit_remote_redirect_t follow_redirects\ngit_strarray custom_headers\ngit_strarray remote_push_options", "tdef": "typedef", "description": " Controls the behavior of a git_push object.", "comments": "", "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, + { "type": "unsigned int", "name": "version", "comments": "" }, { "type": "unsigned int", "name": "pb_parallelism", @@ -32663,16 +33036,26 @@ "name": "proxy_opts", "comments": " Proxy options to use, by default no proxy is used." }, + { + "type": "git_remote_redirect_t", + "name": "follow_redirects", + "comments": " Whether to allow off-site redirects. If this is not\n specified, the `http.followRedirects` configuration setting\n will be consulted." + }, { "type": "git_strarray", "name": "custom_headers", "comments": " Extra headers for this push operation" + }, + { + "type": "git_strarray", + "name": "remote_push_options", + "comments": " \"Push options\" to deliver to the remote." } ], "used": { "returns": [], "needs": [ - "git_push_init_options", + "git_push_options_init", "git_remote_push", "git_remote_upload" ] @@ -32690,9 +33073,9 @@ ], "type": "struct", "value": "git_push_update", - "file": "remote.h", - "line": 341, - "lineto": 358, + "file": "git2/remote.h", + "line": 490, + "lineto": 507, "block": "char * src_refname\nchar * dst_refname\ngit_oid src\ngit_oid dst", "tdef": "typedef", "description": " Represents an update which will be performed on the remote during push", @@ -32719,12 +33102,7 @@ "comments": " The new target for the reference" } ], - "used": { - "returns": [], - "needs": [ - "git_push_negotiation" - ] - } + "used": { "returns": [], "needs": ["git_push_negotiation"] } } ], [ @@ -32733,29 +33111,31 @@ "decl": "git_rebase", "type": "struct", "value": "git_rebase", - "file": "types.h", - "line": 187, - "lineto": 187, + "file": "git2/types.h", + "line": 220, + "lineto": 220, "tdef": "typedef", "description": " Representation of a rebase ", "comments": "", "used": { - "returns": [ - "git_rebase_operation_byindex" - ], + "returns": ["git_rebase_operation_byindex"], "needs": [ "git_rebase_abort", "git_rebase_commit", "git_rebase_finish", "git_rebase_free", "git_rebase_init", - "git_rebase_init_options", "git_rebase_inmemory_index", "git_rebase_next", + "git_rebase_onto_id", + "git_rebase_onto_name", "git_rebase_open", "git_rebase_operation_byindex", "git_rebase_operation_current", - "git_rebase_operation_entrycount" + "git_rebase_operation_entrycount", + "git_rebase_options_init", + "git_rebase_orig_head_id", + "git_rebase_orig_head_name" ] } } @@ -32770,9 +33150,9 @@ ], "type": "struct", "value": "git_rebase_operation", - "file": "rebase.h", - "line": 130, - "lineto": 145, + "file": "git2/rebase.h", + "line": 174, + "lineto": 189, "block": "git_rebase_operation_t type\nconst git_oid id\nconst char * exec", "tdef": "typedef", "description": " A rebase operation", @@ -32795,12 +33175,8 @@ } ], "used": { - "returns": [ - "git_rebase_operation_byindex" - ], - "needs": [ - "git_rebase_next" - ] + "returns": ["git_rebase_operation_byindex"], + "needs": ["git_rebase_next"] } } ], @@ -32816,9 +33192,9 @@ "GIT_REBASE_OPERATION_EXEC" ], "type": "enum", - "file": "rebase.h", - "line": 78, - "lineto": 114, + "file": "git2/rebase.h", + "line": 119, + "lineto": 155, "block": "GIT_REBASE_OPERATION_PICK\nGIT_REBASE_OPERATION_REWORD\nGIT_REBASE_OPERATION_EDIT\nGIT_REBASE_OPERATION_SQUASH\nGIT_REBASE_OPERATION_FIXUP\nGIT_REBASE_OPERATION_EXEC", "tdef": "typedef", "description": " Type of rebase operation in-progress after calling `git_rebase_next`.", @@ -32861,60 +33237,82 @@ "value": 5 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ - "git_ref_t", + "git_rebase_options", { "decl": [ - "GIT_REF_INVALID", - "GIT_REF_OID", - "GIT_REF_SYMBOLIC", - "GIT_REF_LISTALL" + "unsigned int version", + "int quiet", + "int inmemory", + "const char * rewrite_notes_ref", + "git_merge_options merge_options", + "git_checkout_options checkout_options", + "git_commit_create_cb commit_create_cb", + "int (*)(git_buf *, git_buf *, const char *, void *) signing_cb", + "void * payload" ], - "type": "enum", - "file": "types.h", - "line": 190, - "lineto": 195, - "block": "GIT_REF_INVALID\nGIT_REF_OID\nGIT_REF_SYMBOLIC\nGIT_REF_LISTALL", + "type": "struct", + "value": "git_rebase_options", + "file": "git2/rebase.h", + "line": 32, + "lineto": 114, + "block": "unsigned int version\nint quiet\nint inmemory\nconst char * rewrite_notes_ref\ngit_merge_options merge_options\ngit_checkout_options checkout_options\ngit_commit_create_cb commit_create_cb\nint (*)(git_buf *, git_buf *, const char *, void *) signing_cb\nvoid * payload", "tdef": "typedef", - "description": " Basic type of any Git reference. ", - "comments": "", + "description": " Rebase options", + "comments": "

Use to tell the rebase machinery how to operate.

\n", "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, { "type": "int", - "name": "GIT_REF_INVALID", - "comments": "

Invalid reference

\n", - "value": 0 + "name": "quiet", + "comments": " Used by `git_rebase_init`, this will instruct other clients working\n on this rebase that you want a quiet rebase experience, which they\n may choose to provide in an application-specific manner. This has no\n effect upon libgit2 directly, but is provided for interoperability\n between Git tools." }, { "type": "int", - "name": "GIT_REF_OID", - "comments": "

A reference which points at an object id

\n", - "value": 1 + "name": "inmemory", + "comments": " Used by `git_rebase_init`, this will begin an in-memory rebase,\n which will allow callers to step through the rebase operations and\n commit the rebased changes, but will not rewind HEAD or update the\n repository to be in a rebasing state. This will not interfere with\n the working directory (if there is one)." }, { - "type": "int", - "name": "GIT_REF_SYMBOLIC", - "comments": "

A reference which points at another reference

\n", - "value": 2 + "type": "const char *", + "name": "rewrite_notes_ref", + "comments": " Used by `git_rebase_finish`, this is the name of the notes reference\n used to rewrite notes for rebased commits when finishing the rebase;\n if NULL, the contents of the configuration option `notes.rewriteRef`\n is examined, unless the configuration option `notes.rewrite.rebase`\n is set to false. If `notes.rewriteRef` is also NULL, notes will\n not be rewritten." }, { - "type": "int", - "name": "GIT_REF_LISTALL", - "comments": "", - "value": 3 + "type": "git_merge_options", + "name": "merge_options", + "comments": " Options to control how trees are merged during `git_rebase_next`." + }, + { + "type": "git_checkout_options", + "name": "checkout_options", + "comments": " Options to control how files are written during `git_rebase_init`,\n `git_rebase_next` and `git_rebase_abort`. Note that during\n `abort`, these options will add an implied `GIT_CHECKOUT_FORCE`\n to match git semantics." + }, + { + "type": "git_commit_create_cb", + "name": "commit_create_cb", + "comments": " Optional callback that allows users to override commit\n creation in `git_rebase_commit`. If specified, users can\n create their own commit and provide the commit ID, which\n may be useful for signing commits or otherwise customizing\n the commit creation.\n\n If this callback returns `GIT_PASSTHROUGH`, then\n `git_rebase_commit` will continue to create the commit." + }, + { + "type": "int (*)(git_buf *, git_buf *, const char *, void *)", + "name": "signing_cb", + "comments": " If provided, this will be called with the commit content, allowing\n a signature to be added to the rebase commit. Can be skipped with\n GIT_PASSTHROUGH. If GIT_PASSTHROUGH is returned, a commit will be made\n without a signature.\n\n This field is only used when performing git_rebase_commit.\n\n This callback is not invoked if a `git_commit_create_cb` is\n specified.\n\n This callback is deprecated; users should provide a\n creation callback as `commit_create_cb` that produces a\n commit buffer, signs it, and commits it." + }, + { + "type": "void *", + "name": "payload", + "comments": " This will be passed to each of the callbacks in this struct\n as the last parameter." } ], "used": { - "returns": [ - "git_reference_type" - ], - "needs": [] + "returns": [], + "needs": [ + "git_rebase_init", + "git_rebase_open", + "git_rebase_options_init" + ] } } ], @@ -32924,24 +33322,20 @@ "decl": "git_refdb", "type": "struct", "value": "git_refdb", - "file": "types.h", - "line": 96, - "lineto": 96, + "file": "git2/types.h", + "line": 108, + "lineto": 108, "tdef": "typedef", "description": " An open refs database handle. ", "comments": "", "used": { "returns": [], "needs": [ - "git_refdb_backend_fs", "git_refdb_compress", "git_refdb_free", - "git_refdb_init_backend", "git_refdb_new", "git_refdb_open", - "git_refdb_set_backend", - "git_repository_refdb", - "git_repository_set_refdb" + "git_repository_refdb" ] } } @@ -32952,108 +33346,13 @@ "decl": "git_refdb_backend", "type": "struct", "value": "git_refdb_backend", - "file": "types.h", - "line": 99, - "lineto": 99, - "block": "unsigned int version\nint (*)(int *, git_refdb_backend *, const char *) exists\nint (*)(git_reference **, git_refdb_backend *, const char *) lookup\nint (*)(git_reference_iterator **, struct git_refdb_backend *, const char *) iterator\nint (*)(git_refdb_backend *, const git_reference *, int, const git_signature *, const char *, const git_oid *, const char *) write\nint (*)(git_reference **, git_refdb_backend *, const char *, const char *, int, const git_signature *, const char *) rename\nint (*)(git_refdb_backend *, const char *, const git_oid *, const char *) del\nint (*)(git_refdb_backend *) compress\nint (*)(git_refdb_backend *, const char *) has_log\nint (*)(git_refdb_backend *, const char *) ensure_log\nvoid (*)(git_refdb_backend *) free\nint (*)(git_reflog **, git_refdb_backend *, const char *) reflog_read\nint (*)(git_refdb_backend *, git_reflog *) reflog_write\nint (*)(git_refdb_backend *, const char *, const char *) reflog_rename\nint (*)(git_refdb_backend *, const char *) reflog_delete\nint (*)(void **, git_refdb_backend *, const char *) lock\nint (*)(git_refdb_backend *, void *, int, int, const git_reference *, const git_signature *, const char *) unlock", + "file": "git2/types.h", + "line": 111, + "lineto": 111, "tdef": "typedef", "description": " A custom backend for refs ", "comments": "", - "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, - { - "type": "int (*)(int *, git_refdb_backend *, const char *)", - "name": "exists", - "comments": " Queries the refdb backend to determine if the given ref_name\n exists. A refdb implementation must provide this function." - }, - { - "type": "int (*)(git_reference **, git_refdb_backend *, const char *)", - "name": "lookup", - "comments": " Queries the refdb backend for a given reference. A refdb\n implementation must provide this function." - }, - { - "type": "int (*)(git_reference_iterator **, struct git_refdb_backend *, const char *)", - "name": "iterator", - "comments": " Allocate an iterator object for the backend.\n\n A refdb implementation must provide this function." - }, - { - "type": "int (*)(git_refdb_backend *, const git_reference *, int, const git_signature *, const char *, const git_oid *, const char *)", - "name": "write", - "comments": "" - }, - { - "type": "int (*)(git_reference **, git_refdb_backend *, const char *, const char *, int, const git_signature *, const char *)", - "name": "rename", - "comments": "" - }, - { - "type": "int (*)(git_refdb_backend *, const char *, const git_oid *, const char *)", - "name": "del", - "comments": " Deletes the given reference (and if necessary its reflog)\n from the refdb. A refdb implementation must provide this\n function." - }, - { - "type": "int (*)(git_refdb_backend *)", - "name": "compress", - "comments": " Suggests that the given refdb compress or optimize its references.\n This mechanism is implementation specific. (For on-disk reference\n databases, this may pack all loose references.) A refdb\n implementation may provide this function; if it is not provided,\n nothing will be done." - }, - { - "type": "int (*)(git_refdb_backend *, const char *)", - "name": "has_log", - "comments": " Query whether a particular reference has a log (may be empty)" - }, - { - "type": "int (*)(git_refdb_backend *, const char *)", - "name": "ensure_log", - "comments": " Make sure a particular reference will have a reflog which\n will be appended to on writes." - }, - { - "type": "void (*)(git_refdb_backend *)", - "name": "free", - "comments": " Frees any resources held by the refdb (including the `git_refdb_backend`\n itself). A refdb backend implementation must provide this function." - }, - { - "type": "int (*)(git_reflog **, git_refdb_backend *, const char *)", - "name": "reflog_read", - "comments": " Read the reflog for the given reference name." - }, - { - "type": "int (*)(git_refdb_backend *, git_reflog *)", - "name": "reflog_write", - "comments": " Write a reflog to disk." - }, - { - "type": "int (*)(git_refdb_backend *, const char *, const char *)", - "name": "reflog_rename", - "comments": " Rename a reflog" - }, - { - "type": "int (*)(git_refdb_backend *, const char *)", - "name": "reflog_delete", - "comments": " Remove a reflog." - }, - { - "type": "int (*)(void **, git_refdb_backend *, const char *)", - "name": "lock", - "comments": " Lock a reference. The opaque parameter will be passed to the unlock function" - }, - { - "type": "int (*)(git_refdb_backend *, void *, int, int, const git_reference *, const git_signature *, const char *)", - "name": "unlock", - "comments": " Unlock a reference. Only one of target or symbolic_target\n will be set. success indicates whether to update the\n reference or discard the lock (if it's false)" - } - ], - "used": { - "returns": [], - "needs": [ - "git_refdb_backend_fs", - "git_refdb_init_backend", - "git_refdb_set_backend" - ] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -33062,22 +33361,20 @@ "decl": "git_reference", "type": "struct", "value": "git_reference", - "file": "types.h", - "line": 169, - "lineto": 169, + "file": "git2/types.h", + "line": 194, + "lineto": 194, "tdef": "typedef", "description": " In-memory representation of a reference. ", "comments": "", "used": { - "returns": [ - "git_reference__alloc", - "git_reference__alloc_symbolic" - ], + "returns": ["git_reference_type"], "needs": [ "git_annotated_commit_from_ref", "git_branch_create", "git_branch_create_from_annotated", "git_branch_delete", + "git_branch_is_checked_out", "git_branch_is_head", "git_branch_lookup", "git_branch_move", @@ -33085,6 +33382,7 @@ "git_branch_next", "git_branch_set_upstream", "git_branch_upstream", + "git_merge_analysis_for_ref", "git_reference_cmp", "git_reference_create", "git_reference_create_matching", @@ -33092,6 +33390,7 @@ "git_reference_dup", "git_reference_dwim", "git_reference_foreach", + "git_reference_foreach_cb", "git_reference_foreach_glob", "git_reference_foreach_name", "git_reference_free", @@ -33120,46 +33419,70 @@ "git_reference_target_peel", "git_reference_type", "git_repository_head", + "git_repository_head_for_worktree", "git_revparse_ext" ] } } ], [ - "git_reference_iterator", + "git_reference_format_t", { - "decl": "git_reference_iterator", - "type": "struct", - "value": "git_reference_iterator", - "file": "types.h", - "line": 172, - "lineto": 172, - "block": "git_refdb * db\nint (*)(git_reference **, git_reference_iterator *) next\nint (*)(const char **, git_reference_iterator *) next_name\nvoid (*)(git_reference_iterator *) free", + "decl": [ + "GIT_REFERENCE_FORMAT_NORMAL", + "GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL", + "GIT_REFERENCE_FORMAT_REFSPEC_PATTERN", + "GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND" + ], + "type": "enum", + "file": "git2/refs.h", + "line": 663, + "lineto": 692, + "block": "GIT_REFERENCE_FORMAT_NORMAL\nGIT_REFERENCE_FORMAT_ALLOW_ONELEVEL\nGIT_REFERENCE_FORMAT_REFSPEC_PATTERN\nGIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND", "tdef": "typedef", - "description": " Iterator for references ", + "description": " Normalization options for reference lookup", "comments": "", "fields": [ { - "type": "git_refdb *", - "name": "db", - "comments": "" + "type": "int", + "name": "GIT_REFERENCE_FORMAT_NORMAL", + "comments": "

No particular normalization.

\n", + "value": 0 }, { - "type": "int (*)(git_reference **, git_reference_iterator *)", - "name": "next", - "comments": " Return the current reference and advance the iterator." + "type": "int", + "name": "GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL", + "comments": "

Control whether one-level refnames are accepted\n (i.e., refnames that do not contain multiple /-separated\n components). Those are expected to be written only using\n uppercase letters and underscore (FETCH_HEAD, ...)

\n", + "value": 1 }, { - "type": "int (*)(const char **, git_reference_iterator *)", - "name": "next_name", - "comments": " Return the name of the current reference and advance the iterator" + "type": "int", + "name": "GIT_REFERENCE_FORMAT_REFSPEC_PATTERN", + "comments": "

Interpret the provided name as a reference pattern for a\n refspec (as used with remote repositories). If this option\n is enabled, the name is allowed to contain a single * (\n<star

\n\n
\n

)\n in place of a one full pathname component\n (e.g., foo/\n<star\n/bar but not foo/bar\n<star\n).

\n
\n", + "value": 2 }, { - "type": "void (*)(git_reference_iterator *)", - "name": "free", - "comments": " Free the iterator" + "type": "int", + "name": "GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND", + "comments": "

Interpret the name as part of a refspec in shorthand form\n so the ONELEVEL naming rules aren't enforced and 'master'\n becomes a valid name.

\n", + "value": 4 } ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_reference_iterator", + { + "decl": "git_reference_iterator", + "type": "struct", + "value": "git_reference_iterator", + "file": "git2/types.h", + "line": 197, + "lineto": 197, + "tdef": "typedef", + "description": " Iterator for references ", + "comments": "", "used": { "returns": [], "needs": [ @@ -33173,52 +33496,49 @@ } ], [ - "git_reference_normalize_t", + "git_reference_t", { "decl": [ - "GIT_REF_FORMAT_NORMAL", - "GIT_REF_FORMAT_ALLOW_ONELEVEL", - "GIT_REF_FORMAT_REFSPEC_PATTERN", - "GIT_REF_FORMAT_REFSPEC_SHORTHAND" + "GIT_REFERENCE_INVALID", + "GIT_REFERENCE_DIRECT", + "GIT_REFERENCE_SYMBOLIC", + "GIT_REFERENCE_ALL" ], "type": "enum", - "file": "refs.h", - "line": 636, - "lineto": 665, - "block": "GIT_REF_FORMAT_NORMAL\nGIT_REF_FORMAT_ALLOW_ONELEVEL\nGIT_REF_FORMAT_REFSPEC_PATTERN\nGIT_REF_FORMAT_REFSPEC_SHORTHAND", + "file": "git2/types.h", + "line": 223, + "lineto": 228, + "block": "GIT_REFERENCE_INVALID\nGIT_REFERENCE_DIRECT\nGIT_REFERENCE_SYMBOLIC\nGIT_REFERENCE_ALL", "tdef": "typedef", - "description": " Normalization options for reference lookup", + "description": " Basic type of any Git reference. ", "comments": "", "fields": [ { "type": "int", - "name": "GIT_REF_FORMAT_NORMAL", - "comments": "

No particular normalization.

\n", + "name": "GIT_REFERENCE_INVALID", + "comments": "

Invalid reference

\n", "value": 0 }, { "type": "int", - "name": "GIT_REF_FORMAT_ALLOW_ONELEVEL", - "comments": "

Control whether one-level refnames are accepted\n (i.e., refnames that do not contain multiple /-separated\n components). Those are expected to be written only using\n uppercase letters and underscore (FETCH_HEAD, ...)

\n", + "name": "GIT_REFERENCE_DIRECT", + "comments": "

A reference that points at an object id

\n", "value": 1 }, { "type": "int", - "name": "GIT_REF_FORMAT_REFSPEC_PATTERN", - "comments": "

Interpret the provided name as a reference pattern for a\n refspec (as used with remote repositories). If this option\n is enabled, the name is allowed to contain a single * (\n<star

\n\n
\n

)\n in place of a one full pathname component\n (e.g., foo/\n<star\n/bar but not foo/bar\n<star\n).

\n
\n", + "name": "GIT_REFERENCE_SYMBOLIC", + "comments": "

A reference that points at another reference

\n", "value": 2 }, { "type": "int", - "name": "GIT_REF_FORMAT_REFSPEC_SHORTHAND", - "comments": "

Interpret the name as part of a refspec in shorthand form\n so the ONELEVEL naming rules aren't enforced and 'master'\n becomes a valid name.

\n", - "value": 4 + "name": "GIT_REFERENCE_ALL", + "comments": "", + "value": 3 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": ["git_reference_type"], "needs": [] } } ], [ @@ -33227,16 +33547,14 @@ "decl": "git_reflog", "type": "struct", "value": "git_reflog", - "file": "types.h", - "line": 147, - "lineto": 147, + "file": "git2/types.h", + "line": 171, + "lineto": 171, "tdef": "typedef", "description": " Representation of a reference log ", "comments": "", "used": { - "returns": [ - "git_reflog_entry_byindex" - ], + "returns": ["git_reflog_entry_byindex"], "needs": [ "git_reflog_append", "git_reflog_drop", @@ -33248,7 +33566,8 @@ "git_reflog_entrycount", "git_reflog_free", "git_reflog_read", - "git_reflog_write" + "git_reflog_write", + "git_transaction_set_reflog" ] } } @@ -33259,16 +33578,14 @@ "decl": "git_reflog_entry", "type": "struct", "value": "git_reflog_entry", - "file": "types.h", - "line": 144, - "lineto": 144, + "file": "git2/types.h", + "line": 168, + "lineto": 168, "tdef": "typedef", "description": " Representation of a reference log entry ", "comments": "", "used": { - "returns": [ - "git_reflog_entry_byindex" - ], + "returns": ["git_reflog_entry_byindex"], "needs": [ "git_reflog_entry_committer", "git_reflog_entry_id_new", @@ -33278,31 +33595,65 @@ } } ], + [ + "git_refspec", + { + "decl": "git_refspec", + "type": "struct", + "value": "git_refspec", + "file": "git2/types.h", + "line": 251, + "lineto": 251, + "tdef": "typedef", + "description": " A refspec specifies the mapping between remote and local reference\n names when fetch or pushing.", + "comments": "", + "used": { + "returns": ["git_remote_get_refspec"], + "needs": [ + "git_refspec_direction", + "git_refspec_dst", + "git_refspec_dst_matches", + "git_refspec_force", + "git_refspec_free", + "git_refspec_parse", + "git_refspec_rtransform", + "git_refspec_src", + "git_refspec_src_matches", + "git_refspec_src_matches_negative", + "git_refspec_string", + "git_refspec_transform" + ] + } + } + ], [ "git_remote", { "decl": "git_remote", "type": "struct", "value": "git_remote", - "file": "types.h", - "line": 224, - "lineto": 224, + "file": "git2/types.h", + "line": 257, + "lineto": 257, "tdef": "typedef", - "description": " Git's idea of a remote repository. A remote can be anonymous (in\n which case it does not have backing configuration entires).", + "description": " Git's idea of a remote repository. A remote can be anonymous (in\n which case it does not have backing configuration entries).", "comments": "", "used": { - "returns": [ - "git_remote_autotag" - ], + "returns": ["git_remote_autotag"], "needs": [ "git_headlist_cb", "git_remote_autotag", "git_remote_connect", + "git_remote_connect_ext", + "git_remote_connect_options_init", "git_remote_connected", "git_remote_create", "git_remote_create_anonymous", "git_remote_create_cb", + "git_remote_create_detached", + "git_remote_create_options_init", "git_remote_create_with_fetchspec", + "git_remote_create_with_opts", "git_remote_default_branch", "git_remote_disconnect", "git_remote_download", @@ -33321,19 +33672,17 @@ "git_remote_prune_refs", "git_remote_push", "git_remote_pushurl", + "git_remote_ready_cb", "git_remote_refspec_count", "git_remote_set_autotag", + "git_remote_set_instance_pushurl", + "git_remote_set_instance_url", "git_remote_stats", "git_remote_stop", "git_remote_update_tips", "git_remote_upload", "git_remote_url", - "git_transport_cb", - "git_transport_dummy", - "git_transport_local", - "git_transport_new", - "git_transport_smart", - "git_transport_ssh_with_paths" + "git_transport_cb" ] } } @@ -33348,9 +33697,9 @@ "GIT_REMOTE_DOWNLOAD_TAGS_ALL" ], "type": "enum", - "file": "remote.h", - "line": 497, - "lineto": 515, + "file": "git2/remote.h", + "line": 739, + "lineto": 757, "block": "GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED\nGIT_REMOTE_DOWNLOAD_TAGS_AUTO\nGIT_REMOTE_DOWNLOAD_TAGS_NONE\nGIT_REMOTE_DOWNLOAD_TAGS_ALL", "tdef": "typedef", "description": " Automatic tag following option", @@ -33382,13 +33731,8 @@ } ], "used": { - "returns": [ - "git_remote_autotag" - ], - "needs": [ - "git_remote_set_autotag", - "git_remote_update_tips" - ] + "returns": ["git_remote_autotag"], + "needs": ["git_remote_set_autotag", "git_remote_update_tips"] } } ], @@ -33398,24 +33742,27 @@ "decl": [ "unsigned int version", "git_transport_message_cb sideband_progress", - "int (*)(git_remote_completion_type, void *) completion", - "git_cred_acquire_cb credentials", + "int (*)(git_remote_completion_t, void *) completion", + "git_credential_acquire_cb credentials", "git_transport_certificate_check_cb certificate_check", - "git_transfer_progress_cb transfer_progress", + "git_indexer_progress_cb transfer_progress", "int (*)(const char *, const git_oid *, const git_oid *, void *) update_tips", "git_packbuilder_progress pack_progress", - "git_push_transfer_progress push_transfer_progress", - "int (*)(const char *, const char *, void *) push_update_reference", + "git_push_transfer_progress_cb push_transfer_progress", + "git_push_update_reference_cb push_update_reference", "git_push_negotiation push_negotiation", "git_transport_cb transport", - "void * payload" + "git_remote_ready_cb remote_ready", + "void * payload", + "git_url_resolve_cb resolve_url", + "int (*)(const char *, const git_oid *, const git_oid *, git_refspec *, void *) update_refs" ], "type": "struct", "value": "git_remote_callbacks", - "file": "remote.h", - "line": 376, - "lineto": 460, - "block": "unsigned int version\ngit_transport_message_cb sideband_progress\nint (*)(git_remote_completion_type, void *) completion\ngit_cred_acquire_cb credentials\ngit_transport_certificate_check_cb certificate_check\ngit_transfer_progress_cb transfer_progress\nint (*)(const char *, const git_oid *, const git_oid *, void *) update_tips\ngit_packbuilder_progress pack_progress\ngit_push_transfer_progress push_transfer_progress\nint (*)(const char *, const char *, void *) push_update_reference\ngit_push_negotiation push_negotiation\ngit_transport_cb transport\nvoid * payload", + "file": "git2/remote.h", + "line": 572, + "lineto": 698, + "block": "unsigned int version\ngit_transport_message_cb sideband_progress\nint (*)(git_remote_completion_t, void *) completion\ngit_credential_acquire_cb credentials\ngit_transport_certificate_check_cb certificate_check\ngit_indexer_progress_cb transfer_progress\nint (*)(const char *, const git_oid *, const git_oid *, void *) update_tips\ngit_packbuilder_progress pack_progress\ngit_push_transfer_progress_cb push_transfer_progress\ngit_push_update_reference_cb push_update_reference\ngit_push_negotiation push_negotiation\ngit_transport_cb transport\ngit_remote_ready_cb remote_ready\nvoid * payload\ngit_url_resolve_cb resolve_url\nint (*)(const char *, const git_oid *, const git_oid *, git_refspec *, void *) update_refs", "tdef": null, "description": " The callback settings structure", "comments": "

Set the callbacks to be called by the remote when informing the user about the progress of the network operations.

\n", @@ -33423,7 +33770,7 @@ { "type": "unsigned int", "name": "version", - "comments": "" + "comments": " The version " }, { "type": "git_transport_message_cb", @@ -33431,29 +33778,29 @@ "comments": " Textual progress from the remote. Text send over the\n progress side-band will be passed to this function (this is\n the 'counting objects' output)." }, { - "type": "int (*)(git_remote_completion_type, void *)", + "type": "int (*)(git_remote_completion_t, void *)", "name": "completion", - "comments": " Completion is called when different parts of the download\n process are done (currently unused)." + "comments": "" }, { - "type": "git_cred_acquire_cb", + "type": "git_credential_acquire_cb", "name": "credentials", "comments": " This will be called if the remote host requires\n authentication in order to connect to it.\n\n Returning GIT_PASSTHROUGH will make libgit2 behave as\n though this field isn't set." }, { "type": "git_transport_certificate_check_cb", "name": "certificate_check", - "comments": " If cert verification fails, this will be called to let the\n user make the final decision of whether to allow the\n connection to proceed. Returns 1 to allow the connection, 0\n to disallow it or a negative value to indicate an error." + "comments": " If cert verification fails, this will be called to let the\n user make the final decision of whether to allow the\n connection to proceed. Returns 0 to allow the connection\n or a negative value to indicate an error." }, { - "type": "git_transfer_progress_cb", + "type": "git_indexer_progress_cb", "name": "transfer_progress", "comments": " During the download of new data, this will be regularly\n called with the current count of progress done by the\n indexer." }, { "type": "int (*)(const char *, const git_oid *, const git_oid *, void *)", "name": "update_tips", - "comments": " Each time a reference is updated locally, this function\n will be called with information about it." + "comments": "" }, { "type": "git_packbuilder_progress", @@ -33461,14 +33808,14 @@ "comments": " Function to call with progress information during pack\n building. Be aware that this is called inline with pack\n building operations, so performance may be affected." }, { - "type": "git_push_transfer_progress", + "type": "git_push_transfer_progress_cb", "name": "push_transfer_progress", "comments": " Function to call with progress information during the\n upload portion of a push. Be aware that this is called\n inline with pack building operations, so performance may be\n affected." }, { - "type": "int (*)(const char *, const char *, void *)", + "type": "git_push_update_reference_cb", "name": "push_update_reference", - "comments": " Called for each updated reference on push. If `status` is\n not `NULL`, the update was rejected by the remote server\n and `status` contains the reason given." + "comments": " See documentation of git_push_update_reference_cb" }, { "type": "git_push_negotiation", @@ -33480,10 +33827,25 @@ "name": "transport", "comments": " Create the transport to use for this operation. Leave NULL\n to auto-detect." }, + { + "type": "git_remote_ready_cb", + "name": "remote_ready", + "comments": " Callback when the remote is ready to connect." + }, { "type": "void *", "name": "payload", "comments": " This will be passed to each of the callbacks in this struct\n as the last parameter." + }, + { + "type": "git_url_resolve_cb", + "name": "resolve_url", + "comments": " Resolve URL before connecting to remote.\n The returned URL will be used to connect to the remote instead.\n\n This callback is deprecated; users should use\n git_remote_ready_cb and configure the instance URL instead." + }, + { + "type": "int (*)(const char *, const git_oid *, const git_oid *, git_refspec *, void *)", + "name": "update_refs", + "comments": "" } ], "used": { @@ -33498,7 +33860,7 @@ } ], [ - "git_remote_completion_type", + "git_remote_completion_t", { "decl": [ "GIT_REMOTE_COMPLETION_DOWNLOAD", @@ -33506,9 +33868,9 @@ "GIT_REMOTE_COMPLETION_ERROR" ], "type": "enum", - "file": "remote.h", - "line": 326, - "lineto": 330, + "file": "git2/remote.h", + "line": 466, + "lineto": 470, "block": "GIT_REMOTE_COMPLETION_DOWNLOAD\nGIT_REMOTE_COMPLETION_INDEXING\nGIT_REMOTE_COMPLETION_ERROR\nGIT_REMOTE_COMPLETION_DOWNLOAD\nGIT_REMOTE_COMPLETION_INDEXING\nGIT_REMOTE_COMPLETION_ERROR", "tdef": "typedef", "description": " Argument to the completion callback which tells it which operation\n finished.", @@ -33533,9 +33895,137 @@ "value": 2 } ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_remote_connect_options", + { + "decl": [ + "unsigned int version", + "git_remote_callbacks callbacks", + "git_proxy_options proxy_opts", + "git_remote_redirect_t follow_redirects", + "git_strarray custom_headers" + ], + "type": "struct", + "value": "git_remote_connect_options", + "file": "git2/remote.h", + "line": 928, + "lineto": 946, + "block": "unsigned int version\ngit_remote_callbacks callbacks\ngit_proxy_options proxy_opts\ngit_remote_redirect_t follow_redirects\ngit_strarray custom_headers", + "tdef": "typedef", + "description": " Remote creation options structure", + "comments": "

Initialize with GIT_REMOTE_CREATE_OPTIONS_INIT. Alternatively, you can use git_remote_create_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "git_remote_callbacks", + "name": "callbacks", + "comments": " Callbacks to use for this connection " + }, + { + "type": "git_proxy_options", + "name": "proxy_opts", + "comments": " HTTP Proxy settings " + }, + { + "type": "git_remote_redirect_t", + "name": "follow_redirects", + "comments": " Whether to allow off-site redirects. If this is not\n specified, the `http.followRedirects` configuration setting\n will be consulted." + }, + { + "type": "git_strarray", + "name": "custom_headers", + "comments": " Extra HTTP headers to use in this connection " + } + ], + "used": { + "returns": [], + "needs": ["git_remote_connect_ext", "git_remote_connect_options_init"] + } + } + ], + [ + "git_remote_create_flags", + { + "decl": [ + "GIT_REMOTE_CREATE_SKIP_INSTEADOF", + "GIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC" + ], + "type": "enum", + "file": "git2/remote.h", + "line": 71, + "lineto": 77, + "block": "GIT_REMOTE_CREATE_SKIP_INSTEADOF\nGIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC", + "tdef": "typedef", + "description": " Remote creation options flags", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REMOTE_CREATE_SKIP_INSTEADOF", + "comments": "

Ignore the repository apply.insteadOf configuration

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC", + "comments": "

Don't build a fetchspec from the name if none is set

\n", + "value": 2 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_remote_create_options", + { + "decl": [ + "unsigned int version", + "git_repository * repository", + "const char * name", + "const char * fetchspec", + "unsigned int flags" + ], + "type": "struct", + "value": "git_remote_create_options", + "file": "git2/remote.h", + "line": 97, + "lineto": 117, + "block": "unsigned int version\ngit_repository * repository\nconst char * name\nconst char * fetchspec\nunsigned int flags", + "tdef": "typedef", + "description": " Remote creation options structure", + "comments": "

Initialize with GIT_REMOTE_CREATE_OPTIONS_INIT. Alternatively, you can use git_remote_create_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "git_repository *", + "name": "repository", + "comments": " The repository that should own the remote.\n Setting this to NULL results in a detached remote." + }, + { + "type": "const char *", + "name": "name", + "comments": " The remote's name.\n Setting this to NULL results in an in-memory/anonymous remote." + }, + { + "type": "const char *", + "name": "fetchspec", + "comments": " The fetchspec the remote should use. " + }, + { + "type": "unsigned int", + "name": "flags", + "comments": " Additional flags for the remote. See git_remote_create_flags. " + } + ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_remote_create_options_init", + "git_remote_create_with_opts" + ] } } ], @@ -33551,47 +34041,96 @@ ], "type": "struct", "value": "git_remote_head", - "file": "net.h", - "line": 40, - "lineto": 50, + "file": "git2/net.h", + "line": 41, + "lineto": 51, "block": "int local\ngit_oid oid\ngit_oid loid\nchar * name\nchar * symref_target", "tdef": null, "description": " Description of a reference advertised by a remote server, given out\n on `ls` calls.", "comments": "", + "fields": [ + { "type": "int", "name": "local", "comments": "" }, + { "type": "git_oid", "name": "oid", "comments": "" }, + { "type": "git_oid", "name": "loid", "comments": "" }, + { "type": "char *", "name": "name", "comments": "" }, + { + "type": "char *", + "name": "symref_target", + "comments": " If the server send a symref mapping for this ref, this will\n point to the target." + } + ], + "used": { "returns": [], "needs": ["git_headlist_cb", "git_remote_ls"] } + } + ], + [ + "git_remote_redirect_t", + { + "decl": [ + "GIT_REMOTE_REDIRECT_NONE", + "GIT_REMOTE_REDIRECT_INITIAL", + "GIT_REMOTE_REDIRECT_ALL" + ], + "type": "enum", + "file": "git2/remote.h", + "line": 49, + "lineto": 66, + "block": "GIT_REMOTE_REDIRECT_NONE\nGIT_REMOTE_REDIRECT_INITIAL\nGIT_REMOTE_REDIRECT_ALL", + "tdef": "typedef", + "description": " Remote redirection settings; whether redirects to another host\n are permitted. By default, git will follow a redirect on the\n initial request (`/info/refs`), but not subsequent requests.", + "comments": "", "fields": [ { "type": "int", - "name": "local", - "comments": "" + "name": "GIT_REMOTE_REDIRECT_NONE", + "comments": "

Do not follow any off-site redirects at any stage of\n the fetch or push.

\n", + "value": 1 }, { - "type": "git_oid", - "name": "oid", - "comments": "" + "type": "int", + "name": "GIT_REMOTE_REDIRECT_INITIAL", + "comments": "

Allow off-site redirects only upon the initial request.\n This is the default.

\n", + "value": 2 }, { - "type": "git_oid", - "name": "loid", - "comments": "" - }, + "type": "int", + "name": "GIT_REMOTE_REDIRECT_ALL", + "comments": "

Allow redirects at any stage in the fetch or push.

\n", + "value": 4 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_remote_update_flags", + { + "decl": [ + "GIT_REMOTE_UPDATE_FETCHHEAD", + "GIT_REMOTE_UPDATE_REPORT_UNCHANGED" + ], + "type": "enum", + "file": "git2/remote.h", + "line": 82, + "lineto": 88, + "block": "GIT_REMOTE_UPDATE_FETCHHEAD\nGIT_REMOTE_UPDATE_REPORT_UNCHANGED", + "tdef": "typedef", + "description": " How to handle reference updates.", + "comments": "", + "fields": [ { - "type": "char *", - "name": "name", - "comments": "" + "type": "int", + "name": "GIT_REMOTE_UPDATE_FETCHHEAD", + "comments": "", + "value": 1 }, { - "type": "char *", - "name": "symref_target", - "comments": " If the server send a symref mapping for this ref, this will\n point to the target." + "type": "int", + "name": "GIT_REMOTE_UPDATE_REPORT_UNCHANGED", + "comments": "", + "value": 2 } ], - "used": { - "returns": [], - "needs": [ - "git_headlist_cb", - "git_remote_ls" - ] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -33600,9 +34139,9 @@ "decl": "git_repository", "type": "struct", "value": "git_repository", - "file": "types.h", - "line": 105, - "lineto": 105, + "file": "git2/types.h", + "line": 123, + "lineto": 123, "tdef": "typedef", "description": " Representation of an existing git repository,\n including all its object contents", "comments": "", @@ -33610,9 +34149,9 @@ "returns": [ "git_blob_owner", "git_commit_owner", - "git_filter_source_repo", "git_index_owner", "git_object_owner", + "git_patch_owner", "git_reference_owner", "git_remote_owner", "git_revwalk_repository", @@ -33625,22 +34164,30 @@ "git_annotated_commit_from_ref", "git_annotated_commit_from_revspec", "git_annotated_commit_lookup", + "git_apply", + "git_apply_to_tree", "git_attr_add_macro", "git_attr_cache_flush", "git_attr_foreach", + "git_attr_foreach_ext", "git_attr_get", + "git_attr_get_ext", "git_attr_get_many", - "git_blame_file", - "git_blob_create_frombuffer", - "git_blob_create_fromdisk", - "git_blob_create_fromstream", - "git_blob_create_fromworkdir", + "git_attr_get_many_ext", + "git_blob_create_from_buffer", + "git_blob_create_from_disk", + "git_blob_create_from_stream", + "git_blob_create_from_workdir", "git_blob_lookup", "git_blob_lookup_prefix", "git_branch_create", "git_branch_create_from_annotated", "git_branch_iterator_new", "git_branch_lookup", + "git_branch_remote_name", + "git_branch_upstream_merge", + "git_branch_upstream_name", + "git_branch_upstream_remote", "git_checkout_head", "git_checkout_index", "git_checkout_tree", @@ -33649,13 +34196,13 @@ "git_clone", "git_commit_create", "git_commit_create_buffer", - "git_commit_create_from_callback", - "git_commit_create_from_ids", + "git_commit_create_from_stage", "git_commit_create_v", "git_commit_create_with_signature", "git_commit_extract_signature", "git_commit_lookup", "git_commit_lookup_prefix", + "git_config_add_file_ondisk", "git_describe_workdir", "git_diff_commit_as_email", "git_diff_index_to_index", @@ -33666,16 +34213,19 @@ "git_diff_tree_to_workdir_with_index", "git_filter_list_apply_to_file", "git_filter_list_load", - "git_filter_list_new", + "git_filter_list_load_ext", "git_filter_list_stream_file", "git_graph_ahead_behind", "git_graph_descendant_of", + "git_graph_reachable_from_any", "git_ignore_add_rule", "git_ignore_clear_internal_rules", "git_ignore_path_is_ignored", "git_index_write_tree_to", + "git_mailmap_from_repository", "git_merge", "git_merge_analysis", + "git_merge_analysis_for_ref", "git_merge_base", "git_merge_base_many", "git_merge_base_octopus", @@ -33684,18 +34234,12 @@ "git_merge_commits", "git_merge_file_from_index", "git_merge_trees", - "git_note_create", - "git_note_foreach", - "git_note_iterator_new", - "git_note_read", - "git_note_remove", "git_object_lookup", "git_object_lookup_prefix", "git_packbuilder_new", "git_pathspec_match_workdir", "git_rebase_init", "git_rebase_open", - "git_refdb_backend_fs", "git_refdb_new", "git_refdb_open", "git_reference_create", @@ -33730,7 +34274,8 @@ "git_remote_set_autotag", "git_remote_set_pushurl", "git_remote_set_url", - "git_repository__cleanup", + "git_repository_commit_parents", + "git_repository_commondir", "git_repository_config", "git_repository_config_snapshot", "git_repository_create_cb", @@ -33741,41 +34286,38 @@ "git_repository_hashfile", "git_repository_head", "git_repository_head_detached", + "git_repository_head_detached_for_worktree", + "git_repository_head_for_worktree", "git_repository_head_unborn", "git_repository_ident", "git_repository_index", "git_repository_init", "git_repository_init_ext", - "git_repository_init_init_options", + "git_repository_init_options_init", "git_repository_is_bare", "git_repository_is_empty", "git_repository_is_shallow", + "git_repository_is_worktree", + "git_repository_item_path", "git_repository_mergehead_foreach", "git_repository_message", "git_repository_message_remove", - "git_repository_new", "git_repository_odb", + "git_repository_oid_type", "git_repository_open", "git_repository_open_bare", "git_repository_open_ext", + "git_repository_open_from_worktree", "git_repository_path", "git_repository_refdb", - "git_repository_reinit_filesystem", - "git_repository_set_bare", - "git_repository_set_config", "git_repository_set_head", "git_repository_set_head_detached", "git_repository_set_head_detached_from_annotated", "git_repository_set_ident", - "git_repository_set_index", "git_repository_set_namespace", - "git_repository_set_odb", - "git_repository_set_refdb", "git_repository_set_workdir", "git_repository_state", "git_repository_state_cleanup", - "git_repository_submodule_cache_all", - "git_repository_submodule_cache_clear", "git_repository_workdir", "git_repository_wrap_odb", "git_reset", @@ -33788,16 +34330,20 @@ "git_revparse_single", "git_revwalk_new", "git_signature_default", + "git_signature_default_from_env", "git_stash_apply", "git_stash_drop", "git_stash_foreach", "git_stash_pop", + "git_stash_save", + "git_stash_save_with_opts", "git_status_file", "git_status_foreach", "git_status_foreach_ext", "git_status_list_new", "git_status_should_ignore", "git_submodule_add_setup", + "git_submodule_clone", "git_submodule_foreach", "git_submodule_lookup", "git_submodule_open", @@ -33811,7 +34357,7 @@ "git_submodule_status", "git_tag_annotation_create", "git_tag_create", - "git_tag_create_frombuffer", + "git_tag_create_from_buffer", "git_tag_create_lightweight", "git_tag_delete", "git_tag_foreach", @@ -33819,11 +34365,16 @@ "git_tag_list_match", "git_tag_lookup", "git_tag_lookup_prefix", + "git_transaction_new", "git_tree_create_updated", "git_tree_entry_to_object", "git_tree_lookup", "git_tree_lookup_prefix", - "git_treebuilder_new" + "git_treebuilder_new", + "git_worktree_add", + "git_worktree_list", + "git_worktree_lookup", + "git_worktree_open_from_repository" ] } } @@ -33841,61 +34392,58 @@ "GIT_REPOSITORY_INIT_RELATIVE_GITLINK" ], "type": "enum", - "file": "repository.h", - "line": 221, - "lineto": 229, + "file": "git2/repository.h", + "line": 249, + "lineto": 295, "block": "GIT_REPOSITORY_INIT_BARE\nGIT_REPOSITORY_INIT_NO_REINIT\nGIT_REPOSITORY_INIT_NO_DOTGIT_DIR\nGIT_REPOSITORY_INIT_MKDIR\nGIT_REPOSITORY_INIT_MKPATH\nGIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE\nGIT_REPOSITORY_INIT_RELATIVE_GITLINK", "tdef": "typedef", "description": " Option flags for `git_repository_init_ext`.", - "comments": "

These flags configure extra behaviors to git_repository_init_ext. In every case, the default behavior is the zero value (i.e. flag is not set). Just OR the flag values together for the flags parameter when initializing a new repo. Details of individual values are:

\n\n\n", + "comments": "

These flags configure extra behaviors to git_repository_init_ext. In every case, the default behavior is the zero value (i.e. flag is not set). Just OR the flag values together for the flags parameter when initializing a new repo.

\n", "fields": [ { "type": "int", "name": "GIT_REPOSITORY_INIT_BARE", - "comments": "", + "comments": "

Create a bare repository with no working directory.

\n", "value": 1 }, { "type": "int", "name": "GIT_REPOSITORY_INIT_NO_REINIT", - "comments": "", + "comments": "

Return an GIT_EEXISTS error if the repo_path appears to already be\n an git repository.

\n", "value": 2 }, { "type": "int", "name": "GIT_REPOSITORY_INIT_NO_DOTGIT_DIR", - "comments": "", + "comments": "

Normally a "/.git/" will be appended to the repo path for\n non-bare repos (if it is not already there), but passing this flag\n prevents that behavior.

\n", "value": 4 }, { "type": "int", "name": "GIT_REPOSITORY_INIT_MKDIR", - "comments": "", + "comments": "

Make the repo_path (and workdir_path) as needed. Init is always willing\n to create the ".git" directory even without this flag. This flag tells\n init to create the trailing component of the repo and workdir paths\n as needed.

\n", "value": 8 }, { "type": "int", "name": "GIT_REPOSITORY_INIT_MKPATH", - "comments": "", + "comments": "

Recursively make all components of the repo and workdir paths as\n necessary.

\n", "value": 16 }, { "type": "int", "name": "GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE", - "comments": "", + "comments": "

libgit2 normally uses internal templates to initialize a new repo.\n This flags enables external templates, looking the "template_path" from\n the options if set, or the init.templatedir global config if not,\n or falling back on "/usr/share/git-core/templates" if it exists.

\n", "value": 32 }, { "type": "int", "name": "GIT_REPOSITORY_INIT_RELATIVE_GITLINK", - "comments": "", + "comments": "

If an alternate workdir is specified, use relative paths for the gitdir\n and core.worktree.

\n", "value": 64 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -33907,37 +34455,34 @@ "GIT_REPOSITORY_INIT_SHARED_ALL" ], "type": "enum", - "file": "repository.h", - "line": 244, - "lineto": 248, + "file": "git2/repository.h", + "line": 304, + "lineto": 320, "block": "GIT_REPOSITORY_INIT_SHARED_UMASK\nGIT_REPOSITORY_INIT_SHARED_GROUP\nGIT_REPOSITORY_INIT_SHARED_ALL", "tdef": "typedef", "description": " Mode options for `git_repository_init_ext`.", - "comments": "

Set the mode field of the git_repository_init_options structure either to the custom mode that you would like, or to one of the following modes:

\n\n\n", + "comments": "

Set the mode field of the git_repository_init_options structure either to the custom mode that you would like, or to one of the defined modes.

\n", "fields": [ { "type": "int", "name": "GIT_REPOSITORY_INIT_SHARED_UMASK", - "comments": "", + "comments": "

Use permissions configured by umask - the default.

\n", "value": 0 }, { "type": "int", "name": "GIT_REPOSITORY_INIT_SHARED_GROUP", - "comments": "", + "comments": "

Use "--shared=group" behavior, chmod'ing the new repo to be group\n writable and "g+sx" for sticky group assignment.

\n", "value": 1533 }, { "type": "int", "name": "GIT_REPOSITORY_INIT_SHARED_ALL", - "comments": "", + "comments": "

Use "--shared=all" behavior, adding world readability.

\n", "value": 1535 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -33955,64 +34500,190 @@ ], "type": "struct", "value": "git_repository_init_options", - "file": "repository.h", - "line": 278, - "lineto": 287, + "file": "git2/repository.h", + "line": 328, + "lineto": 387, "block": "unsigned int version\nuint32_t flags\nuint32_t mode\nconst char * workdir_path\nconst char * description\nconst char * template_path\nconst char * initial_head\nconst char * origin_url", "tdef": "typedef", "description": " Extended options structure for `git_repository_init_ext`.", - "comments": "

This contains extra options for git_repository_init_ext that enable additional initialization features. The fields are:

\n\n\n", + "comments": "

This contains extra options for git_repository_init_ext that enable additional initialization features.

\n", "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, + { "type": "unsigned int", "name": "version", "comments": "" }, { "type": "uint32_t", "name": "flags", - "comments": "" + "comments": " Combination of GIT_REPOSITORY_INIT flags above." }, { "type": "uint32_t", "name": "mode", - "comments": "" + "comments": " Set to one of the standard GIT_REPOSITORY_INIT_SHARED_... constants\n above, or to a custom value that you would like." }, { "type": "const char *", "name": "workdir_path", - "comments": "" + "comments": " The path to the working dir or NULL for default (i.e. repo_path parent\n on non-bare repos). IF THIS IS RELATIVE PATH, IT WILL BE EVALUATED\n RELATIVE TO THE REPO_PATH. If this is not the \"natural\" working\n directory, a .git gitlink file will be created here linking to the\n repo_path." }, { "type": "const char *", "name": "description", - "comments": "" + "comments": " If set, this will be used to initialize the \"description\" file in the\n repository, instead of using the template content." }, { "type": "const char *", "name": "template_path", - "comments": "" + "comments": " When GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE is set, this contains\n the path to use for the template directory. If this is NULL, the config\n or default directory options will be used instead." }, { "type": "const char *", "name": "initial_head", - "comments": "" + "comments": " The name of the head to point HEAD at. If NULL, then this will be\n treated as \"master\" and the HEAD ref will be set to \"refs/heads/master\".\n If this begins with \"refs/\" it will be used verbatim;\n otherwise \"refs/heads/\" will be prefixed." }, { "type": "const char *", "name": "origin_url", - "comments": "" + "comments": " If this is non-NULL, then after the rest of the repository\n initialization is completed, an \"origin\" remote will be added\n pointing to this URL." } ], "used": { "returns": [], "needs": [ "git_repository_init_ext", - "git_repository_init_init_options" + "git_repository_init_options_init" ] } } ], + [ + "git_repository_item_t", + { + "decl": [ + "GIT_REPOSITORY_ITEM_GITDIR", + "GIT_REPOSITORY_ITEM_WORKDIR", + "GIT_REPOSITORY_ITEM_COMMONDIR", + "GIT_REPOSITORY_ITEM_INDEX", + "GIT_REPOSITORY_ITEM_OBJECTS", + "GIT_REPOSITORY_ITEM_REFS", + "GIT_REPOSITORY_ITEM_PACKED_REFS", + "GIT_REPOSITORY_ITEM_REMOTES", + "GIT_REPOSITORY_ITEM_CONFIG", + "GIT_REPOSITORY_ITEM_INFO", + "GIT_REPOSITORY_ITEM_HOOKS", + "GIT_REPOSITORY_ITEM_LOGS", + "GIT_REPOSITORY_ITEM_MODULES", + "GIT_REPOSITORY_ITEM_WORKTREES", + "GIT_REPOSITORY_ITEM_WORKTREE_CONFIG", + "GIT_REPOSITORY_ITEM__LAST" + ], + "type": "enum", + "file": "git2/repository.h", + "line": 512, + "lineto": 529, + "block": "GIT_REPOSITORY_ITEM_GITDIR\nGIT_REPOSITORY_ITEM_WORKDIR\nGIT_REPOSITORY_ITEM_COMMONDIR\nGIT_REPOSITORY_ITEM_INDEX\nGIT_REPOSITORY_ITEM_OBJECTS\nGIT_REPOSITORY_ITEM_REFS\nGIT_REPOSITORY_ITEM_PACKED_REFS\nGIT_REPOSITORY_ITEM_REMOTES\nGIT_REPOSITORY_ITEM_CONFIG\nGIT_REPOSITORY_ITEM_INFO\nGIT_REPOSITORY_ITEM_HOOKS\nGIT_REPOSITORY_ITEM_LOGS\nGIT_REPOSITORY_ITEM_MODULES\nGIT_REPOSITORY_ITEM_WORKTREES\nGIT_REPOSITORY_ITEM_WORKTREE_CONFIG\nGIT_REPOSITORY_ITEM__LAST", + "tdef": "typedef", + "description": " List of items which belong to the git repository layout", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_GITDIR", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_WORKDIR", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_COMMONDIR", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_INDEX", + "comments": "", + "value": 3 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_OBJECTS", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_REFS", + "comments": "", + "value": 5 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_PACKED_REFS", + "comments": "", + "value": 6 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_REMOTES", + "comments": "", + "value": 7 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_CONFIG", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_INFO", + "comments": "", + "value": 9 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_HOOKS", + "comments": "", + "value": 10 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_LOGS", + "comments": "", + "value": 11 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_MODULES", + "comments": "", + "value": 12 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_WORKTREES", + "comments": "", + "value": 13 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_WORKTREE_CONFIG", + "comments": "", + "value": 14 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM__LAST", + "comments": "", + "value": 15 + } + ], + "used": { "returns": [], "needs": ["git_repository_item_path"] } + } + ], [ "git_repository_open_flag_t", { @@ -34024,49 +34695,46 @@ "GIT_REPOSITORY_OPEN_FROM_ENV" ], "type": "enum", - "file": "repository.h", - "line": 115, - "lineto": 121, + "file": "git2/repository.h", + "line": 110, + "lineto": 157, "block": "GIT_REPOSITORY_OPEN_NO_SEARCH\nGIT_REPOSITORY_OPEN_CROSS_FS\nGIT_REPOSITORY_OPEN_BARE\nGIT_REPOSITORY_OPEN_NO_DOTGIT\nGIT_REPOSITORY_OPEN_FROM_ENV", "tdef": "typedef", "description": " Option flags for `git_repository_open_ext`.", - "comments": "\n", + "comments": "", "fields": [ { "type": "int", "name": "GIT_REPOSITORY_OPEN_NO_SEARCH", - "comments": "", + "comments": "

Only open the repository if it can be immediately found in the\n start_path. Do not walk up from the start_path looking at parent\n directories.

\n", "value": 1 }, { "type": "int", "name": "GIT_REPOSITORY_OPEN_CROSS_FS", - "comments": "", + "comments": "

Unless this flag is set, open will not continue searching across\n filesystem boundaries (i.e. when st_dev changes from the stat\n system call). For example, searching in a user's home directory at\n "/home/user/source/" will not return "/.git/" as the found repo if\n "/" is a different filesystem than "/home".

\n", "value": 2 }, { "type": "int", "name": "GIT_REPOSITORY_OPEN_BARE", - "comments": "", + "comments": "

Open repository as a bare repo regardless of core.bare config, and\n defer loading config file for faster setup.\n Unlike git_repository_open_bare, this can follow gitlinks.

\n", "value": 4 }, { "type": "int", "name": "GIT_REPOSITORY_OPEN_NO_DOTGIT", - "comments": "", + "comments": "

Do not check for a repository by appending /.git to the start_path;\n only open the repository if start_path itself points to the git\n directory.

\n", "value": 8 }, { "type": "int", "name": "GIT_REPOSITORY_OPEN_FROM_ENV", - "comments": "", + "comments": "

Find and open a git repository, respecting the environment variables\n used by the git command-line tools.\n If set, git_repository_open_ext will ignore the other flags and\n the ceiling_dirs argument, and will allow a NULL path to use\n GIT_DIR or search from the current directory.\n The search for a repository will respect $GIT_CEILING_DIRECTORIES and\n $GIT_DISCOVERY_ACROSS_FILESYSTEM. The opened repository will\n respect $GIT_INDEX_FILE, $GIT_NAMESPACE, $GIT_OBJECT_DIRECTORY, and\n $GIT_ALTERNATE_OBJECT_DIRECTORIES.\n In the future, this flag will also cause git_repository_open_ext\n to respect $GIT_WORK_TREE and $GIT_COMMON_DIR; currently,\n git_repository_open_ext with this flag will error out if either\n $GIT_WORK_TREE or $GIT_COMMON_DIR is set.

\n", "value": 16 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -34087,9 +34755,9 @@ "GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE" ], "type": "enum", - "file": "repository.h", - "line": 693, - "lineto": 706, + "file": "git2/repository.h", + "line": 915, + "lineto": 928, "block": "GIT_REPOSITORY_STATE_NONE\nGIT_REPOSITORY_STATE_MERGE\nGIT_REPOSITORY_STATE_REVERT\nGIT_REPOSITORY_STATE_REVERT_SEQUENCE\nGIT_REPOSITORY_STATE_CHERRYPICK\nGIT_REPOSITORY_STATE_CHERRYPICK_SEQUENCE\nGIT_REPOSITORY_STATE_BISECT\nGIT_REPOSITORY_STATE_REBASE\nGIT_REPOSITORY_STATE_REBASE_INTERACTIVE\nGIT_REPOSITORY_STATE_REBASE_MERGE\nGIT_REPOSITORY_STATE_APPLY_MAILBOX\nGIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE", "tdef": "typedef", "description": " Repository state", @@ -34168,22 +34836,15 @@ "value": 11 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ "git_reset_t", { - "decl": [ - "GIT_RESET_SOFT", - "GIT_RESET_MIXED", - "GIT_RESET_HARD" - ], + "decl": ["GIT_RESET_SOFT", "GIT_RESET_MIXED", "GIT_RESET_HARD"], "type": "enum", - "file": "reset.h", + "file": "git2/reset.h", "line": 26, "lineto": 30, "block": "GIT_RESET_SOFT\nGIT_RESET_MIXED\nGIT_RESET_HARD", @@ -34212,10 +34873,7 @@ ], "used": { "returns": [], - "needs": [ - "git_reset", - "git_reset_from_annotated" - ] + "needs": ["git_reset", "git_reset_from_annotated"] } } ], @@ -34230,7 +34888,7 @@ ], "type": "struct", "value": "git_revert_options", - "file": "revert.h", + "file": "git2/revert.h", "line": 26, "lineto": 34, "block": "unsigned int version\nunsigned int mainline\ngit_merge_options merge_opts\ngit_checkout_options checkout_opts", @@ -34238,11 +34896,7 @@ "description": " Options for revert", "comments": "", "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, + { "type": "unsigned int", "name": "version", "comments": "" }, { "type": "unsigned int", "name": "mainline", @@ -34254,73 +34908,24 @@ "comments": " Options for the merging " }, { - "type": "git_checkout_options", - "name": "checkout_opts", - "comments": " Options for the checkout " - } - ], - "used": { - "returns": [], - "needs": [ - "git_revert", - "git_revert_init_options" - ] - } - } - ], - [ - "git_revparse_mode_t", - { - "decl": [ - "GIT_REVPARSE_SINGLE", - "GIT_REVPARSE_RANGE", - "GIT_REVPARSE_MERGE_BASE" - ], - "type": "enum", - "file": "revparse.h", - "line": 71, - "lineto": 78, - "block": "GIT_REVPARSE_SINGLE\nGIT_REVPARSE_RANGE\nGIT_REVPARSE_MERGE_BASE", - "tdef": "typedef", - "description": " Revparse flags. These indicate the intended behavior of the spec passed to\n git_revparse.", - "comments": "", - "fields": [ - { - "type": "int", - "name": "GIT_REVPARSE_SINGLE", - "comments": "

The spec targeted a single object.

\n", - "value": 1 - }, - { - "type": "int", - "name": "GIT_REVPARSE_RANGE", - "comments": "

The spec targeted a range of commits.

\n", - "value": 2 - }, - { - "type": "int", - "name": "GIT_REVPARSE_MERGE_BASE", - "comments": "

The spec used the '...' operator, which invokes special semantics.

\n", - "value": 4 + "type": "git_checkout_options", + "name": "checkout_opts", + "comments": " Options for the checkout " } ], "used": { "returns": [], - "needs": [] + "needs": ["git_revert", "git_revert_options_init"] } } ], [ "git_revspec", { - "decl": [ - "git_object * from", - "git_object * to", - "unsigned int flags" - ], + "decl": ["git_object * from", "git_object * to", "unsigned int flags"], "type": "struct", "value": "git_revspec", - "file": "revparse.h", + "file": "git2/revparse.h", "line": 83, "lineto": 90, "block": "git_object * from\ngit_object * to\nunsigned int flags", @@ -34341,15 +34946,49 @@ { "type": "unsigned int", "name": "flags", - "comments": " The intent of the revspec (i.e. `git_revparse_mode_t` flags) " + "comments": " The intent of the revspec (i.e. `git_revspec_mode_t` flags) " } ], - "used": { - "returns": [], - "needs": [ - "git_revparse" - ] - } + "used": { "returns": [], "needs": ["git_revparse"] } + } + ], + [ + "git_revspec_t", + { + "decl": [ + "GIT_REVSPEC_SINGLE", + "GIT_REVSPEC_RANGE", + "GIT_REVSPEC_MERGE_BASE" + ], + "type": "enum", + "file": "git2/revparse.h", + "line": 71, + "lineto": 78, + "block": "GIT_REVSPEC_SINGLE\nGIT_REVSPEC_RANGE\nGIT_REVSPEC_MERGE_BASE", + "tdef": "typedef", + "description": " Revparse flags. These indicate the intended behavior of the spec passed to\n git_revparse.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REVSPEC_SINGLE", + "comments": "

The spec targeted a single object.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REVSPEC_RANGE", + "comments": "

The spec targeted a range of commits.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REVSPEC_MERGE_BASE", + "comments": "

The spec used the '...' operator, which invokes special semantics.

\n", + "value": 4 + } + ], + "used": { "returns": [], "needs": [] } } ], [ @@ -34358,9 +34997,9 @@ "decl": "git_revwalk", "type": "struct", "value": "git_revwalk", - "file": "types.h", - "line": 111, - "lineto": 111, + "file": "git2/types.h", + "line": 132, + "lineto": 132, "tdef": "typedef", "description": " Representation of an in-progress walk through the commits in a repo ", "comments": "", @@ -34392,16 +35031,12 @@ [ "git_signature", { - "decl": [ - "char * name", - "char * email", - "git_time when" - ], + "decl": ["char * name", "char * email", "git_time when"], "type": "struct", "value": "git_signature", - "file": "types.h", - "line": 162, - "lineto": 166, + "file": "git2/types.h", + "line": 187, + "lineto": 191, "block": "char * name\nchar * email\ngit_time when", "tdef": "typedef", "description": " An action signature (e.g. for committers, taggers, etc) ", @@ -34427,73 +35062,81 @@ "returns": [ "git_commit_author", "git_commit_committer", - "git_note_author", - "git_note_committer", "git_reflog_entry_committer", "git_tag_tagger" ], "needs": [ "git_commit_amend", + "git_commit_author_with_mailmap", + "git_commit_committer_with_mailmap", "git_commit_create", "git_commit_create_buffer", - "git_commit_create_from_callback", - "git_commit_create_from_ids", + "git_commit_create_cb", "git_commit_create_v", - "git_note_create", - "git_note_remove", + "git_mailmap_resolve_signature", "git_rebase_commit", "git_rebase_finish", "git_reflog_append", "git_signature_default", + "git_signature_default_from_env", "git_signature_dup", "git_signature_free", "git_signature_from_buffer", "git_signature_new", "git_signature_now", + "git_stash_save", "git_tag_annotation_create", - "git_tag_create" + "git_tag_create", + "git_transaction_set_symbolic_target", + "git_transaction_set_target" ] } } ], [ - "git_smart_subtransport_definition", + "git_smart_service_t", { "decl": [ - "git_smart_subtransport_cb callback", - "unsigned int rpc", - "void * param" + "GIT_SERVICE_UPLOADPACK_LS", + "GIT_SERVICE_UPLOADPACK", + "GIT_SERVICE_RECEIVEPACK_LS", + "GIT_SERVICE_RECEIVEPACK" ], - "type": "struct", - "value": "git_smart_subtransport_definition", - "file": "sys/transport.h", - "line": 326, - "lineto": 339, - "block": "git_smart_subtransport_cb callback\nunsigned int rpc\nvoid * param", + "type": "enum", + "file": "git2/sys/transport.h", + "line": 323, + "lineto": 328, + "block": "GIT_SERVICE_UPLOADPACK_LS\nGIT_SERVICE_UPLOADPACK\nGIT_SERVICE_RECEIVEPACK_LS\nGIT_SERVICE_RECEIVEPACK", "tdef": "typedef", - "description": " Definition for a \"subtransport\"", - "comments": "

This is used to let the smart protocol code know about the protocol which you are implementing.

\n", + "description": " Actions that the smart transport can ask a subtransport to perform ", + "comments": "", "fields": [ { - "type": "git_smart_subtransport_cb", - "name": "callback", - "comments": " The function to use to create the git_smart_subtransport " + "type": "int", + "name": "GIT_SERVICE_UPLOADPACK_LS", + "comments": "", + "value": 1 }, { - "type": "unsigned int", - "name": "rpc", - "comments": " True if the protocol is stateless; false otherwise. For example,\n http:// is stateless, but git:// is not." + "type": "int", + "name": "GIT_SERVICE_UPLOADPACK", + "comments": "", + "value": 2 }, { - "type": "void *", - "name": "param", - "comments": " Param of the callback" + "type": "int", + "name": "GIT_SERVICE_RECEIVEPACK_LS", + "comments": "", + "value": 3 + }, + { + "type": "int", + "name": "GIT_SERVICE_RECEIVEPACK", + "comments": "", + "value": 4 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -34506,7 +35149,7 @@ "GIT_SORT_REVERSE" ], "type": "enum", - "file": "revwalk.h", + "file": "git2/revwalk.h", "line": 26, "lineto": 53, "block": "GIT_SORT_NONE\nGIT_SORT_TOPOLOGICAL\nGIT_SORT_TIME\nGIT_SORT_REVERSE", @@ -34517,13 +35160,13 @@ { "type": "int", "name": "GIT_SORT_NONE", - "comments": "

Sort the output with the same default time-order method from git.\n This is the default sorting for new walkers.

\n", + "comments": "

Sort the output with the same default method from git: reverse\n chronological order. This is the default sorting for new walkers.

\n", "value": 0 }, { "type": "int", "name": "GIT_SORT_TOPOLOGICAL", - "comments": "

Sort the repository contents in topological order (parents before\n children); this sorting mode can be combined with time sorting to\n produce git's "time-order".

\n", + "comments": "

Sort the repository contents in topological order (no parents before\n all of its children are shown); this sorting mode can be combined\n with time sorting to produce git's --date-order`.

\n", "value": 1 }, { @@ -34539,23 +35182,17 @@ "value": 4 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ "git_stash_apply_flags", { - "decl": [ - "GIT_STASH_APPLY_DEFAULT", - "GIT_STASH_APPLY_REINSTATE_INDEX" - ], + "decl": ["GIT_STASH_APPLY_DEFAULT", "GIT_STASH_APPLY_REINSTATE_INDEX"], "type": "enum", - "file": "stash.h", - "line": 74, - "lineto": 81, + "file": "git2/stash.h", + "line": 137, + "lineto": 144, "block": "GIT_STASH_APPLY_DEFAULT\nGIT_STASH_APPLY_REINSTATE_INDEX", "tdef": "typedef", "description": " Stash application flags. ", @@ -34574,12 +35211,131 @@ "value": 1 } ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_stash_apply_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "git_checkout_options checkout_options", + "git_stash_apply_progress_cb progress_cb", + "void * progress_payload" + ], + "type": "struct", + "value": "git_stash_apply_options", + "file": "git2/stash.h", + "line": 192, + "lineto": 204, + "block": "unsigned int version\nuint32_t flags\ngit_checkout_options checkout_options\ngit_stash_apply_progress_cb progress_cb\nvoid * progress_payload", + "tdef": "typedef", + "description": " Stash application options structure", + "comments": "

Initialize with GIT_STASH_APPLY_OPTIONS_INIT. Alternatively, you can use git_stash_apply_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "uint32_t", + "name": "flags", + "comments": " See `git_stash_apply_flags`, above. " + }, + { + "type": "git_checkout_options", + "name": "checkout_options", + "comments": " Options to use when writing files to the working directory. " + }, + { + "type": "git_stash_apply_progress_cb", + "name": "progress_cb", + "comments": " Optional callback to notify the consumer of application progress. " + }, + { "type": "void *", "name": "progress_payload", "comments": "" } + ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_stash_apply", + "git_stash_apply_options_init", + "git_stash_pop" + ] } } ], + [ + "git_stash_apply_progress_t", + { + "decl": [ + "GIT_STASH_APPLY_PROGRESS_NONE", + "GIT_STASH_APPLY_PROGRESS_LOADING_STASH", + "GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX", + "GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED", + "GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED", + "GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED", + "GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED", + "GIT_STASH_APPLY_PROGRESS_DONE" + ], + "type": "enum", + "file": "git2/stash.h", + "line": 147, + "lineto": 170, + "block": "GIT_STASH_APPLY_PROGRESS_NONE\nGIT_STASH_APPLY_PROGRESS_LOADING_STASH\nGIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX\nGIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED\nGIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED\nGIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED\nGIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED\nGIT_STASH_APPLY_PROGRESS_DONE", + "tdef": "typedef", + "description": " Stash apply progression states ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_NONE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_LOADING_STASH", + "comments": "

Loading the stashed data from the object database.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX", + "comments": "

The stored index is being analyzed.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED", + "comments": "

The modified files are being analyzed.

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED", + "comments": "

The untracked and ignored files are being analyzed.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED", + "comments": "

The untracked files are being written to disk.

\n", + "value": 5 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED", + "comments": "

The modified files are being written to disk.

\n", + "value": 6 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_DONE", + "comments": "

The stash was applied successfully.

\n", + "value": 7 + } + ], + "used": { "returns": [], "needs": ["git_stash_apply_progress_cb"] } + } + ], [ "git_stash_flags", { @@ -34587,13 +35343,14 @@ "GIT_STASH_DEFAULT", "GIT_STASH_KEEP_INDEX", "GIT_STASH_INCLUDE_UNTRACKED", - "GIT_STASH_INCLUDE_IGNORED" + "GIT_STASH_INCLUDE_IGNORED", + "GIT_STASH_KEEP_ALL" ], "type": "enum", - "file": "stash.h", - "line": 24, - "lineto": 47, - "block": "GIT_STASH_DEFAULT\nGIT_STASH_KEEP_INDEX\nGIT_STASH_INCLUDE_UNTRACKED\nGIT_STASH_INCLUDE_IGNORED", + "file": "git2/stash.h", + "line": 30, + "lineto": 58, + "block": "GIT_STASH_DEFAULT\nGIT_STASH_KEEP_INDEX\nGIT_STASH_INCLUDE_UNTRACKED\nGIT_STASH_INCLUDE_IGNORED\nGIT_STASH_KEEP_ALL", "tdef": "typedef", "description": " Stash flags", "comments": "", @@ -34621,23 +35378,107 @@ "name": "GIT_STASH_INCLUDE_IGNORED", "comments": "

All ignored files are also stashed and then cleaned up from\n the working directory

\n", "value": 4 + }, + { + "type": "int", + "name": "GIT_STASH_KEEP_ALL", + "comments": "

All changes in the index and working directory are left intact

\n", + "value": 8 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_stash_save_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "const git_signature * stasher", + "const char * message", + "git_strarray paths" + ], + "type": "struct", + "value": "git_stash_save_options", + "file": "git2/stash.h", + "line": 86, + "lineto": 100, + "block": "unsigned int version\nuint32_t flags\nconst git_signature * stasher\nconst char * message\ngit_strarray paths", + "tdef": "typedef", + "description": " Stash save options structure", + "comments": "

Initialize with GIT_STASH_SAVE_OPTIONS_INIT. Alternatively, you can use git_stash_save_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "uint32_t", + "name": "flags", + "comments": " Flags to control the stashing process. (see GIT_STASH_* above) " + }, + { + "type": "const git_signature *", + "name": "stasher", + "comments": " The identity of the person performing the stashing. " + }, + { + "type": "const char *", + "name": "message", + "comments": " Optional description along with the stashed state. " + }, + { + "type": "git_strarray", + "name": "paths", + "comments": " Optional paths that control which files are stashed. " } ], "used": { "returns": [], - "needs": [] + "needs": ["git_stash_save_options_init", "git_stash_save_with_opts"] } } ], + [ + "git_status_entry", + { + "decl": [ + "git_status_t status", + "git_diff_delta * head_to_index", + "git_diff_delta * index_to_workdir" + ], + "type": "struct", + "value": "git_status_entry", + "file": "git2/status.h", + "line": 298, + "lineto": 302, + "block": "git_status_t status\ngit_diff_delta * head_to_index\ngit_diff_delta * index_to_workdir", + "tdef": "typedef", + "description": " A status entry, providing the differences between the file as it exists\n in HEAD and the index, and providing the differences between the index\n and the working directory.", + "comments": "

The status value provides the status flags for this file.

\n\n

The head_to_index value provides detailed information about the differences between the file in HEAD and the file in the index.

\n\n

The index_to_workdir value provides detailed information about the differences between the file in the index and the file in the working directory.

\n", + "fields": [ + { "type": "git_status_t", "name": "status", "comments": "" }, + { + "type": "git_diff_delta *", + "name": "head_to_index", + "comments": "" + }, + { + "type": "git_diff_delta *", + "name": "index_to_workdir", + "comments": "" + } + ], + "used": { "returns": ["git_status_byindex"], "needs": [] } + } + ], [ "git_status_list", { "decl": "git_status_list", "type": "struct", "value": "git_status_list", - "file": "types.h", - "line": 184, - "lineto": 184, + "file": "git2/types.h", + "line": 217, + "lineto": 217, "tdef": "typedef", "description": " Representation of a status collection ", "comments": "", @@ -34647,7 +35488,6 @@ "git_status_byindex", "git_status_list_entrycount", "git_status_list_free", - "git_status_list_get_perfdata", "git_status_list_new" ] } @@ -34675,114 +35515,173 @@ "GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED" ], "type": "enum", - "file": "status.h", - "line": 137, - "lineto": 154, + "file": "git2/status.h", + "line": 100, + "lineto": 207, "block": "GIT_STATUS_OPT_INCLUDE_UNTRACKED\nGIT_STATUS_OPT_INCLUDE_IGNORED\nGIT_STATUS_OPT_INCLUDE_UNMODIFIED\nGIT_STATUS_OPT_EXCLUDE_SUBMODULES\nGIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS\nGIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH\nGIT_STATUS_OPT_RECURSE_IGNORED_DIRS\nGIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX\nGIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR\nGIT_STATUS_OPT_SORT_CASE_SENSITIVELY\nGIT_STATUS_OPT_SORT_CASE_INSENSITIVELY\nGIT_STATUS_OPT_RENAMES_FROM_REWRITES\nGIT_STATUS_OPT_NO_REFRESH\nGIT_STATUS_OPT_UPDATE_INDEX\nGIT_STATUS_OPT_INCLUDE_UNREADABLE\nGIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED", "tdef": "typedef", "description": " Flags to control status callbacks", - "comments": "\n\n

Calling git_status_foreach() is like calling the extended version with: GIT_STATUS_OPT_INCLUDE_IGNORED, GIT_STATUS_OPT_INCLUDE_UNTRACKED, and GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS. Those options are bundled together as GIT_STATUS_OPT_DEFAULTS if you want them as a baseline.

\n", + "comments": "

Calling git_status_foreach() is like calling the extended version with: GIT_STATUS_OPT_INCLUDE_IGNORED, GIT_STATUS_OPT_INCLUDE_UNTRACKED, and GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS. Those options are bundled together as GIT_STATUS_OPT_DEFAULTS if you want them as a baseline.

\n", "fields": [ { "type": "int", "name": "GIT_STATUS_OPT_INCLUDE_UNTRACKED", - "comments": "", + "comments": "

Says that callbacks should be made on untracked files.\n These will only be made if the workdir files are included in the status\n "show" option.

\n", "value": 1 }, { "type": "int", "name": "GIT_STATUS_OPT_INCLUDE_IGNORED", - "comments": "", + "comments": "

Says that ignored files get callbacks.\n Again, these callbacks will only be made if the workdir files are\n included in the status "show" option.

\n", "value": 2 }, { "type": "int", "name": "GIT_STATUS_OPT_INCLUDE_UNMODIFIED", - "comments": "", + "comments": "

Indicates that callback should be made even on unmodified files.

\n", "value": 4 }, { "type": "int", "name": "GIT_STATUS_OPT_EXCLUDE_SUBMODULES", - "comments": "", + "comments": "

Indicates that submodules should be skipped.\n This only applies if there are no pending typechanges to the submodule\n (either from or to another type).

\n", "value": 8 }, { "type": "int", "name": "GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS", - "comments": "", + "comments": "

Indicates that all files in untracked directories should be included.\n Normally if an entire directory is new, then just the top-level\n directory is included (with a trailing slash on the entry name).\n This flag says to include all of the individual files in the directory\n instead.

\n", "value": 16 }, { "type": "int", "name": "GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH", - "comments": "", + "comments": "

Indicates that the given path should be treated as a literal path,\n and not as a pathspec pattern.

\n", "value": 32 }, { "type": "int", "name": "GIT_STATUS_OPT_RECURSE_IGNORED_DIRS", - "comments": "", + "comments": "

Indicates that the contents of ignored directories should be included\n in the status. This is like doing git ls-files -o -i --exclude-standard\n with core git.

\n", "value": 64 }, { "type": "int", "name": "GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX", - "comments": "", + "comments": "

Indicates that rename detection should be processed between the head and\n the index and enables the GIT_STATUS_INDEX_RENAMED as a possible status\n flag.

\n", "value": 128 }, { "type": "int", "name": "GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR", - "comments": "", + "comments": "

Indicates that rename detection should be run between the index and the\n working directory and enabled GIT_STATUS_WT_RENAMED as a possible status\n flag.

\n", "value": 256 }, { "type": "int", "name": "GIT_STATUS_OPT_SORT_CASE_SENSITIVELY", - "comments": "", + "comments": "

Overrides the native case sensitivity for the file system and forces\n the output to be in case-sensitive order.

\n", "value": 512 }, { - "type": "int", - "name": "GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY", - "comments": "", - "value": 1024 + "type": "int", + "name": "GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY", + "comments": "

Overrides the native case sensitivity for the file system and forces\n the output to be in case-insensitive order.

\n", + "value": 1024 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_RENAMES_FROM_REWRITES", + "comments": "

Iindicates that rename detection should include rewritten files.

\n", + "value": 2048 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_NO_REFRESH", + "comments": "

Bypasses the default status behavior of doing a "soft" index reload\n (i.e. reloading the index data if the file on disk has been modified\n outside libgit2).

\n", + "value": 4096 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_UPDATE_INDEX", + "comments": "

Tells libgit2 to refresh the stat cache in the index for files that are\n unchanged but have out of date stat einformation in the index.\n It will result in less work being done on subsequent calls to get status.\n This is mutually exclusive with the NO_REFRESH option.

\n", + "value": 8192 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_INCLUDE_UNREADABLE", + "comments": "

Normally files that cannot be opened or read are ignored as\n these are often transient files; this option will return\n unreadable files as GIT_STATUS_WT_UNREADABLE.

\n", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED", + "comments": "

Unreadable files will be detected and given the status\n untracked instead of unreadable.

\n", + "value": 32768 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_status_options", + { + "decl": [ + "unsigned int version", + "git_status_show_t show", + "unsigned int flags", + "git_strarray pathspec", + "git_tree * baseline", + "uint16_t rename_threshold" + ], + "type": "struct", + "value": "git_status_options", + "file": "git2/status.h", + "line": 222, + "lineto": 262, + "block": "unsigned int version\ngit_status_show_t show\nunsigned int flags\ngit_strarray pathspec\ngit_tree * baseline\nuint16_t rename_threshold", + "tdef": "typedef", + "description": " Options to control how `git_status_foreach_ext()` will issue callbacks.", + "comments": "

Initialize with GIT_STATUS_OPTIONS_INIT. Alternatively, you can use git_status_options_init.

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": " The struct version; pass `GIT_STATUS_OPTIONS_VERSION`." }, { - "type": "int", - "name": "GIT_STATUS_OPT_RENAMES_FROM_REWRITES", - "comments": "", - "value": 2048 + "type": "git_status_show_t", + "name": "show", + "comments": " The `show` value is one of the `git_status_show_t` constants that\n control which files to scan and in what order. The default is\n `GIT_STATUS_SHOW_INDEX_AND_WORKDIR`." }, { - "type": "int", - "name": "GIT_STATUS_OPT_NO_REFRESH", - "comments": "", - "value": 4096 + "type": "unsigned int", + "name": "flags", + "comments": " The `flags` value is an OR'ed combination of the\n `git_status_opt_t` values above. The default is\n `GIT_STATUS_OPT_DEFAULTS`, which matches git's default\n behavior." }, { - "type": "int", - "name": "GIT_STATUS_OPT_UPDATE_INDEX", - "comments": "", - "value": 8192 + "type": "git_strarray", + "name": "pathspec", + "comments": " The `pathspec` is an array of path patterns to match (using\n fnmatch-style matching), or just an array of paths to match\n exactly if `GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH` is specified\n in the flags." }, { - "type": "int", - "name": "GIT_STATUS_OPT_INCLUDE_UNREADABLE", - "comments": "", - "value": 16384 + "type": "git_tree *", + "name": "baseline", + "comments": " The `baseline` is the tree to be used for comparison to the\n working directory and index; defaults to HEAD." }, { - "type": "int", - "name": "GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED", - "comments": "", - "value": 32768 + "type": "uint16_t", + "name": "rename_threshold", + "comments": " Threshold above which similar files will be considered renames.\n This is equivalent to the -M option. Defaults to 50." } ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_status_foreach_ext", + "git_status_list_new", + "git_status_options_init" + ] } } ], @@ -34795,37 +35694,34 @@ "GIT_STATUS_SHOW_WORKDIR_ONLY" ], "type": "enum", - "file": "status.h", - "line": 79, - "lineto": 83, + "file": "git2/status.h", + "line": 72, + "lineto": 90, "block": "GIT_STATUS_SHOW_INDEX_AND_WORKDIR\nGIT_STATUS_SHOW_INDEX_ONLY\nGIT_STATUS_SHOW_WORKDIR_ONLY", "tdef": "typedef", "description": " Select the files on which to report status.", - "comments": "

With git_status_foreach_ext, this will control which changes get callbacks. With git_status_list_new, these will control which changes are included in the list.

\n\n\n", + "comments": "

With git_status_foreach_ext, this will control which changes get callbacks. With git_status_list_new, these will control which changes are included in the list.

\n", "fields": [ { "type": "int", "name": "GIT_STATUS_SHOW_INDEX_AND_WORKDIR", - "comments": "", + "comments": "

The default. This roughly matches git status --porcelain regarding\n which files are included and in what order.

\n", "value": 0 }, { "type": "int", "name": "GIT_STATUS_SHOW_INDEX_ONLY", - "comments": "", + "comments": "

Only gives status based on HEAD to index comparison, not looking at\n working directory changes.

\n", "value": 1 }, { "type": "int", "name": "GIT_STATUS_SHOW_WORKDIR_ONLY", - "comments": "", + "comments": "

Only gives status based on index to working directory comparison,\n not comparing the index to the HEAD.

\n", "value": 2 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -34848,9 +35744,9 @@ "GIT_STATUS_CONFLICTED" ], "type": "enum", - "file": "status.h", - "line": 32, - "lineto": 50, + "file": "git2/status.h", + "line": 34, + "lineto": 52, "block": "GIT_STATUS_CURRENT\nGIT_STATUS_INDEX_NEW\nGIT_STATUS_INDEX_MODIFIED\nGIT_STATUS_INDEX_DELETED\nGIT_STATUS_INDEX_RENAMED\nGIT_STATUS_INDEX_TYPECHANGE\nGIT_STATUS_WT_NEW\nGIT_STATUS_WT_MODIFIED\nGIT_STATUS_WT_DELETED\nGIT_STATUS_WT_TYPECHANGE\nGIT_STATUS_WT_RENAMED\nGIT_STATUS_WT_UNREADABLE\nGIT_STATUS_IGNORED\nGIT_STATUS_CONFLICTED", "tdef": "typedef", "description": " Status flags for a single file.", @@ -34941,22 +35837,16 @@ "value": 32768 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ "git_strarray", { - "decl": [ - "char ** strings", - "size_t count" - ], + "decl": ["char ** strings", "size_t count"], "type": "struct", "value": "git_strarray", - "file": "strarray.h", + "file": "git2/strarray.h", "line": 22, "lineto": 25, "block": "char ** strings\nsize_t count", @@ -34964,16 +35854,8 @@ "description": " Array of strings ", "comments": "", "fields": [ - { - "type": "char **", - "name": "strings", - "comments": "" - }, - { - "type": "size_t", - "name": "count", - "comments": "" - } + { "type": "char **", "name": "strings", "comments": "" }, + { "type": "size_t", "name": "count", "comments": "" } ], "used": { "returns": [], @@ -34994,95 +35876,42 @@ "git_remote_upload", "git_reset_default", "git_strarray_copy", + "git_strarray_dispose", "git_strarray_free", "git_tag_list", - "git_tag_list_match" + "git_tag_list_match", + "git_worktree_list" ] } } ], [ - "git_stream", + "git_stream_t", { - "decl": [ - "int version", - "int encrypted", - "int proxy_support", - "int (*)(struct git_stream *) connect", - "int (*)(git_cert **, struct git_stream *) certificate", - "int (*)(struct git_stream *, const int *) set_proxy", - "ssize_t (*)(struct git_stream *, void *, size_t) read", - "ssize_t (*)(struct git_stream *, const char *, size_t, int) write", - "int (*)(struct git_stream *) close", - "void (*)(struct git_stream *) free" - ], - "type": "struct", - "value": "git_stream", - "file": "sys/stream.h", - "line": 29, - "lineto": 41, - "block": "int version\nint encrypted\nint proxy_support\nint (*)(struct git_stream *) connect\nint (*)(git_cert **, struct git_stream *) certificate\nint (*)(struct git_stream *, const int *) set_proxy\nssize_t (*)(struct git_stream *, void *, size_t) read\nssize_t (*)(struct git_stream *, const char *, size_t, int) write\nint (*)(struct git_stream *) close\nvoid (*)(struct git_stream *) free", + "decl": ["GIT_STREAM_STANDARD", "GIT_STREAM_TLS"], + "type": "enum", + "file": "git2/sys/stream.h", + "line": 99, + "lineto": 105, + "block": "GIT_STREAM_STANDARD\nGIT_STREAM_TLS", "tdef": "typedef", - "description": " Every stream must have this struct as its first element, so the\n API can talk to it. You'd define your stream as", - "comments": "
 struct my_stream {             git_stream parent;             ...     }\n
\n\n

and fill the functions

\n", + "description": " The type of stream to register.", + "comments": "", "fields": [ { "type": "int", - "name": "version", - "comments": "" - }, - { - "type": "int", - "name": "encrypted", - "comments": "" + "name": "GIT_STREAM_STANDARD", + "comments": "

A standard (non-TLS) socket.

\n", + "value": 1 }, { "type": "int", - "name": "proxy_support", - "comments": "" - }, - { - "type": "int (*)(struct git_stream *)", - "name": "connect", - "comments": "" - }, - { - "type": "int (*)(git_cert **, struct git_stream *)", - "name": "certificate", - "comments": "" - }, - { - "type": "int (*)(struct git_stream *, const int *)", - "name": "set_proxy", - "comments": "" - }, - { - "type": "ssize_t (*)(struct git_stream *, void *, size_t)", - "name": "read", - "comments": "" - }, - { - "type": "ssize_t (*)(struct git_stream *, const char *, size_t, int)", - "name": "write", - "comments": "" - }, - { - "type": "int (*)(struct git_stream *)", - "name": "close", - "comments": "" - }, - { - "type": "void (*)(struct git_stream *)", - "name": "free", - "comments": "" + "name": "GIT_STREAM_TLS", + "comments": "

A TLS-encrypted socket.

\n", + "value": 2 } ], - "used": { - "returns": [], - "needs": [ - "git_stream_register_tls" - ] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -35091,9 +35920,9 @@ "decl": "git_submodule", "type": "struct", "value": "git_submodule", - "file": "types.h", - "line": 335, - "lineto": 335, + "file": "git2/types.h", + "line": 283, + "lineto": 283, "tdef": "typedef", "description": " Opaque structure representing a submodule.", "comments": "", @@ -35109,6 +35938,8 @@ "git_submodule_add_to_index", "git_submodule_branch", "git_submodule_cb", + "git_submodule_clone", + "git_submodule_dup", "git_submodule_fetch_recurse_submodules", "git_submodule_foreach", "git_submodule_free", @@ -35130,7 +35961,7 @@ "git_submodule_status", "git_submodule_sync", "git_submodule_update", - "git_submodule_update_init_options", + "git_submodule_update_options_init", "git_submodule_update_strategy", "git_submodule_url", "git_submodule_wd_id" @@ -35149,9 +35980,9 @@ "GIT_SUBMODULE_IGNORE_ALL" ], "type": "enum", - "file": "types.h", - "line": 399, - "lineto": 406, + "file": "git2/types.h", + "line": 347, + "lineto": 354, "block": "GIT_SUBMODULE_IGNORE_UNSPECIFIED\nGIT_SUBMODULE_IGNORE_NONE\nGIT_SUBMODULE_IGNORE_UNTRACKED\nGIT_SUBMODULE_IGNORE_DIRTY\nGIT_SUBMODULE_IGNORE_ALL", "tdef": "typedef", "description": " Submodule ignore values", @@ -35189,13 +36020,8 @@ } ], "used": { - "returns": [ - "git_submodule_ignore" - ], - "needs": [ - "git_submodule_set_ignore", - "git_submodule_status" - ] + "returns": ["git_submodule_ignore"], + "needs": ["git_submodule_set_ignore", "git_submodule_status"] } } ], @@ -35208,9 +36034,9 @@ "GIT_SUBMODULE_RECURSE_ONDEMAND" ], "type": "enum", - "file": "types.h", - "line": 418, - "lineto": 422, + "file": "git2/types.h", + "line": 366, + "lineto": 370, "block": "GIT_SUBMODULE_RECURSE_NO\nGIT_SUBMODULE_RECURSE_YES\nGIT_SUBMODULE_RECURSE_ONDEMAND", "tdef": "typedef", "description": " Options for submodule recurse.", @@ -35236,12 +36062,8 @@ } ], "used": { - "returns": [ - "git_submodule_fetch_recurse_submodules" - ], - "needs": [ - "git_submodule_set_fetch_recurse_submodules" - ] + "returns": ["git_submodule_fetch_recurse_submodules"], + "needs": ["git_submodule_set_fetch_recurse_submodules"] } } ], @@ -35265,7 +36087,7 @@ "GIT_SUBMODULE_STATUS_WD_UNTRACKED" ], "type": "enum", - "file": "submodule.h", + "file": "git2/submodule.h", "line": 74, "lineto": 89, "block": "GIT_SUBMODULE_STATUS_IN_HEAD\nGIT_SUBMODULE_STATUS_IN_INDEX\nGIT_SUBMODULE_STATUS_IN_CONFIG\nGIT_SUBMODULE_STATUS_IN_WD\nGIT_SUBMODULE_STATUS_INDEX_ADDED\nGIT_SUBMODULE_STATUS_INDEX_DELETED\nGIT_SUBMODULE_STATUS_INDEX_MODIFIED\nGIT_SUBMODULE_STATUS_WD_UNINITIALIZED\nGIT_SUBMODULE_STATUS_WD_ADDED\nGIT_SUBMODULE_STATUS_WD_DELETED\nGIT_SUBMODULE_STATUS_WD_MODIFIED\nGIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED\nGIT_SUBMODULE_STATUS_WD_WD_MODIFIED\nGIT_SUBMODULE_STATUS_WD_UNTRACKED", @@ -35358,10 +36180,7 @@ "value": 8192 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -35375,23 +36194,19 @@ ], "type": "struct", "value": "git_submodule_update_options", - "file": "submodule.h", - "line": 129, - "lineto": 154, + "file": "git2/submodule.h", + "line": 135, + "lineto": 158, "block": "unsigned int version\ngit_checkout_options checkout_opts\ngit_fetch_options fetch_opts\nint allow_fetch", "tdef": "typedef", "description": " Submodule update options structure", - "comments": "

Use the GIT_SUBMODULE_UPDATE_OPTIONS_INIT to get the default settings, like this:

\n\n

git_submodule_update_options opts = GIT_SUBMODULE_UPDATE_OPTIONS_INIT;

\n", + "comments": "

Initialize with GIT_SUBMODULE_UPDATE_OPTIONS_INIT. Alternatively, you can use git_submodule_update_options_init.

\n", "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, + { "type": "unsigned int", "name": "version", "comments": "" }, { "type": "git_checkout_options", "name": "checkout_opts", - "comments": " These options are passed to the checkout step. To disable\n checkout, set the `checkout_strategy` to\n `GIT_CHECKOUT_NONE`. Generally you will want the use\n GIT_CHECKOUT_SAFE to update files in the working\n directory. " + "comments": " These options are passed to the checkout step. To disable\n checkout, set the `checkout_strategy` to `GIT_CHECKOUT_NONE`\n or `GIT_CHECKOUT_DRY_RUN`." }, { "type": "git_fetch_options", @@ -35407,8 +36222,9 @@ "used": { "returns": [], "needs": [ + "git_submodule_clone", "git_submodule_update", - "git_submodule_update_init_options" + "git_submodule_update_options_init" ] } } @@ -35424,9 +36240,9 @@ "GIT_SUBMODULE_UPDATE_DEFAULT" ], "type": "enum", - "file": "types.h", - "line": 363, - "lineto": 370, + "file": "git2/types.h", + "line": 311, + "lineto": 318, "block": "GIT_SUBMODULE_UPDATE_CHECKOUT\nGIT_SUBMODULE_UPDATE_REBASE\nGIT_SUBMODULE_UPDATE_MERGE\nGIT_SUBMODULE_UPDATE_NONE\nGIT_SUBMODULE_UPDATE_DEFAULT", "tdef": "typedef", "description": " Submodule update values", @@ -35464,12 +36280,8 @@ } ], "used": { - "returns": [ - "git_submodule_update_strategy" - ], - "needs": [ - "git_submodule_set_update" - ] + "returns": ["git_submodule_update_strategy"], + "needs": ["git_submodule_set_update"] } } ], @@ -35479,9 +36291,9 @@ "decl": "git_tag", "type": "struct", "value": "git_tag", - "file": "types.h", - "line": 114, - "lineto": 114, + "file": "git2/types.h", + "line": 135, + "lineto": 135, "tdef": "typedef", "description": " Parsed representation of a tag object. ", "comments": "", @@ -35509,16 +36321,13 @@ [ "git_time", { - "decl": [ - "git_time_t time", - "int offset" - ], + "decl": ["git_time_t time", "int offset", "char sign"], "type": "struct", "value": "git_time", - "file": "types.h", - "line": 156, - "lineto": 159, - "block": "git_time_t time\nint offset", + "file": "git2/types.h", + "line": 180, + "lineto": 184, + "block": "git_time_t time\nint offset\nchar sign", "tdef": "typedef", "description": " Time in a signature ", "comments": "", @@ -35532,15 +36341,16 @@ "type": "int", "name": "offset", "comments": " timezone offset, in minutes " + }, + { + "type": "char", + "name": "sign", + "comments": " indicator for questionable '-0000' offsets in signature " } ], "used": { - "returns": [ - "git_commit_time" - ], - "needs": [ - "git_signature_new" - ] + "returns": ["git_commit_time"], + "needs": ["git_signature_new"] } } ], @@ -35557,7 +36367,7 @@ "GIT_TRACE_TRACE" ], "type": "enum", - "file": "trace.h", + "file": "git2/trace.h", "line": 26, "lineto": 47, "block": "GIT_TRACE_NONE\nGIT_TRACE_FATAL\nGIT_TRACE_ERROR\nGIT_TRACE_WARN\nGIT_TRACE_INFO\nGIT_TRACE_DEBUG\nGIT_TRACE_TRACE", @@ -35608,13 +36418,7 @@ "value": 6 } ], - "used": { - "returns": [], - "needs": [ - "git_trace_callback", - "git_trace_set" - ] - } + "used": { "returns": [], "needs": ["git_trace_cb", "git_trace_set"] } } ], [ @@ -35623,89 +36427,24 @@ "decl": "git_transaction", "type": "struct", "value": "git_transaction", - "file": "types.h", - "line": 175, - "lineto": 175, + "file": "git2/types.h", + "line": 200, + "lineto": 200, "tdef": "typedef", "description": " Transactional interface to references ", "comments": "", "used": { "returns": [], "needs": [ - "git_config_lock" - ] - } - } - ], - [ - "git_transfer_progress", - { - "decl": [ - "unsigned int total_objects", - "unsigned int indexed_objects", - "unsigned int received_objects", - "unsigned int local_objects", - "unsigned int total_deltas", - "unsigned int indexed_deltas", - "size_t received_bytes" - ], - "type": "struct", - "value": "git_transfer_progress", - "file": "types.h", - "line": 253, - "lineto": 261, - "block": "unsigned int total_objects\nunsigned int indexed_objects\nunsigned int received_objects\nunsigned int local_objects\nunsigned int total_deltas\nunsigned int indexed_deltas\nsize_t received_bytes", - "tdef": "typedef", - "description": " This is passed as the first argument to the callback to allow the\n user to see the progress.", - "comments": "\n", - "fields": [ - { - "type": "unsigned int", - "name": "total_objects", - "comments": "" - }, - { - "type": "unsigned int", - "name": "indexed_objects", - "comments": "" - }, - { - "type": "unsigned int", - "name": "received_objects", - "comments": "" - }, - { - "type": "unsigned int", - "name": "local_objects", - "comments": "" - }, - { - "type": "unsigned int", - "name": "total_deltas", - "comments": "" - }, - { - "type": "unsigned int", - "name": "indexed_deltas", - "comments": "" - }, - { - "type": "size_t", - "name": "received_bytes", - "comments": "" - } - ], - "used": { - "returns": [ - "git_remote_stats" - ], - "needs": [ - "git_indexer_append", - "git_indexer_commit", - "git_indexer_new", - "git_odb_write_pack", - "git_packbuilder_write", - "git_transfer_progress_cb" + "git_config_lock", + "git_transaction_commit", + "git_transaction_free", + "git_transaction_lock_ref", + "git_transaction_new", + "git_transaction_remove", + "git_transaction_set_reflog", + "git_transaction_set_symbolic_target", + "git_transaction_set_target" ] } } @@ -35716,56 +36455,13 @@ "decl": "git_transport", "type": "struct", "value": "git_transport", - "file": "types.h", - "line": 230, - "lineto": 230, + "file": "git2/types.h", + "line": 263, + "lineto": 263, "tdef": "typedef", "description": " Interface which represents a transport to communicate with a\n remote.", "comments": "", - "used": { - "returns": [], - "needs": [ - "git_smart_subtransport_git", - "git_smart_subtransport_http", - "git_smart_subtransport_ssh", - "git_transport_cb", - "git_transport_dummy", - "git_transport_init", - "git_transport_local", - "git_transport_new", - "git_transport_smart", - "git_transport_smart_certificate_check", - "git_transport_ssh_with_paths" - ] - } - } - ], - [ - "git_transport_flags_t", - { - "decl": [ - "GIT_TRANSPORTFLAGS_NONE" - ], - "type": "enum", - "file": "sys/transport.h", - "line": 31, - "lineto": 33, - "block": "GIT_TRANSPORTFLAGS_NONE", - "tdef": "typedef", - "description": " Flags to pass to transport", - "comments": "

Currently unused.

\n", - "fields": [ - { - "type": "int", - "name": "GIT_TRANSPORTFLAGS_NONE", - "comments": "", - "value": 0 - } - ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": ["git_transport_cb"] } } ], [ @@ -35774,9 +36470,9 @@ "decl": "git_tree", "type": "struct", "value": "git_tree", - "file": "types.h", - "line": 126, - "lineto": 126, + "file": "git2/types.h", + "line": 147, + "lineto": 147, "tdef": "typedef", "description": " Representation of a tree object. ", "comments": "", @@ -35788,9 +36484,11 @@ "git_treebuilder_get" ], "needs": [ + "git_apply_to_tree", "git_commit_amend", "git_commit_create", "git_commit_create_buffer", + "git_commit_create_cb", "git_commit_create_v", "git_commit_tree", "git_diff_tree_to_index", @@ -35844,9 +36542,9 @@ "decl": "git_tree_entry", "type": "struct", "value": "git_tree_entry", - "file": "types.h", - "line": 123, - "lineto": 123, + "file": "git2/types.h", + "line": 144, + "lineto": 144, "tdef": "typedef", "description": " Representation of each one of the entries in a tree object. ", "comments": "", @@ -35886,9 +36584,9 @@ ], "type": "struct", "value": "git_tree_update", - "file": "tree.h", - "line": 447, - "lineto": 456, + "file": "git2/tree.h", + "line": 449, + "lineto": 458, "block": "git_tree_update_t action\ngit_oid id\ngit_filemode_t filemode\nconst char * path", "tdef": "typedef", "description": " An action to perform during the update of a tree", @@ -35899,11 +36597,7 @@ "name": "action", "comments": " Update action. If it's an removal, only the path is looked at " }, - { - "type": "git_oid", - "name": "id", - "comments": " The entry's id " - }, + { "type": "git_oid", "name": "id", "comments": " The entry's id " }, { "type": "git_filemode_t", "name": "filemode", @@ -35915,25 +36609,17 @@ "comments": " The full path from the root tree " } ], - "used": { - "returns": [], - "needs": [ - "git_tree_create_updated" - ] - } + "used": { "returns": [], "needs": ["git_tree_create_updated"] } } ], [ "git_tree_update_t", { - "decl": [ - "GIT_TREE_UPDATE_UPSERT", - "GIT_TREE_UPDATE_REMOVE" - ], + "decl": ["GIT_TREE_UPDATE_UPSERT", "GIT_TREE_UPDATE_REMOVE"], "type": "enum", - "file": "tree.h", - "line": 437, - "lineto": 442, + "file": "git2/tree.h", + "line": 439, + "lineto": 444, "block": "GIT_TREE_UPDATE_UPSERT\nGIT_TREE_UPDATE_REMOVE", "tdef": "typedef", "description": " The kind of update to perform", @@ -35952,10 +36638,7 @@ "value": 1 } ], - "used": { - "returns": [], - "needs": [] - } + "used": { "returns": [], "needs": [] } } ], [ @@ -35964,9 +36647,9 @@ "decl": "git_treebuilder", "type": "struct", "value": "git_treebuilder", - "file": "types.h", - "line": 129, - "lineto": 129, + "file": "git2/types.h", + "line": 150, + "lineto": 150, "tdef": "typedef", "description": " Constructor for in-memory trees ", "comments": "", @@ -35990,14 +36673,11 @@ [ "git_treewalk_mode", { - "decl": [ - "GIT_TREEWALK_PRE", - "GIT_TREEWALK_POST" - ], + "decl": ["GIT_TREEWALK_PRE", "GIT_TREEWALK_POST"], "type": "enum", - "file": "tree.h", - "line": 397, - "lineto": 400, + "file": "git2/tree.h", + "line": 398, + "lineto": 401, "block": "GIT_TREEWALK_PRE\nGIT_TREEWALK_POST", "tdef": "typedef", "description": " Tree traversal modes ", @@ -36016,32 +36696,202 @@ "value": 1 } ], + "used": { "returns": [], "needs": ["git_tree_walk"] } + } + ], + [ + "git_worktree", + { + "decl": "git_worktree", + "type": "struct", + "value": "git_worktree", + "file": "git2/types.h", + "line": 126, + "lineto": 126, + "tdef": "typedef", + "description": " Representation of a working tree ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_repository_open_from_worktree", + "git_worktree_add", + "git_worktree_add_options_init", + "git_worktree_free", + "git_worktree_is_locked", + "git_worktree_is_prunable", + "git_worktree_lock", + "git_worktree_lookup", + "git_worktree_name", + "git_worktree_open_from_repository", + "git_worktree_path", + "git_worktree_prune", + "git_worktree_prune_options_init", + "git_worktree_unlock", + "git_worktree_validate" + ] + } + } + ], + [ + "git_worktree_add_options", + { + "decl": [ + "unsigned int version", + "int lock", + "int checkout_existing", + "git_reference * ref", + "git_checkout_options checkout_options" + ], + "type": "struct", + "value": "git_worktree_add_options", + "file": "git2/worktree.h", + "line": 86, + "lineto": 97, + "block": "unsigned int version\nint lock\nint checkout_existing\ngit_reference * ref\ngit_checkout_options checkout_options", + "tdef": "typedef", + "description": " Worktree add options structure", + "comments": "

Initialize with GIT_WORKTREE_ADD_OPTIONS_INIT. Alternatively, you can use git_worktree_add_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "int", + "name": "lock", + "comments": " lock newly created worktree " + }, + { + "type": "int", + "name": "checkout_existing", + "comments": " allow checkout of existing branch matching worktree name " + }, + { + "type": "git_reference *", + "name": "ref", + "comments": " reference to use for the new worktree HEAD " + }, + { + "type": "git_checkout_options", + "name": "checkout_options", + "comments": " Options for the checkout." + } + ], + "used": { + "returns": [], + "needs": ["git_worktree_add", "git_worktree_add_options_init"] + } + } + ], + [ + "git_worktree_prune_options", + { + "decl": ["unsigned int version", "uint32_t flags"], + "type": "struct", + "value": "git_worktree_prune_options", + "file": "git2/worktree.h", + "line": 210, + "lineto": 215, + "block": "unsigned int version\nuint32_t flags", + "tdef": "typedef", + "description": " Worktree prune options structure", + "comments": "

Initialize with GIT_WORKTREE_PRUNE_OPTIONS_INIT. Alternatively, you can use git_worktree_prune_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "uint32_t", + "name": "flags", + "comments": " A combination of `git_worktree_prune_t` " + } + ], "used": { "returns": [], "needs": [ - "git_tree_walk" + "git_worktree_is_prunable", + "git_worktree_prune", + "git_worktree_prune_options_init" ] } } ], + [ + "git_worktree_prune_t", + { + "decl": [ + "GIT_WORKTREE_PRUNE_VALID", + "GIT_WORKTREE_PRUNE_LOCKED", + "GIT_WORKTREE_PRUNE_WORKING_TREE" + ], + "type": "enum", + "file": "git2/worktree.h", + "line": 194, + "lineto": 201, + "block": "GIT_WORKTREE_PRUNE_VALID\nGIT_WORKTREE_PRUNE_LOCKED\nGIT_WORKTREE_PRUNE_WORKING_TREE", + "tdef": "typedef", + "description": " Flags which can be passed to git_worktree_prune to alter its\n behavior.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_WORKTREE_PRUNE_VALID", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_WORKTREE_PRUNE_LOCKED", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_WORKTREE_PRUNE_WORKING_TREE", + "comments": "", + "value": 4 + } + ], + "used": { "returns": [], "needs": [] } + } + ], [ "git_writestream", { - "decl": "git_writestream", + "decl": [ + "int (*)(git_writestream *, const char *, size_t) write", + "int (*)(git_writestream *) close", + "void (*)(git_writestream *) free" + ], "type": "struct", "value": "git_writestream", - "file": "types.h", - "line": 425, - "lineto": 425, - "tdef": "typedef", + "file": "git2/types.h", + "line": 375, + "lineto": 379, + "tdef": null, "description": " A type to write in a streaming fashion, for example, for filters. ", "comments": "", + "fields": [ + { + "type": "int (*)(git_writestream *, const char *, size_t)", + "name": "write", + "comments": "" + }, + { + "type": "int (*)(git_writestream *)", + "name": "close", + "comments": "" + }, + { + "type": "void (*)(git_writestream *)", + "name": "free", + "comments": "" + } + ], + "block": "int (*)(git_writestream *, const char *, size_t) write\nint (*)(git_writestream *) close\nvoid (*)(git_writestream *) free", "used": { "returns": [], "needs": [ - "git_blob_create_fromstream", - "git_blob_create_fromstream_commit", + "git_blob_create_from_stream", + "git_blob_create_from_stream_commit", "git_filter_list_stream_blob", + "git_filter_list_stream_buffer", "git_filter_list_stream_data", "git_filter_list_stream_file" ] @@ -36049,7 +36899,7 @@ } ] ], - "prefix": "include/git2", + "prefix": "include", "groups": [ [ "annotated", @@ -36059,17 +36909,22 @@ "git_annotated_commit_from_ref", "git_annotated_commit_from_revspec", "git_annotated_commit_id", - "git_annotated_commit_lookup" + "git_annotated_commit_lookup", + "git_annotated_commit_ref" ] ], + ["apply", ["git_apply", "git_apply_options_init", "git_apply_to_tree"]], [ "attr", [ "git_attr_add_macro", "git_attr_cache_flush", "git_attr_foreach", + "git_attr_foreach_ext", "git_attr_get", + "git_attr_get_ext", "git_attr_get_many", + "git_attr_get_many_ext", "git_attr_value" ] ], @@ -36077,23 +36932,31 @@ "blame", [ "git_blame_buffer", - "git_blame_file", "git_blame_free", "git_blame_get_hunk_byindex", "git_blame_get_hunk_byline", "git_blame_get_hunk_count", - "git_blame_init_options" + "git_blame_hunk_byindex", + "git_blame_hunk_byline", + "git_blame_hunkcount", + "git_blame_init_options", + "git_blame_line_byindex", + "git_blame_linecount", + "git_blame_options_init" ] ], [ "blob", [ - "git_blob_create_frombuffer", - "git_blob_create_fromdisk", - "git_blob_create_fromstream", - "git_blob_create_fromstream_commit", - "git_blob_create_fromworkdir", + "git_blob_create_from_buffer", + "git_blob_create_from_disk", + "git_blob_create_from_stream", + "git_blob_create_from_stream_commit", + "git_blob_create_from_workdir", + "git_blob_data_is_binary", "git_blob_dup", + "git_blob_filter", + "git_blob_filter_options_init", "git_blob_filtered_content", "git_blob_free", "git_blob_id", @@ -36111,22 +36974,28 @@ "git_branch_create", "git_branch_create_from_annotated", "git_branch_delete", + "git_branch_is_checked_out", "git_branch_is_head", "git_branch_iterator_free", "git_branch_iterator_new", "git_branch_lookup", "git_branch_move", "git_branch_name", + "git_branch_name_is_valid", "git_branch_next", - "git_branch_set_upstream", "git_branch_remote_name", - "git_branch_upstream" + "git_branch_set_upstream", + "git_branch_upstream", + "git_branch_upstream_merge", + "git_branch_upstream_name", + "git_branch_upstream_remote" ] ], [ "buf", [ "git_buf_contains_nul", + "git_buf_dispose", "git_buf_free", "git_buf_grow", "git_buf_is_binary", @@ -36138,36 +37007,27 @@ [ "git_checkout_head", "git_checkout_index", - "git_checkout_init_options", + "git_checkout_options_init", "git_checkout_tree" ] ], [ "cherrypick", - [ - "git_cherrypick", - "git_cherrypick_commit", - "git_cherrypick_init_options" - ] - ], - [ - "clone", - [ - "git_clone", - "git_clone_init_options" - ] + ["git_cherrypick", "git_cherrypick_commit", "git_cherrypick_options_init"] ], + ["clone", ["git_clone", "git_clone_options_init"]], [ "commit", [ "git_commit_amend", "git_commit_author", + "git_commit_author_with_mailmap", "git_commit_body", "git_commit_committer", + "git_commit_committer_with_mailmap", "git_commit_create", "git_commit_create_buffer", - "git_commit_create_from_callback", - "git_commit_create_from_ids", + "git_commit_create_from_stage", "git_commit_create_v", "git_commit_create_with_signature", "git_commit_dup", @@ -36193,10 +37053,10 @@ "git_commit_tree_id" ] ], + ["commitarray", ["git_commitarray_dispose"]], [ "config", [ - "git_config_add_backend", "git_config_add_file_ondisk", "git_config_backend_foreach_match", "git_config_delete_entry", @@ -36218,7 +37078,6 @@ "git_config_get_path", "git_config_get_string", "git_config_get_string_buf", - "git_config_init_backend", "git_config_iterator_free", "git_config_iterator_glob_new", "git_config_iterator_new", @@ -36240,23 +37099,25 @@ "git_config_set_int64", "git_config_set_multivar", "git_config_set_string", + "git_config_set_writeorder", "git_config_snapshot" ] ], [ - "cred", + "credential", [ - "git_cred_default_new", - "git_cred_free", - "git_cred_has_username", - "git_cred_ssh_custom_new", - "git_cred_ssh_interactive_new", - "git_cred_ssh_key_from_agent", - "git_cred_ssh_key_memory_new", - "git_cred_ssh_key_new", - "git_cred_username_new", - "git_cred_userpass", - "git_cred_userpass_plaintext_new" + "git_credential_default_new", + "git_credential_free", + "git_credential_get_username", + "git_credential_has_username", + "git_credential_ssh_custom_new", + "git_credential_ssh_interactive_new", + "git_credential_ssh_key_from_agent", + "git_credential_ssh_key_memory_new", + "git_credential_ssh_key_new", + "git_credential_username_new", + "git_credential_userpass", + "git_credential_userpass_plaintext_new" ] ], [ @@ -36264,6 +37125,8 @@ [ "git_describe_commit", "git_describe_format", + "git_describe_format_options_init", + "git_describe_options_init", "git_describe_result_free", "git_describe_workdir" ] @@ -36275,26 +37138,25 @@ "git_diff_blobs", "git_diff_buffers", "git_diff_commit_as_email", - "git_diff_find_init_options", + "git_diff_find_options_init", "git_diff_find_similar", "git_diff_foreach", "git_diff_format_email", - "git_diff_format_email_init_options", + "git_diff_format_email_options_init", "git_diff_free", "git_diff_from_buffer", "git_diff_get_delta", - "git_diff_get_perfdata", "git_diff_get_stats", "git_diff_index_to_index", "git_diff_index_to_workdir", - "git_diff_init_options", "git_diff_is_sorted_icase", "git_diff_merge", "git_diff_num_deltas", "git_diff_num_deltas_of_type", + "git_diff_options_init", + "git_diff_patchid", + "git_diff_patchid_options_init", "git_diff_print", - "git_diff_print_callback__to_buf", - "git_diff_print_callback__to_file_handle", "git_diff_stats_deletions", "git_diff_stats_files_changed", "git_diff_stats_free", @@ -36308,61 +37170,36 @@ "git_diff_tree_to_workdir_with_index" ] ], - [ - "fetch", - [ - "git_fetch_init_options" - ] - ], + ["email", ["git_email_create_from_commit"]], + ["error", ["git_error_last"]], + ["fetch", ["git_fetch_options_init"]], [ "filter", [ "git_filter_list_apply_to_blob", + "git_filter_list_apply_to_buffer", "git_filter_list_apply_to_data", "git_filter_list_apply_to_file", "git_filter_list_contains", "git_filter_list_free", - "git_filter_list_length", "git_filter_list_load", - "git_filter_list_new", - "git_filter_list_push", + "git_filter_list_load_ext", "git_filter_list_stream_blob", + "git_filter_list_stream_buffer", "git_filter_list_stream_data", - "git_filter_list_stream_file", - "git_filter_lookup", - "git_filter_register", - "git_filter_source_filemode", - "git_filter_source_flags", - "git_filter_source_id", - "git_filter_source_mode", - "git_filter_source_path", - "git_filter_source_repo", - "git_filter_unregister" + "git_filter_list_stream_file" ] ], [ "giterr", - [ - "giterr_clear", - "giterr_last", - "giterr_set_oom", - "giterr_set_str" - ] + ["giterr_clear", "giterr_last", "giterr_set_oom", "giterr_set_str"] ], [ "graph", [ "git_graph_ahead_behind", - "git_graph_descendant_of" - ] - ], - [ - "hashsig", - [ - "git_hashsig_compare", - "git_hashsig_create", - "git_hashsig_create_fromfile", - "git_hashsig_free" + "git_graph_descendant_of", + "git_graph_reachable_from_any" ] ], [ @@ -36379,7 +37216,7 @@ "git_index_add", "git_index_add_all", "git_index_add_bypath", - "git_index_add_frombuffer", + "git_index_add_from_buffer", "git_index_caps", "git_index_checksum", "git_index_clear", @@ -36399,6 +37236,9 @@ "git_index_get_byindex", "git_index_get_bypath", "git_index_has_conflicts", + "git_index_iterator_free", + "git_index_iterator_new", + "git_index_iterator_next", "git_index_new", "git_index_open", "git_index_owner", @@ -36425,24 +37265,33 @@ "git_indexer_commit", "git_indexer_free", "git_indexer_hash", - "git_indexer_new" + "git_indexer_name", + "git_indexer_new", + "git_indexer_options_init" ] ], [ "libgit2", [ + "git_libgit2_feature_backend", "git_libgit2_features", "git_libgit2_init", "git_libgit2_opts", + "git_libgit2_prerelease", "git_libgit2_shutdown", "git_libgit2_version" ] ], [ - "mempack", + "mailmap", [ - "git_mempack_new", - "git_mempack_reset" + "git_mailmap_add_entry", + "git_mailmap_free", + "git_mailmap_from_buffer", + "git_mailmap_from_repository", + "git_mailmap_new", + "git_mailmap_resolve", + "git_mailmap_resolve_signature" ] ], [ @@ -36450,6 +37299,7 @@ [ "git_merge", "git_merge_analysis", + "git_merge_analysis_for_ref", "git_merge_base", "git_merge_base_many", "git_merge_base_octopus", @@ -36458,36 +37308,22 @@ "git_merge_commits", "git_merge_file", "git_merge_file_from_index", - "git_merge_file_init_input", - "git_merge_file_init_options", + "git_merge_file_input_init", + "git_merge_file_options_init", "git_merge_file_result_free", - "git_merge_init_options", + "git_merge_options_init", "git_merge_trees" ] ], [ "message", [ - "git_message_prettify" - ] - ], - [ - "note", - [ - "git_note_author", - "git_note_committer", - "git_note_create", - "git_note_foreach", - "git_note_free", - "git_note_id", - "git_note_iterator_free", - "git_note_iterator_new", - "git_note_message", - "git_note_next", - "git_note_read", - "git_note_remove" + "git_message_prettify", + "git_message_trailer_array_free", + "git_message_trailers" ] ], + ["note", ["git_note_iterator_free", "git_note_next"]], [ "object", [ @@ -36500,6 +37336,7 @@ "git_object_lookup_prefix", "git_object_owner", "git_object_peel", + "git_object_rawcontent_is_valid", "git_object_short_id", "git_object_string2type", "git_object_type", @@ -36517,6 +37354,7 @@ "git_odb_backend_one_pack", "git_odb_backend_pack", "git_odb_exists", + "git_odb_exists_ext", "git_odb_exists_prefix", "git_odb_expand_ids", "git_odb_foreach", @@ -36524,7 +37362,6 @@ "git_odb_get_backend", "git_odb_hash", "git_odb_hashfile", - "git_odb_init_backend", "git_odb_new", "git_odb_num_backends", "git_odb_object_data", @@ -36540,11 +37377,13 @@ "git_odb_read_header", "git_odb_read_prefix", "git_odb_refresh", + "git_odb_set_commit_graph", "git_odb_stream_finalize_write", "git_odb_stream_free", "git_odb_stream_read", "git_odb_stream_write", "git_odb_write", + "git_odb_write_multi_pack_index", "git_odb_write_pack" ] ], @@ -36559,7 +37398,7 @@ "git_oid_fromstr", "git_oid_fromstrn", "git_oid_fromstrp", - "git_oid_iszero", + "git_oid_is_zero", "git_oid_ncmp", "git_oid_nfmt", "git_oid_pathfmt", @@ -36572,18 +37411,7 @@ "git_oid_tostr_s" ] ], - [ - "oidarray", - [ - "git_oidarray_free" - ] - ], - [ - "openssl", - [ - "git_openssl_set_locking" - ] - ], + ["oidarray", ["git_oidarray_dispose", "git_oidarray_free"]], [ "packbuilder", [ @@ -36595,11 +37423,13 @@ "git_packbuilder_insert_recur", "git_packbuilder_insert_tree", "git_packbuilder_insert_walk", + "git_packbuilder_name", "git_packbuilder_new", "git_packbuilder_object_count", "git_packbuilder_set_callbacks", "git_packbuilder_set_threads", "git_packbuilder_write", + "git_packbuilder_write_buf", "git_packbuilder_written" ] ], @@ -36617,6 +37447,7 @@ "git_patch_line_stats", "git_patch_num_hunks", "git_patch_num_lines_in_hunk", + "git_patch_owner", "git_patch_print", "git_patch_size", "git_patch_to_buf" @@ -36640,18 +37471,8 @@ "git_pathspec_new" ] ], - [ - "proxy", - [ - "git_proxy_init_options" - ] - ], - [ - "push", - [ - "git_push_init_options" - ] - ], + ["proxy", ["git_proxy_options_init"]], + ["push", ["git_push_options_init"]], [ "rebase", [ @@ -36660,32 +37481,31 @@ "git_rebase_finish", "git_rebase_free", "git_rebase_init", - "git_rebase_init_options", "git_rebase_inmemory_index", "git_rebase_next", + "git_rebase_onto_id", + "git_rebase_onto_name", "git_rebase_open", "git_rebase_operation_byindex", "git_rebase_operation_current", - "git_rebase_operation_entrycount" + "git_rebase_operation_entrycount", + "git_rebase_options_init", + "git_rebase_orig_head_id", + "git_rebase_orig_head_name" ] ], [ "refdb", [ - "git_refdb_backend_fs", "git_refdb_compress", "git_refdb_free", - "git_refdb_init_backend", "git_refdb_new", - "git_refdb_open", - "git_refdb_set_backend" + "git_refdb_open" ] ], [ "reference", [ - "git_reference__alloc", - "git_reference__alloc_symbolic", "git_reference_cmp", "git_reference_create", "git_reference_create_matching", @@ -36709,6 +37529,7 @@ "git_reference_list", "git_reference_lookup", "git_reference_name", + "git_reference_name_is_valid", "git_reference_name_to_id", "git_reference_next", "git_reference_next_name", @@ -36754,9 +37575,12 @@ "git_refspec_dst", "git_refspec_dst_matches", "git_refspec_force", + "git_refspec_free", + "git_refspec_parse", "git_refspec_rtransform", "git_refspec_src", "git_refspec_src_matches", + "git_refspec_src_matches_negative", "git_refspec_string", "git_refspec_transform" ] @@ -36768,10 +37592,15 @@ "git_remote_add_push", "git_remote_autotag", "git_remote_connect", + "git_remote_connect_ext", + "git_remote_connect_options_init", "git_remote_connected", "git_remote_create", "git_remote_create_anonymous", + "git_remote_create_detached", + "git_remote_create_options_init", "git_remote_create_with_fetchspec", + "git_remote_create_with_opts", "git_remote_default_branch", "git_remote_delete", "git_remote_disconnect", @@ -36788,6 +37617,7 @@ "git_remote_lookup", "git_remote_ls", "git_remote_name", + "git_remote_name_is_valid", "git_remote_owner", "git_remote_prune", "git_remote_prune_refs", @@ -36796,6 +37626,8 @@ "git_remote_refspec_count", "git_remote_rename", "git_remote_set_autotag", + "git_remote_set_instance_pushurl", + "git_remote_set_instance_url", "git_remote_set_pushurl", "git_remote_set_url", "git_remote_stats", @@ -36808,7 +37640,8 @@ [ "repository", [ - "git_repository__cleanup", + "git_repository_commit_parents", + "git_repository_commondir", "git_repository_config", "git_repository_config_snapshot", "git_repository_detach_head", @@ -36819,69 +37652,45 @@ "git_repository_hashfile", "git_repository_head", "git_repository_head_detached", + "git_repository_head_detached_for_worktree", + "git_repository_head_for_worktree", "git_repository_head_unborn", "git_repository_ident", "git_repository_index", "git_repository_init", "git_repository_init_ext", - "git_repository_init_init_options", + "git_repository_init_options_init", "git_repository_is_bare", "git_repository_is_empty", "git_repository_is_shallow", + "git_repository_is_worktree", + "git_repository_item_path", "git_repository_mergehead_foreach", "git_repository_message", "git_repository_message_remove", - "git_repository_new", "git_repository_odb", + "git_repository_oid_type", "git_repository_open", "git_repository_open_bare", "git_repository_open_ext", + "git_repository_open_from_worktree", "git_repository_path", "git_repository_refdb", - "git_repository_reinit_filesystem", - "git_repository_set_bare", - "git_repository_set_config", "git_repository_set_head", "git_repository_set_head_detached", "git_repository_set_head_detached_from_annotated", "git_repository_set_ident", - "git_repository_set_index", "git_repository_set_namespace", - "git_repository_set_odb", - "git_repository_set_refdb", "git_repository_set_workdir", "git_repository_state", "git_repository_state_cleanup", - "git_repository_submodule_cache_all", - "git_repository_submodule_cache_clear", "git_repository_workdir", "git_repository_wrap_odb" ] ], - [ - "reset", - [ - "git_reset", - "git_reset_default", - "git_reset_from_annotated" - ] - ], - [ - "revert", - [ - "git_revert", - "git_revert_commit", - "git_revert_init_options" - ] - ], - [ - "revparse", - [ - "git_revparse", - "git_revparse_ext", - "git_revparse_single" - ] - ], + ["reset", ["git_reset", "git_reset_default", "git_reset_from_annotated"]], + ["revert", ["git_revert", "git_revert_commit", "git_revert_options_init"]], + ["revparse", ["git_revparse", "git_revparse_ext", "git_revparse_single"]], [ "revwalk", [ @@ -36908,6 +37717,7 @@ "signature", [ "git_signature_default", + "git_signature_default_from_env", "git_signature_dup", "git_signature_free", "git_signature_from_buffer", @@ -36915,22 +37725,17 @@ "git_signature_now" ] ], - [ - "smart", - [ - "git_smart_subtransport_git", - "git_smart_subtransport_http", - "git_smart_subtransport_ssh" - ] - ], [ "stash", [ "git_stash_apply", - "git_stash_apply_init_options", + "git_stash_apply_options_init", "git_stash_drop", "git_stash_foreach", - "git_stash_pop" + "git_stash_pop", + "git_stash_save", + "git_stash_save_options_init", + "git_stash_save_with_opts" ] ], [ @@ -36940,26 +37745,16 @@ "git_status_file", "git_status_foreach", "git_status_foreach_ext", - "git_status_init_options", "git_status_list_entrycount", "git_status_list_free", - "git_status_list_get_perfdata", "git_status_list_new", + "git_status_options_init", "git_status_should_ignore" ] ], [ "strarray", - [ - "git_strarray_copy", - "git_strarray_free" - ] - ], - [ - "stream", - [ - "git_stream_register_tls" - ] + ["git_strarray_copy", "git_strarray_dispose", "git_strarray_free"] ], [ "submodule", @@ -36968,6 +37763,8 @@ "git_submodule_add_setup", "git_submodule_add_to_index", "git_submodule_branch", + "git_submodule_clone", + "git_submodule_dup", "git_submodule_fetch_recurse_submodules", "git_submodule_foreach", "git_submodule_free", @@ -36992,7 +37789,7 @@ "git_submodule_status", "git_submodule_sync", "git_submodule_update", - "git_submodule_update_init_options", + "git_submodule_update_options_init", "git_submodule_update_strategy", "git_submodule_url", "git_submodule_wd_id" @@ -37003,7 +37800,7 @@ [ "git_tag_annotation_create", "git_tag_create", - "git_tag_create_frombuffer", + "git_tag_create_from_buffer", "git_tag_create_lightweight", "git_tag_delete", "git_tag_dup", @@ -37016,6 +37813,7 @@ "git_tag_lookup_prefix", "git_tag_message", "git_tag_name", + "git_tag_name_is_valid", "git_tag_owner", "git_tag_peel", "git_tag_tagger", @@ -37024,29 +37822,18 @@ "git_tag_target_type" ] ], + ["trace", ["git_trace_set"]], [ - "time", - [ - "git_time_monotonic" - ] - ], - [ - "trace", - [ - "git_trace_set" - ] - ], - [ - "transport", + "transaction", [ - "git_transport_dummy", - "git_transport_init", - "git_transport_local", - "git_transport_new", - "git_transport_smart", - "git_transport_smart_certificate_check", - "git_transport_ssh_with_paths", - "git_transport_unregister" + "git_transaction_commit", + "git_transaction_free", + "git_transaction_lock_ref", + "git_transaction_new", + "git_transaction_remove", + "git_transaction_set_reflog", + "git_transaction_set_symbolic_target", + "git_transaction_set_target" ] ], [ @@ -37090,96 +37877,57 @@ "git_treebuilder_write", "git_treebuilder_write_with_buffer" ] - ] - ], - "examples": [ - [ - "add.c", - "ex/HEAD/add.html" - ], - [ - "blame.c", - "ex/HEAD/blame.html" - ], - [ - "cat-file.c", - "ex/HEAD/cat-file.html" - ], - [ - "common.c", - "ex/HEAD/common.html" - ], - [ - "describe.c", - "ex/HEAD/describe.html" - ], - [ - "diff.c", - "ex/HEAD/diff.html" - ], - [ - "for-each-ref.c", - "ex/HEAD/for-each-ref.html" ], [ - "general.c", - "ex/HEAD/general.html" - ], - [ - "init.c", - "ex/HEAD/init.html" - ], - [ - "log.c", - "ex/HEAD/log.html" - ], - [ - "network/clone.c", - "ex/HEAD/network/clone.html" - ], - [ - "network/common.c", - "ex/HEAD/network/common.html" - ], - [ - "network/fetch.c", - "ex/HEAD/network/fetch.html" - ], - [ - "network/git2.c", - "ex/HEAD/network/git2.html" - ], - [ - "network/index-pack.c", - "ex/HEAD/network/index-pack.html" - ], - [ - "network/ls-remote.c", - "ex/HEAD/network/ls-remote.html" - ], - [ - "remote.c", - "ex/HEAD/remote.html" - ], - [ - "rev-list.c", - "ex/HEAD/rev-list.html" - ], - [ - "rev-parse.c", - "ex/HEAD/rev-parse.html" - ], - [ - "showindex.c", - "ex/HEAD/showindex.html" - ], - [ - "status.c", - "ex/HEAD/status.html" - ], - [ - "tag.c", - "ex/HEAD/tag.html" + "worktree", + [ + "git_worktree_add", + "git_worktree_add_options_init", + "git_worktree_free", + "git_worktree_is_locked", + "git_worktree_is_prunable", + "git_worktree_list", + "git_worktree_lock", + "git_worktree_lookup", + "git_worktree_name", + "git_worktree_open_from_repository", + "git_worktree_path", + "git_worktree_prune", + "git_worktree_prune_options_init", + "git_worktree_unlock", + "git_worktree_validate" + ] ] + ], + "examples": [ + ["add.c", "ex/v1.9.1/add.html"], + ["args.c", "ex/v1.9.1/args.html"], + ["blame.c", "ex/v1.9.1/blame.html"], + ["cat-file.c", "ex/v1.9.1/cat-file.html"], + ["checkout.c", "ex/v1.9.1/checkout.html"], + ["clone.c", "ex/v1.9.1/clone.html"], + ["commit.c", "ex/v1.9.1/commit.html"], + ["common.c", "ex/v1.9.1/common.html"], + ["config.c", "ex/v1.9.1/config.html"], + ["describe.c", "ex/v1.9.1/describe.html"], + ["diff.c", "ex/v1.9.1/diff.html"], + ["fetch.c", "ex/v1.9.1/fetch.html"], + ["for-each-ref.c", "ex/v1.9.1/for-each-ref.html"], + ["general.c", "ex/v1.9.1/general.html"], + ["index-pack.c", "ex/v1.9.1/index-pack.html"], + ["init.c", "ex/v1.9.1/init.html"], + ["lg2.c", "ex/v1.9.1/lg2.html"], + ["log.c", "ex/v1.9.1/log.html"], + ["ls-files.c", "ex/v1.9.1/ls-files.html"], + ["ls-remote.c", "ex/v1.9.1/ls-remote.html"], + ["merge.c", "ex/v1.9.1/merge.html"], + ["push.c", "ex/v1.9.1/push.html"], + ["remote.c", "ex/v1.9.1/remote.html"], + ["rev-list.c", "ex/v1.9.1/rev-list.html"], + ["rev-parse.c", "ex/v1.9.1/rev-parse.html"], + ["show-index.c", "ex/v1.9.1/show-index.html"], + ["stash.c", "ex/v1.9.1/stash.html"], + ["status.c", "ex/v1.9.1/status.html"], + ["tag.c", "ex/v1.9.1/tag.html"] ] } diff --git a/generate/input/libgit2-supplement.json b/generate/input/libgit2-supplement.json index 78ecb8ad77..12ee8945b6 100644 --- a/generate/input/libgit2-supplement.json +++ b/generate/input/libgit2-supplement.json @@ -1,7 +1,7 @@ { "types": { - "git_cred_default": { - "decl": "git_cred" + "git_credential_default": { + "decl": "git_credential" }, "git_diff_hunk": { "decl": [ @@ -82,16 +82,1070 @@ }, "git_note_iterator": { "decl": "git_iterator" + }, + "git_checkout_options": { + "decl": [ + "unsigned int version", + "unsigned int checkout_strategy", + "int disable_filters", + "unsigned int dir_mode", + "unsigned int file_mode", + "int file_open_flags", + "unsigned int notify_flags", + "git_checkout_notify_cb notify_cb", + "void * notify_payload", + "git_checkout_progress_cb progress_cb", + "void * progress_payload", + "git_strarray paths", + "git_tree * baseline", + "git_index * baseline_index", + "const char * target_directory", + "const char * ancestor_label", + "const char * our_label", + "const char * their_label", + "git_checkout_perfdata_cb perfdata_cb", + "void * perfdata_payload", + "git_strarray disabled_filters" + ], + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": " The version " + }, + { + "type": "unsigned int", + "name": "checkout_strategy", + "comments": " default will be a safe checkout " + }, + { + "type": "int", + "name": "disable_filters", + "comments": " don't apply filters like CRLF conversion " + }, + { + "type": "unsigned int", + "name": "dir_mode", + "comments": " default is 0755 " + }, + { + "type": "unsigned int", + "name": "file_mode", + "comments": " default is 0644 or 0755 as dictated by blob " + }, + { + "type": "int", + "name": "file_open_flags", + "comments": " default is O_CREAT | O_TRUNC | O_WRONLY " + }, + { + "type": "unsigned int", + "name": "notify_flags", + "comments": " see `git_checkout_notify_t` above " + }, + { + "type": "git_checkout_notify_cb", + "name": "notify_cb", + "comments": " Optional callback to get notifications on specific file states.\n " + }, + { + "type": "void *", + "name": "notify_payload", + "comments": " Payload passed to notify_cb " + }, + { + "type": "git_checkout_progress_cb", + "name": "progress_cb", + "comments": " Optional callback to notify the consumer of checkout progress. " + }, + { + "type": "void *", + "name": "progress_payload", + "comments": " Payload passed to progress_cb " + }, + { + "type": "git_strarray", + "name": "paths", + "comments": " A list of wildmatch patterns or paths.\n\n By default, all paths are processed. If you pass an array of wildmatch\n patterns, those will be used to filter which paths should be taken into\n account.\n\n Use GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH to treat as a simple list." + }, + { + "type": "git_tree *", + "name": "baseline", + "comments": " The expected content of the working directory; defaults to HEAD.\n\n If the working directory does not match this baseline information,\n that will produce a checkout conflict." + }, + { + "type": "git_index *", + "name": "baseline_index", + "comments": " Like `baseline` above, though expressed as an index. This\n option overrides `baseline`." + }, + { + "type": "const char *", + "name": "target_directory", + "comments": " alternative checkout path to workdir " + }, + { + "type": "const char *", + "name": "ancestor_label", + "comments": " the name of the common ancestor side of conflicts " + }, + { + "type": "const char *", + "name": "our_label", + "comments": " the name of the \"our\" side of conflicts " + }, + { + "type": "const char *", + "name": "their_label", + "comments": " the name of the \"their\" side of conflicts " + }, + { + "type": "git_checkout_perfdata_cb", + "name": "perfdata_cb", + "comments": " Optional callback to notify the consumer of performance data. " + }, + { + "type": "void *", + "name": "perfdata_payload", + "comments": " Payload passed to perfdata_cb " + }, + { + "type": "git_strarray", + "name": "disabled_filters", + "comments": " A list filters to disable during checkout." + } + ] } }, - "new" : { + "new": { "functions": { + "git_libgit2_opts": { + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/libgit2/opts.cc", + "isAsync": false, + "isPrototypeMethod": false, + "group": "libgit2" + }, + "git_blame_file": { + "type": "function", + "file": "blame.h", + "args": [ + { + "name": "out", + "type": "git_blame **" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "options", + "type": "git_blame_options *" + } + ], + "group": "blame", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_clone": { + "isManual": true, + "cFile": "generate/templates/manual/clone/clone.cc", + "isAsync": true, + "isPrototypeMethod": false, + "group": "clone" + }, + "git_commit_extract_signature": { + "args": [ + { + "name": "signature", + "type": "git_buf" + }, + { + "name": "signed_data", + "type": "git_buf" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "commit_id", + "type": "git_oid *" + }, + { + "name": "field", + "type": "char *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/commit/extract_signature.cc", + "isAsync": true, + "isPrototypeMethod": false, + "group": "commit", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_email_create_from_diff": { + "file": "sys/email.h", + "type": "function", + "isAsync": true, + "group": "email", + "args": [ + { + "name": "out", + "type": "git_buf *" + }, + { + "name": "diff", + "type": "git_diff *" + }, + { + "name": "patch_idx", + "type": "size_t" + }, + { + "name": "patch_count", + "type": "size_t" + }, + { + "name": "commit_id", + "type": "const git_oid *" + }, + { + "name": "summary", + "type": "const char *" + }, + { + "name": "body", + "type": "const char *" + }, + { + "name": "author", + "type": "const git_signature *" + }, + { + "name": "opts", + "type": "git_email_create_options *" + } + ], + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_diff_get_perfdata": { + "file": "sys/diff.h", + "args": [ + { + "name": "out", + "type": "git_diff_perfdata *" + }, + { + "name": "diff", + "type": "const git_diff *" + } + ], + "return": { + "type": "int" + }, + "group": "diff" + }, + "git_filter_list_load": { + "isManual": true, + "cFile": "generate/templates/manual/filter_list/load.cc", + "isAsync": true, + "isPrototypeMethod": false, + "group": "filter_list" + }, + "git_filter_source_filemode": { + "type": "function", + "file": "sys/filter.h", + "args": [ + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "return": { + "type": "uint16_t" + }, + "group": "filter_source" + }, + "git_filter_source_flags": { + "type": "function", + "file": "sys/filter.h", + "args": [ + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "return": { + "type": "uint32_t" + }, + "group": "filter_source" + }, + "git_filter_source_id": { + "type": "function", + "file": "sys/filter.h", + "args": [ + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "return": { + "type": "const git_oid *" + }, + "group": "filter_source" + }, + "git_filter_source_mode": { + "type": "function", + "file": "sys/filter.h", + "args": [ + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "return": { + "type": "git_filter_mode_t" + }, + "group": "filter_source" + }, + "git_filter_source_path": { + "type": "function", + "file": "sys/filter.h", + "args": [ + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "return": { + "type": "const char *" + }, + "group": "filter_source" + }, + "git_filter_source_repo": { + "args": [ + { + "name": "out", + "type": "git_repository **" + }, + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "isManual": true, + "cFile": "generate/templates/manual/filter_source/repo.cc", + "isAsync": true, + "isPrototypeMethod": true, + "type": "function", + "group": "filter_source", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_hashsig_compare": { + "type": "function", + "file": "sys/hashsig.h", + "args": [ + { + "name": "a", + "type": "const git_hashsig *" + }, + { + "name": "b", + "type": "const git_hashsig *" + } + ], + "return": { + "type": "int" + }, + "group": "hashsig" + }, + "git_hashsig_create": { + "type": "function", + "file": "sys/hashsig.h", + "args": [ + { + "name": "out", + "type": "git_hashsig **" + }, + { + "name": "buf", + "type": "const char *" + }, + { + "name": "buflen", + "type": "size_t" + }, + { + "name": "opts", + "type": "git_hashsig_option_t" + } + ], + "return": { + "type": "int" + }, + "group": "hashsig" + }, + "git_hashsig_create_fromfile": { + "type": "function", + "file": "sys/hashsig.h", + "args": [ + { + "name": "out", + "type": "git_hashsig **" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "opts", + "type": "git_hashsig_option_t" + } + ], + "return": { + "type": "int" + }, + "group": "hashsig" + }, + "git_index_name_add": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "ancestor", + "type": "const char *" + }, + { + "name": "ours", + "type": "const char *" + }, + { + "name": "theirs", + "type": "const char *" + } + ], + "return": { + "type": "int" + }, + "group": "index_name_entry" + }, + "git_index_name_clear": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + } + ], + "return": { + "type": "int" + }, + "group": "index_name_entry" + }, + "git_index_name_entrycount": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + } + ], + "return": { + "type": "size_t" + }, + "group": "index_name_entry" + }, + "git_index_name_get_byindex": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "n", + "type": "size_t" + } + ], + "return": { + "type": "const git_index_name_entry *" + }, + "group": "index_name_entry" + }, + "git_index_reuc_add": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "ancestor_mode", + "type": "int" + }, + { + "name": "ancestor_id", + "type": "const git_oid *" + }, + { + "name": "our_mode", + "type": "int" + }, + { + "name": "our_id", + "type": "const git_oid *" + }, + { + "name": "their_mode", + "type": "int" + }, + { + "name": "their_id", + "type": "const git_oid *" + } + ], + "return": { + "type": "int" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_clear": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + } + ], + "return": { + "type": "int" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_entrycount": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + } + ], + "return": { + "type": "size_t" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_find": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "at_pos", + "type": "size_t *" + }, + { + "name": "index", + "type": "git_index *" + }, + { + "name": "path", + "type": "const char *" + } + ], + "return": { + "type": "int" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_get_byindex": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "n", + "type": "size_t" + } + ], + "return": { + "type": "const git_index_reuc_entry *" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_get_bypath": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "path", + "type": "const char *" + } + ], + "return": { + "type": "const git_index_reuc_entry *" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_remove": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "n", + "type": "size_t" + } + ], + "return": { + "type": "int" + }, + "group": "index_reuc_entry" + }, + "git_note_author": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "note", + "type": "const git_note *" + } + ], + "return": { + "type": "const git_signature *" + }, + "group": "note" + }, + "git_note_commit_create": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "notes_commit_out", + "type": "git_oid *" + }, + { + "name": "notes_blob_out", + "type": "git_oid *" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "parent", + "type": "git_commit *" + }, + { + "name": "author", + "type": "const git_signature *" + }, + { + "name": "committer", + "type": "const git_signature *" + }, + { + "name": "oid", + "type": "const git_oid *" + }, + { + "name": "note", + "type": "const char *" + }, + { + "name": "allow_note_overwrite", + "type": "int" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_commit_iterator_new": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "out", + "type": "git_note_iterator **" + }, + { + "name": "notes_commit", + "type": "git_commit *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_commit_read": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "out", + "type": "git_note **" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "notes_commit", + "type": "git_commit *" + }, + { + "name": "oid", + "type": "const git_oid *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_commit_remove": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "notes_commit_out", + "type": "git_oid *" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "notes_commit", + "type": "git_commit *" + }, + { + "name": "author", + "type": "const git_signature *" + }, + { + "name": "committer", + "type": "const git_signature *" + }, + { + "name": "oid", + "type": "const git_oid *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_committer": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "note", + "type": "const git_note *" + } + ], + "return": { + "type": "const git_signature *" + }, + "group": "note" + }, + "git_note_create": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "out", + "type": "git_oid *" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "notes_ref", + "type": "const char *" + }, + { + "name": "author", + "type": "const git_signature *" + }, + { + "name": "committer", + "type": "const git_signature *" + }, + { + "name": "oid", + "type": "const git_oid *" + }, + { + "name": "note", + "type": "const char *" + }, + { + "name": "force", + "type": "int" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_default_ref": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "out", + "type": "git_buf *" + }, + { + "name": "repo", + "type": "git_repository *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_foreach": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "notes_ref", + "type": "const char *" + }, + { + "name": "note_cb", + "type": "git_note_foreach_cb" + }, + { + "name": "payload", + "type": "void *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_free": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "note", + "type": "git_note *" + } + ], + "return": { + "type": "void" + }, + "group": "note" + }, + "git_note_id": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "note", + "type": "const git_note *" + } + ], + "return": { + "type": "const git_oid *" + }, + "group": "note" + }, + "git_note_iterator_free": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "it", + "type": "git_note_iterator *" + } + ], + "return": { + "type": "void" + }, + "group": "note" + }, + "git_note_iterator_new": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "out", + "type": "git_note_iterator **" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "notes_ref", + "type": "const char *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_message": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "note", + "type": "const git_note *" + } + ], + "return": { + "type": "const char *" + }, + "group": "note" + }, + "git_note_next": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "note_id", + "type": "git_oid *" + }, + { + "name": "annotated_id", + "type": "git_oid *" + }, + { + "name": "it", + "type": "git_note_iterator *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_read": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "out", + "type": "git_note **" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "notes_ref", + "type": "const char *" + }, + { + "name": "oid", + "type": "const git_oid *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_remove": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "notes_ref", + "type": "const char *" + }, + { + "name": "author", + "type": "const git_signature *" + }, + { + "name": "committer", + "type": "const git_signature *" + }, + { + "name": "oid", + "type": "const git_oid *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, "git_patch_convenient_from_diff": { "args": [ { "name": "diff", "type": "git_diff *" }, + { + "name": "indexes", + "type": "std::vector" + }, { "name": "out", "type": "std::vector *" @@ -108,23 +1162,31 @@ "isErrorCode": true } }, - "git_rebase_next": { + "git_path_is_gitfile": { "type": "function", - "file": "rebase.h", + "file": "sys/path.h", "args": [ { - "name": "out", - "type": "git_rebase_operation **" + "name": "path", + "type": "const char *" + }, + { + "name": "pathlen", + "type": "size_t" + }, + { + "name": "gitfile", + "type": "git_path_gitfile" }, { - "name": "rebase", - "type": "git_rebase *" + "name": "fs", + "type": "git_path_fs" } ], "return": { "type": "int" }, - "group": "rebase" + "group": "path" }, "git_remote_reference_list": { "args": [ @@ -148,31 +1210,205 @@ "isErrorCode": true } }, - "git_reset": { + "git_repository__cleanup": { + "type": "function", + "file": "sys/repository.h", + "args": [ + { + "name": "repo", + "type": "git_repository *" + } + ], + "return": { + "type": "int" + }, + "group": "repository" + }, + "git_repository_get_references": { + "args": [ + { + "name": "out", + "type": "std::vector *" + }, + { + "name": "repo", + "type": "git_repository *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/repository/get_references.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "repository", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_repository_get_submodules": { + "args": [ + { + "name": "out", + "type": "std::vector *" + }, + { + "name": "repo", + "type": "git_repository *" + } + ], "type": "function", - "file": "reset.h", + "isManual": true, + "cFile": "generate/templates/manual/repository/get_submodules.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "repository", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_repository_get_remotes": { "args": [ + { + "name": "out", + "type": "std::vector *" + }, { "name": "repo", "type": "git_repository *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/repository/get_remotes.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "repository", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_repository_refresh_references": { + "args": [ + { + "name": "out", + "type": "void *" }, { - "name": "target", - "type": "git_object *" + "name": "repo", + "type": "git_repository *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/repository/refresh_references.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "repository", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_repository_set_index": { + "type": "function", + "file": "sys/repository.h", + "args": [ + { + "name": "repo", + "type": "git_repository *" }, { - "name": "reset_type", - "type": "git_reset_t" + "name": "index", + "type": "git_index *" + } + ], + "return": { + "type": "int" + }, + "group": "repository" + }, + "git_repository_statistics": { + "args": [ + { + "name": "out", + "type": "void *" }, { - "name": "checkout_opts", - "type": "git_checkout_options *" + "name": "repo", + "type": "git_repository *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/repository/statistics.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "repository", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_repository_submodule_cache_all": { + "type": "function", + "file": "sys/repository.h", + "args": [ + { + "name": "repo", + "type": "git_repository *" + } + ], + "return": { + "type": "int" + }, + "group": "repository" + }, + "git_repository_submodule_cache_clear": { + "type": "function", + "file": "sys/repository.h", + "args": [ + { + "name": "repo", + "type": "git_repository *" } ], "return": { "type": "int" }, - "group": "reset" + "group": "repository" + }, + "git_revwalk_commit_walk": { + "args": [ + { + "name": "max_count", + "type": "int" + }, + { + "name": "out", + "type": "void *" + }, + { + "name": "returnPlainObjects", + "type": "bool" + }, + { + "name": "walk", + "type": "git_revwalk *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/revwalk/commit_walk.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "revwalk", + "return": { + "type": "int", + "isErrorCode": true + } }, "git_revwalk_fast_walk": { "args": [ @@ -208,11 +1444,11 @@ }, { "name": "max_count", - "type": "int" + "type": "unsigned int" }, { "name": "out", - "type": "std::vector< std::pair > *> *" + "type": "std::vector *" }, { "name": "walk", @@ -230,35 +1466,48 @@ "isErrorCode": true } }, - "git_stash_save": { - "type": "function", - "file": "stash.h", + "git_status_list_get_perfdata": { + "file": "sys/diff.h", + "args": [ + { + "name": "out", + "type": "git_diff_perfdata *" + }, + { + "name": "status", + "type": "const git_status_list *" + } + ], + "return": { + "type": "int" + }, + "group": "status_list" + }, + "git_tree_get_all_filepaths": { "args": [ { - "name": "out", - "type": "git_oid *" + "name": "tree", + "type": "git_tree *" }, { "name": "repo", "type": "git_repository *" }, { - "name": "stasher", - "type": "const git_signature *" - }, - { - "name": "message", - "type": "const char *" - }, - { - "name": "flags", - "type": "unsigned int" + "name": "out", + "type": "std::vector *" } ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/tree/get_all_filepaths.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "tree", "return": { - "type": "int" - }, - "group": "stash" + "type": "int", + "isErrorCode": true + } } }, "groups": [ @@ -270,7 +1519,44 @@ "git_annotated_commit_from_ref", "git_annotated_commit_from_revspec", "git_annotated_commit_id", - "git_annotated_commit_lookup" + "git_annotated_commit_lookup", + "git_annotated_commit_ref" + ] + ], + [ + "config_iterator", + [ + "git_config_iterator_free", + "git_config_iterator_new", + "git_config_iterator_glob_new", + "git_config_multivar_iterator_new", + "git_config_next" + ] + ], + [ + "diff", + [ + "git_diff_get_perfdata" + ] + ], + [ + "diff_stats", + [ + "git_diff_stats_files_changed", + "git_diff_stats_insertions", + "git_diff_stats_deletions", + "git_diff_stats_to_buf", + "git_diff_stats_free" + ] + ], + [ + "filter_list", + [ + "git_filter_list_apply_to_blob", + "git_filter_list_apply_to_data", + "git_filter_list_apply_to_file", + "git_filter_list_free", + "git_filter_list_load" ] ], [ @@ -284,6 +1570,57 @@ "git_filter_source_flags" ] ], + [ + "hashsig", + [ + "git_hashsig_compare", + "git_hashsig_create", + "git_hashsig_create_fromfile" + ] + ], + [ + "index_conflict_iterator", + [ + "git_index_conflict_iterator_free", + "git_index_conflict_iterator_new", + "git_index_conflict_next" + ] + ], + [ + "index_iterator", + [ + "git_index_iterator_free", + "git_index_iterator_new", + "git_index_iterator_next" + ] + ], + [ + "index_name_entry", + [ + "git_index_name_add", + "git_index_name_clear", + "git_index_name_entrycount", + "git_index_name_get_byindex" + ] + ], + [ + "index_reuc_entry", + [ + "git_index_reuc_add", + "git_index_reuc_clear", + "git_index_reuc_entrycount", + "git_index_reuc_find", + "git_index_reuc_get_byindex", + "git_index_reuc_get_bypath", + "git_index_reuc_remove" + ] + ], + [ + "merge_file_result", + [ + "git_merge_file_result_free" + ] + ], [ "odb_object", [ @@ -295,12 +1632,46 @@ "git_odb_object_type" ] ], + [ + "odb_stream", + [ + "git_odb_stream_finalize_write", + "git_odb_stream_free", + "git_odb_stream_read", + "git_odb_stream_write" + ] + ], + [ + "oid_shorten", + [ + "git_oid_shorten_add", + "git_oid_shorten_free", + "git_oid_shorten_new" + ] + ], [ "patch", [ "git_patch_convenient_from_diff" ] ], + [ + "path", + [ + "git_path_is_gitfile" + ] + ], + [ + "pathspec_match_list", + [ + "git_pathspec_match_list_diff_entry", + "git_pathspec_match_list_entry", + "git_pathspec_match_list_entrycount", + "git_pathspec_match_list_failed_entry", + "git_pathspec_match_list_failed_entrycount", + "git_pathspec_match_list_free" + ] + ], [ "reflog_entry", [ @@ -316,9 +1687,24 @@ "git_remote_reference_list" ] ], + [ + "repository", + [ + "git_repository__cleanup", + "git_repository_get_references", + "git_repository_get_submodules", + "git_repository_get_remotes", + "git_repository_refresh_references", + "git_repository_set_index", + "git_repository_statistics", + "git_repository_submodule_cache_all", + "git_repository_submodule_cache_clear" + ] + ], [ "revwalk", [ + "git_revwalk_commit_walk", "git_revwalk_fast_walk", "git_revwalk_file_history_walk" ] @@ -332,6 +1718,12 @@ "git_status_list_new" ] ], + [ + "tree", + [ + "git_tree_get_all_filepaths" + ] + ], [ "tree_entry", [ @@ -347,49 +1739,145 @@ ], "types": [ [ - "git_stash_apply_progress_t", + "git_apply_options", + { + "type": "struct", + "fields": [ + { + "type": "unsigned int", + "name": "version" + }, + { + "type": "git_apply_delta_cb", + "name": "delta_cb" + }, + { + "type": "git_apply_hunk_cb", + "name": "hunk_cb" + }, + { + "type": "void *", + "name": "payload" + } + ], + "used": { + "needs": [ + "git_apply_init_options" + ] + } + } + ], + [ + "git_blame_hunk", + { + "type": "struct", + "fields": [ + { + "name": "lines_in_hunk", + "type": "int" + }, + { + "name": "final_commit_id", + "type": "git_oid" + }, + { + "name": "final_start_line_number", + "type": "size_t" + }, + { + "name": "final_signature", + "type": "git_signature *" + }, + { + "name": "final_committer", + "type": "git_signature *" + }, + { + "name": "orig_commit_id", + "type": "git_oid" + }, + { + "name": "orig_path", + "type": "const char *" + }, + { + "name": "orig_start_line_number", + "type": "size_t" + }, + { + "name": "orig_signature", + "type": "git_signature *" + }, + { + "name": "orig_committer", + "type": "git_signature *" + }, + { + "name": "summary", + "type": "const char *" + }, + { + "name": "boundary", + "type": "char" + } + ] + } + ], + [ + "git_blob_filter_options", + { + "type": "struct", + "fields": [ + { + "name": "version", + "type": "int" + }, + { + "name": "flags", + "type": "uint32_t" + } + ] + } + ], + [ + "git_cert_ssh_raw_type_t", { "type": "enum", "fields": [ { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_NONE", + "type": "uint32_t", + "name": "GIT_CERT_SSH_RAW_TYPE_UNKNOWN", "value": 0 }, { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_LOADING_STASH", + "type": "uint32_t", + "name": "GIT_CERT_SSH_RAW_TYPE_RSA", "value": 1 }, { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX", + "type": "uint32_t", + "name": "GIT_CERT_SSH_RAW_TYPE_DSS", "value": 2 }, { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED", + "type": "uint32_t", + "name": "GIT_CERT_SSH_RAW_TYPE_KEY_ECDSA_256", "value": 3 }, { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED", + "type": "uint32_t", + "name": "GIT_CERT_SSH_RAW_TYPE_KEY_ECDSA_384", "value": 4 }, { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED", + "type": "uint32_t", + "name": "GIT_CERT_SSH_RAW_TYPE_KEY_ECDSA_521", "value": 5 }, { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED", + "type": "uint32_t", + "name": "GIT_CERT_SSH_RAW_TYPE_KEY_ED25519", "value": 6 - }, - { - "type": "int", - "name": "GIT_STASH_APPLY_PROGRESS_DONE", - "value": 7 } ] } @@ -419,7 +1907,41 @@ } ], [ - "git_filter", + "git_commit_create_options", + { + "decl": [ + "unsigned int version", + "unsigned int allow_empty_commit : 1", + "const git_signature *author", + "const git_signature *committer", + "const char *message_encoding" + ], + "fields": [ + { + "name": "version", + "type": "unsigned int" + }, + { + "name": "allow_empty_commit", + "type": "unsigned int" + }, + { + "name": "author", + "type": "const git_signature *" + }, + { + "name": "committer", + "type": "const git_signature *" + }, + { + "name": "message_encoding", + "type": "const char *" + } + ] + } + ], + [ + "git_describe_format_options", { "type": "struct", "fields": [ @@ -427,68 +1949,116 @@ "type": "unsigned int", "name": "version" }, + { + "type": "unsigned int", + "name": "abbreviated_size" + }, + { + "type": "int", + "name": "always_use_long_format" + }, { "type": "const char *", - "name": "attributes" + "name": "dirty_suffix" + } + ], + "used": { + "needs": [ + "git_describe_init_format_options" + ] + } + } + ], + [ + "git_describe_options", + { + "type": "struct", + "fields": [ + { + "type": "unsigned int", + "name": "version" }, { - "type": "git_filter_init_fn", - "name": "initialize" + "type": "unsigned int", + "name": "max_candidates_tags" }, { - "type": "git_filter_shutdown_fn", - "name": "shutdown" + "type": "unsigned int", + "name": "describe_strategy" }, { - "type": "git_filter_check_fn", - "name": "check" + "type": "const char *", + "name": "pattern" }, { - "type": "git_filter_apply_fn", - "name": "apply" + "type": "int", + "name": "only_follow_first_parent" }, { - "type": "git_filter_cleanup_fn", - "name": "cleanup" + "type": "int", + "name": "show_commit_oid_as_fallback" } - ] + ], + "used": { + "needs": [ + "git_describe_init_options" + ] + } } ], [ - "git_status_entry", + "git_diff_perfdata", { + "type": "struct", "fields": [ { - "type": "git_status_t", - "name": "status" + "type": "unsigned int", + "name": "version", + "ignore": true }, { - "type": "git_diff_delta *", - "name": "head_to_index" + "type": "size_t", + "name": "stat_calls" }, { - "type": "git_diff_delta *", - "name": "index_to_workdir" + "type": "size_t", + "name": "oid_calculations" } ] } ], [ - "git_diff_perfdata", + "git_filter", { "type": "struct", "fields": [ { - "type": "unsigned int", - "name": "version" + "type": "unsigned int", + "name": "version" + }, + { + "type": "const char *", + "name": "attributes" + }, + { + "type": "git_filter_init_fn", + "name": "initialize" }, { - "type": "size_t", - "name": "stat_calls" + "type": "git_filter_shutdown_fn", + "name": "shutdown" }, { - "type": "size_t", - "name": "oid_calculations" + "type": "git_filter_check_fn", + "name": "check" + }, + { + "type": "git_filter_apply_fn", + "name": "apply" + }, + { + "type": "git_filter_cleanup_fn", + "name": "cleanup" } ] } @@ -521,6 +2091,10 @@ { "name": "download_tags", "type": "git_remote_autotag_option_t" + }, + { + "name": "custom_headers", + "type": "git_strarray" } ], "used": { @@ -555,44 +2129,56 @@ } ], [ - "git_off_t", + "git_hashsig", { - "type": "enum" + "type": "struct", + "fields": [] } ], [ - "git_rebase_options", + "git_index_name_entry", { "type": "struct", "fields": [ { - "type": "unsigned int", - "name": "version" + "type": "char *", + "name": "ancestor" }, { - "type": "int", - "name": "quiet" + "type": "char *", + "name": "ours" }, { - "type": "const char *", - "name": "rewrite_notes_ref" + "type": "char *", + "name": "theirs" + } + ] + } + ], + [ + "git_index_reuc_entry", + { + "type": "struct", + "fields": [ + { + "type": "uint32_t [3]", + "name": "mode" }, { - "type": "git_checkout_options", - "name": "checkout_options" + "type": "git_oid [3]", + "name": "oid" }, { - "type": "git_merge_options", - "name": "merge_options" + "type": "char *", + "name": "path" } - ], - "used": { - "needs": [ - "git_rebase_init_options", - "git_checkout_init_options", - "git_merge_init_options" - ] - } + ] + } + ], + [ + "git_off_t", + { + "type": "enum" } ], [ @@ -615,7 +2201,7 @@ "name": "sideband_progress" }, { - "type": "git_cred_acquire_cb", + "type": "git_credential_acquire_cb", "name": "credentials" }, { @@ -623,9 +2209,14 @@ "name": "certificate_check" }, { - "type": "git_transfer_progress_cb", + "type": "git_indexer_progress_cb", "name": "transfer_progress" }, + { + "type": "git_push_transfer_progress_cb", + "name": "push_transfer_progress", + "isCallback": true + }, { "type": "git_transport_cb", "name": "transport", @@ -638,6 +2229,10 @@ { "type": "void *", "name": "payload" + }, + { + "type": "git_url_resolve_cb", + "name": "resolve_url" } ], "used": { @@ -647,6 +2242,39 @@ } } ], + [ + "git_remote_create_options", + { + "type": "struct", + "fields": [ + { + "type": "unsigned int", + "name": "version" + }, + { + "type": "git_repository *", + "name": "repository" + }, + { + "type": "const char *", + "name": "name" + }, + { + "type": "const char *", + "name": "fetchspec" + }, + { + "type": "unsigned int", + "name": "flags" + } + ], + "used": { + "needs": [ + "git_remote_create_init_options" + ] + } + } + ], [ "git_remote_head", { @@ -681,15 +2309,108 @@ } ], [ - "git_time_t", + "git_path_gitfile", { - "type": "enum" + "type": "enum", + "fields": [ + { + "type": "int", + "name": "GIT_PATH_GITFILE_GITIGNORE", + "value": 0 + }, + { + "type": "int", + "name": "GIT_PATH_GITFILE_GITMODULES", + "value": 1 + }, + { + "type": "int", + "name": "GIT_PATH_GITFILE_GITATTRIBUTES", + "value": 1 + } + ] } ], [ - "git_trace_level_t", + "git_stash_apply_progress_t", { - "type": "enum" + "type": "enum", + "fields": [ + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_NONE", + "value": 0 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_LOADING_STASH", + "value": 1 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX", + "value": 2 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED", + "value": 3 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED", + "value": 4 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED", + "value": 5 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED", + "value": 6 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_DONE", + "value": 7 + } + ] + } + ], + [ + "git_stash_apply_options", + { + "type": "struct", + "fields": [ + { + "type": "unsigned int", + "name": "version" + }, + { + "type": "uint32_t", + "name": "flags" + }, + { + "type": "git_checkout_options", + "name": "checkout_options" + }, + { + "type": "git_stash_apply_progress_cb", + "name": "progress_cb" + }, + { + "type": "void *", + "name": "progress_payload" + } + ], + "used": { + "needs": [ + "git_stash_apply_init_options", + "git_checkout_init_options" + ] + } } ], [ @@ -724,7 +2445,13 @@ } ], [ - "git_stash_apply_options", + "git_trace_level_t", + { + "type": "enum" + } + ], + [ + "git_worktree_add_options", { "type": "struct", "fields": [ @@ -733,29 +2460,60 @@ "name": "version" }, { - "type": "git_stash_apply_flags", - "name": "flags" - }, - { - "type": "git_checkout_options", - "name": "checkout_options" - }, + "type": "int", + "name": "lock" + } + ], + "used": { + "needs": [ + "git_worktree_add_options_init" + ] + } + } + ], + [ + "git_worktree_prune_options", + { + "type": "struct", + "fields": [ { - "type": "git_stash_apply_progress_cb", - "name": "progress_cb" + "type": "unsigned int", + "name": "version" }, { - "type": "void *", - "name": "progress_payload" + "type": "uint32_t", + "name": "flags" } ], "used": { "needs": [ - "git_stash_apply_init_options", - "git_checkout_init_options" + "git_worktree_prune_options_init" ] } } + ], + [ + "git_worktree_prune_t", + { + "type": "enum", + "fields": [ + { + "type": "unsigned int", + "name": "git_worktree_prune_valid", + "value": 1 + }, + { + "type": "unsigned int", + "name": "git_worktree_prune_locked", + "value": 2 + }, + { + "type": "unsigned int", + "name": "git_worktree_prune_working_tree", + "value": 4 + } + ] + } ] ] }, @@ -767,33 +2525,60 @@ "git_annotated_commit_from_ref", "git_annotated_commit_from_revspec", "git_annotated_commit_id", - "git_annotated_commit_lookup" + "git_annotated_commit_lookup", + "git_annotated_commit_ref" + ] + }, + "config": { + "functions": [ + "git_config_iterator_free", + "git_config_iterator_new", + "git_config_iterator_glob_new", + "git_config_multivar_iterator_new", + "git_config_next" + ] + }, + "diff": { + "functions": [ + "git_diff_stats_files_changed", + "git_diff_stats_insertions", + "git_diff_stats_deletions", + "git_diff_stats_to_buf", + "git_diff_stats_free" ] }, - "filter": { + "index": { "functions": [ - "git_filter_list_apply_to_blob", - "git_filter_list_apply_to_data", - "git_filter_list_apply_to_file", - "git_filter_list_contains", - "git_filter_list_free", - "git_filter_list_length", - "git_filter_list_load", - "git_filter_list_new", - "git_filter_list_push", - "git_filter_list_stream_blob", - "git_filter_list_stream_data", - "git_filter_list_stream_file", - "git_filter_source_filemode", - "git_filter_source_flags", - "git_filter_source_id", - "git_filter_source_mode", - "git_filter_source_path", - "git_filter_source_repo" + "git_index_conflict_iterator_free", + "git_index_conflict_iterator_new", + "git_index_conflict_next", + "git_index_iterator_free", + "git_index_iterator_new", + "git_index_iterator_next", + "git_index_name_add", + "git_index_name_clear", + "git_index_name_entrycount", + "git_index_name_get_byindex", + "git_index_reuc_add", + "git_index_reuc_clear", + "git_index_reuc_entrycount", + "git_index_reuc_find", + "git_index_reuc_get_byindex", + "git_index_reuc_get_bypath", + "git_index_reuc_remove" ] }, "merge": { "functions": [ + "git_merge_driver_lookup", + "git_merge_driver_register", + "git_merge_driver_source_ancestor", + "git_merge_driver_source_file_options", + "git_merge_driver_source_ours", + "git_merge_driver_source_repo", + "git_merge_driver_source_theirs", + "git_merge_driver_unregister", + "git_merge_file_result_free", "git_merge_head_free", "git_merge_head_from_fetchhead", "git_merge_head_from_id", @@ -801,18 +2586,50 @@ "git_merge_head_id" ] }, + "message": { + "functions": [ + "git_message_trailer_array_free" + ] + }, "odb": { "functions": [ + "git_odb_backend_loose", + "git_odb_backend_malloc", + "git_odb_backend_one_pack", + "git_odb_backend_pack", "git_odb_object_data", "git_odb_object_dup", "git_odb_object_free", "git_odb_object_id", "git_odb_object_size", - "git_odb_object_type" + "git_odb_object_type", + "git_odb_stream_finalize_write", + "git_odb_stream_free", + "git_odb_stream_read", + "git_odb_stream_write" + ] + }, + "oid": { + "functions": [ + "git_oid_shorten_add", + "git_oid_shorten_free", + "git_oid_shorten_new" + ] + }, + "pathspec": { + "functions": [ + "git_pathspec_match_list_diff_entry", + "git_pathspec_match_list_entry", + "git_pathspec_match_list_entrycount", + "git_pathspec_match_list_failed_entry", + "git_pathspec_match_list_failed_entrycount", + "git_pathspec_match_list_free" ] }, "reflog": { "functions": [ + "git_reflog_entry__alloc", + "git_reflog_entry__free", "git_reflog_entry_committer", "git_reflog_entry_id_new", "git_reflog_entry_id_old", @@ -829,6 +2646,7 @@ }, "tree": { "functions": [ + "git_tree_entry_dup", "git_tree_entry_filemode", "git_tree_entry_filemode_raw", "git_tree_entry_free", @@ -840,8 +2658,30 @@ } }, "groups": { - "stash": [ - "git_stash_save" + "blame": [ + "git_blame_file" + ], + "email": [ + "git_email_create_from_diff" + ], + "note": [ + "git_note_author", + "git_note_commit_create", + "git_note_commit_iterator_new", + "git_note_commit_read", + "git_note_commit_remove", + "git_note_committer", + "git_note_create", + "git_note_default_ref", + "git_note_foreach", + "git_note_free", + "git_note_id", + "git_note_iterator_free", + "git_note_iterator_new", + "git_note_message", + "git_note_next", + "git_note_read", + "git_note_remove" ] } -} +} \ No newline at end of file diff --git a/generate/scripts/generateNativeCode.js b/generate/scripts/generateNativeCode.js index 30fc52707e..44fb21dec5 100644 --- a/generate/scripts/generateNativeCode.js +++ b/generate/scripts/generateNativeCode.js @@ -1,6 +1,5 @@ const path = require("path"); -const promisify = require("promisify-node"); -const fse = promisify(require("fs-extra")); +const fse = require("fs-extra"); const os = require('os'); const exec = require('../../utils/execPromise'); const utils = require("./utils"); @@ -27,6 +26,7 @@ module.exports = function generateNativeCode() { var partials = { asyncFunction: utils.readLocalFile("templates/partials/async_function.cc"), callbackHelpers: utils.readLocalFile("templates/partials/callback_helpers.cc"), + configurableCallbacks: utils.readLocalFile("templates/partials/configurable_callbacks.cc"), convertFromV8: utils.readLocalFile("templates/partials/convert_from_v8.cc"), convertToV8: utils.readLocalFile("templates/partials/convert_to_v8.cc"), doc: utils.readLocalFile("templates/partials/doc.cc"), @@ -51,11 +51,18 @@ module.exports = function generateNativeCode() { var filters = { and: require("../templates/filters/and"), argsInfo: require("../templates/filters/args_info"), + arrayTypeToPlainType: require("../templates/filters/array_type_to_plain_type"), + asElementPointer: require("../templates/filters/as_element_pointer"), + callbackArgsInfo: require("../templates/filters/callback_args_info"), + callbackArgsCount: require("../templates/filters/callback_args_count"), cppToV8: require("../templates/filters/cpp_to_v8"), defaultValue: require("../templates/filters/default_value"), fieldsInfo: require("../templates/filters/fields_info"), + getCPPFunctionForRootProto: require("../templates/filters/get_cpp_function_for_root_proto"), + hasFunctionOnRootProto: require("../templates/filters/has_function_on_root_proto"), hasReturnType: require("../templates/filters/has_return_type"), hasReturnValue: require("../templates/filters/has_return_value"), + isArrayType: require("../templates/filters/is_array_type"), isDoublePointer: require("../templates/filters/is_double_pointer"), isFixedLengthString: require("../templates/filters/is_fixed_length_string"), isOid: require("../templates/filters/is_oid"), @@ -69,8 +76,10 @@ module.exports = function generateNativeCode() { returnsCount: require("../templates/filters/returns_count"), returnsInfo: require("../templates/filters/returns_info"), subtract: require("../templates/filters/subtract"), + thisInfo: require("../templates/filters/this_info"), titleCase: require("../templates/filters/title_case"), toBool: require('../templates/filters/to_bool'), + toSizeOfArray: require("../templates/filters/to_size_of_array"), unPointer: require("../templates/filters/un_pointer"), setUnsigned: require("../templates/filters/unsigned"), upper: require("../templates/filters/upper") diff --git a/generate/scripts/helpers.js b/generate/scripts/helpers.js index 9b7baa2cbc..e278e1cc05 100644 --- a/generate/scripts/helpers.js +++ b/generate/scripts/helpers.js @@ -24,7 +24,9 @@ var cTypeMappings = { "uint16_t": "Number", "uint32_t": "Number", "uint64_t": "Number", - "double": "Number" + "double": "Number", + "git_object_size_t": "Number", + "git_time_t": "Number", } var collisionMappings = { @@ -40,6 +42,7 @@ var Helpers = { .replace("struct", "") .replace(utils.doublePointerRegex, "") .replace(utils.pointerRegex, "") + .replace(utils.arrayTypeRegex, "") .trim(); }, @@ -68,15 +71,23 @@ var Helpers = { }, isConstructorFunction: function(cType, fnName) { - var initFnName = cType.split('_'); + var deprecatedInitFnName = cType.split("_"); + deprecatedInitFnName.splice(-1, 0, "init"); + deprecatedInitFnName = deprecatedInitFnName.join("_"); - initFnName.splice(-1, 0, "init"); - initFnName = initFnName.join('_'); + var initFnName = cType + "_init"; - return initFnName === fnName; + return initFnName === fnName || deprecatedInitFnName === fnName; }, hasConstructor: function(type, normalizedType) { + if (normalizedType && descriptor.types[normalizedType.substr(4)]) { + var descriptorEntry = descriptor.types[normalizedType.substr(4)]; + if (descriptorEntry.hasOwnProperty('hasConstructor')) { + return descriptorEntry.hasConstructor; + } + } + return type.used && type.used.needs && type.used.needs.some(function (fnName) { @@ -84,8 +95,8 @@ var Helpers = { }); }, - isCallbackFunction: function(cType) { - return callbackTypePattern.test(cType); + isCallbackFunction: function(cType, isCallback) { + return isCallback === true || callbackTypePattern.test(cType); }, isPayloadFor: function(cbField, payloadName) { @@ -156,7 +167,9 @@ var Helpers = { if (libgitType) { type.isLibgitType = true; type.isEnum = libgitType.type === "enum"; - type.hasConstructor = Helpers.hasConstructor(type, normalizedType); + type.hasConstructor = Helpers.hasConstructor(libgitType, normalizedType); + type.isClassType = !type.isEnum && !type.hasConstructor; + type.isStructType = !type.isEnum && !!type.hasConstructor; // there are no enums at the struct level currently, but we still need to override function args if (type.isEnum) { @@ -167,6 +180,8 @@ var Helpers = { } } + type.freeFunctionName = libgitType.freeFunctionName; + // we don't want to overwrite the c type of the passed in type _.merge(type, descriptor.types[normalizedType.replace("git_", "")] || {}, { cType: type.cType }); } @@ -228,7 +243,7 @@ var Helpers = { field.jsClassName = utils.titleCase(Helpers.cTypeToJsName(field.type)); field.ownedByThis = true; - if (Helpers.isCallbackFunction(field.cType)) { + if (Helpers.isCallbackFunction(field.cType, field.isCallback)) { Helpers.processCallback(field); var argOverrides = fieldOverrides.args || {}; @@ -315,6 +330,7 @@ var Helpers = { fnDef.cppFunctionName = Helpers.cTypeToCppName(key, "git_" + typeDef.typeName); fnDef.jsFunctionName = Helpers.cTypeToJsName(key, "git_" + typeDef.typeName); + fnDef.jsClassName = typeDef.jsClassName; if (fnDef.cppFunctionName == typeDef.cppClassName) { fnDef.cppFunctionName = fnDef.cppFunctionName.replace("Git", ""); diff --git a/generate/scripts/utils.js b/generate/scripts/utils.js index 2771c9cedf..c6e843134a 100644 --- a/generate/scripts/utils.js +++ b/generate/scripts/utils.js @@ -1,5 +1,6 @@ const fse = require("fs-extra"); const walk = require("walk"); +const _ = require('lodash'); const fs = require("fs"); const path = require("path"); @@ -8,6 +9,7 @@ const path = require("path"); var local = path.join.bind(null, __dirname, "../"); var util = { + arrayTypeRegex: /\[\d*\]\s*/, pointerRegex: /\s*\*\s*/, doublePointerRegex: /\s*\*\*\s*/, @@ -62,13 +64,7 @@ var util = { }).join(""); }, - camelCase: function(str) { - return str.split(/_|\//).map(function(val, index) { - return (index >= 1 - ? val[0].toUpperCase() + val.slice(1) - : val[0].toLowerCase() + val.slice(1)); - }).join(""); - }, + camelCase: _.camelCase, getFilePathsRelativeToDir: function(dir) { const files = []; @@ -124,29 +120,35 @@ var util = { }, syncDirs: function(fromDir, toDir) { + let toFilePaths; + let fromFilePaths; return Promise.all([ util.getFilePathsRelativeToDir(toDir), util.getFilePathsRelativeToDir(fromDir) - ]).then(function(filePaths) { - const toFilePaths = filePaths[0]; - const fromFilePaths = filePaths[1]; - - // Delete files that aren't in fromDir - toFilePaths.forEach(function(filePath) { - if (!util.isFile(path.join(fromDir, filePath))) { - fse.remove(path.join(toDir, filePath)); - } + ]) + .then(function(filePaths) { + toFilePaths = filePaths[0]; + fromFilePaths = filePaths[1]; + + // Delete files that aren't in fromDir + return Promise.all(toFilePaths.map(function(filePath) { + if (!util.isFile(path.join(fromDir, filePath))) { + return fse.remove(path.join(toDir, filePath)); + } + return Promise.resolve(); + })); + }) + .then(function() { + // Copy files that don't exist in toDir or have different contents + return Promise.all(fromFilePaths.map(function(filePath) { + const toFilePath = path.join(toDir, filePath); + const fromFilePath = path.join(fromDir, filePath); + if (!util.isFile(toFilePath) || util.readFile(toFilePath) !== util.readFile(fromFilePath)) { + return fse.copy(fromFilePath, toFilePath); + } + return Promise.resolve(); + })); }); - - // Copy files that don't exist in toDir or have different contents - fromFilePaths.forEach(function(filePath) { - const toFilePath = path.join(toDir, filePath); - const fromFilePath = path.join(fromDir, filePath); - if (!util.isFile(toFilePath) || util.readFile(toFilePath) !== util.readFile(fromFilePath)) { - fse.copy(fromFilePath, toFilePath); - } - }); - }); } }; diff --git a/generate/templates/README.md b/generate/templates/README.md new file mode 100644 index 0000000000..ee8b1f70c5 --- /dev/null +++ b/generate/templates/README.md @@ -0,0 +1,35 @@ +# Manual templates + + Manual templates override generated code from nodegit while generating source code. They really should be avoid untill absolutely necessary. + +## Why? + + #### 1. Performance + > Everytime the library switches between C land and the javascript thread, there is a penalty in performance. If in practice the usage of a method in libgit2 requires crossing the c/javascript boundary frequently, it might be better option to use manual templates. An example being ```Revwalk::FastWalk```. + + #### 2. Saftey + > The generated code sometimes does not handle structures that are interdependent. An example would be ```git_patch``` and ```git_diff```. A ```git_patch```'s memory is owned by ```git_diff```, and that includes all of the children of ```git_patch```, as well. So a ```git_diff_hunk```, ```git_diff_line```, and ```git_patch``` all are owned by a ```git_diff```, and when that ```git_diff``` is deleted, all the memory for any patches, hunks, or lines that are in use as NodeGitWrappers are now corrupted. Further, a ```git_diff``` keeps a file handle open for its entire lifespan, which can lead to NodeGit holding onto file locks in Windows. Due to both of these compounding issues, we wrote manual templates to shift ownership away from a ```git_diff``` to ```git_patch```, ```git_diff_hunk```, and ```git_diff_line``` and also shorten the lifespan of a diff. + + #### 3. Odd cases + > If a new pattern exists in libgit that would be difficult to implement using generated code, manual templates can be used for one-off cases. Typically generated code takes care of most patterns seen in libgit, but if function signatures do not follow typical pattern, manual templates could be used. Example: ```git_filter``` and ```git_remote_ls```. + +
+----- +## Implementing manual templates + +#### 1. Write manual .cc and .h files to *generate/templates/manual/* + *.cc files -> /generate/templates/manual/src/ + *.h files -> /generate/templates/manual/include/ + +#### 2. Remove all references from /generate configuration files + +#### 3. Add references to binding.gyp template + location: /generate/templates/templates/binding.gyp + +#### 4. Add headers to nodegit.cc template + location: /generate/templates/templates/nodegit.cc + +#### 5. Add new wrapper to nodegit.js template + use rawApi.ManualWrapper reference to add _ManualWrapper + add any js wrapper (if any) via importExtension + diff --git a/generate/templates/filters/args_info.js b/generate/templates/filters/args_info.js index 0c05c30ebe..55270102d1 100644 --- a/generate/templates/filters/args_info.js +++ b/generate/templates/filters/args_info.js @@ -1,3 +1,11 @@ +var bannedCppClassNames = [ + "Buffer", + "Function", + "GitBuf", + "GitStrarray", + "Wrapper" +]; + module.exports = function(args) { var result = [], cArg, @@ -20,6 +28,9 @@ module.exports = function(args) { arg.isCppClassStringOrArray = ~["String", "Array"].indexOf(arg.cppClassName); arg.isConst = ~arg.cType.indexOf("const "); + arg.isUnwrappable = !arg.isStructType && arg.isLibgitType && !arg.isEnum && + !bannedCppClassNames.includes(arg.cppClassName); + // if we have a callback then we also need the corresponding payload for that callback if (arg.isCallbackFunction) { var payload = args.filter(function(payload) { diff --git a/generate/templates/filters/array_type_to_plain_type.js b/generate/templates/filters/array_type_to_plain_type.js new file mode 100644 index 0000000000..55f2833500 --- /dev/null +++ b/generate/templates/filters/array_type_to_plain_type.js @@ -0,0 +1,3 @@ +module.exports = function(cType) { + return /(.*)\s\[\d+\]\s*/.exec(cType)[1]; +}; diff --git a/generate/templates/filters/as_element_pointer.js b/generate/templates/filters/as_element_pointer.js new file mode 100644 index 0000000000..8b34eed172 --- /dev/null +++ b/generate/templates/filters/as_element_pointer.js @@ -0,0 +1,7 @@ +const isArrayType = require("./is_array_type"); + +module.exports = function(cType, parsedName) { + return isArrayType(cType) ? + "&" + parsedName + "[i]" : + parsedName; +}; diff --git a/generate/templates/filters/callback_args_count.js b/generate/templates/filters/callback_args_count.js new file mode 100644 index 0000000000..26c7762ead --- /dev/null +++ b/generate/templates/filters/callback_args_count.js @@ -0,0 +1,18 @@ +module.exports = function(args) { + if (!args) { + return 0; + } + + return args.reduce( + function(count, arg) { + var shouldCount = !arg.isReturn && + !arg.isSelf && + arg.name !== "payload" && + arg.name !== "self" && + !arg.ignore; + + return shouldCount ? count + 1 : count; + }, + 0 + ); +}; diff --git a/generate/templates/filters/callback_args_info.js b/generate/templates/filters/callback_args_info.js new file mode 100644 index 0000000000..a7285c0b85 --- /dev/null +++ b/generate/templates/filters/callback_args_info.js @@ -0,0 +1,27 @@ +module.exports = function(args) { + var result = args.reduce( + function(argList, arg) { + var useArg = !arg.isReturn && + !arg.isSelf && + arg.name !== "payload" && + arg.name !== "self" && + !arg.ignore; + + if (!useArg) { + return argList; + } + + arg.firstArg = argList.length === 0; + argList.push(arg); + + return argList; + }, + [] + ); + + if (result.length) { + result[result.length - 1].lastArg = true; + } + + return result; +}; diff --git a/generate/templates/filters/fields_info.js b/generate/templates/filters/fields_info.js index 8ec8a930b1..6022aab127 100644 --- a/generate/templates/filters/fields_info.js +++ b/generate/templates/filters/fields_info.js @@ -1,14 +1,26 @@ +var bannedCppClassNames = [ + "Buffer", + "Function", + "GitBuf", + "GitStrarray", + "Wrapper" +]; + module.exports = function(fields) { var result = []; - fields.forEach(function (field){ + fields.forEach(function (field, index){ var fieldInfo = {}; fieldInfo.__proto__ = field; + fieldInfo.index = index; fieldInfo.parsedName = field.name || "result"; fieldInfo.isCppClassIntType = ~["Uint32", "Int32"].indexOf(field.cppClassName); fieldInfo.parsedClassName = (field.cppClassName || '').toLowerCase() + "_t"; + fieldInfo.hasOwner = !fieldInfo.selfOwned && !!fieldInfo.ownedByThis; + fieldInfo.isUnwrappable = fieldInfo.isLibgitType && !fieldInfo.isEnum && + !bannedCppClassNames.includes(fieldInfo.cppClassName); result.push(fieldInfo); }); diff --git a/generate/templates/filters/get_cpp_function_for_root_proto.js b/generate/templates/filters/get_cpp_function_for_root_proto.js new file mode 100644 index 0000000000..6571af880a --- /dev/null +++ b/generate/templates/filters/get_cpp_function_for_root_proto.js @@ -0,0 +1,12 @@ +module.exports = function(functions) { + if (!functions || functions.length === 0) { + throw new Error("Should not be able to get function from empty function list"); + } + + const fun = functions.find(function(f) { return f.useAsOnRootProto; }); + if (!fun) { + throw new Error("There is no function on the root prototype for this collection"); + } + + return fun.cppFunctionName; +}; diff --git a/generate/templates/filters/has_function_on_root_proto.js b/generate/templates/filters/has_function_on_root_proto.js new file mode 100644 index 0000000000..626ce0ff65 --- /dev/null +++ b/generate/templates/filters/has_function_on_root_proto.js @@ -0,0 +1,7 @@ +module.exports = function(functions) { + if (!functions || functions.length === 0) { + return false; + } + + return functions.some(function(f) { return f.useAsOnRootProto; }); +}; diff --git a/generate/templates/filters/is_array_type.js b/generate/templates/filters/is_array_type.js new file mode 100644 index 0000000000..d633d9e407 --- /dev/null +++ b/generate/templates/filters/is_array_type.js @@ -0,0 +1,3 @@ +module.exports = function(cType) { + return /\s\[\d+\]\s*/.test(cType); +}; diff --git a/generate/templates/filters/js_args_count.js b/generate/templates/filters/js_args_count.js index 5be437f417..17a56a1c11 100644 --- a/generate/templates/filters/js_args_count.js +++ b/generate/templates/filters/js_args_count.js @@ -5,11 +5,11 @@ module.exports = function(args) { if (!args) { return 0; } - + for(cArg = 0, jsArg = 0; cArg < args.length; cArg++) { var arg = args[cArg]; - if (!arg.isReturn && !arg.isSelf && !arg.isPayload) { + if (!arg.isReturn && !arg.isSelf) { jsArg++; } } diff --git a/generate/templates/filters/returns_info.js b/generate/templates/filters/returns_info.js index 7eaf26e7ad..5f7bcdc08a 100644 --- a/generate/templates/filters/returns_info.js +++ b/generate/templates/filters/returns_info.js @@ -4,6 +4,22 @@ module.exports = function(fn, argReturnsOnly, isAsync) { var result = []; var args = fn.args || []; + // We will use this to figure out the index + // of arguments, because sync functions + // need to respect ownership to an arbitrary + // parameter that is labeled by name in the + // descriptor, and we won't have access to + // any sort of string to argument index + // in the template. + var nameToArgIndex = {}; + var thisArgName = ''; + args.forEach(function (arg, index) { + nameToArgIndex[arg.name] = index; + if (arg.isSelf) { + thisArgName = arg.name; + } + }); + args.forEach(function (arg) { if (!arg.isReturn) return; @@ -11,6 +27,7 @@ module.exports = function(fn, argReturnsOnly, isAsync) { return_info.__proto__ = arg; + return_info.isAsync = isAsync; return_info.parsedName = isAsync ? "baton->" + return_info.name : return_info.name; return_info.isCppClassIntType = ~['Uint32', 'Int32'].indexOf(return_info.cppClassName); return_info.needsDereference @@ -21,6 +38,23 @@ module.exports = function(fn, argReturnsOnly, isAsync) { return_info.returnNameOrName = return_info.returnName || return_info.name; return_info.jsOrCppClassName = return_info.jsClassName || return_info.cppClassName; return_info.isOutParam = true; + return_info.hasOwner = !return_info.selfOwned && + !!(return_info.ownedBy || return_info.ownedByThis || return_info.ownerFn); + return_info.ownedByIndices = []; + + if (isAsync && return_info.ownedByThis) { + return_info.ownedBy = return_info.ownedBy || []; + return_info.ownedBy.unshift(thisArgName); + } + + // Here we convert ownedBy, which is the list of parameter names + // that own this result to the argument index. + // sync functions will need to know this. + if (!isAsync && return_info.ownedBy) { + return_info.ownedBy.forEach(function (argName) { + return_info.ownedByIndices.push(nameToArgIndex[argName]); + }) + } result.push(return_info); }); @@ -33,7 +67,28 @@ module.exports = function(fn, argReturnsOnly, isAsync) { var return_info = {}; return_info.__proto__ = fn.return; - return_info.parsedName = return_info.name && isAsync ? "baton->" + return_info.name : "result"; + + return_info.isAsync = isAsync; + return_info.hasOwner = !return_info.selfOwned && + !!(return_info.ownedBy || return_info.ownedByThis || return_info.ownerFn); + return_info.ownedByIndices = []; + return_info.ownedBy = return_info.ownedBy || []; + + if (return_info.ownedByThis && isAsync) { + return_info.ownedBy.push(thisArgName); + } + + if (!isAsync) { + return_info.ownedByIndices = return_info.ownedBy.map(function (ownerName) { + return nameToArgIndex[ownerName]; + }); + } + + if (isAsync) { + return_info.parsedName = "baton->" + (return_info.name || "result"); + } else { + return_info.parsedName = "result"; + } return_info.isCppClassIntType = ~['Uint32', 'Int32'].indexOf(return_info.cppClassName); return_info.parsedClassName = (return_info.cppClassName || '').toLowerCase() + "_t"; return_info.returnNameOrName = return_info.returnName || return_info.name; diff --git a/generate/templates/filters/this_info.js b/generate/templates/filters/this_info.js new file mode 100644 index 0000000000..e5d57520ab --- /dev/null +++ b/generate/templates/filters/this_info.js @@ -0,0 +1,8 @@ +module.exports = function(args, fieldToRetrieve) { + const thisArg = args.find(arg => arg.isSelf); + if (thisArg) { + return thisArg[fieldToRetrieve]; + } + + return; +}; diff --git a/generate/templates/filters/to_size_of_array.js b/generate/templates/filters/to_size_of_array.js new file mode 100644 index 0000000000..b56e9315fa --- /dev/null +++ b/generate/templates/filters/to_size_of_array.js @@ -0,0 +1,3 @@ +module.exports = function(cType) { + return /\s\[(\d+)\]\s*/.exec(cType)[1]; +}; diff --git a/generate/templates/manual/clone/clone.cc b/generate/templates/manual/clone/clone.cc new file mode 100644 index 0000000000..02c47ff58b --- /dev/null +++ b/generate/templates/manual/clone/clone.cc @@ -0,0 +1,210 @@ +// NOTE you may need to occasionally rebuild this method by calling the generators +// if major changes are made to the templates / generator. + +// Due to some file locking issues, we have the need to free a repository after it's cloned. +// We do not expose free functions to javascript, and so, we've moved the implementation of +// cloning, freeing the repo, and opening the repo into a custom template. + +/* + * @param String url + * @param String local_path + * @param CloneOptions options + * @param Repository callback + */ +NAN_METHOD(GitClone::Clone) { + + if (info.Length() == 0 || !info[0]->IsString()) { + return Nan::ThrowError("String url is required."); + } + + if (info.Length() == 1 || !info[1]->IsString()) { + return Nan::ThrowError("String local_path is required."); + } + + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + CloneBaton *baton = new CloneBaton(); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + std::map> cleanupHandles; + + if (info[2]->IsNull() || info[2]->IsUndefined()) { + baton->options = nullptr; + } else { + auto conversionResult = ConfigurableGitCloneOptions::fromJavascript(nodegitContext, info[2]); + if (!conversionResult.result) { + return Nan::ThrowError(Nan::New(conversionResult.error).ToLocalChecked()); + } + + auto convertedObject = conversionResult.result; + cleanupHandles["options"] = convertedObject; + baton->options = convertedObject->GetValue(); + } + + baton->error_code = GIT_OK; + baton->error = NULL; + + // start convert_from_v8 block + const char *from_url = NULL; + + Nan::Utf8String url(Nan::To(info[0]).ToLocalChecked()); + // malloc with one extra byte so we can add the terminating null character + // C-strings expect: + from_url = (const char *)malloc(url.length() + 1); + // copy the characters from the nodejs string into our C-string (used instead + // of strdup or strcpy because nulls in the middle of strings are valid coming + // from nodejs): + memcpy((void *)from_url, *url, url.length()); + // ensure the final byte of our new string is null, extra casts added to + // ensure compatibility with various C types used in the nodejs binding + // generation: + memset((void *)(((char *)from_url) + url.length()), 0, 1); + // end convert_from_v8 block + baton->url = from_url; + // start convert_from_v8 block + const char *from_local_path = NULL; + + Nan::Utf8String local_path(Nan::To(info[1]).ToLocalChecked()); + // malloc with one extra byte so we can add the terminating null character + // C-strings expect: + from_local_path = (const char *)malloc(local_path.length() + 1); + // copy the characters from the nodejs string into our C-string (used instead + // of strdup or strcpy because nulls in the middle of strings are valid coming + // from nodejs): + memcpy((void *)from_local_path, *local_path, local_path.length()); + // ensure the final byte of our new string is null, extra casts added to + // ensure compatibility with various C types used in the nodejs binding + // generation: + memset((void *)(((char *)from_local_path) + local_path.length()), 0, 1); + // end convert_from_v8 block + baton->local_path = from_local_path; + + Nan::Callback *callback = + new Nan::Callback(v8::Local::Cast(info[info.Length() - 1])); + CloneWorker *worker = new CloneWorker(baton, callback, cleanupHandles); + + worker->Reference("url", info[0]); + worker->Reference("local_path", info[1]); + + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitClone::CloneWorker::AcquireLocks() { + nodegit::LockMaster lockMaster( + true, + baton->url, + baton->local_path, + baton->options + ); + return lockMaster; +} + +void GitClone::CloneWorker::Execute() { + git_error_clear(); + + git_repository *repo; + int result = + git_clone(&repo, baton->url, baton->local_path, baton->options); + + if (result == GIT_OK) { + // This is required to clean up after the clone to avoid file locking + // issues in Windows and potentially other issues we don't know about. + git_repository_free(repo); + + // We want to provide a valid repository object, so reopen the repository + // after clone and cleanup. + result = git_repository_open(&baton->out, baton->local_path); + } + + baton->error_code = result; + + if (result != GIT_OK && git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } +} + +void GitClone::CloneWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + git_repository_free(baton->out); + + free((void*)baton->url); + free((void*)baton->local_path); + + delete baton; +} + +void GitClone::CloneWorker::HandleOKCallback() { + if (baton->error_code == GIT_OK) { + v8::Local to; + // start convert_to_v8 block + + if (baton->out != NULL) { + // GitRepository baton->out + to = GitRepository::New(baton->out, true); + } else { + to = Nan::Null(); + } + + // end convert_to_v8 block + v8::Local result = to; + + v8::Local argv[2] = {Nan::Null(), result}; + callback->Call(2, argv, async_resource); + } else { + if (baton->error) { + v8::Local err; + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method clone has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), + Nan::New("Clone.clone").ToLocalChecked()); + v8::Local argv[1] = {err}; + callback->Call(1, argv, async_resource); + if (baton->error->message) + free((void *)baton->error->message); + free((void *)baton->error); + } else if (baton->error_code < 0) { + bool callbackFired = false; + if (!callbackErrorHandle.IsEmpty()) { + v8::Local maybeError = Nan::New(callbackErrorHandle); + if (!maybeError->IsNull() && !maybeError->IsUndefined()) { + v8::Local argv[1] = { + maybeError + }; + callback->Call(1, argv, async_resource); + callbackFired = true; + } + } + + if (!callbackFired) { + v8::Local err = + Nan::To(Nan::Error("Method clone has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), + Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), + Nan::New("Clone.clone").ToLocalChecked()); + v8::Local argv[1] = {err}; + callback->Call(1, argv, async_resource); + } + } else { + callback->Call(0, NULL, async_resource); + } + } + + free((void*)baton->url); + free((void*)baton->local_path); + + delete baton; +} diff --git a/generate/templates/manual/commit/extract_signature.cc b/generate/templates/manual/commit/extract_signature.cc new file mode 100644 index 0000000000..82a2141116 --- /dev/null +++ b/generate/templates/manual/commit/extract_signature.cc @@ -0,0 +1,162 @@ +NAN_METHOD(GitCommit::ExtractSignature) +{ + if (info.Length() == 0 || !info[0]->IsObject()) { + return Nan::ThrowError("Repository repo is required."); + } + + if (info.Length() == 1 || (!info[1]->IsObject() && !info[1]->IsString())) { + return Nan::ThrowError("Oid commit_id is required."); + } + + if (info.Length() >= 4 && !info[2]->IsString() && !info[2]->IsUndefined() && !info[2]->IsNull()) { + return Nan::ThrowError("String signature_field must be a string or undefined/null."); + } + + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + ExtractSignatureBaton* baton = new ExtractSignatureBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->signature = GIT_BUF_INIT_CONST(NULL, 0); + baton->signed_data = GIT_BUF_INIT_CONST(NULL, 0); + baton->repo = Nan::ObjectWrap::Unwrap(Nan::To(info[0]).ToLocalChecked())->GetValue(); + + // baton->commit_id + if (info[1]->IsString()) { + Nan::Utf8String oidString(Nan::To(info[1]).ToLocalChecked()); + baton->commit_id = (git_oid *)malloc(sizeof(git_oid)); + if (git_oid_fromstr(baton->commit_id, (const char *)strdup(*oidString)) != GIT_OK) { + free(baton->commit_id); + + if (git_error_last()->klass != GIT_ERROR_NONE) { + return Nan::ThrowError(git_error_last()->message); + } else { + return Nan::ThrowError("Unknown Error"); + } + } + } else { + baton->commit_id = Nan::ObjectWrap::Unwrap(Nan::To(info[1]).ToLocalChecked())->GetValue(); + } + + // baton->field + if (info[2]->IsString()) { + Nan::Utf8String field(Nan::To(info[2]).ToLocalChecked()); + baton->field = (char *)malloc(field.length() + 1); + memcpy((void *)baton->field, *field, field.length()); + baton->field[field.length()] = 0; + } else { + baton->field = NULL; + } + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + + std::map> cleanupHandles; + ExtractSignatureWorker *worker = new ExtractSignatureWorker(baton, callback, cleanupHandles); + worker->Reference("repo", info[0]); + worker->Reference("commit_id", info[1]); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitCommit::ExtractSignatureWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->repo); + return lockMaster; +} + +void GitCommit::ExtractSignatureWorker::Execute() +{ + git_error_clear(); + + baton->error_code = git_commit_extract_signature( + &baton->signature, + &baton->signed_data, + baton->repo, + baton->commit_id, + (const char *)baton->field + ); + + if (baton->error_code != GIT_OK) { + baton->error = git_error_dup(git_error_last()); + } +} + +void GitCommit::ExtractSignatureWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + git_buf_dispose(&baton->signature); + git_buf_dispose(&baton->signed_data); + + free(baton->field); + + delete baton; +} + +void GitCommit::ExtractSignatureWorker::HandleOKCallback() +{ + if (baton->error_code == GIT_OK) + { + Local result = Nan::New(); + Nan::Set( + result, + Nan::New("signature").ToLocalChecked(), + Nan::New(baton->signature.ptr, baton->signature.size).ToLocalChecked() + ); + Nan::Set( + result, + Nan::New("signedData").ToLocalChecked(), + Nan::New(baton->signed_data.ptr, baton->signed_data.size).ToLocalChecked() + ); + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Extract Signature has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Commit.extractSignature").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } + + git_buf_dispose(&baton->signature); + git_buf_dispose(&baton->signed_data); + + if (baton->field != NULL) { + free((void *)baton->field); + } + + delete baton; +} diff --git a/generate/templates/manual/filter_list/load.cc b/generate/templates/manual/filter_list/load.cc new file mode 100644 index 0000000000..22e2f1f4f3 --- /dev/null +++ b/generate/templates/manual/filter_list/load.cc @@ -0,0 +1,227 @@ +// NOTE you may need to occasionally rebuild this method by calling the generators +// if major changes are made to the templates / generator. + +// git_filter_list_load has a more complex ownership pattern than is currently available +// in the generator. This is because it not only has to get the repo as an owner, +// but it also needs to discover which custom filters, a git_filter, it is bound to, if any. +// We must enforce that the custom filters are not freed before a git_filter_list is freed, +// but a git_filter_list also has pointers to the repo in it. + +// TODO In the future, it would be awesome if we could instead of writing a manual method like this, provide +// custom ownership methods that can be injected into the HandleOKCallback. + +/* + * @param Repository repo + * @param Blob blob + * @param String path + * @param Number mode + * @param Number flags + * @param FilterList callback + */ +NAN_METHOD(GitFilterList::Load) { + if (info.Length() == 0 || !info[0]->IsObject()) { + return Nan::ThrowError("Repository repo is required."); + } + + if (info.Length() == 2 || !info[2]->IsString()) { + return Nan::ThrowError("String path is required."); + } + + if (info.Length() == 3 || !info[3]->IsNumber()) { + return Nan::ThrowError("Number mode is required."); + } + + if (info.Length() == 4 || !info[4]->IsNumber()) { + return Nan::ThrowError("Number flags is required."); + } + + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + LoadBaton *baton = new LoadBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + + // start convert_from_v8 block + git_repository *from_repo = NULL; + from_repo = + Nan::ObjectWrap::Unwrap(Nan::To(info[0]).ToLocalChecked())->GetValue(); + // end convert_from_v8 block + baton->repo = from_repo; + // start convert_from_v8 block + git_blob *from_blob = NULL; + if (info[1]->IsObject()) { + from_blob = + Nan::ObjectWrap::Unwrap(Nan::To(info[1]).ToLocalChecked())->GetValue(); + } else { + from_blob = 0; + } + // end convert_from_v8 block + baton->blob = from_blob; + // start convert_from_v8 block + const char *from_path = NULL; + + Nan::Utf8String path(Nan::To(info[2]).ToLocalChecked()); + // malloc with one extra byte so we can add the terminating null character + // C-strings expect: + from_path = (const char *)malloc(path.length() + 1); + // copy the characters from the nodejs string into our C-string (used instead + // of strdup or strcpy because nulls in the middle of strings are valid coming + // from nodejs): + memcpy((void *)from_path, *path, path.length()); + // ensure the final byte of our new string is null, extra casts added to + // ensure compatibility with various C types used in the nodejs binding + // generation: + memset((void *)(((char *)from_path) + path.length()), 0, 1); + // end convert_from_v8 block + baton->path = from_path; + // start convert_from_v8 block + git_filter_mode_t from_mode; + from_mode = (git_filter_mode_t)(int)info[3].As()->Value(); + // end convert_from_v8 block + baton->mode = from_mode; + // start convert_from_v8 block + uint32_t from_flags; + from_flags = (uint32_t)info[4].As()->Value(); + // end convert_from_v8 block + baton->flags = from_flags; + + Nan::Callback *callback = + new Nan::Callback(v8::Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + LoadWorker *worker = new LoadWorker(baton, callback, cleanupHandles); + + worker->Reference("repo", info[0]); + worker->Reference("blob", info[1]); + + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitFilterList::LoadWorker::AcquireLocks() { + nodegit::LockMaster lockMaster( + true, + baton->repo, + baton->blob, + baton->path + ); + return lockMaster; +} + +void GitFilterList::LoadWorker::Execute() { + git_error_clear(); + + int result = git_filter_list_load(&baton->filters, baton->repo, baton->blob, + baton->path, baton->mode, baton->flags); + + baton->error_code = result; + + if (result != GIT_OK && git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } +} + +void GitFilterList::LoadWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + git_filter_list_free(baton->filters); + + free((void *)baton->path); + + delete baton; +} + +void GitFilterList::LoadWorker::HandleOKCallback() { + if (baton->error_code == GIT_OK) { + v8::Local to; + // start convert_to_v8 block + + if (baton->filters != NULL) { + // GitFilterList baton->filters + v8::Local owners = Nan::New(0); + nodegit::Context *nodegitContext = nodegit::Context::GetCurrentContext(); + + Nan::Set( + owners, + Nan::New(0), + Nan::To(this->GetFromPersistent("repo")).ToLocalChecked() + ); + + to = GitFilterList::New(baton->filters, true, Nan::To(owners).ToLocalChecked()); + auto filterListWrapper = Nan::ObjectWrap::Unwrap(to.As()); + auto filterRegistryCleanupHandles = static_pointer_cast(nodegit::Context::GetCurrentContext()->GetCleanupHandle("filterRegistry")); + std::for_each( + filterRegistryCleanupHandles->registeredFilters.begin(), + filterRegistryCleanupHandles->registeredFilters.end(), + [this, &filterListWrapper](std::pair> filterCleanupHandle) { + if (git_filter_list_contains(baton->filters, filterCleanupHandle.first.c_str())) { + filterListWrapper->SaveCleanupHandle(filterCleanupHandle.second); + } + } + ); + } else { + to = Nan::Null(); + } + + // end convert_to_v8 block + v8::Local result = to; + + v8::Local argv[2] = {Nan::Null(), result}; + callback->Call(2, argv, async_resource); + } else { + if (baton->error) { + v8::Local err; + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method load has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), + Nan::New("FilterList.load").ToLocalChecked()); + v8::Local argv[1] = {err}; + callback->Call(1, argv, async_resource); + if (baton->error->message) + free((void *)baton->error->message); + free((void *)baton->error); + } else if (baton->error_code < 0) { + bool callbackFired = false; + if (!callbackErrorHandle.IsEmpty()) { + v8::Local maybeError = Nan::New(callbackErrorHandle); + if (!maybeError->IsNull() && !maybeError->IsUndefined()) { + v8::Local argv[1] = { + maybeError + }; + callback->Call(1, argv, async_resource); + callbackFired = true; + } + } + + if (!callbackFired) { + v8::Local err = + Nan::To(Nan::Error("Method load has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), + Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), + Nan::New("FilterList.load").ToLocalChecked()); + v8::Local argv[1] = {err}; + callback->Call(1, argv, async_resource); + } + } else { + callback->Call(0, NULL, async_resource); + } + } + + free((void *)baton->path); + + delete baton; +} diff --git a/generate/templates/manual/filter_source/repo.cc b/generate/templates/manual/filter_source/repo.cc new file mode 100644 index 0000000000..78903d86b6 --- /dev/null +++ b/generate/templates/manual/filter_source/repo.cc @@ -0,0 +1,107 @@ +// NOTE you may need to occasionally rebuild this method by calling the generators +// if major changes are made to the templates / generator. + +// Due to some garbage collection issues related to submodules and git_filters, we need to clone the repository +// pointer before giving it to a user. + +/* + * @param Repository callback + */ +NAN_METHOD(GitFilterSource::Repo) { + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + RepoBaton *baton = new RepoBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->src = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(v8::Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + RepoWorker *worker = new RepoWorker(baton, callback, cleanupHandles); + + worker->Reference("src", info.This()); + + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitFilterSource::RepoWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->src); + return lockMaster; +} + +void GitFilterSource::RepoWorker::Execute() { + git_error_clear(); + + git_repository *repo = git_filter_source_repo(baton->src); + baton->error_code = git_repository_open(&repo, git_repository_path(repo)); + + if (baton->error_code == GIT_OK) { + baton->out = repo; + } else if (git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } +} + +void GitFilterSource::RepoWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + git_repository_free(baton->out); + + delete baton; +} + +void GitFilterSource::RepoWorker::HandleOKCallback() { + if (baton->error_code == GIT_OK) { + v8::Local to; + + if (baton->out != NULL) { + to = GitRepository::New(baton->out, true); + } else { + to = Nan::Null(); + } + + v8::Local argv[2] = {Nan::Null(), to}; + callback->Call(2, argv, async_resource); + } else { + if (baton->error) { + v8::Local err; + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method repo has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), + Nan::New("FilterSource.repo").ToLocalChecked()); + v8::Local argv[1] = {err}; + callback->Call(1, argv, async_resource); + if (baton->error->message) + free((void *)baton->error->message); + free((void *)baton->error); + } else if (baton->error_code < 0) { + v8::Local err = + Nan::To(Nan::Error("Method repo has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), + Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), + Nan::New("FilterSource.repo").ToLocalChecked()); + v8::Local argv[1] = {err}; + callback->Call(1, argv, async_resource); + } else { + callback->Call(0, NULL, async_resource); + } + } + + delete baton; +} diff --git a/generate/templates/manual/include/async_baton.h b/generate/templates/manual/include/async_baton.h index f8373cd0de..33da4a4520 100644 --- a/generate/templates/manual/include/async_baton.h +++ b/generate/templates/manual/include/async_baton.h @@ -1,97 +1,78 @@ #ifndef ASYNC_BATON #define ASYNC_BATON -#include +#include +#include +#include #include #include "lock_master.h" #include "nodegit.h" +#include "thread_pool.h" -// Base class for Batons used for callbacks (for example, -// JS functions passed as callback parameters, -// or field properties of configuration objects whose values are callbacks) -struct AsyncBaton { - uv_sem_t semaphore; - - virtual ~AsyncBaton() {} -}; - -void deleteBaton(AsyncBaton *baton); - -template -struct AsyncBatonWithResult : public AsyncBaton { - ResultT result; - ResultT defaultResult; // result returned if the callback doesn't return anything valid - void (*onCompletion)(AsyncBaton *); - - AsyncBatonWithResult(const ResultT &defaultResult) - : defaultResult(defaultResult) { - } - - void Done() { - if (onCompletion) { - onCompletion(this); - } else { - // signal completion - uv_sem_post(&semaphore); - } - } - - ResultT ExecuteAsync(ThreadPool::Callback asyncCallback, void (*onCompletion)(AsyncBaton *) = NULL) { - result = 0; - this->onCompletion = onCompletion; - if (!onCompletion) { - uv_sem_init(&semaphore, 0); - } - - { - LockMaster::TemporaryUnlock temporaryUnlock; - - libgit2ThreadPool.ExecuteReverseCallback(asyncCallback, this); - - if (!onCompletion) { - // wait for completion - uv_sem_wait(&semaphore); - uv_sem_destroy(&semaphore); +namespace nodegit { + // Base class for Batons used for callbacks (for example, + // JS functions passed as callback parameters, + // or field properties of configuration objects whose values are callbacks) + class AsyncBaton { + public: + typedef std::function AsyncCallback; + typedef std::function CompletionCallback; + + AsyncBaton(); + AsyncBaton(const AsyncBaton &) = delete; + AsyncBaton(AsyncBaton &&) = delete; + AsyncBaton &operator=(const AsyncBaton &) = delete; + AsyncBaton &operator=(AsyncBaton &&) = delete; + + virtual ~AsyncBaton() {} + + void Done(); + + Nan::AsyncResource *GetAsyncResource(); + + void SetCallbackError(v8::Local error); + + protected: + void ExecuteAsyncPerform(AsyncCallback asyncCallback, AsyncCallback asyncCancelCb, CompletionCallback onCompletion); + + private: + void SignalCompletion(); + void WaitForCompletion(); + + Nan::AsyncResource *asyncResource; + Nan::Global &callbackErrorHandle; + ThreadPool::Callback onCompletion; + std::unique_ptr completedMutex; + std::condition_variable completedCondition; + bool hasCompleted; + }; + + void deleteBaton(AsyncBaton *baton); + + template + class AsyncBatonWithResult : public AsyncBaton { + public: + ResultT defaultResult; // result returned if the callback doesn't return anything valid + ResultT result; + + AsyncBatonWithResult(const ResultT &defaultResult) + : defaultResult(defaultResult) { } - } - - return result; - } -}; - -struct AsyncBatonWithNoResult : public AsyncBaton { - void (*onCompletion)(AsyncBaton *); - - void Done() { - if (onCompletion) { - onCompletion(this); - } else { - // signal completion - uv_sem_post(&semaphore); - } - } - - void ExecuteAsync(ThreadPool::Callback asyncCallback, void (*onCompletion)(AsyncBaton *) = NULL) { - this->onCompletion = onCompletion; - if (!onCompletion) { - uv_sem_init(&semaphore, 0); - } - - { - LockMaster::TemporaryUnlock temporaryUnlock; - - libgit2ThreadPool.ExecuteReverseCallback(asyncCallback, this); - - if (!onCompletion) { - // wait for completion - uv_sem_wait(&semaphore); - uv_sem_destroy(&semaphore); + + ResultT ExecuteAsync(AsyncBaton::AsyncCallback asyncCallback, AsyncBaton::AsyncCallback asyncCancelCb, AsyncBaton::CompletionCallback onCompletion = nullptr) { + result = 0; + ExecuteAsyncPerform(asyncCallback, asyncCancelCb, onCompletion); + return result; } - } + }; - return; - } -}; + class AsyncBatonWithNoResult : public AsyncBaton { + public: + void ExecuteAsync(AsyncBaton::AsyncCallback asyncCallback, AsyncBaton::AsyncCallback asyncCancelCb, AsyncBaton::CompletionCallback onCompletion = nullptr) { + ExecuteAsyncPerform(asyncCallback, asyncCancelCb, onCompletion); + } + }; +} #endif diff --git a/generate/templates/manual/include/async_libgit2_queue_worker.h b/generate/templates/manual/include/async_libgit2_queue_worker.h deleted file mode 100644 index f3ddf2fb3f..0000000000 --- a/generate/templates/manual/include/async_libgit2_queue_worker.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ASYNC_LIBGIT2_QUEUE_WORKER_H -#define ASYNC_LIBGIT2_QUEUE_WORKER_H - -#include -#include -#include "../include/thread_pool.h" -#include "../include/nodegit.h" - - -// Runs WorkComplete of the scheduled AsyncWorker, -// and destroys it. This is run in the uv_default_loop event loop. -NAN_INLINE void AsyncLibgit2Complete (void* data) { - Nan::AsyncWorker *worker = static_cast(data); - worker->WorkComplete(); - worker->Destroy(); -} - -// Runs Execute of the scheduled AyncWorker on the dedicated libgit2 thread / -// event loop, and schedules the WorkComplete callback to run on the -// uv_default_loop event loop -NAN_INLINE void AsyncLibgit2Execute (void *vworker) { - // execute the worker - Nan::AsyncWorker *worker = static_cast(vworker); - worker->Execute(); -} - -// Schedules the AsyncWorker to run on the dedicated libgit2 thread / event loop, -// and on completion AsyncLibgit2Complete on the default loop -NAN_INLINE void AsyncLibgit2QueueWorker (Nan::AsyncWorker* worker) { - libgit2ThreadPool.QueueWork(AsyncLibgit2Execute, AsyncLibgit2Complete, worker); -} - -#endif diff --git a/generate/templates/manual/include/async_worker.h b/generate/templates/manual/include/async_worker.h new file mode 100644 index 0000000000..b8f2909901 --- /dev/null +++ b/generate/templates/manual/include/async_worker.h @@ -0,0 +1,91 @@ +#ifndef NODEGIT_ASYNC_WORKER +#define NODEGIT_ASYNC_WORKER + +#include +#include +#include +#include +#include "lock_master.h" +#include "cleanup_handle.h" + +namespace nodegit { + class AsyncWorker : public Nan::AsyncWorker { + public: + AsyncWorker(Nan::Callback *callback, const char *resourceName, std::map> &cleanupHandles); + AsyncWorker(Nan::Callback *callback, const char *resourceName); + AsyncWorker(const AsyncWorker &) = delete; + AsyncWorker(AsyncWorker &&) = delete; + AsyncWorker &operator=(const AsyncWorker &) = delete; + AsyncWorker &operator=(AsyncWorker &&) = delete; + + // This must be implemented by every async worker + // so that the thread pool can lock separately + // from the execute method in the AsyncWorker + virtual nodegit::LockMaster AcquireLocks() = 0; + + // Ensure that the `HandleErrorCallback` will be called + // when the AsyncWork is complete + void Cancel(); + + // Retrieves the async resource attached to this AsyncWorker + // This is used to inform libgit2 callbacks what asyncResource + // they should use when working with any javascript + Nan::AsyncResource *GetAsyncResource(); + + Nan::Global *GetCallbackErrorHandle(); + + bool GetIsCancelled() const; + + void Destroy() override; + + void RegisterCleanupCall(std::function cleanupCall); + + template + void Reference(v8::Local item) { + if (item->IsFunction() || item->IsString() || item->IsNull() || item->IsUndefined()) { + return; + } + + auto objectWrapPointer = Nan::ObjectWrap::Unwrap(item.As()); + objectWrapPointer->Reference(); + RegisterCleanupCall([objectWrapPointer]() { + objectWrapPointer->Unreference(); + }); + } + + template + inline void Reference(const char *label, v8::Local item) { + SaveToPersistent(label, item); + Reference(item); + } + + template + inline void Reference(const char *label, v8::Local item) { + SaveToPersistent(label, item); + Reference(item); + } + + template + inline void Reference(const char *label, v8::Local array) { + SaveToPersistent(label, array); + for (uint32_t i = 0; i < array->Length(); ++i) { + Reference(Nan::Get(array, i).ToLocalChecked()); + } + } + + inline void Reference(const char *label, v8::Local item) { + SaveToPersistent(label, item); + } + + protected: + std::map> cleanupHandles; + Nan::Global callbackErrorHandle; + + private: + std::vector> cleanupCalls; + bool isCancelled = false; + + }; +} + +#endif diff --git a/generate/templates/manual/include/callback_wrapper.h b/generate/templates/manual/include/callback_wrapper.h index 0f655ed181..d50b976105 100644 --- a/generate/templates/manual/include/callback_wrapper.h +++ b/generate/templates/manual/include/callback_wrapper.h @@ -3,15 +3,16 @@ #include #include +#include using namespace v8; using namespace node; class CallbackWrapper { - Nan::Callback* jsCallback; + std::unique_ptr jsCallback; // throttling data, used for callbacks that need to be throttled - int throttle; // in milliseconds - if > 0, calls to the JS callback will be throttled + uint32_t throttle; // in milliseconds - if > 0, calls to the JS callback will be throttled uint64_t lastCallTime; // false will trigger the callback and not wait for the callback to finish @@ -20,29 +21,23 @@ class CallbackWrapper { bool waitForResult; public: - CallbackWrapper() { - jsCallback = NULL; - lastCallTime = 0; - throttle = 0; - } + CallbackWrapper(): jsCallback(nullptr), throttle(0), lastCallTime(0) {} - ~CallbackWrapper() { - SetCallback(NULL); - } + CallbackWrapper(const CallbackWrapper &) = delete; + CallbackWrapper(CallbackWrapper &&) = delete; + CallbackWrapper &operator=(const CallbackWrapper &) = delete; + CallbackWrapper &operator=(CallbackWrapper &&) = delete; bool HasCallback() { - return jsCallback != NULL; + return jsCallback != nullptr; } Nan::Callback* GetCallback() { - return jsCallback; + return jsCallback.get(); } - void SetCallback(Nan::Callback* callback, int throttle = 0, bool waitForResult = true) { - if(jsCallback) { - delete jsCallback; - } - jsCallback = callback; + void SetCallback(std::unique_ptr callback, uint32_t throttle = 0, bool waitForResult = true) { + jsCallback = std::move(callback); this->throttle = throttle; this->waitForResult = waitForResult; } diff --git a/generate/templates/manual/include/cleanup_handle.h b/generate/templates/manual/include/cleanup_handle.h new file mode 100644 index 0000000000..5eca8cf70d --- /dev/null +++ b/generate/templates/manual/include/cleanup_handle.h @@ -0,0 +1,21 @@ +#ifndef NODEGIT_CLEANUP_HANDLE_H +#define NODEGIT_CLEANUP_HANDLE_H + +#include +#include +#include + +namespace nodegit { + class CleanupHandle { + public: + CleanupHandle(); + virtual ~CleanupHandle(); + }; + + class FilterRegistryCleanupHandles : public CleanupHandle { + public: + std::map> registeredFilters; + }; +} + +#endif diff --git a/generate/templates/manual/include/configurable_class_wrapper.h b/generate/templates/manual/include/configurable_class_wrapper.h new file mode 100644 index 0000000000..ff83a3176d --- /dev/null +++ b/generate/templates/manual/include/configurable_class_wrapper.h @@ -0,0 +1,59 @@ +#ifndef CALLER_CONFIGURABLE_CLASS_WRAPPER_H +#define CALLER_CONFIGURABLE_CLASS_WRAPPER_H + +#include +#include +#include + +#include "cleanup_handle.h" + +namespace nodegit { + class Context; + + template + class ConfigurableClassWrapper : public CleanupHandle { + public: + typedef typename Traits::cType cType; + typedef typename Traits::configurableCppClass configurableCppClass; + + struct v8ConversionResult { + v8ConversionResult(std::string _error) + : error(std::move(_error)), result(nullptr) + {} + + v8ConversionResult(std::shared_ptr _result) + : result(std::move(_result)) + {} + + std::string error; + std::shared_ptr result; + }; + + // We copy the entity + ConfigurableClassWrapper(nodegit::Context *_nodeGitContext) + : nodegitContext(_nodeGitContext), raw(nullptr) {} + + ConfigurableClassWrapper(const ConfigurableClassWrapper &) = delete; + ConfigurableClassWrapper(ConfigurableClassWrapper &&) = delete; + ConfigurableClassWrapper &operator=(const ConfigurableClassWrapper &) = delete; + ConfigurableClassWrapper &operator=(ConfigurableClassWrapper &&) = delete; + + virtual ~ConfigurableClassWrapper() { + if (raw != nullptr) { + free(raw); + raw = nullptr; + } + } + + const Context *nodegitContext = nullptr; + cType *GetValue() { + return raw; + } + + protected: + cType *raw; + std::vector> childCleanupVector; + }; +} + +#endif diff --git a/generate/templates/manual/include/context.h b/generate/templates/manual/include/context.h new file mode 100644 index 0000000000..11e8b93f8a --- /dev/null +++ b/generate/templates/manual/include/context.h @@ -0,0 +1,90 @@ +#ifndef NODEGIT_CONTEXT +#define NODEGIT_CONTEXT + +#include +#include +#include +#include +#include +#include + +#include "async_worker.h" +#include "cleanup_handle.h" +#include "thread_pool.h" +#include "tracker_wrap.h" + +namespace nodegit { + class AsyncContextCleanupHandle; + class Context { + public: + Context(v8::Isolate *isolate); + Context(const Context &) = delete; + Context(Context &&) = delete; + Context &operator=(const Context &) = delete; + Context &operator=(Context &&) = delete; + + ~Context(); + + static Context *GetCurrentContext(); + + v8::Local GetFromPersistent(std::string key); + + void QueueWorker(nodegit::AsyncWorker *worker); + + void SaveToPersistent(std::string key, const v8::Local &value); + + void SaveCleanupHandle(std::string key, std::shared_ptr cleanupHandle); + + std::shared_ptr GetCleanupHandle(std::string key); + + std::shared_ptr RemoveCleanupHandle(std::string key); + + void ShutdownThreadPool(std::unique_ptr cleanupHandle); + + inline void LinkTrackerList(nodegit::TrackerWrap::TrackerList *list) { + list->Link(&trackerList); + } + + inline int TrackerListSize() { + return nodegit::TrackerWrap::SizeFromList(&trackerList); + } + + private: + v8::Isolate *isolate; + + ThreadPool threadPool; + + // This map contains persistent handles that need to be cleaned up + // after the context has been torn down. + // Often this is used as a context-aware storage cell for `*::InitializeComponent` + // to store function templates on them. + Nan::Global persistentStorage; + + std::map> cleanupHandles; + + nodegit::TrackerWrap::TrackerList trackerList; + + static std::map contexts; + }; + + class AsyncContextCleanupHandle { + public: + AsyncContextCleanupHandle(const AsyncContextCleanupHandle &) = delete; + AsyncContextCleanupHandle(AsyncContextCleanupHandle &&) = delete; + AsyncContextCleanupHandle &operator=(const AsyncContextCleanupHandle &) = delete; + AsyncContextCleanupHandle &operator=(AsyncContextCleanupHandle &&) = delete; + ~AsyncContextCleanupHandle(); + + private: + static void AsyncCleanupContext(void *data, void (*uvCallback)(void *), void *uvCallbackData); + + friend class Context; + AsyncContextCleanupHandle(v8::Isolate *isolate, Context *context); + Context *context; + node::AsyncCleanupHookHandle handle; + void (*doneCallback)(void *); + void *doneData; + }; +} + +#endif diff --git a/generate/templates/manual/include/convenient_hunk.h b/generate/templates/manual/include/convenient_hunk.h index 37e9ab1118..c45da7368f 100644 --- a/generate/templates/manual/include/convenient_hunk.h +++ b/generate/templates/manual/include/convenient_hunk.h @@ -5,6 +5,8 @@ #include #include "async_baton.h" +#include "async_worker.h" +#include "lock_master.h" #include "promise_completion.h" extern "C" { @@ -26,8 +28,7 @@ using namespace v8; class ConvenientHunk : public Nan::ObjectWrap { public: - static Nan::Persistent constructor_template; - static void InitializeComponent (v8::Local target); + static void InitializeComponent (v8::Local target, nodegit::Context *nodegitContext); static v8::Local New(void *raw); @@ -35,8 +36,15 @@ class ConvenientHunk : public Nan::ObjectWrap { char *GetHeader(); size_t GetSize(); + void Reference(); + void Unreference(); + private: ConvenientHunk(HunkData *hunk); + ConvenientHunk(const ConvenientHunk &) = delete; + ConvenientHunk(ConvenientHunk &&) = delete; + ConvenientHunk &operator=(const ConvenientHunk &) = delete; + ConvenientHunk &operator=(ConvenientHunk &&) = delete; ~ConvenientHunk(); HunkData *hunk; @@ -55,16 +63,22 @@ class ConvenientHunk : public Nan::ObjectWrap { HunkData *hunk; std::vector *lines; }; - class LinesWorker : public Nan::AsyncWorker { + class LinesWorker : public nodegit::AsyncWorker { public: LinesWorker( LinesBaton *_baton, Nan::Callback *callback - ) : Nan::AsyncWorker(callback) + ) : nodegit::AsyncWorker(callback, "nodegit:AsyncWorker:ConvenientHunk:Lines") , baton(_baton) {}; - ~LinesWorker() {}; + LinesWorker(const LinesWorker &) = delete; + LinesWorker(LinesWorker &&) = delete; + LinesWorker &operator=(const LinesWorker &) = delete; + LinesWorker &operator=(LinesWorker &&) = delete; + ~LinesWorker(){}; void Execute(); + void HandleErrorCallback(); void HandleOKCallback(); + nodegit::LockMaster AcquireLocks(); private: LinesBaton *baton; diff --git a/generate/templates/manual/include/convenient_patch.h b/generate/templates/manual/include/convenient_patch.h index 9d6921ef81..a894765694 100644 --- a/generate/templates/manual/include/convenient_patch.h +++ b/generate/templates/manual/include/convenient_patch.h @@ -5,6 +5,8 @@ #include #include "async_baton.h" +#include "async_worker.h" +#include "lock_master.h" #include "promise_completion.h" extern "C" { @@ -37,8 +39,12 @@ using namespace v8; class ConvenientPatch : public Nan::ObjectWrap { public: - static Nan::Persistent constructor_template; - static void InitializeComponent (v8::Local target); + ConvenientPatch(const ConvenientPatch &) = delete; + ConvenientPatch(ConvenientPatch &&) = delete; + ConvenientPatch &operator=(const ConvenientPatch &) = delete; + ConvenientPatch &operator=(ConvenientPatch &&) = delete; + + static void InitializeComponent(v8::Local target, nodegit::Context *nodegitContext); static v8::Local New(void *raw); @@ -49,6 +55,9 @@ class ConvenientPatch : public Nan::ObjectWrap { size_t GetNumHunks(); PatchData *GetValue(); + void Reference(); + void Unreference(); + private: ConvenientPatch(PatchData *raw); ~ConvenientPatch(); @@ -67,16 +76,22 @@ class ConvenientPatch : public Nan::ObjectWrap { PatchData *patch; std::vector *hunks; }; - class HunksWorker : public Nan::AsyncWorker { + class HunksWorker : public nodegit::AsyncWorker { public: HunksWorker( HunksBaton *_baton, Nan::Callback *callback - ) : Nan::AsyncWorker(callback) + ) : nodegit::AsyncWorker(callback, "nodegit:AsyncWorker:ConvenientPatch:Hunks") , baton(_baton) {}; - ~HunksWorker() {}; + HunksWorker(const HunksWorker &) = delete; + HunksWorker(HunksWorker &&) = delete; + HunksWorker &operator=(const HunksWorker &) = delete; + HunksWorker &operator=(HunksWorker &&) = delete; + ~HunksWorker(){}; void Execute(); + void HandleErrorCallback(); void HandleOKCallback(); + nodegit::LockMaster AcquireLocks(); private: HunksBaton *baton; diff --git a/generate/templates/manual/include/filter_registry.h b/generate/templates/manual/include/filter_registry.h index b75938218b..ca98d972e4 100644 --- a/generate/templates/manual/include/filter_registry.h +++ b/generate/templates/manual/include/filter_registry.h @@ -2,10 +2,13 @@ #define GITFILTERREGISTRY_H #include #include -#include #include #include "async_baton.h" +#include "async_worker.h" +#include "cleanup_handle.h" +#include "context.h" +#include "lock_master.h" #include "nodegit_wrapper.h" #include "promise_completion.h" @@ -23,12 +26,10 @@ using namespace v8; class GitFilterRegistry : public Nan::ObjectWrap { public: - static void InitializeComponent(v8::Local target); - - static Nan::Persistent persistentHandle; + static void InitializeComponent(v8::Local target, nodegit::Context *nodegitContext); private: - + static NAN_METHOD(GitFilterRegister); static NAN_METHOD(GitFilterUnregister); @@ -47,25 +48,37 @@ class GitFilterRegistry : public Nan::ObjectWrap { int error_code; }; - class RegisterWorker : public Nan::AsyncWorker { + class RegisterWorker : public nodegit::AsyncWorker { public: - RegisterWorker(FilterRegisterBaton *_baton, Nan::Callback *callback) - : Nan::AsyncWorker(callback), baton(_baton) {}; + RegisterWorker(FilterRegisterBaton *_baton, Nan::Callback *callback, std::map> &cleanupHandles) + : nodegit::AsyncWorker(callback, "nodegit:AsyncWorker:FilterRegistry:Register", cleanupHandles), baton(_baton) {}; + RegisterWorker(const RegisterWorker &) = delete; + RegisterWorker(RegisterWorker &&) = delete; + RegisterWorker &operator=(const RegisterWorker &) = delete; + RegisterWorker &operator=(RegisterWorker &&) = delete; ~RegisterWorker() {}; void Execute(); + void HandleErrorCallback(); void HandleOKCallback(); + nodegit::LockMaster AcquireLocks(); private: FilterRegisterBaton *baton; }; - class UnregisterWorker : public Nan::AsyncWorker { + class UnregisterWorker : public nodegit::AsyncWorker { public: - UnregisterWorker(FilterUnregisterBaton *_baton, Nan::Callback *callback) - : Nan::AsyncWorker(callback), baton(_baton) {}; + UnregisterWorker(FilterUnregisterBaton *_baton, Nan::Callback *callback) + : nodegit::AsyncWorker(callback, "nodegit:AsyncWorker:FilterRegistry:Unregister"), baton(_baton) {}; + UnregisterWorker(const UnregisterWorker &) = delete; + UnregisterWorker(UnregisterWorker &&) = delete; + UnregisterWorker &operator=(const UnregisterWorker &) = delete; + UnregisterWorker &operator=(UnregisterWorker &&) = delete; ~UnregisterWorker() {}; void Execute(); + void HandleErrorCallback(); void HandleOKCallback(); + nodegit::LockMaster AcquireLocks(); private: FilterUnregisterBaton *baton; diff --git a/generate/templates/manual/include/git_buf_converter.h b/generate/templates/manual/include/git_buf_converter.h index fcbd1eaba7..5671246298 100644 --- a/generate/templates/manual/include/git_buf_converter.h +++ b/generate/templates/manual/include/git_buf_converter.h @@ -4,13 +4,13 @@ #include #include "nan.h" -#include "git2/strarray.h" +#include "git2/buffer.h" using namespace v8; -class StrArrayConverter { +class GitBufConverter { public: - static git_strarray *Convert (v8::Local val); + static git_buf *Convert(v8::Local val); }; #endif diff --git a/generate/templates/manual/include/lock_master.h b/generate/templates/manual/include/lock_master.h index fde38825b7..0cd313b60d 100644 --- a/generate/templates/manual/include/lock_master.h +++ b/generate/templates/manual/include/lock_master.h @@ -3,199 +3,180 @@ #include -class LockMasterImpl; - -class LockMaster { -public: - enum Status { - Disabled = 0, - EnabledForAsyncOnly, - Enabled - }; - -private: - static Status status; - - LockMasterImpl *impl; - - template - void AddLocks(const T *t) { - // by default, don't lock anything - } +namespace nodegit { + class LockMasterImpl; - // base case for variadic template unwinding - void AddParameters() { - } + class LockMaster { + private: + LockMasterImpl *impl; - // processes a single parameter, then calls recursively on the rest - template - void AddParameters(const T *t, const Types*... args) { - if(t) { - AddLocks(t); + template + void AddLocks(const T *t) { + // by default, don't lock anything } - AddParameters(args...); - } - void ConstructorImpl(); - void DestructorImpl(); - void ObjectToLock(const void *); - void ObjectsToLockAdded(); -public: - - // we lock on construction - template LockMaster(bool asyncAction, const Types*... types) { - if((status == Disabled) || ((status == EnabledForAsyncOnly) && !asyncAction)) { - impl = NULL; - return; + // base case for variadic template unwinding + void AddParameters() { } - ConstructorImpl(); - AddParameters(types...); - ObjectsToLockAdded(); - } - - // and unlock on destruction - ~LockMaster() { - if(!impl) { - return; + // processes a single parameter, then calls recursively on the rest + template + void AddParameters(const T *t, const Types*... args) { + if(t) { + AddLocks(t); + } + AddParameters(args...); } - DestructorImpl(); - } - - // TemporaryUnlock unlocks the LockMaster currently registered on the thread, - // and re-locks it on destruction. - class TemporaryUnlock { - LockMasterImpl *impl; void ConstructorImpl(); void DestructorImpl(); + void ObjectToLock(const void *); + void ObjectsToLockAdded(); public: - TemporaryUnlock() { - // We can't return here if disabled - // It's possible that a LockMaster was fully constructed and registered - // before the thread safety was disabled. - // So we rely on ConstructorImpl to abort if there is no registered LockMaster + + // we lock on construction + template LockMaster(bool asyncAction, const Types*... types) { + if(!asyncAction) { + impl = nullptr; + return; + } + ConstructorImpl(); + AddParameters(types...); + ObjectsToLockAdded(); } - ~TemporaryUnlock() { + + // we don't want this object to be copyable, there can only be one lock holder + LockMaster(const LockMaster &other) = delete; + + LockMaster &operator=(const LockMaster &other) = delete; + + // expose a move constructor so that LockMaster can be returned + LockMaster(LockMaster &&other); + + LockMaster &operator=(LockMaster &&other); + + // and unlock on destruction + ~LockMaster() { if(!impl) { return; } DestructorImpl(); } - }; - static void Initialize(); + // TemporaryUnlock unlocks the LockMaster currently registered on the thread, + // and re-locks it on destruction. + class TemporaryUnlock { + LockMasterImpl *impl; + + void ConstructorImpl(); + void DestructorImpl(); + public: + TemporaryUnlock() { + // We can't return here if disabled + // It's possible that a LockMaster was fully constructed and registered + // before the thread safety was disabled. + // So we rely on ConstructorImpl to abort if there is no registered LockMaster + ConstructorImpl(); + } + TemporaryUnlock(const TemporaryUnlock &) = delete; + TemporaryUnlock(TemporaryUnlock &&) = delete; + TemporaryUnlock &operator=(const TemporaryUnlock &) = delete; + TemporaryUnlock &operator=(TemporaryUnlock &&) = delete; + ~TemporaryUnlock() { + if(!impl) { + return; + } + DestructorImpl(); + } + }; - // Enables the thread safety system - static void Enable() { - status = Enabled; - } + static void InitializeGlobal(); + static void InitializeContext(); + }; - static void SetStatus(Status status) { - LockMaster::status = status; - } - static void Disable() { - status = Disabled; + template<> inline void LockMaster::AddLocks(const git_repository *repo) { + // when using a repo, lock the repo + ObjectToLock(repo); } - static Status GetStatus() { - return status; + template<> inline void LockMaster::AddLocks(const git_index *index) { + // when using an index, lock the repo, or if there isn't one lock the index + const void *owner = git_index_owner(index); + if(!owner) { + owner = index; + } + ObjectToLock(owner); } - // Diagnostic information that can be provided to the JavaScript layer - // for a minimal level of testing - struct Diagnostics { - // this counts all stored mutexes - even if they are unlocked: - int storedMutexesCount; - }; - - static Diagnostics GetDiagnostics(); -}; - - -template<> inline void LockMaster::AddLocks(const git_repository *repo) { - // when using a repo, lock the repo - ObjectToLock(repo); -} - -template<> inline void LockMaster::AddLocks(const git_index *index) { - // when using an index, lock the repo, or if there isn't one lock the index - const void *owner = git_index_owner(index); - if(!owner) { - owner = index; + template<> inline void LockMaster::AddLocks(const git_commit *commit) { + // when using a commit, lock the repo + const void *owner = git_commit_owner(commit); + ObjectToLock(owner); } - ObjectToLock(owner); -} -template<> inline void LockMaster::AddLocks(const git_commit *commit) { - // when using a commit, lock the repo - const void *owner = git_commit_owner(commit); - ObjectToLock(owner); + // ... more locking rules would go here. According to an analysis of idefs.json, + // the following types are passed as non-const * and may require locking + // (some likely, some probably not): + // 'git_annotated_commit', + // 'git_blame_options', + // 'git_blob', + // 'git_buf', + // 'git_checkout_options', + // 'git_cherrypick_options', + // 'git_clone_options', + // 'git_commit', + // 'git_config', + // 'git_diff', + // 'git_diff_perfdata', + // 'git_error', + // 'git_fetch_options', + // 'git_fetch_options', + // 'git_filter', + // 'git_filter_list', + // 'git_hashsig', + // 'git_index', + // 'git_merge_file_input', + // 'git_merge_options', + // 'git_merge_options', + // 'git_note', + // 'git_note_iterator', + // 'git_object', + // 'git_odb', + // 'git_odb_object', + // 'git_oid', + // 'git_oidarray', + // 'git_packbuilder', + // 'git_patch', + // 'git_pathspec', + // 'git_push_options', + // 'git_rebase', + // 'git_rebase_options', + // 'git_refdb', + // 'git_reference', + // 'git_reflog', + // 'git_remote', + // 'git_remote_callbacks', + // 'git_remote_callbacks', + // 'git_repository', + // 'git_repository_init_options', + // 'git_revwalk', + // 'git_signature', + // 'git_stash_apply_options', + // 'git_status_list', + // 'git_strarray', + // 'git_submodule', + // 'git_submodule_update_options', + // 'git_tag', + // 'git_transfer_progress', + // 'git_transport', + // 'git_tree', + // 'git_treebuilder', + // 'git_writestream' + // + // Other types are always passed as const * and perhaps don't require locking + // (it's not a guarantee though) } -// ... more locking rules would go here. According to an analysis of idefs.json, -// the following types are passed as non-const * and may require locking -// (some likely, some probably not): -// 'git_annotated_commit', -// 'git_blame_options', -// 'git_blob', -// 'git_buf', -// 'git_checkout_options', -// 'git_cherrypick_options', -// 'git_clone_options', -// 'git_commit', -// 'git_config', -// 'git_diff', -// 'git_diff_perfdata', -// 'git_error', -// 'git_fetch_options', -// 'git_fetch_options', -// 'git_filter', -// 'git_filter_list', -// 'git_hashsig', -// 'git_index', -// 'git_merge_file_input', -// 'git_merge_options', -// 'git_merge_options', -// 'git_note', -// 'git_note_iterator', -// 'git_object', -// 'git_odb', -// 'git_odb_object', -// 'git_oid', -// 'git_oidarray', -// 'git_packbuilder', -// 'git_patch', -// 'git_pathspec', -// 'git_push_options', -// 'git_rebase', -// 'git_rebase_options', -// 'git_refdb', -// 'git_reference', -// 'git_reflog', -// 'git_remote', -// 'git_remote_callbacks', -// 'git_remote_callbacks', -// 'git_repository', -// 'git_repository_init_options', -// 'git_revwalk', -// 'git_signature', -// 'git_stash_apply_options', -// 'git_status_list', -// 'git_strarray', -// 'git_submodule', -// 'git_submodule_update_options', -// 'git_tag', -// 'git_transfer_progress', -// 'git_transport', -// 'git_tree', -// 'git_treebuilder', -// 'git_writestream' -// -// Other types are always passed as const * and perhaps don't require locking -// (it's not a guarantee though) - - #endif diff --git a/generate/templates/manual/include/nodegit.h b/generate/templates/manual/include/nodegit.h index a9cef2950a..bab3e4179b 100644 --- a/generate/templates/manual/include/nodegit.h +++ b/generate/templates/manual/include/nodegit.h @@ -1,10 +1,6 @@ #ifndef NODEGIT_H #define NODEGIT_H -#include "thread_pool.h" - -extern ThreadPool libgit2ThreadPool; - v8::Local GetPrivate(v8::Local object, v8::Local key); diff --git a/generate/templates/manual/include/nodegit_wrapper.h b/generate/templates/manual/include/nodegit_wrapper.h index ea5277a501..c72f29027d 100644 --- a/generate/templates/manual/include/nodegit_wrapper.h +++ b/generate/templates/manual/include/nodegit_wrapper.h @@ -1,7 +1,11 @@ #ifndef NODEGIT_WRAPPER_H #define NODEGIT_WRAPPER_H -#include +#include +#include + +#include "tracker_wrap.h" +#include "cleanup_handle.h" // the Traits template parameter supplies: // typename cppClass - the C++ type of the NodeGit wrapper (e.g. GitRepository) @@ -12,9 +16,16 @@ // // static const bool isFreeable // static void free(cType *raw) - frees the object using freeFunctionName +// +// nodegit::TrackerWrap allows for cheap tracking of new objects, avoiding searchs +// in a container to remove the tracking of a specific object. + +namespace nodegit { + class Context; +} template -class NodeGitWrapper : public Nan::ObjectWrap { +class NodeGitWrapper : public nodegit::TrackerWrap { public: // replicate Traits typedefs for ease of use typedef typename Traits::cType cType; @@ -28,25 +39,31 @@ class NodeGitWrapper : public Nan::ObjectWrap { // (and through a method) instead of changing selfFreeing, but that's // a separate issue. bool selfFreeing; + + nodegit::Context *nodegitContext = nullptr; + protected: cType *raw; + std::vector> childCleanupVector; // owner of the object, in the memory management sense. only populated // when using ownedByThis, and the type doesn't have a dupFunction // CopyablePersistentTraits are used to get the reset-on-destruct behavior. Nan::Persistent > owner; - static Nan::Persistent constructor_template; - // diagnostic count of self-freeing object instances - static int SelfFreeingInstanceCount; + thread_local static int SelfFreeingInstanceCount; // diagnostic count of constructed non-self-freeing object instances - static int NonSelfFreeingConstructedCount; + thread_local static int NonSelfFreeingConstructedCount; static void InitializeTemplate(v8::Local &tpl); NodeGitWrapper(cType *raw, bool selfFreeing, v8::Local owner); NodeGitWrapper(const char *error); // calls ThrowError + NodeGitWrapper(const NodeGitWrapper &) = delete; + NodeGitWrapper(NodeGitWrapper &&) = delete; + NodeGitWrapper &operator=(const NodeGitWrapper &) = delete; + NodeGitWrapper &operator=(NodeGitWrapper &&) = delete; ~NodeGitWrapper(); static NAN_METHOD(JSNewFunction); @@ -54,11 +71,24 @@ class NodeGitWrapper : public Nan::ObjectWrap { static NAN_METHOD(GetSelfFreeingInstanceCount); static NAN_METHOD(GetNonSelfFreeingConstructedCount); + void SetNativeOwners(v8::Local owners); + public: static v8::Local New(const cType *raw, bool selfFreeing, v8::Local owner = v8::Local()); + void SaveCleanupHandle(std::shared_ptr cleanupHandle); + + void Reference(); + void Unreference(); + + void AddReferenceCallbacks(size_t, std::function, std::function); + cType *GetValue(); void ClearValue(); + +private: + std::unordered_map> referenceCallbacks; + std::unordered_map> unreferenceCallbacks; }; #endif diff --git a/generate/templates/manual/include/promise_completion.h b/generate/templates/manual/include/promise_completion.h index 600fc06178..da933b7de3 100644 --- a/generate/templates/manual/include/promise_completion.h +++ b/generate/templates/manual/include/promise_completion.h @@ -4,6 +4,7 @@ #include #include "async_baton.h" +#include "context.h" // PromiseCompletion forwards either the resolved result or the rejection reason // to the native layer, once the promise completes @@ -14,33 +15,28 @@ class PromiseCompletion : public Nan::ObjectWrap { // callback type called when a promise completes - typedef void (*Callback) (bool isFulfilled, AsyncBaton *baton, v8::Local resultOfPromise); + typedef void (*Callback) (bool isFulfilled, nodegit::AsyncBaton *baton, v8::Local resultOfPromise); static NAN_METHOD(New); static NAN_METHOD(PromiseFulfilled); static NAN_METHOD(PromiseRejected); - // persistent handles for NAN_METHODs - static Nan::Persistent newFn; - static Nan::Persistent promiseFulfilled; - static Nan::Persistent promiseRejected; - - static v8::Local Bind(Nan::Persistent &method, v8::Local object); + static v8::Local Bind(v8::Local method, v8::Local object); static void CallCallback(bool isFulfilled, const Nan::FunctionCallbackInfo &info); // callback and baton stored for the promise that this PromiseCompletion is // attached to. when the promise completes, the callback will be called with // the result, and the stored baton. Callback callback; - AsyncBaton *baton; + nodegit::AsyncBaton *baton; - void Setup(v8::Local thenFn, v8::Local result, AsyncBaton *baton, Callback callback); + void Setup(v8::Local thenFn, v8::Local result, nodegit::AsyncBaton *baton, Callback callback); public: // If result is a promise, this will instantiate a new PromiseCompletion // and have it forward the promise result / reason via the baton and callback - static bool ForwardIfPromise(v8::Local result, AsyncBaton *baton, Callback callback); + static bool ForwardIfPromise(v8::Local result, nodegit::AsyncBaton *baton, Callback callback); - static void InitializeComponent(); + static void InitializeComponent(nodegit::Context *nodegitContext); }; #endif diff --git a/generate/templates/manual/include/reference_counter.h b/generate/templates/manual/include/reference_counter.h new file mode 100644 index 0000000000..2afa2310c7 --- /dev/null +++ b/generate/templates/manual/include/reference_counter.h @@ -0,0 +1,30 @@ +#ifndef REFERENCE_COUNTER_H +#define REFERENCE_COUNTER_H + +#include + +#include "lock_master.h" + +// There are certain instances in libgit2 which can be retrieved from multiple sources +// We need to make sure that we're counting how many times we've seen that pointer +// so that when we are performing free behavior, we don't free it until it is no longer +// referenced. The main example of this behavior is the repository instance, where +// after git_repository_open open (first instance) we can git_commit_lookup, followed by +// git_commit_owner (second instance). +// +// I was hoping that we could construct a Persistent handle, but that would interfere with +// GC. We want it to attmept to GC, and if this handle exists, the final repo will not +// free itself :(. +// +// Make sure to utilize LockMaster when incrementing or decrementing a reference count. +class ReferenceCounter { +public: + static void incrementCountForPointer(void *ptr); + + static unsigned long decrementCountForPointer(void *ptr); + +private: + static std::unordered_map referenceCountByPointer; +}; + +#endif diff --git a/generate/templates/manual/include/str_array_converter.h b/generate/templates/manual/include/str_array_converter.h index 37f1bcc1dc..d5edd61872 100644 --- a/generate/templates/manual/include/str_array_converter.h +++ b/generate/templates/manual/include/str_array_converter.h @@ -12,10 +12,12 @@ class StrArrayConverter { public: static git_strarray *Convert (v8::Local val); + static void ConvertInto(git_strarray *out, v8::Local val); + static void ConvertInto(git_strarray *out, v8::Local val); private: - static git_strarray *ConvertArray(Array *val); - static git_strarray *ConvertString(v8::Local val); + static git_strarray *ConvertArray(v8::Local val); + static git_strarray *ConvertString(v8::Local val); static git_strarray *AllocStrArray(const size_t count); static git_strarray *ConstructStrArray(int argc, char** argv); }; diff --git a/generate/templates/manual/include/thread_pool.h b/generate/templates/manual/include/thread_pool.h index 8a346028df..4653e80795 100644 --- a/generate/templates/manual/include/thread_pool.h +++ b/generate/templates/manual/include/thread_pool.h @@ -1,63 +1,84 @@ #ifndef THREAD_POOL_H #define THREAD_POOL_H +#include +#include +#include #include -#include -class ThreadPool { -public: - typedef void (*Callback) (void *); +#include "async_worker.h" -private: - struct Work { - Callback workCallback; - Callback completionCallback; - void *data; +// Temporary workaround for LFS checkout. Comment added to be reverted. +// With the threadpool rewrite, a Worker will execute its callbacks with +// objects temporary unlock (to prevent deadlocks), and we'll wait until +// the callback is done to lock them back again (to make sure it's thread-safe). +// LFS checkout lost performance after this, and the proper way to fix it is +// to integrate nodegit-lfs into nodegit. Until this is implemented, a +// temporary workaround has been applied, which affects only Workers leveraging +// threaded libgit2 functions (at the moment only checkout) and does the +// following: +// - do not wait for the current callback to end, so that it can send the +// next callback to the main JS thread. +// - do not temporary unlock the objects, since they would be locked back +// again before the callback is executed. - Work(Callback workCallback, Callback completionCallback, void *data) - : workCallback(workCallback), completionCallback(completionCallback), data(data) { - } - }; +namespace nodegit { + class Context; + class AsyncContextCleanupHandle; + class ThreadPoolImpl; - struct LoopCallback { - Callback callback; - void *data; - bool isWork; + class ThreadPool { + public: + typedef std::function Callback; + typedef std::function QueueCallbackFn; + // Temporary workaround for LFS checkout. Code modified to be reverted. + // typedef std::function OnPostCallbackFn; + typedef std::function OnPostCallbackFn; - LoopCallback(Callback callback, void *data, bool isWork) - : callback(callback), data(data), isWork(isWork) { - } - }; + // Initializes thread pool and spins up the requested number of threads + // The provided loop will be used for completion callbacks, whenever + // queued work is completed + ThreadPool(int numberOfThreads, uv_loop_t *loop, nodegit::Context *context); + + ThreadPool(const ThreadPool &) = delete; + ThreadPool(ThreadPool &&) = delete; + ThreadPool &operator=(const ThreadPool &) = delete; + ThreadPool &operator=(ThreadPool &&) = delete; + + ~ThreadPool(); + + // Queues work on the thread pool, followed by completion call scheduled + // on the loop provided in the constructor. + // QueueWork should be called on the loop provided in the constructor. + void QueueWorker(nodegit::AsyncWorker *worker); + + // When an AsyncWorker is being executed, the threads involved in executing + // will ensure that this is set to the AsyncResource belonging to the AsyncWorker. + // This ensures that any callbacks from libgit2 take the correct AsyncResource + // when scheduling work on the JS thread. + static Nan::AsyncResource *GetCurrentAsyncResource(); - // work to be performed on the threadpool - std::queue workQueue; - uv_mutex_t workMutex; - uv_sem_t workSemaphore; - int workInProgressCount; - - // completion and async callbacks to be performed on the loop - std::queue loopQueue; - uv_mutex_t loopMutex; - uv_async_t loopAsync; - - static void RunEventQueue(void *threadPool); - void RunEventQueue(); - static void RunLoopCallbacks(uv_async_t* handle); - void RunLoopCallbacks(); - - void QueueLoopCallback(Callback callback, void *data, bool isWork); - -public: - // Initializes thread pool and spins up the requested number of threads - // The provided loop will be used for completion callbacks, whenever - // queued work is completed - ThreadPool(int numberOfThreads, uv_loop_t *loop); - // Queues work on the thread pool, followed by completion call scheduled - // on the loop provided in the constructor. - // QueueWork should be called on the loop provided in the constructor. - void QueueWork(Callback workCallback, Callback completionCallback, void *data); - // Queues a callback on the loop provided in the constructor - void ExecuteReverseCallback(Callback reverseCallback, void *data); -}; + // Same as GetCurrentAsyncResource, except used to ensure callbacks occur + // in the correct context. + static const nodegit::Context *GetCurrentContext(); + + // Same as GetCurrentAsyncResource, except used for callbacks to store errors + // for use after completion of async work + static Nan::Global *GetCurrentCallbackErrorHandle(); + + // Queues a callback on the loop provided in the constructor + static void PostCallbackEvent(OnPostCallbackFn onPostCallback); + + // Called once at libgit2 initialization to setup contracts with libgit2 + static void InitializeGlobal(); + + // Will asynchronously shutdown the thread pool + // It will also clean up any resources that the thread pool is keeping alive + void Shutdown(std::unique_ptr cleanupHandle); + + private: + std::unique_ptr impl; + }; +} #endif diff --git a/generate/templates/manual/include/tracker_wrap.h b/generate/templates/manual/include/tracker_wrap.h new file mode 100644 index 0000000000..3b15eba424 --- /dev/null +++ b/generate/templates/manual/include/tracker_wrap.h @@ -0,0 +1,76 @@ +#ifndef TRACKERWRAP_H +#define TRACKERWRAP_H + +#include +#include +#include + +namespace nodegit { + // Base class used to track wrapped objects, so that we can + // free the objects that were not freed at the time of context + // closing (because their WeakCallback didn't trigger. See + // https://github.com/nodejs/help/issues/3297). + // Implementation based on node.js's class RefTracker (napi). + class TrackerWrap : public Nan::ObjectWrap { + public: + TrackerWrap() = default; + virtual ~TrackerWrap() = default; + TrackerWrap(const TrackerWrap &other) = delete; + TrackerWrap(TrackerWrap &&other) = delete; + TrackerWrap& operator=(const TrackerWrap &other) = delete; + TrackerWrap& operator=(TrackerWrap &&other) = delete; + + // aliases: + // 'TrackerList': used in functionality related to a list. + // 'TrackerWrap' used in functionality not related to a list. + using TrackerList = TrackerWrap; + + // Links 'this' right after 'listStart' + inline void Link(TrackerList* listStart) { + m_prev = listStart; + m_next = listStart->m_next; + if (m_next != nullptr) { + m_next->m_prev = this; + } + listStart->m_next = this; + } + + // Unlinks itself from the list it's linked to + inline TrackerWrap* Unlink() { + if (m_prev != nullptr) { + m_prev->m_next = m_next; + } + if (m_next != nullptr) { + m_next->m_prev = m_prev; + } + m_prev = nullptr; + m_next = nullptr; + return this; + } + + inline void SetTrackerWrapOwners(std::unique_ptr< std::vector > &&owners) { + m_owners = std::move(owners); + } + + inline const std::vector* GetTrackerWrapOwners() const { + return m_owners.get(); + } + + // Unlinks and returns the first item of 'listStart' + static TrackerWrap* UnlinkFirst(TrackerList *listStart); + + // Returns number of items following 'listStart' + static int SizeFromList(TrackerList *listStart); + + // Deletes items following 'listStart', but not 'listStart' itself + static void DeleteFromList(TrackerList *listStart); + + private: + TrackerList* m_next {}; + TrackerList* m_prev {}; + // m_owners will store pointers to native objects + std::unique_ptr< std::vector > m_owners {}; + }; +} + +#endif diff --git a/generate/templates/manual/include/v8_helpers.h b/generate/templates/manual/include/v8_helpers.h new file mode 100644 index 0000000000..184b8d31b1 --- /dev/null +++ b/generate/templates/manual/include/v8_helpers.h @@ -0,0 +1,10 @@ +#ifndef NODEGIT_V8_HELPERS_H +#define NODEGIT_V8_HELPERS_H + +#include + +namespace nodegit { + v8::Local safeGetField(v8::Local &containerObj, std::string fieldName); +} + +#endif diff --git a/generate/templates/manual/include/worker_pool.h b/generate/templates/manual/include/worker_pool.h new file mode 100644 index 0000000000..3380c87060 --- /dev/null +++ b/generate/templates/manual/include/worker_pool.h @@ -0,0 +1,180 @@ +#ifndef WORK_POOL_H +#define WORK_POOL_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * \class WorkItem + * Abstract class for work items in the WorkerPool. + */ +class WorkItem +{ +public: + WorkItem() = default; + virtual ~WorkItem() = default; + WorkItem(const WorkItem &other) = default; + WorkItem(WorkItem &&other) = default; + WorkItem& operator=(const WorkItem &other) = default; + WorkItem& operator=(WorkItem &&other) = default; +}; + +/** + * \class Worker + * Interface for Workers in the WorkerPool. + */ +class IWorker +{ +public: + IWorker() = default; + virtual ~IWorker() = default; + IWorker(const IWorker &other) = delete; + IWorker(IWorker &&other) = delete; + IWorker& operator=(const IWorker &other) = delete; + IWorker& operator=(IWorker &&other) = delete; + + virtual bool Initialize() = 0; + virtual bool Execute(std::unique_ptr &&work) = 0; +}; + +/* Enumeration describing the Worker Pool Status: +* - kOk: everything ok. +* - kInitializeFailed: a worker thread failed when calling Initialize(). +* - kExecuteFailed: a worker thread failed when calling Execute(). +* - kShutdownEarly: InsertWork() was called but the worker pool was stopped. +*/ +enum class WPStatus {kOk, kInitializeFailed, kExecuteFailed, kShutdownEarly}; + +/** + * \class WorkerPool + * To leverage this class, a Worker must inherit from IWorker. + * WorkItem is an abstract class from which to inherit too. + */ +template +class WorkerPool { +public: + WorkerPool(); + ~WorkerPool() = default; + WorkerPool(const WorkerPool &other) = delete; + WorkerPool(WorkerPool &&other) = delete; + WorkerPool& operator=(const WorkerPool &other) = delete; + WorkerPool& operator=(WorkerPool &&other) = delete; + + void Init(std::vector< std::shared_ptr > workers); + void InsertWork(std::unique_ptr &&work); + void Shutdown(); + WPStatus Status() { return m_atomicWPStatus; } + +private: + void DoWork(std::shared_ptr worker); + + std::mutex m_mutex {}; // locks m_workQueue and m_stop + std::condition_variable m_condition {}; + std::queue< std::unique_ptr > m_workQueue {}; + bool m_stop {true}; // initially the workpool has no worker threads + std::vector> m_threads {}; + std::atomic m_atomicWPStatus {WPStatus::kOk}; +}; + + +template +WorkerPool::WorkerPool() { + static_assert(std::is_base_of::value, "Worker must inherit from IWorker"); +} + +// launches the worker threads, if they hadn't been launched already +template +void WorkerPool::Init(std::vector< std::shared_ptr > workers) +{ + { + std::lock_guard lock(m_mutex); + if (!m_stop) + return; + m_stop = false; + } + + std::for_each (workers.begin(), workers.end(), [this](std::shared_ptr worker) { + m_threads.emplace_back(std::make_unique(std::bind(&WorkerPool::DoWork, this, worker))); + }); +} + +// queues work, or sets WPStatus::kShutdownEarly +template +void WorkerPool::InsertWork(std::unique_ptr &&work) +{ + { + std::lock_guard lock(m_mutex); + if (m_stop) { + m_atomicWPStatus = WPStatus::kShutdownEarly; + return; + } + m_workQueue.emplace(std::move(work)); + } + m_condition.notify_one(); +} + +template +void WorkerPool::Shutdown() +{ + { + std::lock_guard lock(m_mutex); + if (m_stop) { + return; + } + m_stop = true; + } + m_condition.notify_all(); + + std::for_each (m_threads.begin(), m_threads.end(), [](std::unique_ptr &wt) { + if (wt->joinable()) { + wt->join(); + } + }); +} + +template +void WorkerPool::DoWork(std::shared_ptr worker) +{ + if (!worker->Initialize()) { + m_atomicWPStatus = WPStatus::kInitializeFailed; + return; + } + + while (true) { + std::unique_ptr work {}; + { + std::unique_lock lock(m_mutex); + m_condition.wait(lock, [this] { + return this->m_stop || !this->m_workQueue.empty(); + }); + + // stop all workers if any of them failed on Initialize() or Execute() + // or the workerPool shutdown early + if (Status() != WPStatus::kOk) { + return; + } + + if (m_stop && m_workQueue.empty()) { + return; + } + + work = std::move(m_workQueue.front()); + m_workQueue.pop(); + } + + if (!worker->Execute(std::move(work))) { + m_atomicWPStatus = WPStatus::kExecuteFailed; + return; + } + } +} + +#endif // WORK_POOL_H + diff --git a/generate/templates/manual/include/wrapper.h b/generate/templates/manual/include/wrapper.h index 9dcbe31863..f24ce800ba 100644 --- a/generate/templates/manual/include/wrapper.h +++ b/generate/templates/manual/include/wrapper.h @@ -9,15 +9,14 @@ #include #include "nan.h" +#include "context.h" using namespace node; using namespace v8; class Wrapper : public Nan::ObjectWrap { public: - - static Nan::Persistent constructor_template; - static void InitializeComponent (v8::Local target); + static void InitializeComponent (v8::Local target, nodegit::Context *nodegitContext); void *GetValue(); static v8::Local New(const void *raw); diff --git a/generate/templates/manual/libgit2/opts.cc b/generate/templates/manual/libgit2/opts.cc new file mode 100644 index 0000000000..5829adc6cd --- /dev/null +++ b/generate/templates/manual/libgit2/opts.cc @@ -0,0 +1,117 @@ +NAN_METHOD(GitLibgit2::Opts) +{ + Nan::EscapableHandleScope scope; + + if (info.Length() == 0 || !info[0]->IsNumber()) { + return Nan::ThrowError("Number option is required."); + } + + const int from_option = (int)info[0].As()->Value(); + + git_error_clear(); + + v8::Local to = Nan::Undefined(); + switch (from_option) { + // GET size_t + case GIT_OPT_GET_MWINDOW_SIZE: + case GIT_OPT_GET_MWINDOW_MAPPED_LIMIT: + case GIT_OPT_GET_PACK_MAX_OBJECTS: { + size_t option_value; + if (git_libgit2_opts(from_option, &option_value)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + to = Nan::New(option_value); + break; + } + // GET int + case GIT_OPT_GET_OWNER_VALIDATION: { + int option_value; + if (git_libgit2_opts(from_option, &option_value)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + to = Nan::New(option_value); + break; + } + // GET unsigned long + case GIT_OPT_GET_WINDOWS_SHAREMODE: { + unsigned long option_value; + if (git_libgit2_opts(from_option, &option_value)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + to = Nan::New(option_value); + break; + } + // GET ssize_t + case GIT_OPT_GET_CACHED_MEMORY: { + ssize_t option_value; + if (git_libgit2_opts(from_option, &option_value)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + to = Nan::New(option_value); + break; + } + // GET git_buf + case GIT_OPT_GET_TEMPLATE_PATH: + case GIT_OPT_GET_USER_AGENT: { + git_buf option_value = { 0 }; + if (git_libgit2_opts(from_option, &option_value)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + to = Nan::New(option_value.ptr, option_value.size) + .ToLocalChecked(); + git_buf_dispose(&option_value); + break; + } + case GIT_OPT_GET_SEARCH_PATH: { + git_buf option_value = { 0 }; + if (info.Length() < 2 || !info[1]->IsNumber()) { + return Nan::ThrowError("Number option is required."); + } + const int level = (int)info[1].As()->Value(); + if (git_libgit2_opts(from_option, level, &option_value)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + to = Nan::New(option_value.ptr, option_value.size) + .ToLocalChecked(); + git_buf_dispose(&option_value); + break; + } + // SET int + case GIT_OPT_ENABLE_CACHING: + case GIT_OPT_ENABLE_STRICT_OBJECT_CREATION: + case GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION: + case GIT_OPT_ENABLE_OFS_DELTA: + case GIT_OPT_ENABLE_FSYNC_GITDIR: + case GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION: + case GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY: + case GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS: + case GIT_OPT_SET_OWNER_VALIDATION: { + if (info.Length() < 2 || !info[1]->IsNumber()) { + return Nan::ThrowError("Number option is required."); + } + const int option_arg = (int)info[1].As()->Value(); + if (git_libgit2_opts(from_option, option_arg)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + break; + } + // SET size_t + case GIT_OPT_SET_MWINDOW_SIZE: + case GIT_OPT_SET_MWINDOW_MAPPED_LIMIT: + case GIT_OPT_SET_PACK_MAX_OBJECTS: { + if (info.Length() < 2 || !info[1]->IsNumber()) { + return Nan::ThrowError("Number option is required."); + } + const size_t option_arg = (size_t)info[1].As()->Value(); + if (git_libgit2_opts(from_option, option_arg)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + break; + } + default: { + return Nan::ThrowError("Unsupported option"); + } + } + + return info.GetReturnValue().Set(scope.Escape(to)); +} diff --git a/generate/templates/manual/patches/convenient_patches.cc b/generate/templates/manual/patches/convenient_patches.cc index 27de54fcf9..8873fe07c8 100644 --- a/generate/templates/manual/patches/convenient_patches.cc +++ b/generate/templates/manual/patches/convenient_patches.cc @@ -3,36 +3,89 @@ NAN_METHOD(GitPatch::ConvenientFromDiff) { return Nan::ThrowError("Diff diff is required."); } - if (info.Length() == 1 || !info[1]->IsFunction()) { + if (!info[info.Length() - 1]->IsFunction()) { return Nan::ThrowError("Callback is required and must be a Function."); } - ConvenientFromDiffBaton *baton = new ConvenientFromDiffBaton; + ConvenientFromDiffBaton *baton = new ConvenientFromDiffBaton(); baton->error_code = GIT_OK; baton->error = NULL; - baton->diff = Nan::ObjectWrap::Unwrap(info[0]->ToObject())->GetValue(); + baton->diff = Nan::ObjectWrap::Unwrap(Nan::To(info[0]).ToLocalChecked())->GetValue(); + + if (info[1]->IsArray()) { + v8::Local context = Nan::GetCurrentContext(); + const v8::Local indexesArray = info[1].As(); + const uint32_t numIndexes = indexesArray->Length(); + + for (uint32_t i = 0; i < numIndexes; ++i) { + v8::Local value = indexesArray->Get(context, i).ToLocalChecked(); + int idx = value.As()->Value(); + baton->indexes.push_back(idx); + } + } + baton->out = new std::vector; baton->out->reserve(git_diff_num_deltas(baton->diff)); - Nan::Callback *callback = new Nan::Callback(Local::Cast(info[1])); - ConvenientFromDiffWorker *worker = new ConvenientFromDiffWorker(baton, callback); + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + ConvenientFromDiffWorker *worker = new ConvenientFromDiffWorker(baton, callback, cleanupHandles); - worker->SaveToPersistent("diff", info[0]); + worker->Reference("diff", info[0]); - Nan::AsyncQueueWorker(worker); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); return; } +nodegit::LockMaster GitPatch::ConvenientFromDiffWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->diff); + return lockMaster; +} + void GitPatch::ConvenientFromDiffWorker::Execute() { - giterr_clear(); + git_error_clear(); - { - LockMaster lockMaster(true, baton->diff); - std::vector patchesToBeFreed; + std::vector patchesToBeFreed; + + if (baton->indexes.size() > 0) { + for (int idx : baton->indexes) { + git_patch *nextPatch; + int result = git_patch_from_diff(&nextPatch, baton->diff, idx); + + if (result) { + while (!patchesToBeFreed.empty()) + { + git_patch_free(patchesToBeFreed.back()); + patchesToBeFreed.pop_back(); + } + + while (!baton->out->empty()) { + PatchDataFree(baton->out->back()); + baton->out->pop_back(); + } + + baton->error_code = result; + + if (git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } - for (int i = 0; i < git_diff_num_deltas(baton->diff); ++i) { + delete baton->out; + baton->out = NULL; + + return; + } + + if (nextPatch != NULL) { + baton->out->push_back(createFromRaw(nextPatch)); + patchesToBeFreed.push_back(nextPatch); + } + } + } else { + for (std::size_t i = 0; i < git_diff_num_deltas(baton->diff); ++i) { git_patch *nextPatch; int result = git_patch_from_diff(&nextPatch, baton->diff, i); @@ -50,8 +103,8 @@ void GitPatch::ConvenientFromDiffWorker::Execute() { baton->error_code = result; - if (giterr_last() != NULL) { - baton->error = git_error_dup(giterr_last()); + if (git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); } delete baton->out; @@ -65,13 +118,32 @@ void GitPatch::ConvenientFromDiffWorker::Execute() { patchesToBeFreed.push_back(nextPatch); } } + } - while (!patchesToBeFreed.empty()) - { - git_patch_free(patchesToBeFreed.back()); - patchesToBeFreed.pop_back(); + while (!patchesToBeFreed.empty()) + { + git_patch_free(patchesToBeFreed.back()); + patchesToBeFreed.pop_back(); + } +} + +void GitPatch::ConvenientFromDiffWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); } + + free((void *)baton->error); + } + + while (!baton->out->empty()) { + PatchDataFree(baton->out->back()); + baton->out->pop_back(); } + + delete baton->out; + + delete baton; } void GitPatch::ConvenientFromDiffWorker::HandleOKCallback() { @@ -89,7 +161,7 @@ void GitPatch::ConvenientFromDiffWorker::HandleOKCallback() { Nan::Null(), result }; - callback->Call(2, argv); + callback->Call(2, argv, async_resource); return; } @@ -97,15 +169,16 @@ void GitPatch::ConvenientFromDiffWorker::HandleOKCallback() { if (baton->error) { Local err; if (baton->error->message) { - err = Nan::Error(baton->error->message)->ToObject(); + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); } else { - err = Nan::Error("Method convenientFromDiff has thrown an error.")->ToObject(); + err = Nan::To(Nan::Error("Method convenientFromDiff has thrown an error.")).ToLocalChecked(); } - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Patch.convenientFromDiff").ToLocalChecked()); Local argv[1] = { err }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); if (baton->error->message) { free((void *)baton->error->message); @@ -117,15 +190,16 @@ void GitPatch::ConvenientFromDiffWorker::HandleOKCallback() { } if (baton->error_code < 0) { - Local err = Nan::Error("method convenientFromDiff has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Local err = Nan::To(Nan::Error("method convenientFromDiff has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Patch.convenientFromDiff").ToLocalChecked()); Local argv[1] = { err }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); return; } - callback->Call(0, NULL); + Nan::Call(*callback, 0, NULL); } diff --git a/generate/templates/manual/remote/ls.cc b/generate/templates/manual/remote/ls.cc index d426d6f790..97c801c629 100644 --- a/generate/templates/manual/remote/ls.cc +++ b/generate/templates/manual/remote/ls.cc @@ -1,55 +1,69 @@ NAN_METHOD(GitRemote::ReferenceList) { - if (info.Length() == 0 || !info[0]->IsFunction()) { + if (!info[info.Length() - 1]->IsFunction()) { return Nan::ThrowError("Callback is required and must be a Function."); } - ReferenceListBaton* baton = new ReferenceListBaton; + ReferenceListBaton* baton = new ReferenceListBaton(); baton->error_code = GIT_OK; baton->error = NULL; baton->out = new std::vector; baton->remote = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); - Nan::Callback *callback = new Nan::Callback(Local::Cast(info[0])); - ReferenceListWorker *worker = new ReferenceListWorker(baton, callback); - worker->SaveToPersistent("remote", info.This()); - Nan::AsyncQueueWorker(worker); + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + ReferenceListWorker *worker = new ReferenceListWorker(baton, callback, cleanupHandles); + worker->Reference("remote", info.This()); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); return; } +nodegit::LockMaster GitRemote::ReferenceListWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->remote); + return lockMaster; +} + void GitRemote::ReferenceListWorker::Execute() { - giterr_clear(); + git_error_clear(); - { - LockMaster lockMaster( - /*asyncAction: */true, - baton->remote - ); - - const git_remote_head **remote_heads; - size_t num_remote_heads; - baton->error_code = git_remote_ls( - &remote_heads, - &num_remote_heads, - baton->remote - ); - - if (baton->error_code != GIT_OK) { - baton->error = git_error_dup(giterr_last()); - delete baton->out; - baton->out = NULL; - return; - } + const git_remote_head **remote_heads; + size_t num_remote_heads; + baton->error_code = git_remote_ls( + &remote_heads, + &num_remote_heads, + baton->remote + ); + + if (baton->error_code != GIT_OK) { + baton->error = git_error_dup(git_error_last()); + delete baton->out; + baton->out = NULL; + return; + } + + baton->out->reserve(num_remote_heads); - baton->out->reserve(num_remote_heads); + for (size_t head_index = 0; head_index < num_remote_heads; ++head_index) { + git_remote_head *remote_head = git_remote_head_dup(remote_heads[head_index]); + baton->out->push_back(remote_head); + } +} - for (size_t head_index = 0; head_index < num_remote_heads; ++head_index) { - git_remote_head *remote_head = git_remote_head_dup(remote_heads[head_index]); - baton->out->push_back(remote_head); +void GitRemote::ReferenceListWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); } + + free((void *)baton->error); } + + delete baton->out; + + delete baton; } void GitRemote::ReferenceListWorker::HandleOKCallback() @@ -68,14 +82,14 @@ void GitRemote::ReferenceListWorker::HandleOKCallback() Nan::Null(), result }; - callback->Call(2, argv); + callback->Call(2, argv, async_resource); } else if (baton->error) { Local argv[1] = { Nan::Error(baton->error->message) }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); if (baton->error->message) { free((void *)baton->error->message); @@ -85,15 +99,18 @@ void GitRemote::ReferenceListWorker::HandleOKCallback() } else if (baton->error_code < 0) { - Local err = Nan::Error("Reference List has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Local err = Nan::To(Nan::Error("Reference List has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Remote.referenceList").ToLocalChecked()); Local argv[1] = { err }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); } else { - callback->Call(0, NULL); + callback->Call(0, NULL, async_resource); } + + delete baton; } diff --git a/generate/templates/manual/repository/get_references.cc b/generate/templates/manual/repository/get_references.cc new file mode 100644 index 0000000000..56bc12ac34 --- /dev/null +++ b/generate/templates/manual/repository/get_references.cc @@ -0,0 +1,162 @@ +NAN_METHOD(GitRepository::GetReferences) +{ + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + GetReferencesBaton* baton = new GetReferencesBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->out = new std::vector; + baton->repo = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + GetReferencesWorker *worker = new GetReferencesWorker(baton, callback, cleanupHandles); + worker->Reference("repo", info.This()); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitRepository::GetReferencesWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->repo); + return lockMaster; +} + +void GitRepository::GetReferencesWorker::Execute() +{ + giterr_clear(); + + git_repository *repo = baton->repo; + + git_strarray reference_names; + baton->error_code = git_reference_list(&reference_names, repo); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + delete baton->out; + baton->out = NULL; + return; + } + + for (size_t reference_index = 0; reference_index < reference_names.count; ++reference_index) { + git_reference *reference; + baton->error_code = git_reference_lookup(&reference, repo, reference_names.strings[reference_index]); + + // stop execution and return if there is an error + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + // unwind and return + while (baton->out->size()) { + git_reference *referenceToFree = baton->out->back(); + baton->out->pop_back(); + git_reference_free(referenceToFree); + } + + git_strarray_free(&reference_names); + delete baton->out; + baton->out = NULL; + return; + } + + if (git_reference_type(reference) == GIT_REF_SYMBOLIC) { + git_reference *resolved_reference; + int resolve_result = git_reference_resolve(&resolved_reference, reference); + git_reference_free(reference); + + // if we can't resolve the ref, then just ignore it + if (resolve_result == GIT_OK) { + baton->out->push_back(resolved_reference); + } + } else { + baton->out->push_back(reference); + } + } + + git_strarray_free(&reference_names); +} + +void GitRepository::GetReferencesWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + while (baton->out->size()) { + git_reference *referenceToFree = baton->out->back(); + baton->out->pop_back(); + git_reference_free(referenceToFree); + } + + delete baton->out; + + delete baton; +} + +void GitRepository::GetReferencesWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + unsigned int size = baton->out->size(); + Local result = Nan::New(size); + for (unsigned int i = 0; i < size; i++) { + git_reference *reference = baton->out->at(i); + Nan::Set( + result, + Nan::New(i), + GitRefs::New( + reference, + true, + Nan::To(GitRepository::New(git_reference_owner(reference), true)).ToLocalChecked() + ) + ); + } + + delete baton->out; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Repository getReferences has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Repository.getReferences").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } + + delete baton; +} diff --git a/generate/templates/manual/repository/get_remotes.cc b/generate/templates/manual/repository/get_remotes.cc new file mode 100644 index 0000000000..a7c316bb0e --- /dev/null +++ b/generate/templates/manual/repository/get_remotes.cc @@ -0,0 +1,161 @@ +NAN_METHOD(GitRepository::GetRemotes) +{ + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + GetRemotesBaton* baton = new GetRemotesBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->out = new std::vector; + baton->repo = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + GetRemotesWorker *worker = new GetRemotesWorker(baton, callback, cleanupHandles); + worker->Reference("repo", info.This()); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitRepository::GetRemotesWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true); + return lockMaster; +} + +void GitRepository::GetRemotesWorker::Execute() +{ + giterr_clear(); + + git_repository *repo = baton->repo; + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + delete baton->out; + baton->out = NULL; + return; + } + + git_strarray remote_names; + baton->error_code = git_remote_list(&remote_names, repo); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + delete baton->out; + baton->out = NULL; + return; + } + + for (size_t remote_index = 0; remote_index < remote_names.count; ++remote_index) { + git_remote *remote; + baton->error_code = git_remote_lookup(&remote, repo, remote_names.strings[remote_index]); + + // stop execution and return if there is an error + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + // unwind and return + while (baton->out->size()) { + git_remote *remoteToFree = baton->out->back(); + baton->out->pop_back(); + git_remote_free(remoteToFree); + } + + git_strarray_free(&remote_names); + delete baton->out; + baton->out = NULL; + return; + } + + baton->out->push_back(remote); + } + + git_strarray_free(&remote_names); +} + +void GitRepository::GetRemotesWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + while (baton->out->size()) { + git_remote *remoteToFree = baton->out->back(); + baton->out->pop_back(); + git_remote_free(remoteToFree); + } + + delete baton->out; + + delete baton; +} + +void GitRepository::GetRemotesWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + unsigned int size = baton->out->size(); + Local result = Nan::New(size); + for (unsigned int i = 0; i < size; i++) { + git_remote *remote = baton->out->at(i); + Nan::Set( + result, + Nan::New(i), + GitRemote::New( + remote, + true, + Nan::To(GitRepository::New(git_remote_owner(remote), true)).ToLocalChecked() + ) + ); + } + + delete baton->out; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Repository refreshRemotes has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Repository.refreshRemotes").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } + + delete baton; +} diff --git a/generate/templates/manual/repository/get_submodules.cc b/generate/templates/manual/repository/get_submodules.cc new file mode 100644 index 0000000000..069f6bdbc8 --- /dev/null +++ b/generate/templates/manual/repository/get_submodules.cc @@ -0,0 +1,141 @@ +NAN_METHOD(GitRepository::GetSubmodules) +{ + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + GetSubmodulesBaton* baton = new GetSubmodulesBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->out = new std::vector; + baton->repo = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + GetSubmodulesWorker *worker = new GetSubmodulesWorker(baton, callback, cleanupHandles); + worker->Reference("repo", info.This()); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +struct submodule_foreach_payload { + git_repository *repo; + std::vector *out; +}; + +int foreachSubmoduleCB(git_submodule *submodule, const char *name, void *void_payload) { + submodule_foreach_payload *payload = (submodule_foreach_payload *)void_payload; + git_submodule *out; + + int result = git_submodule_lookup(&out, payload->repo, name); + if (result == GIT_OK) { + payload->out->push_back(out); + } + + return result; +} + +nodegit::LockMaster GitRepository::GetSubmodulesWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->repo); + return lockMaster; +} + +void GitRepository::GetSubmodulesWorker::Execute() +{ + giterr_clear(); + + submodule_foreach_payload payload { baton->repo, baton->out }; + baton->error_code = git_submodule_foreach(baton->repo, foreachSubmoduleCB, (void *)&payload); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + while (baton->out->size()) { + git_submodule_free(baton->out->back()); + baton->out->pop_back(); + } + delete baton->out; + baton->out = NULL; + } +} + +void GitRepository::GetSubmodulesWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + while (baton->out->size()) { + git_submodule_free(baton->out->back()); + baton->out->pop_back(); + } + + delete baton->out; + + delete baton; +} + +void GitRepository::GetSubmodulesWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + unsigned int size = baton->out->size(); + Local result = Nan::New(size); + for (unsigned int i = 0; i < size; i++) { + git_submodule *submodule = baton->out->at(i); + Nan::Set( + result, + Nan::New(i), + GitSubmodule::New( + submodule, + true, + Nan::To(GitRepository::New(git_submodule_owner(submodule), true)).ToLocalChecked() + ) + ); + } + + delete baton->out; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Repository getSubmodules has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Repository.getSubmodules").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } + + delete baton; +} diff --git a/generate/templates/manual/repository/refresh_references.cc b/generate/templates/manual/repository/refresh_references.cc new file mode 100644 index 0000000000..5194f1c48c --- /dev/null +++ b/generate/templates/manual/repository/refresh_references.cc @@ -0,0 +1,712 @@ +int getOidOfReferenceCommit(git_oid *commitOid, git_reference *ref) { + git_object *commitObject; + int result = git_reference_peel(&commitObject, ref, GIT_OBJ_COMMIT); + + if (result != GIT_OK) { + return result; + } + + git_oid_cpy(commitOid, git_object_id(commitObject)); + git_object_free(commitObject); + return result; +} + +int asDirectReference(git_reference **out, git_reference *ref) { + if (git_reference_type(ref) != GIT_REF_SYMBOLIC) { + return git_reference_dup(out, ref); + } + + int error = git_reference_resolve(out, ref); + if (error != GIT_OK) { + *out = NULL; + } + + return GIT_OK; +} + +int lookupDirectReferenceByShorthand(git_reference **out, git_repository *repo, const char *shorthand) { + git_reference *ref = NULL; + int result = git_reference_dwim(&ref, repo, shorthand); + + if (result != GIT_OK) { + return result; + } + + result = asDirectReference(out, ref); + git_reference_free(ref); + return result; +} + +int lookupDirectReferenceByFullName(git_reference **out, git_repository *repo, const char *fullName) { + git_reference *ref = NULL; + int result = git_reference_lookup(&ref, repo, fullName); + + if (result != GIT_OK) { + return result; + } + + result = asDirectReference(out, ref); + git_reference_free(ref); + return result; +} + +char *getRemoteNameOfReference(git_reference *remoteReference) { + return strtok(strdup(git_reference_shorthand(remoteReference)), "/"); +} + +bool gitStrArrayContains(git_strarray *strarray, const char *string) { + for (size_t i = 0; i < strarray->count; ++i) { + if (strcmp(strarray->strings[i], string) == 0) { + return true; + } + } + return false; +} + +class RefreshedRefModel { +public: + RefreshedRefModel(git_reference *ref): + fullName(strdup(git_reference_name(ref))), + message(NULL), + sha(new char[GIT_OID_HEXSZ + 1]), + shorthand(strdup(git_reference_shorthand(ref))), + tagOdbBuffer(NULL), + tagOdbBufferLength(0), + type(NULL) + { + if (git_reference_is_branch(ref)) { + type = "branch"; + } else if (git_reference_is_remote(ref)) { + type = "remote"; + } else { + type = "tag"; + } + } + + RefreshedRefModel(const RefreshedRefModel &) = delete; + RefreshedRefModel(RefreshedRefModel &&) = delete; + RefreshedRefModel &operator=(const RefreshedRefModel &) = delete; + RefreshedRefModel &operator=(RefreshedRefModel &&) = delete; + + static int fromReference(RefreshedRefModel **out, git_reference *ref, git_odb *odb) { + RefreshedRefModel *refModel = new RefreshedRefModel(ref); + const git_oid *referencedTargetOid = git_reference_target(ref); + + if (!git_reference_is_tag(ref)) { + git_oid_tostr(refModel->sha, GIT_OID_HEXSZ + 1, referencedTargetOid); + + *out = refModel; + return GIT_OK; + } + git_repository *repo = git_reference_owner(ref); + + git_tag *referencedTag; + if (git_tag_lookup(&referencedTag, repo, referencedTargetOid) == GIT_OK) { + const char *tagMessage = git_tag_message(referencedTag); + refModel->message = tagMessage ? strdup(tagMessage) : NULL; + + git_odb_object *tagOdbObject; + if (git_odb_read(&tagOdbObject, odb, git_tag_id(referencedTag)) == GIT_OK) { + refModel->tagOdbBufferLength = git_odb_object_size(tagOdbObject); + refModel->tagOdbBuffer = new char[refModel->tagOdbBufferLength]; + std::memcpy(refModel->tagOdbBuffer, git_odb_object_data(tagOdbObject), refModel->tagOdbBufferLength); + git_odb_object_free(tagOdbObject); + } + + git_tag_free(referencedTag); + } + + git_oid peeledReferencedTargetOid; + int error = getOidOfReferenceCommit(&peeledReferencedTargetOid, ref); + if (error != GIT_OK) { + delete refModel; + return error; + } + + git_oid_tostr(refModel->sha, GIT_OID_HEXSZ + 1, &peeledReferencedTargetOid); + + *out = refModel; + return GIT_OK; + } + + static void ensureSignatureRegexes() { + if (!signatureRegexesBySignatureType.IsEmpty()) { + return; + } + + v8::Local gpgsigArray = Nan::New(2), + x509Array = Nan::New(1); + + Nan::Set( + gpgsigArray, + Nan::New(0), + Nan::New( + Nan::New("-----BEGIN PGP SIGNATURE-----[\\s\\S]+?-----END PGP SIGNATURE-----").ToLocalChecked(), + static_cast(v8::RegExp::Flags::kGlobal | v8::RegExp::Flags::kMultiline) + ).ToLocalChecked() + ); + + Nan::Set( + gpgsigArray, + Nan::New(1), + Nan::New( + Nan::New("-----BEGIN PGP MESSAGE-----[\\s\\S]+?-----END PGP MESSAGE-----").ToLocalChecked(), + static_cast(v8::RegExp::Flags::kGlobal | v8::RegExp::Flags::kMultiline) + ).ToLocalChecked() + ); + + Nan::Set( + x509Array, + Nan::New(0), + Nan::New( + Nan::New("-----BEGIN SIGNED MESSAGE-----[\\s\\S]+?-----END SIGNED MESSAGE-----").ToLocalChecked(), + static_cast(v8::RegExp::Flags::kGlobal | v8::RegExp::Flags::kMultiline) + ).ToLocalChecked() + ); + + v8::Local result = Nan::New(); + Nan::Set(result, Nan::New("gpgsig").ToLocalChecked(), gpgsigArray); + Nan::Set(result, Nan::New("x509").ToLocalChecked(), x509Array); + + signatureRegexesBySignatureType.Reset(result); + } + + v8::Local toJavascript(v8::Local signatureType) { + v8::Local result = Nan::New(); + + v8::Local jsFullName; + if (fullName == NULL) { + jsFullName = Nan::Null(); + } else { + jsFullName = Nan::New(fullName).ToLocalChecked(); + } + Nan::Set(result, Nan::New("fullName").ToLocalChecked(), jsFullName); + + v8::Local jsMessage; + if (message == NULL) { + jsMessage = Nan::Null(); + } else { + jsMessage = Nan::New(message).ToLocalChecked(); + } + Nan::Set(result, Nan::New("message").ToLocalChecked(), jsMessage); + + Nan::Set( + result, + Nan::New("sha").ToLocalChecked(), + Nan::New(sha).ToLocalChecked() + ); + + v8::Local jsShorthand; + if (shorthand == NULL) { + jsShorthand = Nan::Null(); + } else { + jsShorthand = Nan::New(shorthand).ToLocalChecked(); + } + Nan::Set(result, Nan::New("shorthand").ToLocalChecked(), jsShorthand); + + v8::Local jsTagSignature = Nan::Null(); + if (tagOdbBuffer != NULL && tagOdbBufferLength != 0) { + // tagOdbBuffer is already a copy, so we'd like to use NewBuffer instead, + // but we were getting segfaults and couldn't easily figure out why. :( + // We tried passing the tagOdbBuffer directly to NewBuffer and then nullifying tagOdbBuffer so that + // the destructor didn't double free, but that still segfaulted internally in Node. + v8::Local buffer = Nan::CopyBuffer(tagOdbBuffer, tagOdbBufferLength).ToLocalChecked(); + v8::Local toStringProp = Nan::Get(buffer, Nan::New("toString").ToLocalChecked()).ToLocalChecked(); + v8::Local jsTagOdbObjectString = Nan::To(Nan::CallAsFunction(Nan::To(toStringProp).ToLocalChecked(), buffer, 0, NULL).ToLocalChecked()).ToLocalChecked(); + + v8::Local _signatureRegexesBySignatureType = Nan::New(signatureRegexesBySignatureType); + v8::Local signatureRegexes = v8::Local::Cast(Nan::Get(_signatureRegexesBySignatureType, signatureType).ToLocalChecked()); + + for (uint32_t i = 0; i < signatureRegexes->Length(); ++i) { + v8::Local argv[] = { + Nan::Get(signatureRegexes, Nan::New(i)).ToLocalChecked() + }; + + v8::Local matchProp = Nan::Get(jsTagOdbObjectString, Nan::New("match").ToLocalChecked()).ToLocalChecked(); + v8::Local match = Nan::CallAsFunction(Nan::To(matchProp).ToLocalChecked(), jsTagOdbObjectString, 1, argv).ToLocalChecked(); + if (match->IsArray()) { + jsTagSignature = Nan::Get(Nan::To(match).ToLocalChecked(), 0).ToLocalChecked(); + break; + } + } + } + Nan::Set(result, Nan::New("tagSignature").ToLocalChecked(), jsTagSignature); + + v8::Local jsType; + if (type == NULL) { + jsType = Nan::Null(); + } else { + jsType = Nan::New(type).ToLocalChecked(); + } + Nan::Set(result, Nan::New("type").ToLocalChecked(), jsType); + + return result; + } + + ~RefreshedRefModel() { + if (fullName != NULL) { free(fullName); } + if (message != NULL) { free(message); } + delete[] sha; + if (shorthand != NULL) { free(shorthand); } + if (tagOdbBuffer != NULL) { delete[] tagOdbBuffer; } + } + + char *fullName, *message, *sha, *shorthand, *tagOdbBuffer; + size_t tagOdbBufferLength; + const char *type; + static Nan::Persistent signatureRegexesBySignatureType; +}; + +Nan::Persistent RefreshedRefModel::signatureRegexesBySignatureType; + +class UpstreamModel { +public: + UpstreamModel(const char *inputDownstreamFullName, const char *inputUpstreamFullName): + downstreamFullName((char *)strdup(inputDownstreamFullName)), + upstreamFullName((char *)strdup(inputUpstreamFullName)), + ahead(0), + behind(0) {} + + UpstreamModel(const UpstreamModel &) = delete; + UpstreamModel(UpstreamModel &&) = delete; + UpstreamModel &operator=(const UpstreamModel &) = delete; + UpstreamModel &operator=(UpstreamModel &&) = delete; + + static bool fromReference(UpstreamModel **out, git_reference *ref) { + if (!git_reference_is_branch(ref)) { + return false; + } + + git_reference *upstream; + int result = git_branch_upstream(&upstream, ref); + if (result != GIT_OK) { + return false; + } + + UpstreamModel *upstreamModel = new UpstreamModel( + git_reference_name(ref), + git_reference_name(upstream) + ); + + git_oid localCommitOid; + result = getOidOfReferenceCommit(&localCommitOid, ref); + if (result != GIT_OK) { + delete upstreamModel; + return false; + } + + git_oid upstreamCommitOid; + result = getOidOfReferenceCommit(&upstreamCommitOid, upstream); + if (result != GIT_OK) { + delete upstreamModel; + return false; + } + + result = git_graph_ahead_behind( + &upstreamModel->ahead, + &upstreamModel->behind, + git_reference_owner(ref), + &localCommitOid, + &upstreamCommitOid + ); + + if (result != GIT_OK) { + delete upstreamModel; + return false; + } + + *out = upstreamModel; + return true; + } + + v8::Local toJavascript() { + v8::Local result = Nan::New(); + + v8::Local jsDownstreamFullName; + if (downstreamFullName == NULL) { + jsDownstreamFullName = Nan::Null(); + } else { + jsDownstreamFullName = Nan::New(downstreamFullName).ToLocalChecked(); + } + Nan::Set(result, Nan::New("downstreamFullName").ToLocalChecked(), jsDownstreamFullName); + + v8::Local jsUpstreamFullName; + if (upstreamFullName == NULL) { + jsUpstreamFullName = Nan::Null(); + } else { + jsUpstreamFullName = Nan::New(upstreamFullName).ToLocalChecked(); + } + Nan::Set(result, Nan::New("upstreamFullName").ToLocalChecked(), jsUpstreamFullName); + + Nan::Set(result, Nan::New("ahead").ToLocalChecked(), Nan::New(ahead)); + Nan::Set(result, Nan::New("behind").ToLocalChecked(), Nan::New(behind)); + return result; + } + + ~UpstreamModel() { + if (downstreamFullName != NULL) { free(downstreamFullName); } + if (upstreamFullName != NULL) { free(upstreamFullName); } + } + + char *downstreamFullName; + char *upstreamFullName; + size_t ahead; + size_t behind; +}; + +class RefreshReferencesData { +public: + RefreshReferencesData(): + headRefFullName(NULL), + cherrypick(NULL), + merge(NULL) {} + + RefreshReferencesData(const RefreshReferencesData &) = delete; + RefreshReferencesData(RefreshReferencesData &&) = delete; + RefreshReferencesData &operator=(const RefreshReferencesData &) = delete; + RefreshReferencesData &operator=(RefreshReferencesData &&) = delete; + + ~RefreshReferencesData() { + while(refs.size()) { + delete refs.back(); + refs.pop_back(); + } + while(upstreamInfo.size()) { + delete upstreamInfo.back(); + upstreamInfo.pop_back(); + } + if (headRefFullName != NULL) { free(headRefFullName); } + if (cherrypick != NULL) { delete cherrypick; } + if (merge != NULL) { delete merge; } + } + + std::vector refs; + std::vector upstreamInfo; + char *headRefFullName; + RefreshedRefModel *cherrypick; + RefreshedRefModel *merge; +}; + +NAN_METHOD(GitRepository::RefreshReferences) +{ + v8::Local signatureType; + if (info.Length() == 2) { + if (!info[0]->IsString()) { + return Nan::ThrowError("Signature type must be \"gpgsig\" or \"x509\"."); + } + + v8::Local signatureTypeParam = Nan::To(info[0]).ToLocalChecked(); + if ( + Nan::Equals(signatureTypeParam, Nan::New("gpgsig").ToLocalChecked()) != Nan::Just(true) + && Nan::Equals(signatureTypeParam, Nan::New("x509").ToLocalChecked()) != Nan::Just(true) + ) { + return Nan::ThrowError("Signature type must be \"gpgsig\" or \"x509\"."); + } + signatureType = signatureTypeParam; + } else { + signatureType = Nan::New("gpgsig").ToLocalChecked(); + } + + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + RefreshReferencesBaton* baton = new RefreshReferencesBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->out = (void *)new RefreshReferencesData(); + baton->repo = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + RefreshReferencesWorker *worker = new RefreshReferencesWorker(baton, callback, cleanupHandles); + worker->Reference("repo", info.This()); + worker->Reference("signatureType", signatureType); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitRepository::RefreshReferencesWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->repo); + return lockMaster; +} + +void GitRepository::RefreshReferencesWorker::Execute() +{ + giterr_clear(); + + git_repository *repo = baton->repo; + RefreshReferencesData *refreshData = (RefreshReferencesData *)baton->out; + git_odb *odb; + + baton->error_code = git_repository_odb(&odb, repo); + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + delete refreshData; + baton->out = NULL; + return; + } + + // START Refresh HEAD + git_reference *headRef = NULL; + baton->error_code = lookupDirectReferenceByShorthand(&headRef, repo, "HEAD"); + + if (baton->error_code != GIT_OK || headRef == NULL) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + git_odb_free(odb); + delete refreshData; + baton->out = NULL; + return; + } + + RefreshedRefModel *headModel; + baton->error_code = RefreshedRefModel::fromReference(&headModel, headRef, odb); + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + git_odb_free(odb); + git_reference_free(headRef); + delete refreshData; + baton->out = NULL; + return; + } + refreshData->refs.push_back(headModel); + + refreshData->headRefFullName = strdup(git_reference_name(headRef)); + git_reference_free(headRef); + // END Refresh HEAD + + // START Refresh CHERRY_PICK_HEAD + git_reference *cherrypickRef = NULL; + if (lookupDirectReferenceByShorthand(&cherrypickRef, repo, "CHERRY_PICK_HEAD") == GIT_OK && cherrypickRef != NULL) { + baton->error_code = RefreshedRefModel::fromReference(&refreshData->cherrypick, cherrypickRef, odb); + git_reference_free(cherrypickRef); + } else { + cherrypickRef = NULL; + } + // END Refresh CHERRY_PICK_HEAD + + // START Refresh MERGE_HEAD + git_reference *mergeRef = NULL; + // fall through if cherry pick failed + if (baton->error_code == GIT_OK && lookupDirectReferenceByShorthand(&mergeRef, repo, "MERGE_HEAD") == GIT_OK && mergeRef != NULL) { + baton->error_code = RefreshedRefModel::fromReference(&refreshData->merge, mergeRef, odb); + git_reference_free(mergeRef); + } else { + mergeRef = NULL; + } + // END Refresh MERGE_HEAD + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + git_odb_free(odb); + delete refreshData; + baton->out = NULL; + return; + } + + // Retrieve reference models and upstream info for each reference + git_strarray referenceNames; + baton->error_code = git_reference_list(&referenceNames, repo); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + git_odb_free(odb); + delete refreshData; + baton->out = NULL; + return; + } + + git_strarray remoteNames; + baton->error_code = git_remote_list(&remoteNames, repo); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + git_odb_free(odb); + git_strarray_free(&referenceNames); + delete refreshData; + baton->out = NULL; + return; + } + + for (size_t referenceIndex = 0; referenceIndex < referenceNames.count; ++referenceIndex) { + git_reference *reference; + baton->error_code = lookupDirectReferenceByFullName(&reference, repo, referenceNames.strings[referenceIndex]); + + if (baton->error_code != GIT_OK) { + break; + } + if (reference == NULL) { + // lookup found the reference but failed to resolve it directly + continue; + } + + UpstreamModel *upstreamModel; + if (UpstreamModel::fromReference(&upstreamModel, reference)) { + refreshData->upstreamInfo.push_back(upstreamModel); + } + + bool isBranch = git_reference_is_branch(reference); + bool isRemote = git_reference_is_remote(reference); + bool isTag = git_reference_is_tag(reference); + if ( + strcmp(referenceNames.strings[referenceIndex], headModel->fullName) == 0 + || (!isBranch && !isRemote && !isTag) + ) { + git_reference_free(reference); + continue; + } + + if (isRemote) { + char *remoteNameOfRef = getRemoteNameOfReference(reference); + bool isFromExistingRemote = gitStrArrayContains(&remoteNames, remoteNameOfRef); + free(remoteNameOfRef); + if (!isFromExistingRemote) { + git_reference_free(reference); + continue; + } + } + + RefreshedRefModel *refreshedRefModel; + baton->error_code = RefreshedRefModel::fromReference(&refreshedRefModel, reference, odb); + git_reference_free(reference); + + if (baton->error_code == GIT_OK) { + refreshData->refs.push_back(refreshedRefModel); + } else { + baton->error_code = GIT_OK; + } + } + + git_odb_free(odb); + git_strarray_free(&remoteNames); + git_strarray_free(&referenceNames); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + delete refreshData; + baton->out = NULL; + return; + } +} + +void GitRepository::RefreshReferencesWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + RefreshReferencesData *refreshData = (RefreshReferencesData *)baton->out; + delete refreshData; + + delete baton; +} + +void GitRepository::RefreshReferencesWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + RefreshedRefModel::ensureSignatureRegexes(); + auto refreshData = (RefreshReferencesData *)baton->out; + v8::Local result = Nan::New(); + + Nan::Set( + result, + Nan::New("headRefFullName").ToLocalChecked(), + Nan::New(refreshData->headRefFullName).ToLocalChecked() + ); + + v8::Local signatureType = Nan::To(GetFromPersistent("signatureType")).ToLocalChecked(); + + unsigned int numRefs = refreshData->refs.size(); + v8::Local refs = Nan::New(numRefs); + for (unsigned int i = 0; i < numRefs; ++i) { + RefreshedRefModel *refreshedRefModel = refreshData->refs[i]; + Nan::Set(refs, Nan::New(i), refreshedRefModel->toJavascript(signatureType)); + } + Nan::Set(result, Nan::New("refs").ToLocalChecked(), refs); + + unsigned int numUpstreamInfo = refreshData->upstreamInfo.size(); + v8::Local upstreamInfo = Nan::New(numUpstreamInfo); + for (unsigned int i = 0; i < numUpstreamInfo; ++i) { + UpstreamModel *upstreamModel = refreshData->upstreamInfo[i]; + Nan::Set(upstreamInfo, Nan::New(i), upstreamModel->toJavascript()); + } + Nan::Set(result, Nan::New("upstreamInfo").ToLocalChecked(), upstreamInfo); + + if (refreshData->cherrypick != NULL) { + Nan::Set( + result, + Nan::New("cherrypick").ToLocalChecked(), + refreshData->cherrypick->toJavascript(signatureType) + ); + } else { + Nan::Set(result, Nan::New("cherrypick").ToLocalChecked(), Nan::Null()); + } + + if (refreshData->merge != NULL) { + Nan::Set( + result, + Nan::New("merge").ToLocalChecked(), + refreshData->merge->toJavascript(signatureType) + ); + } else { + Nan::Set(result, Nan::New("merge").ToLocalChecked(), Nan::Null()); + } + + delete refreshData; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Repository refreshReferences has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Repository.refreshReferences").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } + + delete baton; +} diff --git a/generate/templates/manual/repository/statistics.cc b/generate/templates/manual/repository/statistics.cc new file mode 100644 index 0000000000..f438bb5f8d --- /dev/null +++ b/generate/templates/manual/repository/statistics.cc @@ -0,0 +1,1892 @@ +/** + * \struct CommitsGraphNode + */ +struct CommitsGraphNode +{ + CommitsGraphNode(uint32_t aParentsLeft) : parentsLeft(aParentsLeft) {} + CommitsGraphNode() = default; + ~CommitsGraphNode() = default; + CommitsGraphNode(const CommitsGraphNode &other) = delete; + CommitsGraphNode(CommitsGraphNode &&other) = delete; + CommitsGraphNode& operator=(const CommitsGraphNode &other) = delete; + CommitsGraphNode& operator=(CommitsGraphNode &&other) = delete; + + std::vector children {}; + uint32_t parentsLeft {0}; // used when calculating the maximum history depth +}; + +/** + * \class CommitsGraph + */ +class CommitsGraph +{ +public: + CommitsGraph() = default; + ~CommitsGraph() = default; + CommitsGraph(const CommitsGraph &other) = delete; + CommitsGraph(CommitsGraph &&other) = delete; + CommitsGraph& operator=(const CommitsGraph &other) = delete; + CommitsGraph& operator=(CommitsGraph &&other) = delete; + + using CommitsGraphMap = std::unordered_map>; + + void AddNode(const std::string &oidStr, const std::vector &parents); + uint32_t CalculateMaxDepth(); + +private: + void addParentNode(const std::string &oidParentStr, CommitsGraphNode *child); + + CommitsGraphMap m_mapOidNode {}; + std::vector m_roots {}; +}; + +/** + * CommitsGraph::AddNode + * + * \param oidStr oid of the commit object to add. + * \param parents oids of the commit's parents. + */ +void CommitsGraph::AddNode(const std::string &oidStr, const std::vector &parents) +{ + const uint32_t numParents = static_cast(parents.size()); + + auto emplacePair = m_mapOidNode.emplace(std::make_pair( + oidStr, std::make_unique(numParents))); + + CommitsGraphMap::iterator itNode = emplacePair.first; + + // if this node already added by a child, update its parentsLeft + if (emplacePair.second == false) { + itNode->second.get()->parentsLeft = numParents; + } + + // set roots + if (numParents == 0) { + m_roots.emplace_back(itNode->second.get()); + } + + // add parents + for (unsigned int i = 0; i < numParents; ++i) { + addParentNode(parents.at(i), itNode->second.get()); + } +} + +/** + * CommitsGraph::CalculateMaxDepth + * \return Calculated maximum depth of the tree. + * + * Uses iterative algorithm to count levels. + * Considers multiple initial commits. + * Considers that children of one level can have multiple parents, hence we insert unique children + * at each level. + * Considers that same child can be in different levels. Here to prevent counting the same child + * multiple times, we only add a child when the last parent (parentsLeft) inserts it. This is + * actually what makes the algorithm fast. + * Recursive algorithm avoided to prevent stack overflow in case of excessive levels in the tree. + * + * Explanation of the algorithm: + * once the graph is built with the commit history, `CalculateMaxDepth()` counts the maximum number + * of levels from any of the roots to any of the leaves, which gives us the maximum depth + * (`historyStructure.maxDepth` in the final result). + * Inside `CalculateMaxDepth()`, to count levels, we add in an iterative way for each level and + * starting at the roots level, all the children from that level, but only if each child is the last + * time we'll consider it in the algorithm (for example if a child node 'C' has 2 parents 'P1' and + * 'P2', and 'P1' has already been considered before in the algorithm as parent of 'C', and now we are + * processing 'C' as a child from 'P2', which will be the last time, as 'C' has no more parents left). + * This way we prevent counting 'C' multiple times. + */ +uint32_t CommitsGraph::CalculateMaxDepth() +{ + uint32_t maxDepth {0}; + std::unordered_set parents {}; + std::unordered_set children {}; + + // start from the root commmits + for (CommitsGraphNode *root : m_roots) { + children.insert(root); + } + + while (!children.empty()) { + ++maxDepth; + parents = std::move(children); + + // add unique children of next level, and only if from the last parent + for (CommitsGraphNode *parent : parents) { + for (CommitsGraphNode *child : parent->children) { + if (--child->parentsLeft == 0) { + children.insert(child); + } + } + } + } + + return maxDepth; +} + +/** + * CommitsGraph::addParentNode + * + * \param oidParentStr oid of the parent commit to add. + * \param child Child of the parent commit being added. + */ +void CommitsGraph::addParentNode(const std::string &oidParentStr, CommitsGraphNode *child) +{ + CommitsGraphMap::iterator itParentNode = m_mapOidNode.emplace(std::make_pair( + oidParentStr, std::make_unique())).first; + + // add child to parent + itParentNode->second->children.emplace_back(child); +} + +/** + * \struct TreeStatistics + * Structure to store statistics for a git tree object. + */ +struct TreeStatistics +{ + TreeStatistics() = default; + ~TreeStatistics() = default; + TreeStatistics(const TreeStatistics &other) = delete; + TreeStatistics(TreeStatistics &&other) = default; + TreeStatistics& operator=(const TreeStatistics &other) = delete; + TreeStatistics& operator=(TreeStatistics &&other) = default; + + size_t numDirectories{0}; + size_t maxPathDepth {0}; + size_t maxPathLength {0}; + size_t numFiles {0}; + size_t totalFileSize {0}; + size_t numSymlinks {0}; + size_t numSubmodules {0}; +}; + +/** + * \struct Statistics + * Stores statistics of the analyzed repository. + */ +struct Statistics +{ + Statistics() = default; + ~Statistics() = default; + Statistics(const Statistics &other) = delete; + Statistics(Statistics &&other) = delete; + Statistics& operator=(const Statistics &other) = delete; + Statistics& operator=(Statistics &&other) = delete; + + struct { + struct { size_t count {0}; size_t size {0}; } commits; + struct { size_t count {0}; size_t size {0}; size_t entries {0}; } trees; + struct { size_t count {0}; size_t size {0}; } blobs; + struct { size_t count {0}; } annotatedTags; + struct { size_t count {0}; } references; + } repositorySize {}; + + struct { + struct { size_t maxSize {0}; size_t maxParents {0}; } commits; + struct { size_t maxEntries {0}; } trees; + struct { size_t maxSize {0}; } blobs; + } biggestObjects {}; + + struct { + uint32_t maxDepth {0}; + uint32_t maxTagDepth {0}; + } historyStructure {}; + + TreeStatistics biggestCheckouts {}; +}; + +/** + * \struct OdbObjectsData + * Structure to store, for each object read from the repository: + * - its information (size, parents for a commit, etc.) + * - different data needed to obtain the resulting statistics + */ +struct OdbObjectsData +{ + static constexpr uint32_t kUnreachable = 0; + + struct CommitInfo { + std::string oidTree {}; + size_t size {0}; + std::vector parents {}; + // number of sources from which a commit can be reached: + // a child commit, a tag, or a direct git reference + uint32_t reachability {kUnreachable}; + }; + + struct TreeInfoAndStats { + size_t size {0}; + size_t numEntries {0}; + std::vector entryBlobs {}; + std::vector< std::pair > entryTreesNameLen {}; + // number of sources from which a tree can be reached: + // a commit, another tree's entry, or a tag + uint32_t reachability {kUnreachable}; + TreeStatistics stats {}; + bool statsDone {false}; + }; + + struct BlobInfo { + size_t size {0}; + // number of sources from which a blob can be reached: + // a tree's entry, or a tag + uint32_t reachability {kUnreachable}; + }; + + struct TagInfo { + static constexpr uint32_t kUnsetDepth = 0; + + std::string oidTarget {}; + git_object_t typeTarget {GIT_OBJECT_INVALID}; + uint32_t depth {kUnsetDepth}; + // number of sources from which a tag can be reached: + // a reference, or another tag + uint32_t reachability {kUnreachable}; + }; + + OdbObjectsData() = default; + ~OdbObjectsData() = default; + OdbObjectsData(const OdbObjectsData &other) = delete; + OdbObjectsData(OdbObjectsData &&other) = delete; + OdbObjectsData& operator=(const OdbObjectsData &other) = delete; + OdbObjectsData& operator=(OdbObjectsData &&other) = delete; + + struct { + std::unordered_map info {}; + std::unordered_set unreachables {}; + // Tree of commits (graph) to be built after having read the object + // database, and pruned unreachable objects. + // Used to calculate the maximum history depth. + CommitsGraph graph {}; + size_t totalSize {0}; + size_t maxSize {0}; + size_t maxParents {0}; + } commits {}; + + struct { + std::unordered_map info; + std::unordered_set unreachables {}; + size_t totalSize {0}; + size_t totalEntries {0}; + size_t maxEntries {0}; + } trees {}; + + struct { + std::unordered_map info {}; + std::unordered_set unreachables {}; + size_t totalSize {0}; + size_t maxSize {0}; + } blobs {}; + + struct { + std::unordered_map info; + std::unordered_set unreachables {}; + } tags {}; + + struct { + std::mutex commits {}; + std::mutex trees {}; + std::mutex blobs {}; + std::mutex tags {}; + } infoMutex; + + using iterCommitInfo = std::unordered_map::iterator; + using iterUnreachable = std::unordered_set::iterator; + using iterTreeInfo = std::unordered_map::iterator; + using iterBlobInfo = std::unordered_map::iterator; + using iterTagInfo = std::unordered_map::iterator; +}; + +/** + * \class WorkItemOid + * WorkItem storing odb oids for the WorkPool. + */ +class WorkItemOid : public WorkItem { +public: + WorkItemOid(const git_oid &oid) + : m_oid(oid) {} + ~WorkItemOid() = default; + WorkItemOid(const WorkItemOid &other) = delete; + WorkItemOid(WorkItemOid &&other) = delete; + WorkItemOid& operator=(const WorkItemOid &other) = delete; + WorkItemOid& operator=(WorkItemOid &&other) = delete; + + const git_oid& GetOid() const { return m_oid; } + +private: + git_oid m_oid {}; +}; + +/** + * \class WorkerStoreOdbData + * Worker for the WorkPool to store odb object data. + */ +class WorkerStoreOdbData : public IWorker +{ +public: + WorkerStoreOdbData(const std::string &repoPath, OdbObjectsData *odbObjectsData) + : m_repoPath(repoPath), m_odbObjectsData(odbObjectsData) {} + ~WorkerStoreOdbData(); + WorkerStoreOdbData(const WorkerStoreOdbData &other) = delete; + WorkerStoreOdbData(WorkerStoreOdbData &&other) = delete; + WorkerStoreOdbData& operator=(const WorkerStoreOdbData &other) = delete; + WorkerStoreOdbData& operator=(WorkerStoreOdbData &&other) = delete; + + bool Initialize(); + bool Execute(std::unique_ptr &&work); + +private: + OdbObjectsData::TreeInfoAndStats thisTreeInfoAndStats(const git_tree *tree, size_t size, size_t numEntries); + + std::string m_repoPath {}; + git_repository *m_repo {nullptr}; + git_odb *m_odb {nullptr}; + OdbObjectsData *m_odbObjectsData {nullptr}; +}; + +/** + * WorkerStoreOdbData::~WorkerStoreOdbData + */ +WorkerStoreOdbData::~WorkerStoreOdbData() { + if (m_odb) { + git_odb_free(m_odb); + } + if (m_repo) { + git_repository_free(m_repo); + } +} + +/** + * WorkerStoreOdbData::Initialize + */ +bool WorkerStoreOdbData::Initialize() { + if (m_repo != nullptr) { // if already initialized + return true; + } + + return !m_repoPath.empty() && + git_repository_open(&m_repo, m_repoPath.c_str()) == GIT_OK && + git_repository_odb(&m_odb, m_repo) == GIT_OK; +} + +/** + * WorkerStoreOdbData::Execute + */ +bool WorkerStoreOdbData::Execute(std::unique_ptr &&work) +{ + std::unique_ptr wi {static_cast(work.release())}; + const git_oid &oid = wi->GetOid(); + + // NOTE about PERFORMANCE (May 2021): + // git_object_lookup() is as expensive as git_odb_read(). + // They give access to different information from the libgit2 API. + // Try to call only one of them if possible. + + git_object *target {nullptr}; + if (git_object_lookup(&target, m_repo, &oid, GIT_OBJECT_ANY) != GIT_OK) { + return false; + } + + switch (git_object_type(target)) + { + case GIT_OBJECT_COMMIT: + { + git_commit *commit = (git_commit*)target; + // NOTE about PERFORMANCE (May 2021): + // calling git_odb_object_size() was slightly faster than calculating header size + message size + 1 with GK repo + + // obtain size + git_odb_object *obj {nullptr}; + if (git_odb_read(&obj, m_odb, &oid) != GIT_OK) { + git_object_free(target); + return false; + } + const size_t size = git_odb_object_size(obj); + git_odb_object_free(obj); + + // obtain CommitInfo + const unsigned int numParents = git_commit_parentcount(commit); + std::vector parents {}; + for (unsigned int i = 0; i < numParents; ++i) { + parents.emplace_back(reinterpret_cast(git_commit_parent_id(commit, i)->id), + GIT_OID_RAWSZ); + } + + OdbObjectsData::CommitInfo commitInfo { + std::string(reinterpret_cast(git_commit_tree_id(commit)->id), GIT_OID_RAWSZ), + size, + std::move(parents), + OdbObjectsData::kUnreachable}; + + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.commits); + + m_odbObjectsData->commits.info.emplace(std::make_pair( + std::string(reinterpret_cast(oid.id), GIT_OID_RAWSZ), + std::move(commitInfo))); + } + } + break; + + case GIT_OBJECT_TREE: + { + git_tree *tree = (git_tree*)target; + + // do not count empty trees, like git's empty tree "4b825dc642cb6eb9a060e54bf8d69288fbee4904" + const size_t numEntries = git_tree_entrycount(tree); + if (numEntries == 0) { + git_object_free(target); + return true; + } + + // obtain size + git_odb_object *obj {nullptr}; + if (git_odb_read(&obj, m_odb, &oid) != GIT_OK) { + git_object_free(target); + return false; + } + const size_t size = git_odb_object_size(obj); + git_odb_object_free(obj); + + // obtain tree data and calculate statistics for only this tree (not recursively) + OdbObjectsData::TreeInfoAndStats treeInfoAndStats = thisTreeInfoAndStats(tree, size, numEntries); + + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.trees); + + m_odbObjectsData->trees.info.emplace(std::make_pair( + std::string(reinterpret_cast(oid.id), GIT_OID_RAWSZ), + std::move(treeInfoAndStats))); + } + } + break; + + case GIT_OBJECT_BLOB: + { + git_blob *blob = (git_blob*)target; + const size_t size = git_blob_rawsize(blob); + OdbObjectsData::BlobInfo blobInfo {size, OdbObjectsData::kUnreachable}; + + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.blobs); + + m_odbObjectsData->blobs.info.emplace(std::make_pair( + std::string(reinterpret_cast(oid.id), GIT_OID_RAWSZ), + std::move(blobInfo))); + } + } + break; + + case GIT_OBJECT_TAG: + { + // obtain TagInfo + git_tag *tag = (git_tag*)target; + const git_oid *oid_target = git_tag_target_id(tag); + OdbObjectsData::TagInfo tagInfo { + std::string(reinterpret_cast(oid_target->id), GIT_OID_RAWSZ), + git_tag_target_type(tag), + OdbObjectsData::TagInfo::kUnsetDepth, + OdbObjectsData::kUnreachable}; + + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.tags); + m_odbObjectsData->tags.info.emplace(std::make_pair( + std::string(reinterpret_cast(oid.id), GIT_OID_RAWSZ), + std::move(tagInfo))); + } + } + break; + + default: + break; + } + + git_object_free(target); + + return true; +} + +/** + * WorkerStoreOdbData::thisTreeInfoAndStats + * + * Obtain tree data and calculate the part of this tree's statistics that each thread can do. + * + * \param tree tree to get data from and calculate partial statistics of. + * \param size tree size, to be added to the final result. + * \param numEntries number of entries of this tree. + * \return this tree's data and partial statistics. + */ +OdbObjectsData::TreeInfoAndStats WorkerStoreOdbData::thisTreeInfoAndStats(const git_tree *tree, size_t size, + size_t numEntries) +{ + OdbObjectsData::TreeInfoAndStats treeInfoAndStats {}; + treeInfoAndStats.size = size; + treeInfoAndStats.numEntries = numEntries; + + for (size_t i = 0; i < numEntries; ++i) + { + const git_tree_entry *te = git_tree_entry_byindex(tree, i); + if (te == nullptr) { + continue; + } + const git_object_t te_type = git_tree_entry_type(te); + const char *teName {nullptr}; + size_t teNameLen {0}; + const git_oid *te_oid {nullptr}; + + switch (te_type) + { + // count submodules + case GIT_OBJECT_COMMIT: + if (git_tree_entry_filemode(te) == GIT_FILEMODE_COMMIT) { + ++treeInfoAndStats.stats.numSubmodules; + } + break; + + case GIT_OBJECT_BLOB: + { + // count symbolic links, but don't add them as blob entries + if (git_tree_entry_filemode(te) == GIT_FILEMODE_LINK) { + ++treeInfoAndStats.stats.numSymlinks; + } + else { + ++treeInfoAndStats.stats.numFiles; + teName = git_tree_entry_name(te); + teNameLen = std::char_traits::length(teName); + treeInfoAndStats.stats.maxPathLength = + std::max(treeInfoAndStats.stats.maxPathLength, teNameLen); + } + // store both types of files (symbolic links and non symbolic links) as entryBlob + te_oid = git_tree_entry_id(te); + treeInfoAndStats.entryBlobs.emplace_back( + reinterpret_cast(te_oid->id), GIT_OID_RAWSZ); + } + break; + + case GIT_OBJECT_TREE: + { + // We store tree's name length to compare in posterior stage, after threads work + teName = git_tree_entry_name(te); + teNameLen = std::char_traits::length(teName); + + te_oid = git_tree_entry_id(te); + treeInfoAndStats.entryTreesNameLen.emplace_back(std::make_pair( + std::string(reinterpret_cast(te_oid->id), GIT_OID_RAWSZ), + teNameLen)); + } + break; + + default: + break; + } + } + + return treeInfoAndStats; +} + +/** + * \class WorkItemOidStrType + * WorkItem storing pointers to object info structs for the WorkPool. + */ +class WorkItemOidStrType : public WorkItem { +public: + WorkItemOidStrType(void *objectInfo, git_object_t type) + : m_objectInfo(objectInfo), m_oid_type(type) {} + ~WorkItemOidStrType() = default; + WorkItemOidStrType(const WorkItemOidStrType &other) = delete; + WorkItemOidStrType(WorkItemOidStrType &&other) = delete; + WorkItemOidStrType& operator=(const WorkItemOidStrType &other) = delete; + WorkItemOidStrType& operator=(WorkItemOidStrType &&other) = delete; + + void* GetObjectInfo() const { return m_objectInfo; } + const git_object_t& GetOidType() const { return m_oid_type; } + +private: + void *m_objectInfo {nullptr}; + git_object_t m_oid_type {}; +}; + +/** + * \class WorkerReachCounter + * Worker for the WorkPool to count reachability of each object. + */ +class WorkerReachCounter : public IWorker +{ +public: + WorkerReachCounter(OdbObjectsData *odbObjectsData) + : m_odbObjectsData(odbObjectsData) {} + ~WorkerReachCounter() = default; + WorkerReachCounter(const WorkerReachCounter &other) = delete; + WorkerReachCounter(WorkerReachCounter &&other) = delete; + WorkerReachCounter& operator=(const WorkerReachCounter &other) = delete; + WorkerReachCounter& operator=(WorkerReachCounter &&other) = delete; + + bool Initialize() { return true; } + bool Execute(std::unique_ptr &&work); + +private: + void setReachabilityFromTags(void *objectInfo); + void setReachabilityFromCommits(void *objectInfo); + void setReachabilityFromTrees(void *objectInfo); + + OdbObjectsData *m_odbObjectsData {nullptr}; +}; + +/** + * WorkerReachCounter::Execute + */ +bool WorkerReachCounter::Execute(std::unique_ptr &&work) +{ + std::unique_ptr wi {static_cast(work.release())}; + void *objectInfo = wi->GetObjectInfo(); + const git_object_t &oid_type = wi->GetOidType(); + + switch (oid_type) { + case GIT_OBJECT_TAG: + setReachabilityFromTags(objectInfo); + break; + case GIT_OBJECT_COMMIT: + setReachabilityFromCommits(objectInfo); + break; + case GIT_OBJECT_TREE: + setReachabilityFromTrees(objectInfo); + break; + case GIT_OBJECT_BLOB: + // do not process blobs in this stage + break; + default: + break; + } + + return true; +} + +/** + * WorkerReachCounter::setReachabilityFromTags + * Adds reachability counter where tags point (any type of object). + */ +void WorkerReachCounter::setReachabilityFromTags(void *objectInfo) +{ + const OdbObjectsData::TagInfo *tagInfo = static_cast(objectInfo); + + switch (tagInfo->typeTarget) { + case GIT_OBJECT_COMMIT: + { + OdbObjectsData::iterCommitInfo itCommitInfo = + m_odbObjectsData->commits.info.find(tagInfo->oidTarget); + + if (itCommitInfo != m_odbObjectsData->commits.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.commits); + ++itCommitInfo->second.reachability; + } + } + } + break; + + case GIT_OBJECT_TREE: + { + OdbObjectsData::iterTreeInfo itTreeInfo = + m_odbObjectsData->trees.info.find(tagInfo->oidTarget); + + if (itTreeInfo != m_odbObjectsData->trees.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.trees); + ++itTreeInfo->second.reachability; + } + } + } + + case GIT_OBJECT_BLOB: + { + OdbObjectsData::iterBlobInfo itBlobInfo = + m_odbObjectsData->blobs.info.find(tagInfo->oidTarget); + + if (itBlobInfo != m_odbObjectsData->blobs.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.blobs); + ++itBlobInfo->second.reachability; + } + } + } + + case GIT_OBJECT_TAG: + { + OdbObjectsData::iterTagInfo itTargetTagInfo = + m_odbObjectsData->tags.info.find(tagInfo->oidTarget); + + if (itTargetTagInfo != m_odbObjectsData->tags.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.tags); + ++itTargetTagInfo->second.reachability; + } + } + } + default: + break; + } +} + +/** + * WorkerReachCounter::setReachabilityFromCommits + * Adds reachability counter where commits point (parents and tree). + */ +void WorkerReachCounter::setReachabilityFromCommits(void *objectInfo) +{ + const OdbObjectsData::CommitInfo *commitInfo = + static_cast(objectInfo); + const size_t numParents = commitInfo->parents.size(); + + // set parents' reachability + for (size_t i = 0; i < numParents; ++i) { + OdbObjectsData::iterCommitInfo itParentCommitInfo = + m_odbObjectsData->commits.info.find(commitInfo->parents.at(i)); + + if (itParentCommitInfo != m_odbObjectsData->commits.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.commits); + ++itParentCommitInfo->second.reachability; + } + } + } + + // add 1 to its tree's reachability + OdbObjectsData::iterTreeInfo itCommitTreeInfo = + m_odbObjectsData->trees.info.find(commitInfo->oidTree); + + if (itCommitTreeInfo != m_odbObjectsData->trees.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.trees); + ++itCommitTreeInfo->second.reachability; + } + } +} + +/** + * WorkerReachCounter::setReachabilityFromTrees + * Adds reachability counter where tree entries point (blobs and other trees). + */ +void WorkerReachCounter::setReachabilityFromTrees(void *objectInfo) +{ + const OdbObjectsData::TreeInfoAndStats *treeInfo = + static_cast(objectInfo); + + // set entry blobs' reachability + for (auto &blob : treeInfo->entryBlobs) { + OdbObjectsData::iterBlobInfo itBlobInfo = m_odbObjectsData->blobs.info.find(blob); + + if (itBlobInfo != m_odbObjectsData->blobs.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.blobs); + ++itBlobInfo->second.reachability; + } + } + } + + // set entry trees' reachability + for (auto &treeNameLen : treeInfo->entryTreesNameLen) { + OdbObjectsData::iterTreeInfo itTreeInfo = m_odbObjectsData->trees.info.find(treeNameLen.first); + + if (itTreeInfo != m_odbObjectsData->trees.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.trees); + ++itTreeInfo->second.reachability; + } + } + } +} + +/** + * forEachOdbCb. Callback for git_odb_foreach. + * Returns GIT_OK on success; GIT_EUSER otherwise + */ +static int forEachOdbCb(const git_oid *oid, void *payloadToCast) +{ + WorkerPool *workerPool = + static_cast*>(payloadToCast); + + // Must insert copies of oid, since the pointers might not survive until worker thread picks it up + workerPool->InsertWork(std::make_unique(*oid)); + + // check there were no problems inserting work + if (workerPool->Status() != WPStatus::kOk) { + return GIT_EUSER; + } + + return GIT_OK; +} + +/** + * \class RepoAnalysis + * Class to analyse and hold repository statistics + */ +class RepoAnalysis +{ +public: + static constexpr unsigned int kMinThreads = 4; + + explicit RepoAnalysis(git_repository *repo) + : m_repo(repo) {} + ~RepoAnalysis() = default; + RepoAnalysis(const RepoAnalysis &other) = delete; + RepoAnalysis(RepoAnalysis &&other) = delete; + RepoAnalysis& operator=(const RepoAnalysis &other) = delete; + RepoAnalysis& operator=(RepoAnalysis &&other) = delete; + + int Analyze(); + v8::Local StatisticsToJS() const; + +private: + // stage 1 methods: store data from repository (with threads) + int storeObjectsInfo(); + int storeAndCountRefs(); + // stage 2 methods: count reachability of each object (with threads) + // NOTE: we need this stage, since so far libgit2 doesn't provide unreachable objects + bool setObjectsReachability(); + void setReachabilityFromRefs(); + void setUnreachables(); + // stage 3 methods: prune unreachable oids + void pruneUnreachables(); + void pruneUnreachableTags(); + void pruneUnreachableCommits(); + void pruneUnreachableTrees(); + void pruneUnreachableBlobs(); + // stage 4 methods: repositorySize and biggestObjects + void statsCountAndMax(); + // stage 5 methods: historyStructure and biggestCheckouts + bool statsHistoryAndBiggestCheckouts(); + bool calculateBiggestCheckouts(); + OdbObjectsData::iterTreeInfo calculateTreeStatistics(const std::string &oidTree); + bool calculateMaxTagDepth(); + OdbObjectsData::iterTagInfo calculateTagDepth(const std::string &oidTag); + // methods to return the statistics calculated + void fillOutStatistics(); + v8::Local repositorySizeToJS() const; + v8::Local biggestObjectsToJS() const; + v8::Local historyStructureToJS() const; + v8::Local biggestCheckoutsToJS() const; + + git_repository *m_repo {nullptr}; + Statistics m_statistics {}; + // odb objects info to build while reading the object database by each thread + OdbObjectsData m_odbObjectsData {}; + // oid and type of peeled references + std::unordered_map m_peeledRefs {}; +}; + +/** + * RepoAnalysis::Analyze + * To obtain the final result, the whole process is run in different stages. + * If a stage leverages threads via a worker pool, the worker pool is created + * and we wait until all the threads are done to continue with the next stage. + */ +int RepoAnalysis::Analyze() +{ + int errorCode {GIT_OK}; + + // stage 1 + if ((errorCode = storeObjectsInfo() != GIT_OK)) { + return errorCode; + } + + // stage 2 + if (!setObjectsReachability()) { + return GIT_EUSER; + } + + // stage 3 + pruneUnreachables(); + + // stage 4 + statsCountAndMax(); + + // stage 5 + if (!statsHistoryAndBiggestCheckouts()) { + return GIT_EUSER; + } + + fillOutStatistics(); + + return errorCode; +} + +/** + * RepoAnalysis::StatisticsToJS + */ +v8::Local RepoAnalysis::StatisticsToJS() const +{ + v8::Local result = Nan::New(); + + v8::Local repositorySize = repositorySizeToJS(); + Nan::Set(result, Nan::New("repositorySize").ToLocalChecked(), repositorySize); + + v8::Local biggestObjects = biggestObjectsToJS(); + Nan::Set(result, Nan::New("biggestObjects").ToLocalChecked(), biggestObjects); + + v8::Local historyStructure = historyStructureToJS(); + Nan::Set(result, Nan::New("historyStructure").ToLocalChecked(), historyStructure); + + v8::Local biggestCheckouts = biggestCheckoutsToJS(); + Nan::Set(result, Nan::New("biggestCheckouts").ToLocalChecked(), biggestCheckouts); + + return result; +} + +/** + * RepoAnalysis::storeObjectsInfo + * Store information from read odb objects. + * Starts building a container which eventually will hold only reachable objects. + * Leverages threads via a worker pool . + */ +int RepoAnalysis::storeObjectsInfo() +{ + int errorCode {GIT_OK}; + + // get the objects database + git_odb *odb {nullptr}; + if ((errorCode = git_repository_odb(&odb, m_repo)) != GIT_OK) { + return errorCode; + } + + // initialize workers for the worker pool + const std::string repoPath = git_repository_path(m_repo); + const unsigned int numThreads = + std::max(std::thread::hardware_concurrency(), static_cast(kMinThreads)); + + std::vector< std::shared_ptr > workers {}; + for (unsigned int i = 0; i < numThreads; ++i) { + workers.emplace_back(std::make_shared(repoPath, &m_odbObjectsData)); + } + + // initialize worker pool + WorkerPool workerPool {}; + workerPool.Init(workers); + + if ((errorCode = git_odb_foreach(odb, forEachOdbCb, &workerPool)) != GIT_OK) { + workerPool.Shutdown(); + git_odb_free(odb); + return errorCode; + } + + // main thread will work on the refs while waiting for the threads to finish + if ((errorCode = storeAndCountRefs() != GIT_OK)) { + workerPool.Shutdown(); + git_odb_free(odb); + return errorCode; + } + + // wait for the threads to finish and shutdown the work pool + workerPool.Shutdown(); + + // check there were no problems during execution + if (workerPool.Status() != WPStatus::kOk) { + git_odb_free(odb); + return GIT_EUSER; + } + + git_odb_free(odb); + + return errorCode; +} + +/** + * RepoAnalysis::storeAndCountRefs + * Stores the oid and type of peeled references. + * Also counts total references. + */ +int RepoAnalysis::storeAndCountRefs() +{ + int errorCode {GIT_OK}; + git_strarray ref_list; + + // count refs + if ((errorCode = git_reference_list(&ref_list, m_repo)) != GIT_OK) { + return errorCode; + } + m_statistics.repositorySize.references.count = ref_list.count; + + // store refs info + for (size_t i = 0; i < ref_list.count; ++i) + { + // lookup ref + git_reference *ref {nullptr}; + const int refLookupError = git_reference_lookup(&ref, m_repo, ref_list.strings[i]); + if (refLookupError == GIT_ENOTFOUND || refLookupError == GIT_EINVALIDSPEC) { + continue; + } + else if (refLookupError != GIT_OK) { + git_strarray_dispose(&ref_list); + return refLookupError; + } + + // obtain peeled oid of the reference + bool found_oid = false; + git_oid oid_ref; + switch (git_reference_type(ref)) + { + case GIT_REFERENCE_DIRECT: + git_oid_cpy(&oid_ref, git_reference_target(ref)); + found_oid = true; + break; + + case GIT_REFERENCE_SYMBOLIC: + { + git_reference *ref_resolved {nullptr}; + if ((errorCode = git_reference_resolve(&ref_resolved, ref)) != GIT_OK) { + git_reference_free(ref); + git_strarray_dispose(&ref_list); + return errorCode; + } + git_oid_cpy(&oid_ref, git_reference_target(ref_resolved)); + found_oid = true; + git_reference_free(ref_resolved); + } + break; + + default: + break; + } + + // store object's oid and type + if (found_oid) + { + git_object *target {nullptr}; + if ((errorCode = git_object_lookup(&target, m_repo, &oid_ref, GIT_OBJECT_ANY)) != GIT_OK) { + git_reference_free(ref); + git_strarray_dispose(&ref_list); + return errorCode; + } + + m_peeledRefs.emplace(std::make_pair( + std::string(reinterpret_cast(oid_ref.id), GIT_OID_RAWSZ), + git_object_type(target))); + + git_object_free(target); + } + git_reference_free(ref); + } + git_strarray_dispose(&ref_list); + + return errorCode; +} + +/** + * RepoAnalysis::setObjectsReachability + * Leverages threads via a worker pool to + * set reachability from tags, commits, and trees. + * NOTE: the worker pool leveraged in this method runs at a different stage than the + * worker pool leveraged in previous stages, meaning they do not run at the same time, hence + * access to 'm_odbObjectsData->....info' won't suffer from a data race. + * NOTE: performance didn't improve leveraging threads for adding objects to unreachables container. + * \return false if the workerPool finished with errors; true otherwise + */ +bool RepoAnalysis::setObjectsReachability() +{ + // references are not objects, hence they won't be sent to the worker threads + setReachabilityFromRefs(); + + const unsigned int numThreads = + std::max(std::thread::hardware_concurrency(), static_cast(kMinThreads)); + std::vector< std::shared_ptr > workers {}; + for (unsigned int i = 0; i < numThreads; ++i) { + workers.emplace_back(std::make_shared(&m_odbObjectsData)); + } + + // initialize worker pool + WorkerPool workerPool {}; + workerPool.Init(workers); + + // NOTE: avoid queueing same type of objects in a row, so that different mutex can be used concurrently + uint8_t workInserted {0}; + OdbObjectsData::iterTagInfo itTagInfo = m_odbObjectsData.tags.info.begin(); + OdbObjectsData::iterCommitInfo itCommitInfo = m_odbObjectsData.commits.info.begin(); + OdbObjectsData::iterTreeInfo itTreeInfo = m_odbObjectsData.trees.info.begin(); + do { + workInserted = 0; + // insert tag + if (itTagInfo != m_odbObjectsData.tags.info.end()) { + workerPool.InsertWork(std::make_unique(&itTagInfo->second, GIT_OBJECT_TAG)); + ++itTagInfo; + ++workInserted; + } + // insert commmit + if (itCommitInfo != m_odbObjectsData.commits.info.end()) { + workerPool.InsertWork(std::make_unique(&itCommitInfo->second, GIT_OBJECT_COMMIT)); + ++itCommitInfo; + ++workInserted; + } + // insert tree + if (itTreeInfo != m_odbObjectsData.trees.info.end()) { + workerPool.InsertWork(std::make_unique(&itTreeInfo->second, GIT_OBJECT_TREE)); + ++itTreeInfo; + ++workInserted; + } + // blobs do not reach to any other object, hence no need to process them + } while (workInserted); + + // wait for the threads to finish and shutdown the work pool + workerPool.Shutdown(); + + // check there were no problems during execution + if (workerPool.Status() != WPStatus::kOk) { + return false; + } + + setUnreachables(); + + return true; +} + +/** + * RepoAnalysis::setReachabilityFromRefs + * Adds reachability counter where peeled refs point (normally a commit or a tag). + */ +void RepoAnalysis::setReachabilityFromRefs() +{ + for (const auto &ref : m_peeledRefs) { + switch (ref.second) { + case GIT_OBJECT_COMMIT: + { + OdbObjectsData::iterCommitInfo itCommitInfo = + m_odbObjectsData.commits.info.find(ref.first); + + if (itCommitInfo != m_odbObjectsData.commits.info.end()) { + ++itCommitInfo->second.reachability; + } + } + break; + case GIT_OBJECT_TREE: + { + OdbObjectsData::iterTreeInfo itTreeInfo = + m_odbObjectsData.trees.info.find(ref.first); + + if (itTreeInfo != m_odbObjectsData.trees.info.end()) { + ++itTreeInfo->second.reachability; + } + } + break; + case GIT_OBJECT_BLOB: + { + OdbObjectsData::iterBlobInfo itBlobInfo = + m_odbObjectsData.blobs.info.find(ref.first); + + if (itBlobInfo != m_odbObjectsData.blobs.info.end()) { + ++itBlobInfo->second.reachability; + } + } + break; + case GIT_OBJECT_TAG: + { + OdbObjectsData::iterTagInfo itTagInfo = + m_odbObjectsData.tags.info.find(ref.first); + + if (itTagInfo != m_odbObjectsData.tags.info.end()) { + ++itTagInfo->second.reachability; + } + } + break; + default: + break; + } + } +} + +/** + * RepoAnalysis::setUnreachables + * After setting reachability, we add the unreached objects to their unreachables container. + */ +void RepoAnalysis::setUnreachables() +{ + for (const auto &tag : m_odbObjectsData.tags.info) { + if (!tag.second.reachability) { + m_odbObjectsData.tags.unreachables.emplace(tag.first); + } + } + for (const auto &commit : m_odbObjectsData.commits.info) { + if (!commit.second.reachability) { + m_odbObjectsData.commits.unreachables.emplace(commit.first); + } + } + for (const auto &tree : m_odbObjectsData.trees.info) { + if (!tree.second.reachability) { + m_odbObjectsData.trees.unreachables.emplace(tree.first); + } + } + for (const auto &blob : m_odbObjectsData.blobs.info) { + if (!blob.second.reachability) { + m_odbObjectsData.blobs.unreachables.emplace(blob.first); + } + } +} + +/** + * RepoAnalysis::pruneUnreachables + * Removes from their containers the unreachable objects. + * Decreases reachability of the objects they can reach. + */ +void RepoAnalysis::pruneUnreachables() +{ + // NOTE: order is important here, since each method prunes its own objects, but + // only decreases reachability of the objects connected to it; and those + // connected objects will be checked and pruned afterwards. + pruneUnreachableTags(); + pruneUnreachableCommits(); + pruneUnreachableTrees(); + pruneUnreachableBlobs(); +} + +/** + * RepoAnalysis::pruneUnreachableTags + * Prune tags and their chained tags if they become unreachable. + * Also decreases reachability of targets. + */ +void RepoAnalysis::pruneUnreachableTags() +{ + while (!m_odbObjectsData.tags.unreachables.empty()) { + std::unordered_set newUnreachables {}; + + // erase unreachable tags + for (OdbObjectsData::iterUnreachable itTagUnrch = m_odbObjectsData.tags.unreachables.begin(); + itTagUnrch != m_odbObjectsData.tags.unreachables.end(); ++itTagUnrch) + { + OdbObjectsData::iterTagInfo itTagInfo = m_odbObjectsData.tags.info.find(*itTagUnrch); + + if (itTagInfo != m_odbObjectsData.tags.info.end()) { + const std::string &oidTarget = itTagInfo->second.oidTarget; + switch (itTagInfo->second.typeTarget) { + case GIT_OBJECT_TAG: + { + // if target is another tag, add it to newUnreachables + OdbObjectsData::iterTagInfo itTargetTagInfo = m_odbObjectsData.tags.info.find(oidTarget); + if (itTargetTagInfo != m_odbObjectsData.tags.info.end()) { + if (--itTargetTagInfo->second.reachability == OdbObjectsData::kUnreachable) { + newUnreachables.emplace(itTargetTagInfo->first); + } + } + } + break; + case GIT_OBJECT_COMMIT: + { + OdbObjectsData::iterCommitInfo itCommitInfo = m_odbObjectsData.commits.info.find(oidTarget); + if (itCommitInfo != m_odbObjectsData.commits.info.end()) { + if (--itCommitInfo->second.reachability == OdbObjectsData::kUnreachable) { + m_odbObjectsData.commits.unreachables.emplace(itCommitInfo->first); + } + } + } + break; + case GIT_OBJECT_TREE: + { + OdbObjectsData::iterTreeInfo itTreeInfo = m_odbObjectsData.trees.info.find(oidTarget); + if (itTreeInfo != m_odbObjectsData.trees.info.end()) { + if (--itTreeInfo->second.reachability == OdbObjectsData::kUnreachable) { + m_odbObjectsData.trees.unreachables.emplace(itTreeInfo->first); + } + } + } + break; + case GIT_OBJECT_BLOB: + { + OdbObjectsData::iterBlobInfo itBlobInfo = m_odbObjectsData.blobs.info.find(oidTarget); + if (itBlobInfo != m_odbObjectsData.blobs.info.end()) { + if (--itBlobInfo->second.reachability == OdbObjectsData::kUnreachable) { + m_odbObjectsData.blobs.unreachables.emplace(itBlobInfo->first); + } + } + } + break; + default: + break; + } + // erase tag from the tag's container + m_odbObjectsData.tags.info.erase(itTagInfo); + } + } + // set new unreachable tags + m_odbObjectsData.tags.unreachables = std::move(newUnreachables); + } +} + +/** + * RepoAnalysis::pruneUnreachableCommits + * Prune commits and decrease reachability of their associated trees. + */ +void RepoAnalysis::pruneUnreachableCommits() +{ + while (!m_odbObjectsData.commits.unreachables.empty()) { + std::unordered_set newUnreachables {}; + + // erase unreachable commits + for (OdbObjectsData::iterUnreachable itCommitUnrch = m_odbObjectsData.commits.unreachables.begin(); + itCommitUnrch != m_odbObjectsData.commits.unreachables.end(); ++itCommitUnrch) + { + OdbObjectsData::iterCommitInfo itCommitInfo = m_odbObjectsData.commits.info.find(*itCommitUnrch); + + if (itCommitInfo != m_odbObjectsData.commits.info.end()) + { + // decrease commit's parents reachability and add them as newUnreachable + const size_t numParents = itCommitInfo->second.parents.size(); + for (size_t i = 0; i < numParents; ++i) { + OdbObjectsData::iterCommitInfo itParentCommitInfo = + m_odbObjectsData.commits.info.find(itCommitInfo->second.parents.at(i)); + + if (itParentCommitInfo != m_odbObjectsData.commits.info.end()) { + if (--itParentCommitInfo->second.reachability == OdbObjectsData::kUnreachable) { + newUnreachables.emplace(itParentCommitInfo->first); + } + } + } + // decrease reachability of the commit's tree + OdbObjectsData::iterTreeInfo itTreeInfo = + m_odbObjectsData.trees.info.find(itCommitInfo->second.oidTree); + if (itTreeInfo != m_odbObjectsData.trees.info.end()) { + if (--itTreeInfo->second.reachability == OdbObjectsData::kUnreachable) { + m_odbObjectsData.trees.unreachables.emplace(itTreeInfo->first); + } + } + // erase commit from the commit's container + m_odbObjectsData.commits.info.erase(itCommitInfo); + } + } + // set new unreachable commits + m_odbObjectsData.commits.unreachables = std::move(newUnreachables); + } +} + +/** + * RepoAnalysis::pruneUnreachableTrees + * Prune unreachable trees and decrement reachability of their entries. + */ +void RepoAnalysis::pruneUnreachableTrees() +{ + while (!m_odbObjectsData.trees.unreachables.empty()) { + std::unordered_set newUnreachables {}; + + // erase unreachable trees + for (OdbObjectsData::iterUnreachable itTreeUnrch = m_odbObjectsData.trees.unreachables.begin(); + itTreeUnrch != m_odbObjectsData.trees.unreachables.end(); ++itTreeUnrch) + { + OdbObjectsData::iterTreeInfo itTreeInfo = m_odbObjectsData.trees.info.find(*itTreeUnrch); + + if (itTreeInfo != m_odbObjectsData.trees.info.end()) { + // decrease reachability of the entry blobs + for (auto &blob : itTreeInfo->second.entryBlobs) { + OdbObjectsData::iterBlobInfo itEntryBlobInfo = m_odbObjectsData.blobs.info.find(blob); + if (itEntryBlobInfo != m_odbObjectsData.blobs.info.end()) { + if (--itEntryBlobInfo->second.reachability == OdbObjectsData::kUnreachable) { + m_odbObjectsData.blobs.unreachables.emplace(blob); + } + } + } + // decrease reachability of the entry trees and add them as newUnreachables + for (auto &treeNameLen : itTreeInfo->second.entryTreesNameLen) { + OdbObjectsData::iterTreeInfo itEntryTreeInfo = + m_odbObjectsData.trees.info.find(treeNameLen.first); + if (itEntryTreeInfo != m_odbObjectsData.trees.info.end()) { + if (--itEntryTreeInfo->second.reachability == OdbObjectsData::kUnreachable) { + newUnreachables.emplace(treeNameLen.first); + } + } + } + // erase tree from the tree's container + m_odbObjectsData.trees.info.erase(itTreeInfo); + } + } + // set new unreachable trees + m_odbObjectsData.trees.unreachables = std::move(newUnreachables); + } +} + +/** + * RepoAnalysis::pruneUnreachableBlobs + * Rremoves unreachable blobs from their container. + */ +void RepoAnalysis::pruneUnreachableBlobs() +{ + for (OdbObjectsData::iterUnreachable itBlobUnrch = m_odbObjectsData.blobs.unreachables.begin(); + itBlobUnrch != m_odbObjectsData.blobs.unreachables.end(); ++itBlobUnrch) + { + m_odbObjectsData.blobs.info.erase(*itBlobUnrch); + } +} + +/** + * RepoAnalysis::statsCountAndMax + * Statistics for repositorySize (count objects) and biggestObjects (get maximum of them). + * Also builds the commits graph. + * NOTE: better results achieved not leveraging threads. + */ +void RepoAnalysis::statsCountAndMax() +{ + // commits + for (auto &info : m_odbObjectsData.commits.info) { + OdbObjectsData::CommitInfo &commitInfo = info.second; + const size_t objectSize = commitInfo.size; + + m_odbObjectsData.commits.totalSize += objectSize; + m_odbObjectsData.commits.maxSize = std::max(m_odbObjectsData.commits.maxSize, objectSize); + m_odbObjectsData.commits.maxParents = std::max( + m_odbObjectsData.commits.maxParents, commitInfo.parents.size()); + + // build commit's graph + m_odbObjectsData.commits.graph.AddNode(info.first, commitInfo.parents); + } + // trees + for (auto &info : m_odbObjectsData.trees.info) { + OdbObjectsData::TreeInfoAndStats &treeInfo = info.second; + const size_t numEntries = treeInfo.numEntries; + const size_t objectSize = treeInfo.size; + + m_odbObjectsData.trees.totalSize += objectSize; + m_odbObjectsData.trees.totalEntries += numEntries; + m_odbObjectsData.trees.maxEntries = std::max(m_odbObjectsData.trees.maxEntries, numEntries); + } + // blobs + for (auto &info : m_odbObjectsData.blobs.info) { + OdbObjectsData::BlobInfo &blobInfo = info.second; + const size_t objectSize = blobInfo.size; + + m_odbObjectsData.blobs.totalSize += objectSize; + m_odbObjectsData.blobs.maxSize = std::max(m_odbObjectsData.blobs.maxSize, objectSize); + } + // no need to process tags here (we already have the count) +} + +/** + * RepoAnalysis::statsHistoryAndBiggestCheckouts + * Statistics for historyStructure and biggestCheckouts. + * \return true if success; false if something went wrong. + */ +bool RepoAnalysis::statsHistoryAndBiggestCheckouts() +{ + if (!calculateBiggestCheckouts()) { + return false; + } + + if (!calculateMaxTagDepth()) { + return false; + } + + // calculate max commit history depth + m_statistics.historyStructure.maxDepth = m_odbObjectsData.commits.graph.CalculateMaxDepth(); + + return true; +} + +/** + * RepoAnalysis::calculateBiggestCheckouts + * + * Once threads have collected data from objects and unreachable objects + * have been pruned, biggest checkouts can be calculated. + * Threads have already collected partial non-recursive tree statistics. + * \return true if success; false if something went wrong. + */ +bool RepoAnalysis::calculateBiggestCheckouts() +{ + for (auto &commitInfo : m_odbObjectsData.commits.info) + { + // calculate this commit's data + const std::string &commitOidTree = commitInfo.second.oidTree; + + OdbObjectsData::iterTreeInfo itTreeInfo {}; + if ((itTreeInfo = calculateTreeStatistics(commitOidTree)) == m_odbObjectsData.trees.info.end()) { + return false; + } + + // update biggestCheckouts data + OdbObjectsData::TreeInfoAndStats &treeInfoAndStats = itTreeInfo->second; + m_statistics.biggestCheckouts.numDirectories = std::max( + m_statistics.biggestCheckouts.numDirectories, treeInfoAndStats.stats.numDirectories); + m_statistics.biggestCheckouts.totalFileSize = std::max( + m_statistics.biggestCheckouts.totalFileSize, treeInfoAndStats.stats.totalFileSize); + m_statistics.biggestCheckouts.maxPathDepth = std::max( + m_statistics.biggestCheckouts.maxPathDepth, treeInfoAndStats.stats.maxPathDepth); + m_statistics.biggestCheckouts.numFiles = std::max( + m_statistics.biggestCheckouts.numFiles, treeInfoAndStats.stats.numFiles); + m_statistics.biggestCheckouts.maxPathLength = std::max( + m_statistics.biggestCheckouts.maxPathLength, treeInfoAndStats.stats.maxPathLength); + m_statistics.biggestCheckouts.numSymlinks = std::max( + m_statistics.biggestCheckouts.numSymlinks, treeInfoAndStats.stats.numSymlinks); + m_statistics.biggestCheckouts.numSubmodules = std::max( + m_statistics.biggestCheckouts.numSubmodules, treeInfoAndStats.stats.numSubmodules); + } + + return true; +} + +/** + * RepoAnalysis::calculateTreeStatistics + * + * Calculates tree statistics recursively, considering individual tree's statistics + * have already been calculated. + * The maximum number of recursive calls depend directly on the maximum path depth of + * the repository. For instance, the linux repository have a maximum path depth of 13, + * so it should be safe against stack overflow. + * Returns an iterator to the tree info container, or to end if something went wrong. + */ +OdbObjectsData::iterTreeInfo RepoAnalysis::calculateTreeStatistics(const std::string &oidTree) +{ + OdbObjectsData::iterTreeInfo itTreeInfo = m_odbObjectsData.trees.info.find(oidTree); + if (itTreeInfo == m_odbObjectsData.trees.info.end()) { + return itTreeInfo; + } + + OdbObjectsData::TreeInfoAndStats &treeInfoAndStats = itTreeInfo->second; + + // prune recursivity + if (treeInfoAndStats.statsDone) { + return itTreeInfo; + } + + ++treeInfoAndStats.stats.numDirectories; + ++treeInfoAndStats.stats.maxPathDepth; + // the following partial statistics have also been calculated in previous stage with threads: + // - treeInfoAndStats.stats.numFiles + // - treeInfoAndStats.stats.maxPathLength + // - treeInfoAndStats.stats.numSymLinks + // - treeInfoAndStats.stats.numSubmodules + + // totalFileSize + OdbObjectsData::iterBlobInfo itBlobInfo {}; + for (auto &oidBlob : treeInfoAndStats.entryBlobs) + { + if ((itBlobInfo = m_odbObjectsData.blobs.info.find(oidBlob)) == m_odbObjectsData.blobs.info.end()) { + return m_odbObjectsData.trees.info.end(); // to let the caller know that something went wrong + } + + treeInfoAndStats.stats.totalFileSize += itBlobInfo->second.size; + } + + // recursively into subtrees + for (const auto &subTreeNameLen : treeInfoAndStats.entryTreesNameLen) + { + OdbObjectsData::iterTreeInfo itSubTreeInfo {}; + if ((itSubTreeInfo = calculateTreeStatistics(subTreeNameLen.first)) == + m_odbObjectsData.trees.info.end()) { + return itSubTreeInfo; + } + + OdbObjectsData::TreeInfoAndStats &subTreeInfoAndStats = itSubTreeInfo->second; + treeInfoAndStats.stats.numDirectories += subTreeInfoAndStats.stats.numDirectories; + treeInfoAndStats.stats.maxPathDepth = std::max(treeInfoAndStats.stats.maxPathDepth, + subTreeInfoAndStats.stats.maxPathDepth + 1); + treeInfoAndStats.stats.maxPathLength = std::max(treeInfoAndStats.stats.maxPathLength, + subTreeNameLen.second + 1 + subTreeInfoAndStats.stats.maxPathLength); + treeInfoAndStats.stats.numFiles += subTreeInfoAndStats.stats.numFiles; + treeInfoAndStats.stats.totalFileSize += subTreeInfoAndStats.stats.totalFileSize; + treeInfoAndStats.stats.numSymlinks += subTreeInfoAndStats.stats.numSymlinks; + treeInfoAndStats.stats.numSubmodules += subTreeInfoAndStats.stats.numSubmodules; + } + + treeInfoAndStats.statsDone = true; + + return itTreeInfo; +} + +/** + * RepoAnalysis::calculateMaxTagDepth + * \return true if success; false if something went wrong. + */ +bool RepoAnalysis::calculateMaxTagDepth() +{ + for (auto &tag : m_odbObjectsData.tags.info) + { + OdbObjectsData::iterTagInfo itTagInfo {}; + if ((itTagInfo = calculateTagDepth(tag.first)) == m_odbObjectsData.tags.info.end()) { + return false; + } + + // update maxTagDepth + OdbObjectsData::TagInfo &tagInfo = itTagInfo->second; + m_statistics.historyStructure.maxTagDepth = std::max( + m_statistics.historyStructure.maxTagDepth, tagInfo.depth); + } + + return true; +} + +/** + * RepoAnalysis::calculateTagDepth + * + * Calculates recursively the tag depth of the oidTag passed as a parameter. + * Returns an iterator to the tag info container, or to end if something went wrong. + */ +OdbObjectsData::iterTagInfo RepoAnalysis::calculateTagDepth(const std::string &oidTag) +{ + OdbObjectsData::iterTagInfo itTagInfo = m_odbObjectsData.tags.info.find(oidTag); + if (itTagInfo == m_odbObjectsData.tags.info.end()) { + return itTagInfo; + } + + OdbObjectsData::TagInfo &tagInfo = itTagInfo->second; + + // prune recursivity + if (tagInfo.depth != OdbObjectsData::TagInfo::kUnsetDepth) { + return itTagInfo; + } + + ++tagInfo.depth; + + if (tagInfo.typeTarget == GIT_OBJECT_TAG) + { + OdbObjectsData::iterTagInfo itChainedTagInfo {}; + if ((itChainedTagInfo = calculateTagDepth(tagInfo.oidTarget)) == m_odbObjectsData.tags.info.end()) { + return itChainedTagInfo; + } + + OdbObjectsData::TagInfo &chainedTagInfo = itChainedTagInfo->second; + tagInfo.depth += chainedTagInfo.depth; + } + + return itTagInfo; +} + +/** + * RepoAnalysis::fillOutStatistics + */ +void RepoAnalysis::fillOutStatistics() +{ + m_statistics.repositorySize.commits.count = m_odbObjectsData.commits.info.size(); + m_statistics.repositorySize.commits.size = m_odbObjectsData.commits.totalSize; + m_statistics.repositorySize.trees.count = m_odbObjectsData.trees.info.size(); + m_statistics.repositorySize.trees.size = m_odbObjectsData.trees.totalSize; + m_statistics.repositorySize.trees.entries = m_odbObjectsData.trees.totalEntries; + m_statistics.repositorySize.blobs.count = m_odbObjectsData.blobs.info.size(); + m_statistics.repositorySize.blobs.size = m_odbObjectsData.blobs.totalSize; + m_statistics.repositorySize.annotatedTags.count = m_odbObjectsData.tags.info.size(); + + m_statistics.biggestObjects.commits.maxSize = m_odbObjectsData.commits.maxSize; + m_statistics.biggestObjects.commits.maxParents = m_odbObjectsData.commits.maxParents; + m_statistics.biggestObjects.trees.maxEntries = m_odbObjectsData.trees.maxEntries; + m_statistics.biggestObjects.blobs.maxSize = m_odbObjectsData.blobs.maxSize; + + // m_statistics.biggestCheckouts have already been filled out while running +} + +/** + * RepoAnalysis::repositorySizeToJS + */ +v8::Local RepoAnalysis::repositorySizeToJS() const +{ + v8::Local commits = Nan::New(); + Nan::Set(commits, Nan::New("count").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.commits.count)); + Nan::Set(commits, Nan::New("size").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.commits.size)); + + v8::Local trees = Nan::New(); + Nan::Set(trees, Nan::New("count").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.trees.count)); + Nan::Set(trees, Nan::New("size").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.trees.size)); + Nan::Set(trees, Nan::New("entries").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.trees.entries)); + + v8::Local blobs = Nan::New(); + Nan::Set(blobs, Nan::New("count").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.blobs.count)); + Nan::Set(blobs, Nan::New("size").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.blobs.size)); + + v8::Local annotatedTags = Nan::New(); + Nan::Set(annotatedTags, Nan::New("count").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.annotatedTags.count)); + + v8::Local references = Nan::New(); + Nan::Set(references, Nan::New("count").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.references.count)); + + v8::Local result = Nan::New(); + Nan::Set(result, Nan::New("commits").ToLocalChecked(), commits); + Nan::Set(result, Nan::New("trees").ToLocalChecked(), trees); + Nan::Set(result, Nan::New("blobs").ToLocalChecked(), blobs); + Nan::Set(result, Nan::New("annotatedTags").ToLocalChecked(), annotatedTags); + Nan::Set(result, Nan::New("references").ToLocalChecked(), references); + + return result; +} + +/** + * RepoAnalysis::biggestObjectsToJS + */ +v8::Local RepoAnalysis::biggestObjectsToJS() const +{ + v8::Local commits = Nan::New(); + Nan::Set(commits, Nan::New("maxSize").ToLocalChecked(), + Nan::New(m_statistics.biggestObjects.commits.maxSize)); + Nan::Set(commits, Nan::New("maxParents").ToLocalChecked(), + Nan::New(m_statistics.biggestObjects.commits.maxParents)); + + v8::Local trees = Nan::New(); + Nan::Set(trees, Nan::New("maxEntries").ToLocalChecked(), + Nan::New(m_statistics.biggestObjects.trees.maxEntries)); + + v8::Local blobs = Nan::New(); + Nan::Set(blobs, Nan::New("maxSize").ToLocalChecked(), + Nan::New(m_statistics.biggestObjects.blobs.maxSize)); + + v8::Local result = Nan::New(); + Nan::Set(result, Nan::New("commits").ToLocalChecked(), commits); + Nan::Set(result, Nan::New("trees").ToLocalChecked(), trees); + Nan::Set(result, Nan::New("blobs").ToLocalChecked(), blobs); + + return result; +} + +/** + * RepoAnalysis::historyStructureToJS + */ +v8::Local RepoAnalysis::historyStructureToJS() const +{ + v8::Local result = Nan::New(); + Nan::Set(result, Nan::New("maxDepth").ToLocalChecked(), + Nan::New(m_statistics.historyStructure.maxDepth)); + Nan::Set(result, Nan::New("maxTagDepth").ToLocalChecked(), + Nan::New(m_statistics.historyStructure.maxTagDepth)); + + return result; +} + +/** + * RepoAnalysis::biggestCheckoutsToJS + */ +v8::Local RepoAnalysis::biggestCheckoutsToJS() const +{ + v8::Local result = Nan::New(); + Nan::Set(result, Nan::New("numDirectories").ToLocalChecked(), + Nan::New(m_statistics.biggestCheckouts.numDirectories)); + Nan::Set(result, Nan::New("maxPathDepth").ToLocalChecked(), + Nan::New(m_statistics.biggestCheckouts.maxPathDepth)); + Nan::Set(result, Nan::New("maxPathLength").ToLocalChecked(), + Nan::New(m_statistics.biggestCheckouts.maxPathLength)); + Nan::Set(result, Nan::New("numFiles").ToLocalChecked(), + Nan::New(m_statistics.biggestCheckouts.numFiles)); + Nan::Set(result, Nan::New("totalFileSize").ToLocalChecked(), + Nan::New(m_statistics.biggestCheckouts.totalFileSize)); + Nan::Set(result, Nan::New("numSymlinks").ToLocalChecked(), + Nan::New(m_statistics.biggestCheckouts.numSymlinks)); + Nan::Set(result, Nan::New("numSubmodules").ToLocalChecked(), + Nan::New(m_statistics.biggestCheckouts.numSubmodules)); + + return result; +} + +NAN_METHOD(GitRepository::Statistics) +{ + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + StatisticsBaton* baton = new StatisticsBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->repo = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + baton->out = static_cast(new RepoAnalysis(baton->repo)); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + StatisticsWorker *worker = new StatisticsWorker(baton, callback, cleanupHandles); + worker->Reference("repo", info.This()); + nodegit::Context *nodegitContext = + reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitRepository::StatisticsWorker::AcquireLocks() +{ + nodegit::LockMaster lockMaster(true, baton->repo); + + return lockMaster; +} + +void GitRepository::StatisticsWorker::Execute() +{ + git_error_clear(); + + RepoAnalysis *repoAnalysis = static_cast(baton->out); + if ((baton->error_code = repoAnalysis->Analyze()) != GIT_OK) + { + if (git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } + + delete repoAnalysis; + baton->out = nullptr; + } +} + +void GitRepository::StatisticsWorker::HandleErrorCallback() +{ + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + RepoAnalysis *repoAnalysis = static_cast(baton->out); + if (repoAnalysis) { + delete repoAnalysis; + } + + delete baton; +} + +void GitRepository::StatisticsWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + RepoAnalysis *repoAnalysis = static_cast(baton->out); + Local result = repoAnalysis->StatisticsToJS(); + + delete repoAnalysis; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local err; + + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method statistics has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("GitRepository.statistics").ToLocalChecked()); + Local argv[1] = { + err + }; + + callback->Call(1, argv, async_resource); + + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Method statistics has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("GitRepository.statistics").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } + + delete baton; +} \ No newline at end of file diff --git a/generate/templates/manual/revwalk/commit_walk.cc b/generate/templates/manual/revwalk/commit_walk.cc new file mode 100644 index 0000000000..4fe60de9e1 --- /dev/null +++ b/generate/templates/manual/revwalk/commit_walk.cc @@ -0,0 +1,275 @@ +#define SET_ON_OBJECT(obj, field, data) Nan::Set(obj, Nan::New(field).ToLocalChecked(), data) + +v8::Local signatureToJavascript(const git_signature *signature) { + v8::Local signatureObject = Nan::New(); + SET_ON_OBJECT(signatureObject, "name", Nan::New(signature->name).ToLocalChecked()); + SET_ON_OBJECT(signatureObject, "email", Nan::New(signature->email).ToLocalChecked()); + SET_ON_OBJECT(signatureObject, "date", Nan::New(signature->when.time * 1000)); + std::stringstream fullSignature; + fullSignature << signature->name << " <" << signature << ">"; + SET_ON_OBJECT(signatureObject, "full", Nan::New(fullSignature.str()).ToLocalChecked()); + return signatureObject; +} + +#include +class CommitModel { +public: + CommitModel(git_commit *commit, bool fetchSignature): + commit(commit), + fetchSignature(fetchSignature), + signature({ 0, 0, 0 }), + signedData({ 0, 0, 0 }) + { + if (fetchSignature) { + const int error = git_commit_extract_signature( + &signature, + &signedData, + git_commit_owner(commit), + const_cast(git_commit_id(commit)), + NULL + ); + if (error != GIT_ENOTFOUND) { + assert(error == GIT_OK); + } + } + + const size_t parentCount = git_commit_parentcount(commit); + parentIds.reserve(parentCount); + for (size_t parentIndex = 0; parentIndex < parentCount; ++parentIndex) { + parentIds.push_back(git_oid_tostr_s(git_commit_parent_id(commit, parentIndex))); + } + } + + CommitModel(const CommitModel &) = delete; + CommitModel(CommitModel &&) = delete; + CommitModel &operator=(const CommitModel &) = delete; + CommitModel &operator=(CommitModel &&) = delete; + + v8::Local toJavascript() { + if (!fetchSignature) { + v8::Local commitObject = GitCommit::New( + commit, + true, + Nan::To(GitRepository::New( + git_commit_owner(commit), + true + )).ToLocalChecked() + ); + commit = NULL; + return commitObject; + } + + v8::Local commitModel = Nan::New(); + SET_ON_OBJECT(commitModel, "sha", Nan::New(git_oid_tostr_s(git_commit_id(commit))).ToLocalChecked()); + SET_ON_OBJECT(commitModel, "message", Nan::New(git_commit_message(commit)).ToLocalChecked()); + SET_ON_OBJECT(commitModel, "author", signatureToJavascript(git_commit_author(commit))); + SET_ON_OBJECT(commitModel, "committer", signatureToJavascript(git_commit_committer(commit))); + + size_t parentCount = parentIds.size(); + v8::Local parents = Nan::New(parentCount); + for (size_t parentIndex = 0; parentIndex < parentCount; ++parentIndex) { + Nan::Set(parents, Nan::New(parentIndex), Nan::New(parentIds[parentIndex]).ToLocalChecked()); + } + SET_ON_OBJECT(commitModel, "parents", parents); + + if (signature.size != 0 || signedData.size != 0) { + v8::Local gpgSignature = Nan::New(); + if (signature.size != 0) { + SET_ON_OBJECT(gpgSignature, "signature", Nan::New(signature.ptr).ToLocalChecked()); + } else { + SET_ON_OBJECT(gpgSignature, "signature", Nan::Null()); + } + + if (signedData.size != 0) { + SET_ON_OBJECT(gpgSignature, "signedData", Nan::New(signedData.ptr).ToLocalChecked()); + } else { + SET_ON_OBJECT(gpgSignature, "signedData", Nan::Null()); + } + + SET_ON_OBJECT(commitModel, "gpgSignature", gpgSignature); + } + + return commitModel; + } + + ~CommitModel() { + git_buf_dispose(&signature); + git_buf_dispose(&signedData); + if (commit) { + git_commit_free(commit); + } + } + +private: + git_commit *commit; + bool fetchSignature; + git_buf signature, signedData; + std::vector parentIds; +}; + +NAN_METHOD(GitRevwalk::CommitWalk) { + if (info.Length() == 0 || !info[0]->IsNumber()) { + return Nan::ThrowError("Max count is required and must be a number."); + } + + if (info.Length() >= 3 && !info[1]->IsNull() && !info[1]->IsUndefined() && !info[1]->IsObject()) { + return Nan::ThrowError("Options must be an object, null, or undefined."); + } + + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + CommitWalkBaton* baton = new CommitWalkBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->max_count = Nan::To(info[0]).FromJust(); + std::vector *out = new std::vector; + out->reserve(baton->max_count); + baton->out = static_cast(out); + if (info.Length() == 3 && info[1]->IsObject()) { + v8::Local options = Nan::To(info[1]).ToLocalChecked(); + v8::Local propName = Nan::New("returnPlainObjects").ToLocalChecked(); + if (Nan::Has(options, propName).FromJust()) { + baton->returnPlainObjects = Nan::Get(options, propName).ToLocalChecked()->IsTrue(); + } else { + baton->returnPlainObjects = false; + } + } else { + baton->returnPlainObjects = false; + } + baton->walk = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + CommitWalkWorker *worker = new CommitWalkWorker(baton, callback, cleanupHandles); + worker->Reference("commitWalk", info.This()); + + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitRevwalk::CommitWalkWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true); + return lockMaster; +} + +void GitRevwalk::CommitWalkWorker::Execute() { + giterr_clear(); + + std::vector *out = static_cast *>(baton->out); + for (int i = 0; i < baton->max_count; i++) { + git_oid next_commit_id; + baton->error_code = git_revwalk_next(&next_commit_id, baton->walk); + + if (baton->error_code == GIT_ITEROVER) { + baton->error_code = GIT_OK; + return; + } + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + while (out->size()) { + delete out->back(); + out->pop_back(); + } + + delete out; + baton->out = NULL; + + return; + } + + git_commit *commit; + baton->error_code = git_commit_lookup(&commit, git_revwalk_repository(baton->walk), &next_commit_id); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + while (out->size()) { + delete out->back(); + out->pop_back(); + } + + delete out; + baton->out = NULL; + + return; + } + + out->push_back(new CommitModel(commit, baton->returnPlainObjects)); + } +} + +void GitRevwalk::CommitWalkWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + auto out = static_cast *>(baton->out); + while (out->size()) { + delete out->back(); + out->pop_back(); + } + + delete out; + + delete baton; +} + +void GitRevwalk::CommitWalkWorker::HandleOKCallback() { + if (baton->out != NULL) { + std::vector *out = static_cast *>(baton->out); + const unsigned int size = out->size(); + Local result = Nan::New(size); + for (unsigned int i = 0; i < size; i++) { + CommitModel *commitModel = out->at(i); + Nan::Set( + result, + Nan::New(i), + commitModel->toJavascript() + ); + delete commitModel; + } + + delete out; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } else if (baton->error) { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } else if (baton->error_code < 0) { + Local err = Nan::To(Nan::Error("Revwalk commitWalk has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.commitWalk").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } else { + callback->Call(0, NULL, async_resource); + } + + delete baton; +} diff --git a/generate/templates/manual/revwalk/fast_walk.cc b/generate/templates/manual/revwalk/fast_walk.cc index ec3a10cd78..ce2d05a2d3 100644 --- a/generate/templates/manual/revwalk/fast_walk.cc +++ b/generate/templates/manual/revwalk/fast_walk.cc @@ -4,33 +4,40 @@ NAN_METHOD(GitRevwalk::FastWalk) return Nan::ThrowError("Max count is required and must be a number."); } - if (info.Length() == 1 || !info[1]->IsFunction()) { + if (!info[info.Length() - 1]->IsFunction()) { return Nan::ThrowError("Callback is required and must be a Function."); } - FastWalkBaton* baton = new FastWalkBaton; + FastWalkBaton* baton = new FastWalkBaton(); baton->error_code = GIT_OK; baton->error = NULL; - baton->max_count = (unsigned int)info[0]->ToNumber()->Value(); + baton->max_count = Nan::To(info[0]).FromJust(); baton->out = new std::vector; baton->out->reserve(baton->max_count); baton->walk = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); - Nan::Callback *callback = new Nan::Callback(Local::Cast(info[1])); - FastWalkWorker *worker = new FastWalkWorker(baton, callback); - worker->SaveToPersistent("fastWalk", info.This()); + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + FastWalkWorker *worker = new FastWalkWorker(baton, callback, cleanupHandles); + worker->Reference("fastWalk", info.This()); - Nan::AsyncQueueWorker(worker); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); return; } +nodegit::LockMaster GitRevwalk::FastWalkWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true); + return lockMaster; +} + void GitRevwalk::FastWalkWorker::Execute() { for (int i = 0; i < baton->max_count; i++) { git_oid *nextCommit = (git_oid *)malloc(sizeof(git_oid)); - giterr_clear(); + git_error_clear(); baton->error_code = git_revwalk_next(nextCommit, baton->walk); if (baton->error_code != GIT_OK) @@ -40,7 +47,7 @@ void GitRevwalk::FastWalkWorker::Execute() free(nextCommit); if (baton->error_code != GIT_ITEROVER) { - baton->error = git_error_dup(giterr_last()); + baton->error = git_error_dup(git_error_last()); while(!baton->out->empty()) { @@ -66,6 +73,25 @@ void GitRevwalk::FastWalkWorker::Execute() } } +void GitRevwalk::FastWalkWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + while(!baton->out->empty()) { + free(baton->out->back()); + baton->out->pop_back(); + } + + delete baton->out; + + delete baton; +} + void GitRevwalk::FastWalkWorker::HandleOKCallback() { if (baton->out != NULL) @@ -82,7 +108,7 @@ void GitRevwalk::FastWalkWorker::HandleOKCallback() Nan::Null(), result }; - callback->Call(2, argv); + callback->Call(2, argv, async_resource); } else { @@ -90,15 +116,16 @@ void GitRevwalk::FastWalkWorker::HandleOKCallback() { Local err; if (baton->error->message) { - err = Nan::Error(baton->error->message)->ToObject(); + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); } else { - err = Nan::Error("Method fastWalk has thrown an error.")->ToObject(); + err = Nan::To(Nan::Error("Method fastWalk has thrown an error.")).ToLocalChecked(); } - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fastWalk").ToLocalChecked()); Local argv[1] = { err }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); if (baton->error->message) { free((void *)baton->error->message); @@ -108,66 +135,34 @@ void GitRevwalk::FastWalkWorker::HandleOKCallback() } else if (baton->error_code < 0) { - std::queue< Local > workerArguments; bool callbackFired = false; - - while(!workerArguments.empty()) - { - Local node = workerArguments.front(); - workerArguments.pop(); - - if ( - !node->IsObject() - || node->IsArray() - || node->IsBooleanObject() - || node->IsDate() - || node->IsFunction() - || node->IsNumberObject() - || node->IsRegExp() - || node->IsStringObject() - ) - { - continue; - } - - Local nodeObj = node->ToObject(); - Local checkValue = GetPrivate(nodeObj, Nan::New("NodeGitPromiseError").ToLocalChecked()); - - if (!checkValue.IsEmpty() && !checkValue->IsNull() && !checkValue->IsUndefined()) - { - Local argv[1] = { - checkValue->ToObject() + if (!callbackErrorHandle.IsEmpty()) { + v8::Local maybeError = Nan::New(callbackErrorHandle); + if (!maybeError->IsNull() && !maybeError->IsUndefined()) { + v8::Local argv[1] = { + maybeError }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); callbackFired = true; - break; - } - - Local properties = nodeObj->GetPropertyNames(); - for (unsigned int propIndex = 0; propIndex < properties->Length(); ++propIndex) - { - Local propName = properties->Get(propIndex)->ToString(); - Local nodeToQueue = nodeObj->Get(propName); - if (!nodeToQueue->IsUndefined()) - { - workerArguments.push(nodeToQueue); - } } } if (!callbackFired) { - Local err = Nan::Error("Method next has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Local err = Nan::To(Nan::Error("Method next has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fastWalk").ToLocalChecked()); Local argv[1] = { err }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); } } else { - callback->Call(0, NULL); + callback->Call(0, NULL, async_resource); } } + + delete baton; } diff --git a/generate/templates/manual/revwalk/file_history_walk.cc b/generate/templates/manual/revwalk/file_history_walk.cc index 2204826795..569bb022dc 100644 --- a/generate/templates/manual/revwalk/file_history_walk.cc +++ b/generate/templates/manual/revwalk/file_history_walk.cc @@ -1,3 +1,196 @@ +// Note: commit is not owned by this class (must be freed elsewhere) +class FileHistoryEvent { +public: + FileHistoryEvent( + git_delta_t inputType, + bool inputExistsInCurrentTree, + bool inputIsMergeCommit, + git_commit *inputCommit, + const char *inputFrom, + const char *inputTo + ): + type(inputType), + existsInCurrentTree(inputExistsInCurrentTree), + isMergeCommit(inputIsMergeCommit), + from(inputFrom == NULL ? NULL : strdup(inputFrom)), + to(inputTo == NULL ? NULL : strdup(inputTo)), + commit(inputCommit) + { + if (inputCommit != NULL) { + const int error = git_commit_dup(&commit, inputCommit); + assert(error == GIT_OK); + } + } + + FileHistoryEvent(const FileHistoryEvent &) = delete; + FileHistoryEvent(FileHistoryEvent &&) = delete; + FileHistoryEvent &operator=(const FileHistoryEvent &) = delete; + FileHistoryEvent &operator=(FileHistoryEvent &&) = delete; + + ~FileHistoryEvent() { + if (commit != NULL) { + git_commit_free(commit); + } + + if(from != NULL) { + free((void *)from); + } + + if(to != NULL) { + free((void *)to); + } + } + + v8::Local toJavascript() { + v8::Local historyEntry = Nan::New(); + v8::Local owners = Nan::New(0); + Nan::Set( + owners, + Nan::New(owners->Length()), + Nan::To(GitRepository::New( + git_commit_owner(commit), + true + )).ToLocalChecked() + ); + Nan::Set(historyEntry, Nan::New("commit").ToLocalChecked(), GitCommit::New(commit, true, owners)); + commit = NULL; + Nan::Set(historyEntry, Nan::New("status").ToLocalChecked(), Nan::New(type)); + Nan::Set(historyEntry, Nan::New("isMergeCommit").ToLocalChecked(), Nan::New(isMergeCommit)); + if (type == GIT_DELTA_RENAMED) { + if (from != NULL) { + Nan::Set(historyEntry, Nan::New("oldName").ToLocalChecked(), Nan::New(from).ToLocalChecked()); + } + if (to != NULL) { + Nan::Set(historyEntry, Nan::New("newName").ToLocalChecked(), Nan::New(to).ToLocalChecked()); + } + } + return historyEntry; + } + + static int buildHistoryEvent( + FileHistoryEvent **fileHistoryEvent, + git_repository *repo, + git_commit *currentCommit, + git_tree *currentTree, + git_tree *parentTree, + const char *filePath + ) { + int errorCode; + git_tree_entry *currentEntry; + if (git_tree_entry_bypath(¤tEntry, currentTree, filePath) != GIT_OK) { + currentEntry = NULL; + } + git_tree_entry *parentEntry; + if (git_tree_entry_bypath(&parentEntry, parentTree, filePath) != GIT_OK) { + parentEntry = NULL; + } + + if (!currentEntry && !parentEntry) { + *fileHistoryEvent = new FileHistoryEvent(GIT_DELTA_UNMODIFIED, false, false, currentCommit, NULL, NULL); + return GIT_OK; + } + + // The filePath was added + if (currentEntry && !parentEntry) { + git_diff *diff; + if ((errorCode = git_diff_tree_to_tree(&diff, repo, parentTree, currentTree, NULL)) != GIT_OK) { + git_tree_entry_free(currentEntry); + return errorCode; + } + if ((errorCode = git_diff_find_similar(diff, NULL)) != GIT_OK) { + git_diff_free(diff); + git_tree_entry_free(currentEntry); + return errorCode; + } + const size_t numDeltas = git_diff_num_deltas(diff); + for (size_t i = 0; i < numDeltas; ++i) { + const git_diff_delta *delta = git_diff_get_delta(diff, i); + if (delta->new_file.path != NULL && std::strcmp(delta->new_file.path, filePath) == 0) { + if (delta->status == GIT_DELTA_RENAMED + || (delta->old_file.path != NULL && std::strcmp(delta->old_file.path, filePath) != 0)) { + *fileHistoryEvent = new FileHistoryEvent( + GIT_DELTA_RENAMED, + true, + false, + currentCommit, + delta->old_file.path, + delta->new_file.path + ); + git_diff_free(diff); + git_tree_entry_free(currentEntry); + return GIT_OK; + } + break; + } + } + git_diff_free(diff); + git_tree_entry_free(currentEntry); + + *fileHistoryEvent = new FileHistoryEvent(GIT_DELTA_ADDED, true, false, currentCommit, NULL, NULL); + return GIT_OK; + } + + // The filePath was deleted + if (!currentEntry && parentEntry) { + git_diff *diff; + if ((errorCode = git_diff_tree_to_tree(&diff, repo, parentTree, currentTree, NULL)) != GIT_OK) { + git_tree_entry_free(parentEntry); + return errorCode; + } + if ((errorCode = git_diff_find_similar(diff, NULL)) != GIT_OK) { + git_diff_free(diff); + git_tree_entry_free(parentEntry); + return errorCode; + } + const size_t numDeltas = git_diff_num_deltas(diff); + for (size_t i = 0; i < numDeltas; ++i) { + const git_diff_delta *delta = git_diff_get_delta(diff, i); + if (delta->old_file.path != NULL && std::strcmp(delta->old_file.path, filePath) == 0) { + if (delta->status == GIT_DELTA_RENAMED + || (delta->new_file.path != NULL && std::strcmp(delta->new_file.path, filePath) != 0)) { + *fileHistoryEvent = new FileHistoryEvent( + GIT_DELTA_RENAMED, + false, + false, + currentCommit, + delta->old_file.path, + delta->new_file.path + ); + git_diff_free(diff); + git_tree_entry_free(parentEntry); + return GIT_OK; + } + break; + } + } + git_diff_free(diff); + git_tree_entry_free(parentEntry); + + *fileHistoryEvent = new FileHistoryEvent(GIT_DELTA_DELETED, false, false, currentCommit, NULL, NULL); + return GIT_OK; + } + + if (git_oid_cmp(git_tree_entry_id(currentEntry), git_tree_entry_id(parentEntry)) != 0 + || git_tree_entry_filemode(currentEntry) != git_tree_entry_filemode(parentEntry) + ) { + git_tree_entry_free(parentEntry); + git_tree_entry_free(currentEntry); + *fileHistoryEvent = new FileHistoryEvent(GIT_DELTA_MODIFIED, true, false, currentCommit, NULL, NULL); + return GIT_OK; + } + + *fileHistoryEvent = new FileHistoryEvent(GIT_DELTA_UNMODIFIED, true, false, currentCommit, NULL, NULL); + git_tree_entry_free(parentEntry); + git_tree_entry_free(currentEntry); + return GIT_OK; + } + + git_delta_t type; + bool existsInCurrentTree, isMergeCommit; + const char *from, *to; + git_commit *commit; +}; + NAN_METHOD(GitRevwalk::FileHistoryWalk) { if (info.Length() == 0 || !info[0]->IsString()) { @@ -8,298 +201,299 @@ NAN_METHOD(GitRevwalk::FileHistoryWalk) return Nan::ThrowError("Max count is required and must be a number."); } - if (info.Length() == 2 || !info[2]->IsFunction()) { + if (!info[info.Length() - 1]->IsFunction()) { return Nan::ThrowError("Callback is required and must be a Function."); } - FileHistoryWalkBaton* baton = new FileHistoryWalkBaton; + FileHistoryWalkBaton* baton = new FileHistoryWalkBaton(); baton->error_code = GIT_OK; baton->error = NULL; - String::Utf8Value from_js_file_path(info[0]->ToString()); + Nan::Utf8String from_js_file_path(Nan::To(info[0]).ToLocalChecked()); baton->file_path = strdup(*from_js_file_path); - baton->max_count = (unsigned int)info[1]->ToNumber()->Value(); - baton->out = new std::vector< std::pair > *>; + baton->max_count = Nan::To(info[1]).FromJust(); + baton->out = new std::vector; baton->out->reserve(baton->max_count); baton->walk = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); - Nan::Callback *callback = new Nan::Callback(Local::Cast(info[2])); - FileHistoryWalkWorker *worker = new FileHistoryWalkWorker(baton, callback); - worker->SaveToPersistent("fileHistoryWalk", info.This()); + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + FileHistoryWalkWorker *worker = new FileHistoryWalkWorker(baton, callback, cleanupHandles); + worker->Reference("fileHistoryWalk", info.This()); - Nan::AsyncQueueWorker(worker); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); return; } +nodegit::LockMaster GitRevwalk::FileHistoryWalkWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true); + return lockMaster; +} + void GitRevwalk::FileHistoryWalkWorker::Execute() { git_repository *repo = git_revwalk_repository(baton->walk); - git_oid *nextOid = (git_oid *)malloc(sizeof(git_oid)); - giterr_clear(); + git_oid currentOid; + git_error_clear(); for ( - unsigned int i = 0; - i < baton->max_count && (baton->error_code = git_revwalk_next(nextOid, baton->walk)) == GIT_OK; - ++i + unsigned int revwalkIterations = 0; + revwalkIterations < baton->max_count && (baton->error_code = git_revwalk_next(¤tOid, baton->walk)) == GIT_OK; + ++revwalkIterations ) { - // check if this commit has the file - git_commit *nextCommit; - - if ((baton->error_code = git_commit_lookup(&nextCommit, repo, nextOid)) != GIT_OK) { + git_commit *currentCommit; + if ((baton->error_code = git_commit_lookup(¤tCommit, repo, ¤tOid)) != GIT_OK) { break; } - git_tree *thisTree, *parentTree; - if ((baton->error_code = git_commit_tree(&thisTree, nextCommit)) != GIT_OK) { - git_commit_free(nextCommit); + git_tree *currentTree; + if ((baton->error_code = git_commit_tree(¤tTree, currentCommit)) != GIT_OK) { + git_commit_free(currentCommit); break; } - git_diff *diffs; - git_diff_options opts = GIT_DIFF_OPTIONS_INIT; - char *file_path = strdup(baton->file_path); - opts.pathspec.strings = &file_path; - opts.pathspec.count = 1; - git_commit *parent; - unsigned int parents = git_commit_parentcount(nextCommit); - if (parents > 1) { - git_commit_free(nextCommit); - continue; - } else if (parents == 1) { - if ((baton->error_code = git_commit_parent(&parent, nextCommit, 0)) != GIT_OK) { - git_commit_free(nextCommit); - break; + const unsigned int parentCount = git_commit_parentcount(currentCommit); + if (parentCount == 0) { + git_tree_entry* entry; + if (git_tree_entry_bypath(&entry, currentTree, baton->file_path) == GIT_OK) { + baton->out->push_back(new FileHistoryEvent(GIT_DELTA_ADDED, false, false, currentCommit, NULL, NULL)); + git_tree_entry_free(entry); } - if ( - (baton->error_code = git_commit_tree(&parentTree, parent)) != GIT_OK || - (baton->error_code = git_diff_tree_to_tree(&diffs, repo, parentTree, thisTree, &opts)) != GIT_OK - ) { - git_commit_free(nextCommit); - git_commit_free(parent); + git_commit_free(currentCommit); + git_tree_free(currentTree); + continue; + } + + if (parentCount == 1) { + git_commit *parentCommit; + if ((baton->error_code = git_commit_parent(&parentCommit, currentCommit, 0)) != GIT_OK) { + git_commit_free(currentCommit); + git_tree_free(currentTree); break; } - } else { - if ((baton->error_code = git_diff_tree_to_tree(&diffs, repo, NULL, thisTree, &opts)) != GIT_OK) { - git_commit_free(nextCommit); + + git_tree *parentTree; + if ((baton->error_code = git_commit_tree(&parentTree, parentCommit)) != GIT_OK) { + git_commit_free(currentCommit); + git_commit_free(parentCommit); + git_tree_free(currentTree); break; } - } - free(file_path); - opts.pathspec.strings = NULL; - opts.pathspec.count = 0; - bool flag = false; - bool doRenamedPass = false; - unsigned int numDeltas = git_diff_num_deltas(diffs); - for (unsigned int j = 0; j < numDeltas; ++j) { - git_patch *nextPatch; - baton->error_code = git_patch_from_diff(&nextPatch, diffs, j); - - if (baton->error_code < GIT_OK) { + FileHistoryEvent *fileHistoryEvent; + if ((baton->error_code = FileHistoryEvent::buildHistoryEvent( + &fileHistoryEvent, + repo, + currentCommit, + currentTree, + parentTree, + baton->file_path + )) != GIT_OK) { + git_commit_free(currentCommit); + git_commit_free(parentCommit); + git_tree_free(currentTree); + git_tree_free(parentTree); break; } - if (nextPatch == NULL) { - continue; + if (fileHistoryEvent->type != GIT_DELTA_UNMODIFIED) { + baton->out->push_back(fileHistoryEvent); } - const git_diff_delta *delta = git_patch_get_delta(nextPatch); - bool isEqualOldFile = !strcmp(delta->old_file.path, baton->file_path); - bool isEqualNewFile = !strcmp(delta->new_file.path, baton->file_path); + git_commit_free(currentCommit); + git_commit_free(parentCommit); + git_tree_free(currentTree); + git_tree_free(parentTree); + continue; + } - if (isEqualNewFile) { - if (delta->status == GIT_DELTA_ADDED || delta->status == GIT_DELTA_DELETED) { - doRenamedPass = true; - break; - } - std::pair > *historyEntry; - if (!isEqualOldFile) { - historyEntry = new std::pair >( - nextCommit, - std::pair(strdup(delta->old_file.path), delta->status) - ); - } else { - historyEntry = new std::pair >( - nextCommit, - std::pair(strdup(delta->new_file.path), delta->status) - ); - } - baton->out->push_back(historyEntry); - flag = true; + std::pair firstMatchingParentIndex(false, 0); + bool fileExistsInCurrent = false, fileExistsInSomeParent = false; + for (unsigned int parentIndex = 0; parentIndex < parentCount; ++parentIndex) { + git_commit *parentCommit; + if ((baton->error_code = git_commit_parent(&parentCommit, currentCommit, parentIndex)) != GIT_OK) { + break; } - git_patch_free(nextPatch); - - if (flag) { + git_tree *parentTree; + if ((baton->error_code = git_commit_tree(&parentTree, parentCommit)) != GIT_OK) { + git_commit_free(parentCommit); break; } - } - if (doRenamedPass) { - git_diff_free(diffs); + FileHistoryEvent *fileHistoryEvent; + if ((baton->error_code = FileHistoryEvent::buildHistoryEvent( + &fileHistoryEvent, + repo, + currentCommit, + currentTree, + parentTree, + baton->file_path + )) != GIT_OK) { + git_tree_free(parentTree); + git_commit_free(parentCommit); + break; + } - if (parents == 1) { - if ((baton->error_code = git_diff_tree_to_tree(&diffs, repo, parentTree, thisTree, NULL)) != GIT_OK) { - git_commit_free(nextCommit); + switch (fileHistoryEvent->type) { + case GIT_DELTA_ADDED: { + fileExistsInCurrent = true; break; } - if ((baton->error_code = git_diff_find_similar(diffs, NULL)) != GIT_OK) { - git_commit_free(nextCommit); + case GIT_DELTA_MODIFIED: { + fileExistsInCurrent = true; + fileExistsInSomeParent = true; break; } - } else { - if ((baton->error_code = git_diff_tree_to_tree(&diffs, repo, NULL, thisTree, NULL)) != GIT_OK) { - git_commit_free(nextCommit); + case GIT_DELTA_DELETED: { + fileExistsInSomeParent = true; break; } - if((baton->error_code = git_diff_find_similar(diffs, NULL)) != GIT_OK) { - git_commit_free(nextCommit); - break; - } - } - - flag = false; - numDeltas = git_diff_num_deltas(diffs); - for (unsigned int j = 0; j < numDeltas; ++j) { - git_patch *nextPatch; - baton->error_code = git_patch_from_diff(&nextPatch, diffs, j); - - if (baton->error_code < GIT_OK) { + case GIT_DELTA_RENAMED: { + if (fileHistoryEvent->existsInCurrentTree) { + fileExistsInCurrent = true; + } else { + fileExistsInSomeParent = true; + } break; } - - if (nextPatch == NULL) { - continue; - } - - const git_diff_delta *delta = git_patch_get_delta(nextPatch); - bool isEqualOldFile = !strcmp(delta->old_file.path, baton->file_path); - bool isEqualNewFile = !strcmp(delta->new_file.path, baton->file_path); - int oldLen = strlen(delta->old_file.path); - int newLen = strlen(delta->new_file.path); - char *outPair = new char[oldLen + newLen + 2]; - strcpy(outPair, delta->new_file.path); - outPair[newLen] = '\n'; - outPair[newLen + 1] = '\0'; - strcat(outPair, delta->old_file.path); - - if (isEqualNewFile) { - std::pair > *historyEntry; - if (!isEqualOldFile) { - historyEntry = new std::pair >( - nextCommit, - std::pair(strdup(outPair), delta->status) - ); - } else { - historyEntry = new std::pair >( - nextCommit, - std::pair(strdup(delta->new_file.path), delta->status) - ); + case GIT_DELTA_UNMODIFIED: { + if (fileHistoryEvent->existsInCurrentTree) { + fileExistsInCurrent = true; + fileExistsInSomeParent = true; } - baton->out->push_back(historyEntry); - flag = true; - } else if (isEqualOldFile) { - std::pair > *historyEntry; - historyEntry = new std::pair >( - nextCommit, - std::pair(strdup(outPair), delta->status) - ); - baton->out->push_back(historyEntry); - flag = true; + firstMatchingParentIndex = std::make_pair(true, parentIndex); + break; } - - delete[] outPair; - - git_patch_free(nextPatch); - - if (flag) { + default: { break; } } - } - git_diff_free(diffs); + delete fileHistoryEvent; + git_commit_free(parentCommit); + git_tree_free(parentTree); - if (!flag && nextCommit != NULL) { - git_commit_free(nextCommit); + if (firstMatchingParentIndex.first) { + break; + } } if (baton->error_code != GIT_OK) { + git_tree_free(currentTree); + git_commit_free(currentCommit); break; } - } - free(nextOid); + if (!firstMatchingParentIndex.first) { + assert(fileExistsInCurrent || fileExistsInSomeParent); + git_delta_t mergeType = GIT_DELTA_UNREADABLE; // It will never result in this case because of the assertion above. + if (fileExistsInCurrent && fileExistsInSomeParent) { + mergeType = GIT_DELTA_MODIFIED; + } else if (fileExistsInCurrent) { + mergeType = GIT_DELTA_ADDED; + } else if (fileExistsInSomeParent) { + mergeType = GIT_DELTA_DELETED; + } - if (baton->error_code != GIT_OK) { - if (baton->error_code != GIT_ITEROVER) { - baton->error = git_error_dup(giterr_last()); + FileHistoryEvent *fileHistoryEvent = new FileHistoryEvent( + mergeType, + mergeType != GIT_DELTA_DELETED, + true, + currentCommit, + NULL, + NULL + ); + baton->out->push_back(fileHistoryEvent); + git_tree_free(currentTree); + git_commit_free(currentCommit); + continue; + } - while(!baton->out->empty()) - { - std::pair > *pairToFree = baton->out->back(); - baton->out->pop_back(); - git_commit_free(pairToFree->first); - free(pairToFree->second.first); - free(pairToFree); + assert(firstMatchingParentIndex.first); + for (unsigned int parentIndex = 0; parentIndex < parentCount; ++parentIndex) { + if (parentIndex == firstMatchingParentIndex.second) { + continue; } - delete baton->out; + const git_oid *parentOid = git_commit_parent_id(currentCommit, parentIndex); + assert(parentOid != NULL); + git_revwalk_hide(baton->walk, parentOid); + } + git_commit_free(currentCommit); + git_tree_free(currentTree); + } - baton->out = NULL; + if (baton->error_code != GIT_OK && baton->error_code != GIT_ITEROVER) { + // Something went wrong in our loop, discard everything in the async worker + for (unsigned int i = 0; i < baton->out->size(); ++i) { + delete static_cast(baton->out->at(i)); } - } else { - baton->error_code = GIT_OK; + delete baton->out; + baton->out = NULL; + baton->error = git_error_dup(git_error_last()); } + free((void *)baton->file_path); + baton->file_path = NULL; +} + +void GitRevwalk::FileHistoryWalkWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + for (unsigned int i = 0; i < baton->out->size(); ++i) { + delete static_cast(baton->out->at(i)); + } + + delete baton->out; + + free((void *)baton->file_path); + + delete baton; } void GitRevwalk::FileHistoryWalkWorker::HandleOKCallback() { if (baton->out != NULL) { - unsigned int size = baton->out->size(); - Local result = Nan::New(size); + const unsigned int size = baton->out->size(); + v8::Local result = Nan::New(size); for (unsigned int i = 0; i < size; i++) { - Local historyEntry = Nan::New(); - std::pair > *batonResult = baton->out->at(i); - Nan::Set(historyEntry, Nan::New("commit").ToLocalChecked(), GitCommit::New(batonResult->first, true)); - Nan::Set(historyEntry, Nan::New("status").ToLocalChecked(), Nan::New(batonResult->second.second)); - if (batonResult->second.second == GIT_DELTA_RENAMED) { - char *namePair = batonResult->second.first; - char *split = strchr(namePair, '\n'); - *split = '\0'; - char *oldName = split + 1; - - Nan::Set(historyEntry, Nan::New("oldName").ToLocalChecked(), Nan::New(oldName).ToLocalChecked()); - Nan::Set(historyEntry, Nan::New("newName").ToLocalChecked(), Nan::New(namePair).ToLocalChecked()); - } - Nan::Set(result, Nan::New(i), historyEntry); - - free(batonResult->second.first); - free(batonResult); + FileHistoryEvent *batonResult = static_cast(baton->out->at(i)); + Nan::Set(result, Nan::New(i), batonResult->toJavascript()); + delete batonResult; } - Local argv[2] = { + Nan::Set(result, Nan::New("reachedEndOfHistory").ToLocalChecked(), Nan::New(baton->error_code == GIT_ITEROVER)); + + v8::Local argv[2] = { Nan::Null(), result }; - callback->Call(2, argv); + callback->Call(2, argv, async_resource); delete baton->out; return; } if (baton->error) { - Local err; + v8::Local err; if (baton->error->message) { - err = Nan::Error(baton->error->message)->ToObject(); + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); } else { - err = Nan::Error("Method fileHistoryWalk has thrown an error.")->ToObject(); + err = Nan::To(Nan::Error("Method fileHistoryWalk has thrown an error.")).ToLocalChecked(); } - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - Local argv[1] = { + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fileHistoryWalk").ToLocalChecked()); + v8::Local argv[1] = { err }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); if (baton->error->message) { free((void *)baton->error->message); @@ -310,14 +504,17 @@ void GitRevwalk::FileHistoryWalkWorker::HandleOKCallback() } if (baton->error_code < 0) { - Local err = Nan::Error("Method next has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); - Local argv[1] = { + v8::Local err = Nan::To(Nan::Error("Method next has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fileHistoryWalk").ToLocalChecked()); + v8::Local argv[1] = { err }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); return; } - callback->Call(0, NULL); + callback->Call(0, NULL, async_resource); + + delete baton; } diff --git a/generate/templates/manual/src/async_baton.cc b/generate/templates/manual/src/async_baton.cc index 590a19c621..56694f33f1 100644 --- a/generate/templates/manual/src/async_baton.cc +++ b/generate/templates/manual/src/async_baton.cc @@ -1,5 +1,89 @@ #include "../include/async_baton.h" -void deleteBaton(AsyncBaton *baton) { - delete baton; +namespace nodegit { + void deleteBaton(AsyncBaton *baton) { + delete baton; + } + + AsyncBaton::AsyncBaton() + : asyncResource(ThreadPool::GetCurrentAsyncResource()), + callbackErrorHandle(*ThreadPool::GetCurrentCallbackErrorHandle()), + completedMutex(new std::mutex), + hasCompleted(false) + {} + + void AsyncBaton::SignalCompletion() { + std::lock_guard lock(*completedMutex); + hasCompleted = true; + completedCondition.notify_one(); + } + + void AsyncBaton::Done() { + onCompletion(); + } + + Nan::AsyncResource *AsyncBaton::GetAsyncResource() { + return asyncResource; + } + + void AsyncBaton::SetCallbackError(v8::Local error) { + callbackErrorHandle.Reset(error); + } + + void AsyncBaton::ExecuteAsyncPerform(AsyncCallback asyncCallback, AsyncCallback asyncCancelCb, CompletionCallback onCompletion) { + auto jsCallback = [asyncCallback, this]() { + asyncCallback(this); + }; + auto cancelCallback = [asyncCancelCb, this]() { + asyncCancelCb(this); + }; + + if (onCompletion) { + this->onCompletion = [this, onCompletion]() { + onCompletion(this); + }; + + ThreadPool::PostCallbackEvent( + [jsCallback, cancelCallback]( + ThreadPool::QueueCallbackFn queueCallback, + ThreadPool::Callback callbackCompleted, + bool isThreaded // Temporary workaround for LFS checkout. Code added to be reverted. + ) -> ThreadPool::Callback { + queueCallback(jsCallback, cancelCallback); + callbackCompleted(); + + return []() {}; + } + ); + } else { + ThreadPool::PostCallbackEvent( + [this, jsCallback, cancelCallback]( + ThreadPool::QueueCallbackFn queueCallback, + ThreadPool::Callback callbackCompleted, + bool isThreaded // Temporary workaround for LFS checkout. Code added to be reverted. + ) -> ThreadPool::Callback { + // Temporary workaround for LFS checkout. Code modified to be reverted. + if (!isThreaded) { + this->onCompletion = callbackCompleted; + + queueCallback(jsCallback, cancelCallback); + + return std::bind(&AsyncBaton::SignalCompletion, this); + } + else { + this->onCompletion = std::bind(&AsyncBaton::SignalCompletion, this); + queueCallback(jsCallback, cancelCallback); + return []() {}; + } + } + ); + + WaitForCompletion(); + } + } + + void AsyncBaton::WaitForCompletion() { + std::unique_lock lock(*completedMutex); + while (!hasCompleted) completedCondition.wait(lock); + } } diff --git a/generate/templates/manual/src/async_worker.cc b/generate/templates/manual/src/async_worker.cc new file mode 100644 index 0000000000..709e8a1e83 --- /dev/null +++ b/generate/templates/manual/src/async_worker.cc @@ -0,0 +1,43 @@ +#include "../include/async_worker.h" + +namespace nodegit { + AsyncWorker::AsyncWorker(Nan::Callback *callback, const char *resourceName, std::map> &_cleanupHandles) + : Nan::AsyncWorker(callback, resourceName), cleanupHandles(_cleanupHandles) + {} + + AsyncWorker::AsyncWorker(Nan::Callback *callback, const char *resourceName) + : Nan::AsyncWorker(callback, resourceName) + {} + + void AsyncWorker::Cancel() { + isCancelled = true; + + // We use Nan::AsyncWorker's ErrorMessage flow + // to trigger `HandleErrorCallback` for cancellation + // of AsyncWork + SetErrorMessage("SHUTTING DOWN"); + } + + Nan::AsyncResource *AsyncWorker::GetAsyncResource() { + return async_resource; + } + + Nan::Global *AsyncWorker::GetCallbackErrorHandle() { + return &callbackErrorHandle; + } + + bool AsyncWorker::GetIsCancelled() const { + return isCancelled; + } + + void AsyncWorker::Destroy() { + std::for_each(cleanupCalls.begin(), cleanupCalls.end(), [](std::function cleanupCall) { + cleanupCall(); + }); + Nan::AsyncWorker::Destroy(); + } + + void AsyncWorker::RegisterCleanupCall(std::function cleanupCall) { + cleanupCalls.push_back(cleanupCall); + } +} diff --git a/generate/templates/manual/src/cleanup_handle.cc b/generate/templates/manual/src/cleanup_handle.cc new file mode 100644 index 0000000000..b243d4f0e0 --- /dev/null +++ b/generate/templates/manual/src/cleanup_handle.cc @@ -0,0 +1,6 @@ +#include "../include/cleanup_handle.h" + +namespace nodegit { + CleanupHandle::CleanupHandle() {} + CleanupHandle::~CleanupHandle() {} +} diff --git a/generate/templates/manual/src/context.cc b/generate/templates/manual/src/context.cc new file mode 100644 index 0000000000..a4c9483dc7 --- /dev/null +++ b/generate/templates/manual/src/context.cc @@ -0,0 +1,84 @@ +#include "../include/context.h" + +namespace nodegit { + std::map Context::contexts; + + AsyncContextCleanupHandle::AsyncContextCleanupHandle(v8::Isolate *isolate, Context *context) + : context(context), + handle(node::AddEnvironmentCleanupHook(isolate, AsyncCleanupContext, this)) + {} + + AsyncContextCleanupHandle::~AsyncContextCleanupHandle() { + delete context; + doneCallback(doneData); + } + + void AsyncContextCleanupHandle::AsyncCleanupContext(void *data, void(*uvCallback)(void*), void *uvCallbackData) { + std::unique_ptr cleanupHandle(static_cast(data)); + cleanupHandle->doneCallback = uvCallback; + cleanupHandle->doneData = uvCallbackData; + // the ordering of std::move and the call to Context::ShutdownThreadPool prohibits + // us from referring to context on cleanupHandle if we're also intending to move + // the unique_ptr into the method. + Context *context = cleanupHandle->context; + context->ShutdownThreadPool(std::move(cleanupHandle)); + } + + Context::Context(v8::Isolate *isolate) + : isolate(isolate) + , threadPool(10, node::GetCurrentEventLoop(isolate), this) + { + Nan::HandleScope scopoe; + v8::Local storage = Nan::New(); + persistentStorage.Reset(storage); + contexts[isolate] = this; + new AsyncContextCleanupHandle(isolate, this); + } + + Context::~Context() { + nodegit::TrackerWrap::DeleteFromList(&trackerList); + contexts.erase(isolate); + } + + std::shared_ptr Context::GetCleanupHandle(std::string key) { + return cleanupHandles[key]; + } + + Context *Context::GetCurrentContext() { + Nan::HandleScope scope; + v8::Local context = Nan::GetCurrentContext(); + v8::Isolate *isolate = context->GetIsolate(); + return contexts[isolate]; + } + + v8::Local Context::GetFromPersistent(std::string key) { + Nan::EscapableHandleScope scope; + v8::Local storage = Nan::New(persistentStorage); + Nan::MaybeLocal value = Nan::Get(storage, Nan::New(key).ToLocalChecked()); + return scope.Escape(value.ToLocalChecked()); + } + + void Context::QueueWorker(nodegit::AsyncWorker *worker) { + threadPool.QueueWorker(worker); + } + + std::shared_ptr Context::RemoveCleanupHandle(std::string key) { + std::shared_ptr cleanupItem = cleanupHandles[key]; + cleanupHandles.erase(key); + return cleanupItem; + } + + void Context::SaveToPersistent(std::string key, const v8::Local &value) { + Nan::HandleScope scope; + v8::Local storage = Nan::New(persistentStorage); + Nan::Set(storage, Nan::New(key).ToLocalChecked(), value); + } + + void Context::SaveCleanupHandle(std::string key, std::shared_ptr cleanupItem) { + cleanupHandles[key] = cleanupItem; + } + + void Context::ShutdownThreadPool(std::unique_ptr cleanupHandle) { + threadPool.Shutdown(std::move(cleanupHandle)); + } +} diff --git a/generate/templates/manual/src/convenient_hunk.cc b/generate/templates/manual/src/convenient_hunk.cc index 845ba4098e..2d33e50b66 100644 --- a/generate/templates/manual/src/convenient_hunk.cc +++ b/generate/templates/manual/src/convenient_hunk.cc @@ -5,6 +5,7 @@ extern "C" { #include } +#include "../include/context.h" #include "../include/functions/copy.h" #include "../include/convenient_hunk.h" #include "../include/diff_line.h" @@ -32,27 +33,28 @@ ConvenientHunk::~ConvenientHunk() { HunkDataFree(this->hunk); } -void ConvenientHunk::InitializeComponent(Local target) { +void ConvenientHunk::InitializeComponent(Local target, nodegit::Context *nodegitContext) { Nan::HandleScope scope; - Local tpl = Nan::New(JSNewFunction); + Local nodegitExternal = Nan::New(nodegitContext); + Local tpl = Nan::New(JSNewFunction, nodegitExternal); - tpl->InstanceTemplate()->SetInternalFieldCount(1); + tpl->InstanceTemplate()->SetInternalFieldCount(2); tpl->SetClassName(Nan::New("ConvenientHunk").ToLocalChecked()); - Nan::SetPrototypeMethod(tpl, "size", Size); - Nan::SetPrototypeMethod(tpl, "lines", Lines); + Nan::SetPrototypeMethod(tpl, "size", Size, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "lines", Lines, nodegitExternal); - Nan::SetPrototypeMethod(tpl, "oldStart", OldStart); - Nan::SetPrototypeMethod(tpl, "oldLines", OldLines); - Nan::SetPrototypeMethod(tpl, "newStart", NewStart); - Nan::SetPrototypeMethod(tpl, "newLines", NewLines); - Nan::SetPrototypeMethod(tpl, "headerLen", HeaderLen); - Nan::SetPrototypeMethod(tpl, "header", Header); + Nan::SetPrototypeMethod(tpl, "oldStart", OldStart, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "oldLines", OldLines, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "newStart", NewStart, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "newLines", NewLines, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "headerLen", HeaderLen, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "header", Header, nodegitExternal); - Local _constructor_template = Nan::GetFunction(tpl).ToLocalChecked(); - constructor_template.Reset(_constructor_template); - Nan::Set(target, Nan::New("ConvenientHunk").ToLocalChecked(), _constructor_template); + Local constructor_template = Nan::GetFunction(tpl).ToLocalChecked(); + nodegitContext->SaveToPersistent("ConvenientHunk::Template", constructor_template); + Nan::Set(target, Nan::New("ConvenientHunk").ToLocalChecked(), constructor_template); } NAN_METHOD(ConvenientHunk::JSNewFunction) { @@ -70,7 +72,9 @@ NAN_METHOD(ConvenientHunk::JSNewFunction) { Local ConvenientHunk::New(void *raw) { Nan::EscapableHandleScope scope; Local argv[1] = { Nan::New((void *)raw) }; - return scope.Escape(Nan::NewInstance(Nan::New(ConvenientHunk::constructor_template), 1, argv).ToLocalChecked()); + nodegit::Context *nodegitContext = nodegit::Context::GetCurrentContext(); + Local constructor_template = nodegitContext->GetFromPersistent("ConvenientHunk::Template").As(); + return scope.Escape(Nan::NewInstance(constructor_template, 1, argv).ToLocalChecked()); } HunkData *ConvenientHunk::GetValue() { @@ -92,22 +96,27 @@ NAN_METHOD(ConvenientHunk::Lines) { return Nan::ThrowError("Callback is required and must be a Function."); } - LinesBaton *baton = new LinesBaton; + LinesBaton *baton = new LinesBaton(); baton->hunk = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + baton->lines = new std::vector; + baton->lines->reserve(baton->hunk->numLines); Nan::Callback *callback = new Nan::Callback(Local::Cast(info[0])); LinesWorker *worker = new LinesWorker(baton, callback); - worker->SaveToPersistent("hunk", info.This()); + worker->Reference("hunk", info.This()); - Nan::AsyncQueueWorker(worker); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); return; } +nodegit::LockMaster ConvenientHunk::LinesWorker::AcquireLocks() { + return nodegit::LockMaster(true); +} + void ConvenientHunk::LinesWorker::Execute() { - baton->lines = new std::vector; - baton->lines->reserve(baton->hunk->numLines); for (unsigned int i = 0; i < baton->hunk->numLines; ++i) { git_diff_line *storeLine = (git_diff_line *)malloc(sizeof(git_diff_line)); storeLine->origin = baton->hunk->lines->at(i)->origin; @@ -121,6 +130,15 @@ void ConvenientHunk::LinesWorker::Execute() { } } +void ConvenientHunk::LinesWorker::HandleErrorCallback() { + while (!baton->lines->empty()) { + free(baton->lines->back()); + baton->lines->pop_back(); + } + + delete baton->lines; +} + void ConvenientHunk::LinesWorker::HandleOKCallback() { unsigned int size = baton->lines->size(); Local result = Nan::New(size); @@ -135,7 +153,9 @@ void ConvenientHunk::LinesWorker::HandleOKCallback() { Nan::Null(), result }; - callback->Call(2, argv); + callback->Call(2, argv, async_resource); + + delete baton; } NAN_METHOD(ConvenientHunk::OldStart) { @@ -182,4 +202,10 @@ NAN_METHOD(ConvenientHunk::Header) { info.GetReturnValue().Set(to); } -Nan::Persistent ConvenientHunk::constructor_template; +void ConvenientHunk::Reference() { + Ref(); +} + +void ConvenientHunk::Unreference() { + Unref(); +} diff --git a/generate/templates/manual/src/convenient_patch.cc b/generate/templates/manual/src/convenient_patch.cc index dbe75ba74f..22e6e6b49b 100644 --- a/generate/templates/manual/src/convenient_patch.cc +++ b/generate/templates/manual/src/convenient_patch.cc @@ -5,6 +5,7 @@ extern "C" { #include } +#include "../include/context.h" #include "../include/convenient_hunk.h" #include "../include/convenient_patch.h" #include "../include/functions/copy.h" @@ -32,7 +33,7 @@ void PatchDataFree(PatchData *patch) { } PatchData *createFromRaw(git_patch *raw) { - PatchData *patch = new PatchData; + PatchData *patch = new PatchData(); const git_diff_delta *delta = git_patch_get_delta(raw); patch->status = delta->status; @@ -55,7 +56,7 @@ PatchData *createFromRaw(git_patch *raw) { patch->hunks->reserve(patch->numHunks); for (unsigned int i = 0; i < patch->numHunks; ++i) { - HunkData *hunkData = new HunkData; + HunkData *hunkData = new HunkData(); const git_diff_hunk *hunk = NULL; int result = git_patch_get_hunk(&hunk, &hunkData->numLines, raw, i); if (result != 0) { @@ -129,36 +130,37 @@ ConvenientPatch::~ConvenientPatch() { PatchDataFree(this->patch); } -void ConvenientPatch::InitializeComponent(Local target) { +void ConvenientPatch::InitializeComponent(Local target, nodegit::Context *nodegitContext) { Nan::HandleScope scope; - Local tpl = Nan::New(JSNewFunction); + Local nodegitExternal = Nan::New(nodegitContext); + Local tpl = Nan::New(JSNewFunction, nodegitExternal); - tpl->InstanceTemplate()->SetInternalFieldCount(1); + tpl->InstanceTemplate()->SetInternalFieldCount(2); tpl->SetClassName(Nan::New("ConvenientPatch").ToLocalChecked()); - Nan::SetPrototypeMethod(tpl, "hunks", Hunks); - Nan::SetPrototypeMethod(tpl, "lineStats", LineStats); - Nan::SetPrototypeMethod(tpl, "size", Size); - - Nan::SetPrototypeMethod(tpl, "oldFile", OldFile); - Nan::SetPrototypeMethod(tpl, "newFile", NewFile); - Nan::SetPrototypeMethod(tpl, "status", Status); - Nan::SetPrototypeMethod(tpl, "isUnmodified", IsUnmodified); - Nan::SetPrototypeMethod(tpl, "isAdded", IsAdded); - Nan::SetPrototypeMethod(tpl, "isDeleted", IsDeleted); - Nan::SetPrototypeMethod(tpl, "isModified", IsModified); - Nan::SetPrototypeMethod(tpl, "isRenamed", IsRenamed); - Nan::SetPrototypeMethod(tpl, "isCopied", IsCopied); - Nan::SetPrototypeMethod(tpl, "isIgnored", IsIgnored); - Nan::SetPrototypeMethod(tpl, "isUntracked", IsUntracked); - Nan::SetPrototypeMethod(tpl, "isTypeChange", IsTypeChange); - Nan::SetPrototypeMethod(tpl, "isUnreadable", IsUnreadable); - Nan::SetPrototypeMethod(tpl, "isConflicted", IsConflicted); - - Local _constructor_template = Nan::GetFunction(tpl).ToLocalChecked(); - constructor_template.Reset(_constructor_template); - Nan::Set(target, Nan::New("ConvenientPatch").ToLocalChecked(), _constructor_template); + Nan::SetPrototypeMethod(tpl, "hunks", Hunks, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "lineStats", LineStats, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "size", Size, nodegitExternal); + + Nan::SetPrototypeMethod(tpl, "oldFile", OldFile, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "newFile", NewFile, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "status", Status, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isUnmodified", IsUnmodified, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isAdded", IsAdded, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isDeleted", IsDeleted, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isModified", IsModified, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isRenamed", IsRenamed, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isCopied", IsCopied, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isIgnored", IsIgnored, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isUntracked", IsUntracked, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isTypeChange", IsTypeChange, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isUnreadable", IsUnreadable, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isConflicted", IsConflicted, nodegitExternal); + + Local constructor_template = Nan::GetFunction(tpl).ToLocalChecked(); + nodegitContext->SaveToPersistent("ConvenientPatch::Template", constructor_template); + Nan::Set(target, Nan::New("ConvenientPatch").ToLocalChecked(), constructor_template); } NAN_METHOD(ConvenientPatch::JSNewFunction) { @@ -176,7 +178,9 @@ NAN_METHOD(ConvenientPatch::JSNewFunction) { Local ConvenientPatch::New(void *raw) { Nan::EscapableHandleScope scope; Local argv[1] = { Nan::New((void *)raw) }; - return scope.Escape(Nan::NewInstance(Nan::New(ConvenientPatch::constructor_template), 1, argv).ToLocalChecked()); + nodegit::Context *nodegitContext = nodegit::Context::GetCurrentContext(); + Local constructor_template = nodegitContext->GetFromPersistent("ConvenientPatch::Template").As(); + return scope.Escape(Nan::NewInstance(constructor_template, 1, argv).ToLocalChecked()); } ConvenientLineStats ConvenientPatch::GetLineStats() { @@ -208,26 +212,30 @@ NAN_METHOD(ConvenientPatch::Hunks) { return Nan::ThrowError("Callback is required and must be a Function."); } - HunksBaton *baton = new HunksBaton; + HunksBaton *baton = new HunksBaton(); baton->patch = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + baton->hunks = new std::vector; + baton->hunks->reserve(baton->patch->numHunks); Nan::Callback *callback = new Nan::Callback(Local::Cast(info[0])); HunksWorker *worker = new HunksWorker(baton, callback); - worker->SaveToPersistent("patch", info.This()); + worker->Reference("patch", info.This()); - Nan::AsyncQueueWorker(worker); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); return; } +nodegit::LockMaster ConvenientPatch::HunksWorker::AcquireLocks() { + return nodegit::LockMaster(true); +} + void ConvenientPatch::HunksWorker::Execute() { // copy hunks - baton->hunks = new std::vector; - baton->hunks->reserve(baton->patch->numHunks); - for (unsigned int i = 0; i < baton->patch->numHunks; ++i) { - HunkData *hunkData = new HunkData; + HunkData *hunkData = new HunkData(); hunkData->numLines = baton->patch->hunks->at(i)->numLines; hunkData->hunk.old_start = baton->patch->hunks->at(i)->hunk.old_start; hunkData->hunk.old_lines = baton->patch->hunks->at(i)->hunk.old_lines; @@ -254,6 +262,20 @@ void ConvenientPatch::HunksWorker::Execute() { } } +void ConvenientPatch::HunksWorker::HandleErrorCallback() { + while (!baton->hunks->empty()) { + HunkData *hunk = baton->hunks->back(); + baton->hunks->pop_back(); + + while (!hunk->lines->empty()) { + free(hunk->lines->back()); + hunk->lines->pop_back(); + } + } + + delete baton->hunks; +} + void ConvenientPatch::HunksWorker::HandleOKCallback() { unsigned int size = baton->hunks->size(); Local result = Nan::New(size); @@ -268,7 +290,9 @@ void ConvenientPatch::HunksWorker::HandleOKCallback() { Nan::Null(), result }; - callback->Call(2, argv); + callback->Call(2, argv, async_resource); + + delete baton; } NAN_METHOD(ConvenientPatch::LineStats) { @@ -397,4 +421,10 @@ NAN_METHOD(ConvenientPatch::IsConflicted) { info.GetReturnValue().Set(to); } -Nan::Persistent ConvenientPatch::constructor_template; +void ConvenientPatch::Reference() { + Ref(); +} + +void ConvenientPatch::Unreference() { + Unref(); +} diff --git a/generate/templates/manual/src/filter_registry.cc b/generate/templates/manual/src/filter_registry.cc index a44e4ae707..21a7cfbb86 100644 --- a/generate/templates/manual/src/filter_registry.cc +++ b/generate/templates/manual/src/filter_registry.cc @@ -6,11 +6,12 @@ extern "C" { } #include "../include/nodegit.h" +#include "../include/cleanup_handle.h" +#include "../include/context.h" #include "../include/lock_master.h" #include "../include/functions/copy.h" #include "../include/filter_registry.h" #include "nodegit_wrapper.cc" -#include "../include/async_libgit2_queue_worker.h" #include "../include/filter.h" @@ -18,19 +19,19 @@ using namespace std; using namespace v8; using namespace node; -Nan::Persistent GitFilterRegistry::persistentHandle; - -// #pragma unmanaged -void GitFilterRegistry::InitializeComponent(v8::Local target) { +void GitFilterRegistry::InitializeComponent(v8::Local target, nodegit::Context *nodegitContext) { Nan::HandleScope scope; - v8::Local object = Nan::New(); + v8::Local filterRegistry = Nan::New(); + + Local nodegitExternal = Nan::New(nodegitContext); + Nan::SetMethod(filterRegistry, "register", GitFilterRegister, nodegitExternal); + Nan::SetMethod(filterRegistry, "unregister", GitFilterUnregister, nodegitExternal); - Nan::SetMethod(object, "register", GitFilterRegister); - Nan::SetMethod(object, "unregister", GitFilterUnregister); - - Nan::Set(target, Nan::New("FilterRegistry").ToLocalChecked(), object); - GitFilterRegistry::persistentHandle.Reset(object); + Nan::Set(target, Nan::New("FilterRegistry").ToLocalChecked(), filterRegistry); + nodegitContext->SaveToPersistent("FilterRegistry", filterRegistry); + std::shared_ptr filterRegistryCleanupHandles(new nodegit::FilterRegistryCleanupHandles); + nodegitContext->SaveCleanupHandle("filterRegistry", filterRegistryCleanupHandles); } NAN_METHOD(GitFilterRegistry::GitFilterRegister) { @@ -52,82 +53,115 @@ NAN_METHOD(GitFilterRegistry::GitFilterRegister) { return Nan::ThrowError("Callback is required and must be a Function."); } - FilterRegisterBaton *baton = new FilterRegisterBaton; + FilterRegisterBaton *baton = new FilterRegisterBaton(); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + std::map> cleanupHandles; + + { + auto conversionResult = ConfigurableGitFilter::fromJavascript(nodegitContext, info[1]); + if (!conversionResult.result) { + delete baton; + return Nan::ThrowError(Nan::New(conversionResult.error).ToLocalChecked()); + } + + auto convertedObject = conversionResult.result; + cleanupHandles["filter"] = convertedObject; + baton->filter = convertedObject->GetValue(); + } + + Nan::Utf8String name(Nan::To(info[0]).ToLocalChecked()); - baton->filter = Nan::ObjectWrap::Unwrap(info[1]->ToObject())->GetValue(); - String::Utf8Value name(info[0]->ToString()); - baton->filter_name = (char *)malloc(name.length() + 1); memcpy((void *)baton->filter_name, *name, name.length()); memset((void *)(((char *)baton->filter_name) + name.length()), 0, 1); baton->error_code = GIT_OK; - baton->filter_priority = (int)info[2]->ToNumber()->Value(); - - Nan::New(GitFilterRegistry::persistentHandle)->Set(info[0]->ToString(), info[1]->ToObject()); + baton->filter_priority = Nan::To(info[2]).FromJust(); Nan::Callback *callback = new Nan::Callback(Local::Cast(info[3])); - RegisterWorker *worker = new RegisterWorker(baton, callback); + RegisterWorker *worker = new RegisterWorker(baton, callback, cleanupHandles); - worker->SaveToPersistent("filter_name", info[0]->ToObject()); - worker->SaveToPersistent("filter_priority", info[2]->ToObject()); + worker->Reference("filter_name", info[0]); + worker->Reference("filter_priority", info[2]); - AsyncLibgit2QueueWorker(worker); + nodegitContext->QueueWorker(worker); return; } +nodegit::LockMaster GitFilterRegistry::RegisterWorker::AcquireLocks() { + return nodegit::LockMaster(true, baton->filter_name, baton->filter); +} + void GitFilterRegistry::RegisterWorker::Execute() { - giterr_clear(); + git_error_clear(); { - LockMaster lockMaster(/*asyncAction: */true, baton->filter_name, baton->filter); int result = git_filter_register(baton->filter_name, baton->filter, baton->filter_priority); baton->error_code = result; - if (result != GIT_OK && giterr_last() != NULL) { - baton->error = git_error_dup(giterr_last()); + if (result != GIT_OK && git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } + } +} + +void GitFilterRegistry::RegisterWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); } + + free((void *)baton->error); } + + free(baton->filter_name); + + delete baton; } void GitFilterRegistry::RegisterWorker::HandleOKCallback() { if (baton->error_code == GIT_OK) { + static_pointer_cast(nodegit::Context::GetCurrentContext()->GetCleanupHandle("filterRegistry"))->registeredFilters[baton->filter_name] = cleanupHandles["filter"]; v8::Local result = Nan::New(baton->error_code); v8::Local argv[2] = { Nan::Null(), result }; - callback->Call(2, argv); - } + callback->Call(2, argv, async_resource); + } else if (baton->error) { v8::Local err; if (baton->error->message) { - err = Nan::Error(baton->error->message)->ToObject(); + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); } else { - err = Nan::Error("Method register has thrown an error.")->ToObject(); + err = Nan::To(Nan::Error("Method register has thrown an error.")).ToLocalChecked(); } - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.register").ToLocalChecked()); v8::Local argv[1] = { err }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); if (baton->error->message) free((void *)baton->error->message); free((void *)baton->error); } else if (baton->error_code < 0) { - v8::Local err = Nan::Error("Method register has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + v8::Local err = Nan::To(Nan::Error("Method register has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.register").ToLocalChecked()); v8::Local argv[1] = { err }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); } else { - callback->Call(0, NULL); + callback->Call(0, NULL, async_resource); } + + free(baton->filter_name); + delete baton; - return; } NAN_METHOD(GitFilterRegistry::GitFilterUnregister) { @@ -141,8 +175,8 @@ NAN_METHOD(GitFilterRegistry::GitFilterUnregister) { return Nan::ThrowError("Callback is required and must be a Function."); } - FilterUnregisterBaton *baton = new FilterUnregisterBaton; - String::Utf8Value name(info[0]->ToString()); + FilterUnregisterBaton *baton = new FilterUnregisterBaton(); + Nan::Utf8String name(Nan::To(info[0]).ToLocalChecked()); baton->filter_name = (char *)malloc(name.length() + 1); memcpy((void *)baton->filter_name, *name, name.length()); @@ -154,62 +188,83 @@ NAN_METHOD(GitFilterRegistry::GitFilterUnregister) { Nan::Callback *callback = new Nan::Callback(Local::Cast(info[1])); UnregisterWorker *worker = new UnregisterWorker(baton, callback); - worker->SaveToPersistent("filter_name", info[0]); - - AsyncLibgit2QueueWorker(worker); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); return; } +nodegit::LockMaster GitFilterRegistry::UnregisterWorker::AcquireLocks() { + return nodegit::LockMaster(true, baton->filter_name); +} + void GitFilterRegistry::UnregisterWorker::Execute() { - giterr_clear(); + git_error_clear(); { - LockMaster lockMaster(/*asyncAction: */true, baton->filter_name); int result = git_filter_unregister(baton->filter_name); baton->error_code = result; - if (result != GIT_OK && giterr_last() != NULL) { - baton->error = git_error_dup(giterr_last()); + if (result != GIT_OK && git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); } } } +void GitFilterRegistry::UnregisterWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + free(baton->filter_name); + + delete baton; +} + void GitFilterRegistry::UnregisterWorker::HandleOKCallback() { if (baton->error_code == GIT_OK) { + static_pointer_cast(nodegit::Context::GetCurrentContext()->GetCleanupHandle("filterRegistry"))->registeredFilters.erase(baton->filter_name); v8::Local result = Nan::New(baton->error_code); v8::Local argv[2] = { Nan::Null(), result }; - callback->Call(2, argv); - } + callback->Call(2, argv, async_resource); + } else if (baton->error) { v8::Local err; if (baton->error->message) { - err = Nan::Error(baton->error->message)->ToObject(); + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); } else { - err = Nan::Error("Method register has thrown an error.")->ToObject(); + err = Nan::To(Nan::Error("Method register has thrown an error.")).ToLocalChecked(); } - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.unregister").ToLocalChecked()); v8::Local argv[1] = { err }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); if (baton->error->message) free((void *)baton->error->message); free((void *)baton->error); } else if (baton->error_code < 0) { - v8::Local err = Nan::Error("Method unregister has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + v8::Local err = Nan::To(Nan::Error("Method unregister has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.unregister").ToLocalChecked()); v8::Local argv[1] = { err }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); } else { - callback->Call(0, NULL); + callback->Call(0, NULL, async_resource); } + + free(baton->filter_name); + delete baton; - return; } diff --git a/generate/templates/manual/src/git_buf_converter.cc b/generate/templates/manual/src/git_buf_converter.cc index 371f143363..da6f425f89 100644 --- a/generate/templates/manual/src/git_buf_converter.cc +++ b/generate/templates/manual/src/git_buf_converter.cc @@ -1,7 +1,6 @@ #include #include #include -#include #include "../include/git_buf_converter.h" #include "git2/buffer.h" @@ -9,18 +8,21 @@ using namespace v8; using namespace node; -git_buf *StrArrayConverter::Convert(Local val) { +git_buf *GitBufConverter::Convert(Local val) { if (val->IsString() || val->IsStringObject()) { - string v8String = ConvertString(val->ToString()); + Nan::Utf8String param1(Nan::To(val).ToLocalChecked()); + std::string v8String = std::string(*param1); + const size_t size = sizeof(git_buf); uint8_t* memory = reinterpret_cast(malloc(size)); git_buf *result = reinterpret_cast(memory); - size_t stringLength = v8String.length() - 1; + size_t stringLength = v8String.length(); memory = reinterpret_cast(malloc(stringLength)); memcpy(memory, v8String.c_str(), stringLength); + result->reserved = stringLength; result->size = stringLength; result->ptr = reinterpret_cast(memory); return result; diff --git a/generate/templates/manual/src/lock_master.cc b/generate/templates/manual/src/lock_master.cc index 30679b534b..8ad33378f9 100644 --- a/generate/templates/manual/src/lock_master.cc +++ b/generate/templates/manual/src/lock_master.cc @@ -1,246 +1,239 @@ #include #include -#include #include #include #include #include +#include +#include +#include #include "../include/lock_master.h" +namespace nodegit { + // information about a lockable object + // - the mutex used to lock it and the number of outstanding locks + struct ObjectInfo { + std::shared_ptr mutex; + unsigned useCount; + + ObjectInfo(unsigned useCount) + : mutex(new std::mutex), useCount(useCount) + {} + }; + + // LockMaster implementation details + // implemented in a separate class to keep LockMaster opaque + class LockMasterImpl { + // STATIC variables / methods + + // A map from objects that are locked (or were locked), to information on their mutex + static std::map mutexes; + // A mutex used for the mutexes map + static std::mutex mapMutex; + + // A thread local storage slot for the current thread-specific LockMasterImpl instance + thread_local static LockMasterImpl* currentLockMaster; + + // Cleans up any mutexes that are not currently used + static NAN_GC_CALLBACK(CleanupMutexes); + + public: + static void InitializeContext(); + + // INSTANCE variables / methods + + private: + // The set of objects this LockMaster is responsible for locking + std::set objectsToLock; + + // Mutexes locked by this LockMaster on construction and unlocked on destruction + std::vector> GetMutexes(int useCountDelta); + void Register(); + void Unregister(); + + public: + static LockMasterImpl *CurrentLockMasterImpl() { + return (LockMasterImpl *)currentLockMaster; + } -// information about a lockable object -// - the mutex used to lock it and the number of outstanding locks -struct ObjectInfo { - uv_mutex_t *mutex; - unsigned useCount; - - ObjectInfo(uv_mutex_t *mutex, unsigned useCount) - : mutex(mutex), useCount(useCount) - {} -}; - -// LockMaster implementation details -// implemented in a separate class to keep LockMaster opaque -class LockMasterImpl { - // STATIC variables / methods - - // A map from objects that are locked (or were locked), to information on their mutex - static std::map mutexes; - // A mutex used for the mutexes map - static uv_mutex_t mapMutex; - - // A libuv key used to store the current thread-specific LockMasterImpl instance - static uv_key_t currentLockMasterKey; - - // Cleans up any mutexes that are not currently used - static NAN_GC_CALLBACK(CleanupMutexes); + LockMasterImpl() { + Register(); + } -public: - static void Initialize(); + ~LockMasterImpl() { + Unregister(); + Unlock(true); + } - // INSTANCE variables / methods + void ObjectToLock(const void *objectToLock) { + objectsToLock.insert(objectToLock); + } -private: - // The set of objects this LockMaster is responsible for locking - std::set objectsToLock; + void Lock(bool acquireMutexes); + void Unlock(bool releaseMutexes); + }; - // Mutexes locked by this LockMaster on construction and unlocked on destruction - std::vector GetMutexes(int useCountDelta); - void Register(); - void Unregister(); + std::map LockMasterImpl::mutexes; + std::mutex LockMasterImpl::mapMutex; + thread_local LockMasterImpl* LockMasterImpl::currentLockMaster = nullptr; -public: - static LockMasterImpl *CurrentLockMasterImpl() { - return (LockMasterImpl *)uv_key_get(¤tLockMasterKey); + LockMaster::LockMaster(LockMaster &&other) { + impl = other.impl; + other.impl = nullptr; } - static LockMaster::Diagnostics GetDiagnostics(); - LockMasterImpl() { - Register(); - } + LockMaster &LockMaster::operator=(LockMaster &&other) { + if (&other == this) { + return *this; + } - ~LockMasterImpl() { - Unregister(); - Unlock(true); - } + impl = other.impl; + other.impl = nullptr; - void ObjectToLock(const void *objectToLock) { - objectsToLock.insert(objectToLock); + return *this; } - void Lock(bool acquireMutexes); - void Unlock(bool releaseMutexes); -}; - -std::map LockMasterImpl::mutexes; -uv_mutex_t LockMasterImpl::mapMutex; -uv_key_t LockMasterImpl::currentLockMasterKey; - -void LockMasterImpl::Initialize() { - uv_mutex_init(&mapMutex); - uv_key_create(¤tLockMasterKey); - Nan::AddGCEpilogueCallback(CleanupMutexes); -} + void LockMasterImpl::InitializeContext() { + Nan::AddGCEpilogueCallback(CleanupMutexes); + } -NAN_GC_CALLBACK(LockMasterImpl::CleanupMutexes) { - // skip cleanup if thread safety is disabled - // this means that turning thread safety on and then off - // could result in remaining mutexes - but they would get cleaned up - // if thread safety is turned on again - if (LockMaster::GetStatus() == LockMaster::Disabled) { - return; - } - - uv_mutex_lock(&mapMutex); - - for (auto it = mutexes.begin(); it != mutexes.end(); ) - { - uv_mutex_t *mutex = it->second.mutex; - unsigned useCount = it->second.useCount; - // if the mutex is not used by any LockMasters, - // we can destroy it - if (!useCount) { - uv_mutex_destroy(mutex); - free(mutex); - auto to_erase = it; - it++; - mutexes.erase(to_erase); - } else { - it++; + NAN_GC_CALLBACK(LockMasterImpl::CleanupMutexes) { + std::lock_guard lock(mapMutex); + + for (auto it = mutexes.begin(); it != mutexes.end(); ) + { + // if the mutex is not used by any LockMasters, + // we can destroy it + unsigned useCount = it->second.useCount; + if (!useCount) { + auto to_erase = it; + it++; + mutexes.erase(to_erase); + } else { + it++; + } } } - uv_mutex_unlock(&mapMutex); -} + void LockMaster::InitializeContext() { + LockMasterImpl::InitializeContext(); + } -void LockMaster::Initialize() { - LockMasterImpl::Initialize(); -} + std::vector> LockMasterImpl::GetMutexes(int useCountDelta) { + std::vector> objectMutexes; + std::lock_guard lock(mapMutex); + + for (auto object : objectsToLock) { + if (object) { + // ensure we have an initialized mutex for each object + auto mutexIt = mutexes.find(object); + if (mutexIt == mutexes.end()) { + mutexIt = mutexes.insert( + std::make_pair( + object, + ObjectInfo(0U) + ) + ).first; + } -std::vector LockMasterImpl::GetMutexes(int useCountDelta) { - std::vector objectMutexes; - - uv_mutex_lock(&mapMutex); - - for (auto object : objectsToLock) { - if(object) { - // ensure we have an initialized mutex for each object - auto mutexIt = mutexes.find(object); - if(mutexIt == mutexes.end()) { - mutexIt = mutexes.insert( - std::make_pair( - object, - ObjectInfo((uv_mutex_t *)malloc(sizeof(uv_mutex_t)), 0U) - ) - ).first; - uv_mutex_init(mutexIt->second.mutex); + objectMutexes.push_back(mutexIt->second.mutex); + mutexIt->second.useCount += useCountDelta; } - - objectMutexes.push_back(mutexIt->second.mutex); - mutexIt->second.useCount += useCountDelta; } - } - uv_mutex_unlock(&mapMutex); + return objectMutexes; + } - return objectMutexes; -} + void LockMasterImpl::Register() { + currentLockMaster = this; + } -void LockMasterImpl::Register() { - uv_key_set(¤tLockMasterKey, this); -} + void LockMasterImpl::Unregister() { + currentLockMaster = nullptr; + } -void LockMasterImpl::Unregister() { - uv_key_set(¤tLockMasterKey, NULL); -} + void LockMasterImpl::Lock(bool acquireMutexes) { + std::vector> objectMutexes = GetMutexes(acquireMutexes * 1); + + auto alreadyLocked = objectMutexes.end(); + std::vector>::iterator it; + + // we will attempt to lock all the mutexes at the same time to avoid deadlocks + // note in most cases we are locking 0 or 1 mutexes. more than 1 implies + // passing objects with different repos/owners in the same call. + do { + // go through all the mutexes and try to lock them + for (it = objectMutexes.begin(); it != objectMutexes.end(); it++) { + // if we already locked this mutex in a previous pass via std::mutex::lock, + // we don't need to lock it again + if (it == alreadyLocked) { + continue; + } -void LockMasterImpl::Lock(bool acquireMutexes) { - std::vector objectMutexes = GetMutexes(acquireMutexes * 1); - - auto alreadyLocked = objectMutexes.end(); - - // we will attempt to lock all the mutexes at the same time to avoid deadlocks - // note in most cases we are locking 0 or 1 mutexes. more than 1 implies - // passing objects with different repos/owners in the same call. - std::vector::iterator it; - do { - // go through all the mutexes and try to lock them - for(it = objectMutexes.begin(); it != objectMutexes.end(); it++) { - // if we already locked this mutex in a previous pass via uv_mutex_lock, - // we don't need to lock it again - if (it == alreadyLocked) { - continue; - } - // first, try to lock (non-blocking) - bool failure = uv_mutex_trylock(*it); - if(failure) { - // we have failed to lock a mutex... unlock everything we have locked - std::for_each(objectMutexes.begin(), it, uv_mutex_unlock); - if (alreadyLocked > it && alreadyLocked != objectMutexes.end()) { - uv_mutex_unlock(*alreadyLocked); + // first, try to lock (non-blocking) + bool success = (*it)->try_lock(); + if (!success) { + // we have failed to lock a mutex... unlock everything we have locked + std::for_each(objectMutexes.begin(), it, [](std::shared_ptr mutex) { + mutex->unlock(); + }); + + if (alreadyLocked > it && alreadyLocked != objectMutexes.end()) { + (*alreadyLocked)->unlock(); + } + + // now do a blocking lock on what we couldn't lock + (*it)->lock(); + // mark that we have already locked this one + // if there are more mutexes than this one, we will go back to locking everything + alreadyLocked = it; + break; } - // now do a blocking lock on what we couldn't lock - uv_mutex_lock(*it); - // mark that we have already locked this one - // if there are more mutexes than this one, we will go back to locking everything - alreadyLocked = it; - break; } - } - } while(it != objectMutexes.end()); -} - -void LockMasterImpl::Unlock(bool releaseMutexes) { - // Get the mutexes but don't decrement their use count until after we've - // unlocked them all. - std::vector objectMutexes = GetMutexes(0); + } while (it != objectMutexes.end()); + } - std::for_each(objectMutexes.begin(), objectMutexes.end(), uv_mutex_unlock); + void LockMasterImpl::Unlock(bool releaseMutexes) { + // Get the mutexes but don't decrement their use count until after we've + // unlocked them all. + std::vector> objectMutexes = GetMutexes(0); - GetMutexes(releaseMutexes * -1); -} + std::for_each(objectMutexes.begin(), objectMutexes.end(), [](std::shared_ptr mutex) { + mutex->unlock(); + }); -LockMaster::Diagnostics LockMasterImpl::GetDiagnostics() { - LockMaster::Diagnostics diagnostics; - uv_mutex_lock(&LockMasterImpl::mapMutex); - diagnostics.storedMutexesCount = mutexes.size(); - uv_mutex_unlock(&LockMasterImpl::mapMutex); - return diagnostics; -} + GetMutexes(releaseMutexes * -1); + } -// LockMaster + // LockMaster -void LockMaster::ConstructorImpl() { - impl = new LockMasterImpl(); -} + void LockMaster::ConstructorImpl() { + impl = new LockMasterImpl(); + } -void LockMaster::DestructorImpl() { - delete impl; -} + void LockMaster::DestructorImpl() { + delete impl; + } -void LockMaster::ObjectToLock(const void *objectToLock) { - impl->ObjectToLock(objectToLock); -} + void LockMaster::ObjectToLock(const void *objectToLock) { + impl->ObjectToLock(objectToLock); + } -void LockMaster::ObjectsToLockAdded() { - impl->Lock(true); -} + void LockMaster::ObjectsToLockAdded() { + impl->Lock(true); + } -LockMaster::Diagnostics LockMaster::GetDiagnostics() { - return LockMasterImpl::GetDiagnostics(); -} + // LockMaster::TemporaryUnlock -// LockMaster::TemporaryUnlock + void LockMaster::TemporaryUnlock::ConstructorImpl() { + impl = LockMasterImpl::CurrentLockMasterImpl(); + if (impl) { + impl->Unlock(false); + } + } -void LockMaster::TemporaryUnlock::ConstructorImpl() { - impl = LockMasterImpl::CurrentLockMasterImpl(); - if(impl) { - impl->Unlock(false); + void LockMaster::TemporaryUnlock::DestructorImpl() { + impl->Lock(false); } -} -void LockMaster::TemporaryUnlock::DestructorImpl() { - impl->Lock(false); } - -LockMaster::Status LockMaster::status = LockMaster::Disabled; diff --git a/generate/templates/manual/src/nodegit_wrapper.cc b/generate/templates/manual/src/nodegit_wrapper.cc index ea66944256..a790d7bc3c 100644 --- a/generate/templates/manual/src/nodegit_wrapper.cc +++ b/generate/templates/manual/src/nodegit_wrapper.cc @@ -1,17 +1,29 @@ template -NodeGitWrapper::NodeGitWrapper(typename Traits::cType *raw, bool selfFreeing, v8::Local owner) { - if (!owner.IsEmpty()) { - // if we have an owner, there are two options - either we duplicate the raw object - // (so we own the duplicate, and can self-free it) - // or we keep a handle on the owner so it doesn't get garbage collected - // while this wrapper is accessible - if(Traits::isDuplicable) { +NodeGitWrapper::NodeGitWrapper(typename Traits::cType *raw, bool selfFreeing, v8::Local owner) + : nodegitContext(nodegit::Context::GetCurrentContext()) { + nodegitContext->LinkTrackerList(this); + if (Traits::isSingleton) { + ReferenceCounter::incrementCountForPointer((void *)raw); + this->raw = raw; + } else if (!owner.IsEmpty()) { + // if we have an owner, it could mean 2 things: + // 1. We are borrowed memory from another struct and should not be freed. We will keep a handle to the owner + // so that the owner isn't gc'd while we are using its memory. + // 2. We are borrowed memory from another struct and can be duplicated, so we should duplicate + // and become selfFreeing. + // 3. We are cached memory, potentially on the repo or config. + // Even though we have a handle in another objects cache, we are expected to call free, + // otherwise we are leaking memory. Cached objects are reference counted in libgit2, but will be leaked + // even if the cache is cleared if we haven't freed them. We will keep a handle on the owner, even though it + // is probably safe as we're reference counted. This should at worst just ensure that the cache owner is the + // last thing to be freed, and that is more safety than anything else. + if (Traits::isDuplicable) { Traits::duplicate(&this->raw, raw); selfFreeing = true; } else { + SetNativeOwners(owner); this->owner.Reset(owner); this->raw = raw; - selfFreeing = false; } } else { this->raw = raw; @@ -26,7 +38,8 @@ NodeGitWrapper::NodeGitWrapper(typename Traits::cType *raw, bool selfFre } template -NodeGitWrapper::NodeGitWrapper(const char *error) { +NodeGitWrapper::NodeGitWrapper(const char *error) + : nodegitContext(nodegit::Context::GetCurrentContext()) { selfFreeing = false; raw = NULL; Nan::ThrowError(error); @@ -34,11 +47,15 @@ NodeGitWrapper::NodeGitWrapper(const char *error) { template NodeGitWrapper::~NodeGitWrapper() { - if(Traits::isFreeable && selfFreeing) { + Unlink(); + if (Traits::isFreeable && selfFreeing) { Traits::free(raw); SelfFreeingInstanceCount--; raw = NULL; } + else if (!selfFreeing) { + --NonSelfFreeingConstructedCount; + } } template @@ -58,7 +75,7 @@ NAN_METHOD(NodeGitWrapper::JSNewFunction) { instance = new cppClass(static_cast( Local::Cast(info[0])->Value()), Nan::To(info[1]).FromJust(), - info.Length() >= 3 && !info[2].IsEmpty() && info[2]->IsObject() ? info[2]->ToObject() : Local() + info.Length() >= 3 && !info[2].IsEmpty() && info[2]->IsObject() ? Nan::To(info[2]).ToLocalChecked() : Local() ); } @@ -66,13 +83,44 @@ NAN_METHOD(NodeGitWrapper::JSNewFunction) { info.GetReturnValue().Set(info.This()); } +template +void NodeGitWrapper::SetNativeOwners(v8::Local owners) { + assert(owners->IsArray() || owners->IsObject()); + Nan::HandleScope scope; + std::unique_ptr< std::vector > trackerOwners = + std::make_unique< std::vector >(); + + if (owners->IsArray()) { + v8::Local context = Nan::GetCurrentContext(); + const v8::Local ownersArray = owners.As(); + const uint32_t numOwners = ownersArray->Length(); + + for (uint32_t i = 0; i < numOwners; ++i) { + v8::Local value = ownersArray->Get(context, i).ToLocalChecked(); + const v8::Local object = value.As(); + Nan::ObjectWrap *objectWrap = Nan::ObjectWrap::Unwrap(object); + trackerOwners->push_back(static_cast(objectWrap)); + } + } + else if (owners->IsObject()) { + Nan::ObjectWrap *objectWrap = Nan::ObjectWrap::Unwrap(owners); + trackerOwners->push_back(static_cast(objectWrap)); + } + + SetTrackerWrapOwners(std::move(trackerOwners)); +} + template v8::Local NodeGitWrapper::New(const typename Traits::cType *raw, bool selfFreeing, v8::Local owner) { Nan::EscapableHandleScope scope; Local argv[3] = { Nan::New((void *)raw), Nan::New(selfFreeing), owner }; + nodegit::Context *nodegitContext = nodegit::Context::GetCurrentContext(); + Local constructor_template = nodegitContext->GetFromPersistent( + std::string(Traits::className()) + "::Template" + ).As(); return scope.Escape( Nan::NewInstance( - Nan::New(constructor_template), + constructor_template, owner.IsEmpty() ? 2 : 3, // passing an empty handle as part of the arguments causes a crash argv ).ToLocalChecked()); @@ -89,13 +137,10 @@ void NodeGitWrapper::ClearValue() { } template -Nan::Persistent NodeGitWrapper::constructor_template; +thread_local int NodeGitWrapper::SelfFreeingInstanceCount; template -int NodeGitWrapper::SelfFreeingInstanceCount; - -template -int NodeGitWrapper::NonSelfFreeingConstructedCount; +thread_local int NodeGitWrapper::NonSelfFreeingConstructedCount; template NAN_METHOD(NodeGitWrapper::GetSelfFreeingInstanceCount) { @@ -112,3 +157,30 @@ void NodeGitWrapper::InitializeTemplate(v8::Local Nan::SetMethod(tpl, "getSelfFreeingInstanceCount", GetSelfFreeingInstanceCount); Nan::SetMethod(tpl, "getNonSelfFreeingConstructedCount", GetNonSelfFreeingConstructedCount); } + +template +void NodeGitWrapper::Reference() { + Ref(); + for (auto &i : referenceCallbacks) { + i.second(); + } +} + +template +void NodeGitWrapper::Unreference() { + Unref(); + for (auto &i : unreferenceCallbacks) { + i.second(); + } +} + +template +void NodeGitWrapper::AddReferenceCallbacks(size_t fieldIndex, std::function refCb, std::function unrefCb) { + referenceCallbacks[fieldIndex] = refCb; + unreferenceCallbacks[fieldIndex] = unrefCb; +} + +template +void NodeGitWrapper::SaveCleanupHandle(std::shared_ptr cleanupHandle) { + childCleanupVector.push_back(cleanupHandle); +} diff --git a/generate/templates/manual/src/promise_completion.cc b/generate/templates/manual/src/promise_completion.cc index 4b003d80fd..d3e4f4426e 100644 --- a/generate/templates/manual/src/promise_completion.cc +++ b/generate/templates/manual/src/promise_completion.cc @@ -1,33 +1,46 @@ +#include #include "../include/promise_completion.h" -Nan::Persistent PromiseCompletion::newFn; -Nan::Persistent PromiseCompletion::promiseFulfilled; -Nan::Persistent PromiseCompletion::promiseRejected; - // initializes the persistent handles for NAN_METHODs -void PromiseCompletion::InitializeComponent() { - v8::Local newTemplate = Nan::New(New); - newTemplate->InstanceTemplate()->SetInternalFieldCount(1); - newFn.Reset(newTemplate->GetFunction()); - - promiseFulfilled.Reset(Nan::New(PromiseFulfilled)->GetFunction()); - promiseRejected.Reset(Nan::New(PromiseRejected)->GetFunction()); +void PromiseCompletion::InitializeComponent(nodegit::Context *nodegitContext) { + Nan::HandleScope scope; + v8::Local nodegitExternal = Nan::New(nodegitContext); + v8::Local newTemplate = Nan::New(New, nodegitExternal); + newTemplate->InstanceTemplate()->SetInternalFieldCount(2); + + nodegitContext->SaveToPersistent( + "PromiseCompletion::Template", + Nan::GetFunction(newTemplate).ToLocalChecked() + ); + + v8::Local promiseFulfilled = Nan::GetFunction( + Nan::New(PromiseFulfilled, nodegitExternal) + ).ToLocalChecked(); + nodegitContext->SaveToPersistent("PromiseCompletion::PromiseFulfilled", promiseFulfilled); + + v8::Local promiseRejected = Nan::GetFunction( + Nan::New(PromiseRejected, nodegitExternal) + ).ToLocalChecked(); + nodegitContext->SaveToPersistent("PromiseCompletion::PromiseRejected", promiseRejected); } -bool PromiseCompletion::ForwardIfPromise(v8::Local result, AsyncBaton *baton, Callback callback) +bool PromiseCompletion::ForwardIfPromise(v8::Local result, nodegit::AsyncBaton *baton, Callback callback) { Nan::HandleScope scope; // check if the result is a promise - if (result->IsObject()) { - Nan::MaybeLocal maybeThenProp = Nan::Get(result->ToObject(), Nan::New("then").ToLocalChecked()); + if (!result.IsEmpty() && result->IsObject()) { + Nan::MaybeLocal maybeThenProp = Nan::Get(Nan::To(result).ToLocalChecked(), Nan::New("then").ToLocalChecked()); if (!maybeThenProp.IsEmpty()) { v8::Local thenProp = maybeThenProp.ToLocalChecked(); if(thenProp->IsFunction()) { // we can be reasonably certain that the result is a promise // create a new v8 instance of PromiseCompletion - v8::Local object = Nan::NewInstance(Nan::New(newFn)).ToLocalChecked(); + nodegit::Context *nodegitContext = nodegit::Context::GetCurrentContext(); + v8::Local constructor_template = nodegitContext->GetFromPersistent("PromiseCompletion::Template") + .As(); + v8::Local object = Nan::NewInstance(constructor_template).ToLocalChecked(); // set up the native PromiseCompletion object PromiseCompletion *promiseCompletion = ObjectWrap::Unwrap(object); @@ -49,13 +62,18 @@ NAN_METHOD(PromiseCompletion::New) { } // sets up a Promise to forward the promise result via the baton and callback -void PromiseCompletion::Setup(v8::Local thenFn, v8::Local result, AsyncBaton *baton, Callback callback) { +void PromiseCompletion::Setup(v8::Local thenFn, v8::Local result, nodegit::AsyncBaton *baton, Callback callback) { this->callback = callback; this->baton = baton; - v8::Local promise = result->ToObject(); + v8::Local promise = Nan::To(result).ToLocalChecked(); + nodegit::Context *nodegitContext = nodegit::Context::GetCurrentContext(); v8::Local thisHandle = handle(); + v8::Local promiseFulfilled = nodegitContext->GetFromPersistent("PromiseCompletion::PromiseFulfilled") + .As(); + v8::Local promiseRejected = nodegitContext->GetFromPersistent("PromiseCompletion::PromiseRejected") + .As(); v8::Local argv[2] = { Bind(promiseFulfilled, thisHandle), @@ -63,21 +81,21 @@ void PromiseCompletion::Setup(v8::Local thenFn, v8::Local PromiseCompletion::Bind(Nan::Persistent &function, v8::Local object) { +v8::Local PromiseCompletion::Bind(v8::Local function, v8::Local object) { Nan::EscapableHandleScope scope; v8::Local bind = - Nan::Get(Nan::New(function), Nan::New("bind").ToLocalChecked()) + Nan::Get(function, Nan::New("bind").ToLocalChecked()) .ToLocalChecked().As(); v8::Local argv[1] = { object }; - return scope.Escape(bind->Call(Nan::New(function), 1, argv)); + return scope.Escape(Nan::Call(bind, Nan::To(function).ToLocalChecked(), 1, argv).ToLocalChecked()); } // calls the callback stored in the PromiseCompletion, passing the baton that @@ -89,7 +107,7 @@ void PromiseCompletion::CallCallback(bool isFulfilled, const Nan::FunctionCallba resultOfPromise = info[0]; } - PromiseCompletion *promiseCompletion = ObjectWrap::Unwrap(info.This()->ToObject()); + PromiseCompletion *promiseCompletion = ObjectWrap::Unwrap(Nan::To(info.This()).ToLocalChecked()); (*promiseCompletion->callback)(isFulfilled, promiseCompletion->baton, resultOfPromise); } diff --git a/generate/templates/manual/src/reference_counter.cc b/generate/templates/manual/src/reference_counter.cc new file mode 100644 index 0000000000..e3bc483a7a --- /dev/null +++ b/generate/templates/manual/src/reference_counter.cc @@ -0,0 +1,24 @@ +#include "../include/reference_counter.h" + +void ReferenceCounter::incrementCountForPointer(void *ptr) { + nodegit::LockMaster lm(true, &referenceCountByPointer); + if (referenceCountByPointer.find(ptr) == referenceCountByPointer.end()) { + referenceCountByPointer[ptr] = 1; + } else { + referenceCountByPointer[ptr] = referenceCountByPointer[ptr] + 1; + } +} + +unsigned long ReferenceCounter::decrementCountForPointer(void *ptr) { + nodegit::LockMaster lm(true, &referenceCountByPointer); + unsigned long referenceCount = referenceCountByPointer[ptr]; + if (referenceCount == 1) { + referenceCountByPointer.erase(ptr); + return 0; + } else { + referenceCountByPointer[ptr] = referenceCount - 1; + return referenceCountByPointer[ptr]; + } +} + +std::unordered_map ReferenceCounter::referenceCountByPointer; diff --git a/generate/templates/manual/src/str_array_converter.cc b/generate/templates/manual/src/str_array_converter.cc index c66f901c36..5d04c65622 100644 --- a/generate/templates/manual/src/str_array_converter.cc +++ b/generate/templates/manual/src/str_array_converter.cc @@ -9,15 +9,15 @@ using namespace v8; using namespace node; -git_strarray *StrArrayConverter::Convert(Local val) { - if (!val->BooleanValue()) { +git_strarray *StrArrayConverter::Convert(v8::Local val) { + if (!Nan::To(val).FromJust()) { return NULL; } else if (val->IsArray()) { - return ConvertArray(Array::Cast(*val)); + return ConvertArray(v8::Local::Cast(val)); } else if (val->IsString() || val->IsStringObject()) { - return ConvertString(val->ToString()); + return ConvertString(Nan::To(val).ToLocalChecked()); } else { return NULL; @@ -33,18 +33,18 @@ git_strarray * StrArrayConverter::AllocStrArray(const size_t count) { return result; } -git_strarray *StrArrayConverter::ConvertArray(Array *val) { +git_strarray *StrArrayConverter::ConvertArray(v8::Local val) { git_strarray *result = AllocStrArray(val->Length()); for(size_t i = 0; i < result->count; i++) { - Nan::Utf8String entry(val->Get(i)); + Nan::Utf8String entry(Nan::Get(val, i).ToLocalChecked()); result->strings[i] = strdup(*entry); } return result; } -git_strarray* StrArrayConverter::ConvertString(Local val) { +git_strarray* StrArrayConverter::ConvertString(v8::Local val) { char *strings[1]; Nan::Utf8String utf8String(val); @@ -62,3 +62,19 @@ git_strarray *StrArrayConverter::ConstructStrArray(int argc, char** argv) { return result; } + +void StrArrayConverter::ConvertInto(git_strarray *out, v8::Local val) { + out->count = val->Length(); + out->strings = (char**) malloc(out->count * sizeof(char*)); + for (uint32_t i = 0; i < out->count; ++i) { + Nan::Utf8String utf8String(Nan::Get(val, i).ToLocalChecked().As()); + out->strings[i] = strdup(*utf8String); + } +} + +void StrArrayConverter::ConvertInto(git_strarray *out, v8::Local val) { + Nan::Utf8String utf8String(val); + out->count = 1; + out->strings = (char**) malloc(out->count * sizeof(char*)); + out->strings[0] = strdup(*utf8String); +} diff --git a/generate/templates/manual/src/thread_pool.cc b/generate/templates/manual/src/thread_pool.cc index 7eadf0421e..4cd5c095a3 100644 --- a/generate/templates/manual/src/thread_pool.cc +++ b/generate/templates/manual/src/thread_pool.cc @@ -1,102 +1,808 @@ +#include +#include "../include/context.h" #include "../include/thread_pool.h" -ThreadPool::ThreadPool(int numberOfThreads, uv_loop_t *loop) { - uv_mutex_init(&workMutex); - uv_sem_init(&workSemaphore, 0); +#include +#include +#include +#include +#include +#include // Temporary workaround for LFS checkout. Code added to be reverted. - uv_async_init(loop, &loopAsync, RunLoopCallbacks); - loopAsync.data = this; - uv_unref((uv_handle_t *)&loopAsync); - uv_mutex_init(&loopMutex); +extern "C" { + #include +} + +using namespace std::placeholders; + +namespace nodegit { + class Executor { + public: + struct Task { + enum Type { SHUTDOWN, WORK }; + + Task(Type initType) + : type(initType) + {} + Task(const Task &) = delete; + Task(Task &&) = delete; + Task &operator=(const Task &) = delete; + Task &operator=(Task &&) = delete; + + // We must define a virtual destructor so that derived classes are castable + virtual ~Task() {} + + Type type; + }; + + struct ShutdownTask : Task { + ShutdownTask() + : Task(SHUTDOWN) + {} + }; + + struct WorkTask : Task { + WorkTask(ThreadPool::Callback initCallback, Nan::AsyncResource *asyncResource, Nan::Global *callbackErrorHandle) + : Task(WORK), asyncResource(asyncResource), callbackErrorHandle(callbackErrorHandle), callback(initCallback) + {} + + Nan::AsyncResource *asyncResource; + Nan::Global *callbackErrorHandle; + ThreadPool::Callback callback; + }; + + typedef std::function PostCallbackEventToOrchestratorFn; + typedef std::function PostCompletedEventToOrchestratorFn; + typedef std::function()> TakeNextTaskFn; + + struct Event { + enum Type { COMPLETED, CALLBACK_TYPE }; + Event(Type initType) + : type(initType) + {} + Event(const Event &) = delete; + Event(Event &&) = delete; + Event &operator=(const Event &) = delete; + Event &operator=(Event &&) = delete; + + Type type; + + // We must define a virtual destructor so that derived classes are castable + virtual ~Event() {} + }; + + struct CompletedEvent : Event { + CompletedEvent() + : Event(COMPLETED) + {} + }; + + struct CallbackEvent : Event { + CallbackEvent(ThreadPool::OnPostCallbackFn initCallback) + : Event(CALLBACK_TYPE), callback(initCallback) + {} + + // Temporary workaround for LFS checkout. Code modified to be reverted. + // ThreadPool::Callback operator()(ThreadPool::QueueCallbackFn queueCb, ThreadPool::Callback completedCb) { + // return callback(queueCb, completedCb); + ThreadPool::Callback operator()(ThreadPool::QueueCallbackFn queueCb, ThreadPool::Callback completedCb, bool isThreaded) { + return callback(queueCb, completedCb, isThreaded); + } + + private: + ThreadPool::OnPostCallbackFn callback; + }; + + Executor( + PostCallbackEventToOrchestratorFn postCallbackEventToOrchestrator, + PostCompletedEventToOrchestratorFn postCompletedEventToOrchestrator, + TakeNextTaskFn takeNextTask, + nodegit::Context *context + ); + + void RunTaskLoop(); + + // Orchestrator needs to call this to ensure that the executor is done reading from + // the Orchestrator's memory + void WaitForThreadClose(); + + // Temporary workaround for LFS checkout. Code added to be reverted. + // Returns true if the task running spawned threads within libgit2 + bool IsGitThreaded() { return currentGitThreads > kInitialGitThreads; } + + static Nan::AsyncResource *GetCurrentAsyncResource(); + + static const nodegit::Context *GetCurrentContext(); - workInProgressCount = 0; + static Nan::Global *GetCurrentCallbackErrorHandle(); - for(int i=0; i *currentCallbackErrorHandle; + nodegit::Context *currentContext; + + // We need to populate the executor on every thread that libgit2 + // could make a callback on so that it can correctly queue callbacks + // in the correct javascript context + thread_local static Executor *executor; + thread_local static bool isExecutorThread; + PostCallbackEventToOrchestratorFn postCallbackEventToOrchestrator; + PostCompletedEventToOrchestratorFn postCompletedEventToOrchestrator; + TakeNextTaskFn takeNextTask; + std::thread thread; + + // Temporary workaround for LFS checkout. Code added to be reverted. + static constexpr int kInitialGitThreads {0}; + // Number of threads spawned internally by libgit2 to deal with + // the task of this Executor instance. Defaults to kInitialGitThreads. + std::atomic currentGitThreads {kInitialGitThreads}; + }; + + Executor::Executor( + PostCallbackEventToOrchestratorFn postCallbackEventToOrchestrator, + PostCompletedEventToOrchestratorFn postCompletedEventToOrchestrator, + TakeNextTaskFn takeNextTask, + nodegit::Context *context + ) + : currentAsyncResource(nullptr), + currentCallbackErrorHandle(nullptr), + currentContext(context), + postCallbackEventToOrchestrator(postCallbackEventToOrchestrator), + postCompletedEventToOrchestrator(postCompletedEventToOrchestrator), + takeNextTask(takeNextTask), + thread(&Executor::RunTaskLoop, this) + {} + + void Executor::RunTaskLoop() { + // Set the thread local storage so that libgit2 can pick up the current executor + // for the thread. + isExecutorThread = true; + executor = this; + + for ( ; ; ) { + std::unique_ptr task = takeNextTask(); + if (task->type == Task::Type::SHUTDOWN) { + return; + } + + WorkTask *workTask = static_cast(task.get()); + + // Temporary workaround for LFS checkout. Code added to be reverted. + currentGitThreads = kInitialGitThreads; + + currentAsyncResource = workTask->asyncResource; + currentCallbackErrorHandle = workTask->callbackErrorHandle; + workTask->callback(); + currentCallbackErrorHandle = nullptr; + currentAsyncResource = nullptr; + + postCompletedEventToOrchestrator(); + } } -} -void ThreadPool::QueueWork(Callback workCallback, Callback completionCallback, void *data) { - uv_mutex_lock(&workMutex); - // there is work on the thread pool - reference the handle so - // node doesn't terminate - uv_ref((uv_handle_t *)&loopAsync); - workQueue.push(Work(workCallback, completionCallback, data)); - workInProgressCount++; - uv_mutex_unlock(&workMutex); - uv_sem_post(&workSemaphore); -} + void Executor::WaitForThreadClose() { + thread.join(); + } -void ThreadPool::QueueLoopCallback(Callback callback, void *data, bool isWork) { - // push the callback into the queue - uv_mutex_lock(&loopMutex); - LoopCallback loopCallback(callback, data, isWork); - bool queueWasEmpty = loopQueue.empty(); - loopQueue.push(loopCallback); - // we only trigger RunLoopCallbacks via the loopAsync handle if the queue - // was empty. Otherwise, we depend on RunLoopCallbacks to re-trigger itself - if (queueWasEmpty) { - uv_async_send(&loopAsync); - } - uv_mutex_unlock(&loopMutex); -} + Nan::AsyncResource *Executor::GetCurrentAsyncResource() { + if (executor) { + return executor->currentAsyncResource; + } -void ThreadPool::ExecuteReverseCallback(Callback reverseCallback, void *data) { - QueueLoopCallback(reverseCallback, data, false); -} + // NOTE this should always be set when a libgit2 callback is running, + // so this case should not happen. + return nullptr; + } -void ThreadPool::RunEventQueue(void *threadPool) { - static_cast(threadPool)->RunEventQueue(); -} + const nodegit::Context *Executor::GetCurrentContext() { + if (executor) { + return executor->currentContext; + } -void ThreadPool::RunEventQueue() { - for ( ; ; ) { - // wait until there is work to do - uv_sem_wait(&workSemaphore); - uv_mutex_lock(&workMutex); - // the semaphore should guarantee that queue is not empty - Work work = workQueue.front(); - workQueue.pop(); - uv_mutex_unlock(&workMutex); + // NOTE this should always be set when a libgit2 callback is running, + // so this case should not happen. + return nullptr; + } - // perform the queued work - (*work.workCallback)(work.data); + Nan::Global *Executor::GetCurrentCallbackErrorHandle() { + if (executor) { + return executor->currentCallbackErrorHandle; + } - // schedule the completion callback on the loop - QueueLoopCallback(work.completionCallback, work.data, true); + // NOTE this should always be set when a libgit2 callback is running, + // so this case should not happen. + return nullptr; } -} -void ThreadPool::RunLoopCallbacks(uv_async_t* handle) { - static_cast(handle->data)->RunLoopCallbacks(); -} + void Executor::PostCallbackEvent(ThreadPool::OnPostCallbackFn onPostCallback) { + if (executor) { + executor->postCallbackEventToOrchestrator(onPostCallback); + } + } + + void *Executor::RetrieveTLSForLibgit2ChildThread() { + // Temporary workaround for LFS checkout. Code added to be reverted. + ++Executor::executor->currentGitThreads; + return Executor::executor; + } + + void Executor::SetTLSForLibgit2ChildThread(void *vexecutor) { + Executor::executor = static_cast(vexecutor); + } + + void Executor::TeardownTLSOnLibgit2ChildThread() { + if (!isExecutorThread) { + // Temporary workaround for LFS checkout. Code added to be reverted. + --Executor::executor->currentGitThreads; + Executor::executor = nullptr; + } + } + + thread_local Executor *Executor::executor = nullptr; + thread_local bool Executor::isExecutorThread = false; + + class Orchestrator { + public: + struct Job { + enum Type { SHUTDOWN, ASYNC_WORK }; + Job(Type initType) + : type(initType) + {} + Job(const Job &) = delete; + Job(Job &&) = delete; + Job &operator=(const Job &) = delete; + Job &operator=(Job &&) = delete; + + virtual ~Job() {} + + Type type; + }; + + struct ShutdownJob : Job { + ShutdownJob() + : Job(SHUTDOWN) + {} + }; + + struct AsyncWorkJob : Job { + AsyncWorkJob(nodegit::AsyncWorker *initWorker) + : Job(ASYNC_WORK), worker(initWorker) + {} + + nodegit::AsyncWorker *worker; + }; + + typedef std::function QueueCallbackOnJSThreadFn; + typedef std::function()> TakeNextJobFn; + + private: + class OrchestratorImpl { + public: + OrchestratorImpl( + QueueCallbackOnJSThreadFn queueCallbackOnJSThread, + TakeNextJobFn takeNextJob, + nodegit::Context *context + ); + + void RunJobLoop(); + + // The Executor will call this method to queue a CallbackEvent in Orchestrator's event loop + void PostCallbackEvent(ThreadPool::OnPostCallbackFn onPostCallback); + + // The Executor will call this method after completion its work. This should queue + // a CompletedEvent in Thread's event loop + void PostCompletedEvent(); + + // This will be used by Executor to take jobs that the Thread has picked up and run them. + std::unique_ptr TakeNextTask(); + + // This is used to wait for the Orchestrator's thread to shutdown after signaling shutdown + void WaitForThreadClose(); + + private: + // The only thread safe way to pull events from executorEventsQueue + std::shared_ptr TakeEventFromExecutor(); + + void ScheduleWorkTaskOnExecutor(ThreadPool::Callback callback, Nan::AsyncResource *asyncResource, Nan::Global *callbackErrorHandle); + + void ScheduleShutdownTaskOnExecutor(); + + std::condition_variable taskCondition; + std::unique_ptr taskMutex; + + std::queue> executorEventsQueue; + std::unique_ptr executorEventsMutex; + std::condition_variable executorEventsCondition; + + QueueCallbackOnJSThreadFn queueCallbackOnJSThread; + TakeNextJobFn takeNextJob; + std::unique_ptr task; + std::thread thread; + Executor executor; + }; + + std::unique_ptr impl; + + public: + Orchestrator( + QueueCallbackOnJSThreadFn queueCallbackOnJSThread, + TakeNextJobFn takeNextJob, + nodegit::Context *context + ); + + void WaitForThreadClose(); + }; + + Orchestrator::OrchestratorImpl::OrchestratorImpl( + QueueCallbackOnJSThreadFn queueCallbackOnJSThread, + TakeNextJobFn takeNextJob, + nodegit::Context *context + ) + : taskMutex(new std::mutex), + executorEventsMutex(new std::mutex), + queueCallbackOnJSThread(queueCallbackOnJSThread), + takeNextJob(takeNextJob), + task(nullptr), + thread(&Orchestrator::OrchestratorImpl::RunJobLoop, this), + executor( + std::bind(&Orchestrator::OrchestratorImpl::PostCallbackEvent, this, _1), + std::bind(&Orchestrator::OrchestratorImpl::PostCompletedEvent, this), + std::bind(&Orchestrator::OrchestratorImpl::TakeNextTask, this), + context + ) + {} + + void Orchestrator::OrchestratorImpl::RunJobLoop() { + for ( ; ; ) { + auto job = takeNextJob(); + switch (job->type) { + case Job::Type::SHUTDOWN: { + ScheduleShutdownTaskOnExecutor(); + executor.WaitForThreadClose(); + return; + } + + case Job::Type::ASYNC_WORK: { + std::shared_ptr asyncWorkJob = std::static_pointer_cast(job); + nodegit::AsyncWorker *worker = asyncWorkJob->worker; + // We lock at this level, because we temporarily unlock the lock master + // when a callback is fired. We need to be on the same thread to ensure + // the same thread that acquired the locks also releases them + nodegit::LockMaster lock = worker->AcquireLocks(); + ScheduleWorkTaskOnExecutor(std::bind(&nodegit::AsyncWorker::Execute, worker), worker->GetAsyncResource(), worker->GetCallbackErrorHandle()); + for ( ; ; ) { + std::shared_ptr event = TakeEventFromExecutor(); + if (event->type == Executor::Event::Type::COMPLETED) { + break; + } + + // We must have received a callback from libgit2 + auto callbackEvent = std::static_pointer_cast(event); + std::shared_ptr callbackMutex(new std::mutex); + std::shared_ptr callbackCondition(new std::condition_variable); + bool hasCompleted = false; + + // Temporary workaround for LFS checkout. Code removed to be reverted. + //LockMaster::TemporaryUnlock temporaryUnlock; + + // Temporary workaround for LFS checkout. Code added to be reverted. + bool isWorkerThreaded = executor.IsGitThreaded(); + ThreadPool::Callback callbackCompleted = []() {}; + if (!isWorkerThreaded) { + callbackCompleted = [callbackCondition, callbackMutex, &hasCompleted]() { + std::lock_guard lock(*callbackMutex); + hasCompleted = true; + callbackCondition->notify_one(); + }; + } + std::unique_ptr temporaryUnlock {nullptr}; + if (!isWorkerThreaded) { + temporaryUnlock = std::make_unique(); + } + + auto onCompletedCallback = (*callbackEvent)( + [this](ThreadPool::Callback callback, ThreadPool::Callback cancelCallback) { + queueCallbackOnJSThread(callback, cancelCallback, false); + }, + // Temporary workaround for LFS checkout. Code modified to be reverted. + /* + [callbackCondition, callbackMutex, &hasCompleted]() { + std::lock_guard lock(*callbackMutex); + hasCompleted = true; + callbackCondition->notify_one(); + } + */ + callbackCompleted, + isWorkerThreaded + ); + + // Temporary workaround for LFS checkout. Code modified to be reverted. + if (!isWorkerThreaded) { + std::unique_lock lock(*callbackMutex); + while (!hasCompleted) callbackCondition->wait(lock); + onCompletedCallback(); + } + } + + queueCallbackOnJSThread( + [worker]() { + worker->WorkComplete(); + worker->Destroy(); + }, + [worker]() { + worker->Cancel(); + worker->WorkComplete(); + worker->Destroy(); + }, + true + ); + } + } + } + } + + // TODO add a cancel callback to `OnPostCallbackFn` which can be used on nodegit terminate + void Orchestrator::OrchestratorImpl::PostCallbackEvent(ThreadPool::OnPostCallbackFn onPostCallback) { + std::lock_guard lock(*executorEventsMutex); + std::shared_ptr callbackEvent(new Executor::CallbackEvent(onPostCallback)); + executorEventsQueue.push(callbackEvent); + executorEventsCondition.notify_one(); + } + + void Orchestrator::OrchestratorImpl::PostCompletedEvent() { + std::lock_guard lock(*executorEventsMutex); + std::shared_ptr completedEvent(new Executor::CompletedEvent); + executorEventsQueue.push(completedEvent); + executorEventsCondition.notify_one(); + } + + std::shared_ptr Orchestrator::OrchestratorImpl::TakeEventFromExecutor() { + std::unique_lock lock(*executorEventsMutex); + while (executorEventsQueue.empty()) executorEventsCondition.wait(lock); + std::shared_ptr executorEvent = executorEventsQueue.front(); + executorEventsQueue.pop(); + return executorEvent; + } + + void Orchestrator::OrchestratorImpl::ScheduleShutdownTaskOnExecutor() { + std::lock_guard lock(*taskMutex); + task.reset(new Executor::ShutdownTask); + taskCondition.notify_one(); + } + + void Orchestrator::OrchestratorImpl::ScheduleWorkTaskOnExecutor(ThreadPool::Callback callback, Nan::AsyncResource *asyncResource, Nan::Global *callbackErrorHandle) { + std::lock_guard lock(*taskMutex); + task.reset(new Executor::WorkTask(callback, asyncResource, callbackErrorHandle)); + taskCondition.notify_one(); + } + + std::unique_ptr Orchestrator::OrchestratorImpl::TakeNextTask() { + std::unique_lock lock(*taskMutex); + while (!task) taskCondition.wait(lock); + return std::move(task); + } + + void Orchestrator::OrchestratorImpl::WaitForThreadClose() { + thread.join(); + } + + Orchestrator::Orchestrator( + QueueCallbackOnJSThreadFn queueCallbackOnJSThread, + TakeNextJobFn takeNextJob, + nodegit::Context *context + ) + : impl(new OrchestratorImpl(queueCallbackOnJSThread, takeNextJob, context)) + {} + + void Orchestrator::WaitForThreadClose() { + impl->WaitForThreadClose(); + } + + class ThreadPoolImpl { + public: + ThreadPoolImpl(int numberOfThreads, uv_loop_t *loop, nodegit::Context *context); + + void QueueWorker(nodegit::AsyncWorker *worker); + + std::shared_ptr TakeNextJob(); + + void QueueCallbackOnJSThread(ThreadPool::Callback callback, ThreadPool::Callback cancelCallback, bool isWork); + + static void RunLoopCallbacks(uv_async_t *handle); + + void Shutdown(std::unique_ptr cleanupHandle); + + struct AsyncCallbackData { + AsyncCallbackData(ThreadPoolImpl *pool) + : pool(pool) + {} + + std::unique_ptr cleanupHandle; + ThreadPoolImpl *pool; + }; + + private: + bool isMarkedForDeletion; + + struct JSThreadCallback { + JSThreadCallback(ThreadPool::Callback callback, ThreadPool::Callback cancelCallback, bool isWork) + : isWork(isWork), callback(callback), cancelCallback(cancelCallback) + {} + + JSThreadCallback() + : isWork(false), callback(nullptr), cancelCallback(nullptr) + {} + + void performCallback() { + callback(); + } + + void cancel() { + cancelCallback(); + } + + bool isWork; + + private: + ThreadPool::Callback callback; + ThreadPool::Callback cancelCallback; + }; + + void RunLoopCallbacks(); + + std::queue> orchestratorJobQueue; + std::unique_ptr orchestratorJobMutex; + std::condition_variable orchestratorJobCondition; + size_t workInProgressCount; + + // completion and async callbacks to be performed on the loop + std::queue jsThreadCallbackQueue; + std::unique_ptr jsThreadCallbackMutex; + uv_async_t jsThreadCallbackAsync; + + std::vector orchestrators; + }; + + // context required to be passed to Orchestrators, but ThreadPoolImpl doesn't need to keep it + ThreadPoolImpl::ThreadPoolImpl(int numberOfThreads, uv_loop_t *loop, nodegit::Context *context) + : isMarkedForDeletion(false), + orchestratorJobMutex(new std::mutex), + jsThreadCallbackMutex(new std::mutex) + { + uv_async_init(loop, &jsThreadCallbackAsync, RunLoopCallbacks); + jsThreadCallbackAsync.data = new AsyncCallbackData(this); + uv_unref((uv_handle_t *)&jsThreadCallbackAsync); + + workInProgressCount = 0; + + for (int i = 0; i < numberOfThreads; i++) { + orchestrators.emplace_back( + std::bind(&ThreadPoolImpl::QueueCallbackOnJSThread, this, _1, _2, _3), + std::bind(&ThreadPoolImpl::TakeNextJob, this), + context + ); + } + } + + void ThreadPoolImpl::QueueWorker(nodegit::AsyncWorker *worker) { + std::lock_guard lock(*orchestratorJobMutex); + // there is work on the thread pool - reference the handle so + // node doesn't terminate + uv_ref((uv_handle_t *)&jsThreadCallbackAsync); + orchestratorJobQueue.emplace(new Orchestrator::AsyncWorkJob(worker)); + workInProgressCount++; + orchestratorJobCondition.notify_one(); + } + + std::shared_ptr ThreadPoolImpl::TakeNextJob() { + std::unique_lock lock(*orchestratorJobMutex); + while (orchestratorJobQueue.empty()) orchestratorJobCondition.wait(lock); + auto orchestratorJob = orchestratorJobQueue.front(); + + // When the thread pool is shutting down, the thread pool will drain the work queue and replace it with + // a single shared_ptr to a shutdown job, so don't pop the queue when we're shutting down so + // everyone gets the signal + if (orchestratorJob->type != Orchestrator::Job::Type::SHUTDOWN) { + orchestratorJobQueue.pop(); + } + + return orchestratorJob; + } -void ThreadPool::RunLoopCallbacks() { - // get the next callback to run - uv_mutex_lock(&loopMutex); - LoopCallback loopCallback = loopQueue.front(); - uv_mutex_unlock(&loopMutex); + void ThreadPoolImpl::QueueCallbackOnJSThread(ThreadPool::Callback callback, ThreadPool::Callback cancelCallback, bool isWork) { + std::unique_lock lock(*jsThreadCallbackMutex); + // When the threadpool is shutting down, we want to free up the executors to also shutdown + // that means that we need to cancel all non-work callbacks as soon as we see them and + // we know that we are shutting down + if (isMarkedForDeletion && !isWork) { + // we don't know how long the cancelCallback will take, and it certainly doesn't need the lock + // while we're running it, so unlock it immediately. + lock.unlock(); + cancelCallback(); + return; + } - // perform the queued loop callback - (*loopCallback.callback)(loopCallback.data); + bool queueWasEmpty = jsThreadCallbackQueue.empty(); + jsThreadCallbackQueue.emplace(callback, cancelCallback, isWork); + // we only trigger RunLoopCallbacks via the jsThreadCallbackAsync handle if the queue + // was empty. Otherwise, we depend on RunLoopCallbacks to re-trigger itself + if (queueWasEmpty) { + uv_async_send(&jsThreadCallbackAsync); + } + } - // pop the queue, and if necessary, re-trigger RunLoopCallbacks - uv_mutex_lock(&loopMutex); - loopQueue.pop(); - if (!loopQueue.empty()) { - uv_async_send(&loopAsync); + void ThreadPoolImpl::RunLoopCallbacks(uv_async_t* handle) { + auto asyncCallbackData = static_cast(handle->data); + if (asyncCallbackData->pool) { + asyncCallbackData->pool->RunLoopCallbacks(); + } } - uv_mutex_unlock(&loopMutex); - // if there is no ongoing work / completion processing, node doesn't need - // to be prevented from terminating - if (loopCallback.isWork) { - uv_mutex_lock(&workMutex); - workInProgressCount --; - if(!workInProgressCount) { - uv_unref((uv_handle_t *)&loopAsync); + // NOTE this should theoretically never be triggered during a cleanup operation + void ThreadPoolImpl::RunLoopCallbacks() { + Nan::HandleScope scope; + v8::Local context = Nan::GetCurrentContext(); + node::CallbackScope callbackScope(context->GetIsolate(), Nan::New(), {0, 0}); + + std::unique_lock lock(*jsThreadCallbackMutex); + // get the next callback to run + JSThreadCallback jsThreadCallback = jsThreadCallbackQueue.front(); + jsThreadCallbackQueue.pop(); + + lock.unlock(); + jsThreadCallback.performCallback(); + lock.lock(); + + if (!jsThreadCallbackQueue.empty()) { + uv_async_send(&jsThreadCallbackAsync); + } + + // if there is no ongoing work / completion processing, node doesn't need + // to be prevented from terminating + if (jsThreadCallback.isWork) { + std::lock_guard orchestratorLock(*orchestratorJobMutex); + workInProgressCount--; + if (!workInProgressCount) { + uv_unref((uv_handle_t *)&jsThreadCallbackAsync); + } + } + } + + void ThreadPoolImpl::Shutdown(std::unique_ptr cleanupHandle) { + std::queue> cancelledJobs; + std::queue cancelledCallbacks; + { + std::unique_lock orchestratorLock(*orchestratorJobMutex, std::defer_lock); + std::unique_lock jsThreadLock(*jsThreadCallbackMutex, std::defer_lock); + std::lock(orchestratorLock, jsThreadLock); + + // Once we've marked for deletion, we will start cancelling all callbacks + // when an attempt to queue a callback is made + isMarkedForDeletion = true; + // We want to grab all of the jobs that have been queued and run their cancel routines + // so that we can clean up their resources + orchestratorJobQueue.swap(cancelledJobs); + // We also want to grab all callbacks that have been queued so that we can + // run their cancel routines, this will help terminate the async workers + // that are currently being executed complete so that the threads + // running them can exit cleanly + jsThreadCallbackQueue.swap(cancelledCallbacks); + // Pushing a ShutdownJob into the queue will instruct all threads + // to start their shutdown process when they see the job is available. + orchestratorJobQueue.emplace(new Orchestrator::ShutdownJob); + + if (workInProgressCount) { + // unref the jsThreadCallback for all work in progress + // it will not be used after this function has completed + while (workInProgressCount--) { + uv_unref((uv_handle_t *)&jsThreadCallbackAsync); + } + } + + orchestratorJobCondition.notify_all(); + } + + Nan::HandleScope scope; + v8::Local context = Nan::GetCurrentContext(); + node::CallbackScope callbackScope(context->GetIsolate(), Nan::New(), {0, 0}); + + while (cancelledJobs.size()) { + std::shared_ptr cancelledJob = cancelledJobs.front(); + std::shared_ptr asyncWorkJob = std::static_pointer_cast(cancelledJob); + + asyncWorkJob->worker->Cancel(); + asyncWorkJob->worker->WorkComplete(); + asyncWorkJob->worker->Destroy(); + + cancelledJobs.pop(); } - uv_mutex_unlock(&workMutex); + + // We need to cancel all callbacks that were scheduled before the shutdown + // request went through. This will help finish any work any currently operating + // executors are undertaking + while (cancelledCallbacks.size()) { + JSThreadCallback cancelledCallback = cancelledCallbacks.front(); + cancelledCallback.cancel(); + cancelledCallbacks.pop(); + } + + std::for_each(orchestrators.begin(), orchestrators.end(), [](Orchestrator &orchestrator) { + orchestrator.WaitForThreadClose(); + }); + + // After we have completed waiting for all threads to close + // we will need to cleanup the rest of the completion callbacks + // from workers that were still running when the shutdown signal + // was sent + std::lock_guard jsThreadLock(*jsThreadCallbackMutex); + while (jsThreadCallbackQueue.size()) { + JSThreadCallback jsThreadCallback = jsThreadCallbackQueue.front(); + jsThreadCallback.cancel(); + jsThreadCallbackQueue.pop(); + } + + AsyncCallbackData *asyncCallbackData = static_cast(jsThreadCallbackAsync.data); + asyncCallbackData->cleanupHandle.swap(cleanupHandle); + asyncCallbackData->pool = nullptr; + + uv_close(reinterpret_cast(&jsThreadCallbackAsync), [](uv_handle_t *handle) { + auto asyncCallbackData = static_cast(handle->data); + delete asyncCallbackData; + }); + } + + ThreadPool::ThreadPool(int numberOfThreads, uv_loop_t *loop, nodegit::Context *context) + : impl(new ThreadPoolImpl(numberOfThreads, loop, context)) + {} + + ThreadPool::~ThreadPool() {} + + void ThreadPool::QueueWorker(nodegit::AsyncWorker *worker) { + impl->QueueWorker(worker); + } + + void ThreadPool::PostCallbackEvent(OnPostCallbackFn onPostCallback) { + Executor::PostCallbackEvent(onPostCallback); + } + + Nan::AsyncResource *ThreadPool::GetCurrentAsyncResource() { + return Executor::GetCurrentAsyncResource(); + } + + const nodegit::Context *ThreadPool::GetCurrentContext() { + return Executor::GetCurrentContext(); + } + + Nan::Global *ThreadPool::GetCurrentCallbackErrorHandle() { + return Executor::GetCurrentCallbackErrorHandle(); + } + + void ThreadPool::Shutdown(std::unique_ptr cleanupHandle) { + impl->Shutdown(std::move(cleanupHandle)); + } + + void ThreadPool::InitializeGlobal() { + git_custom_tls_set_callbacks( + Executor::RetrieveTLSForLibgit2ChildThread, + Executor::SetTLSForLibgit2ChildThread, + Executor::TeardownTLSOnLibgit2ChildThread + ); } } diff --git a/generate/templates/manual/src/tracker_wrap.cc b/generate/templates/manual/src/tracker_wrap.cc new file mode 100644 index 0000000000..85034d88de --- /dev/null +++ b/generate/templates/manual/src/tracker_wrap.cc @@ -0,0 +1,238 @@ +#include "../include/tracker_wrap.h" + +#include +#include + +namespace { + /** + * \class TrackerWrapTreeNode + * + * Parents of a TrackerWrapTreeNode will be the nodes holding TrackerWrap objects that + * are owners of the TrackerWrap object that this node holds. The same way for its children. + */ + class TrackerWrapTreeNode + { + public: + TrackerWrapTreeNode(nodegit::TrackerWrap *trackerWrap) : m_trackerWrap(trackerWrap) {} + TrackerWrapTreeNode() = delete; + ~TrackerWrapTreeNode(); + TrackerWrapTreeNode(const TrackerWrapTreeNode &other) = delete; + TrackerWrapTreeNode(TrackerWrapTreeNode &&other) = delete; + TrackerWrapTreeNode& operator=(const TrackerWrapTreeNode &other) = delete; + TrackerWrapTreeNode& operator=(TrackerWrapTreeNode &&other) = delete; + + inline const std::unordered_set& Children() const; + inline nodegit::TrackerWrap* TrackerWrap(); + inline void AddChild(TrackerWrapTreeNode *child); + + private: + std::unordered_set m_children {}; + nodegit::TrackerWrap *m_trackerWrap {}; + }; + + /** + * TrackerWrapTreeNode::~TrackerWrapTreeNode() + * Frees the memory of the TrackerWrap pointer it holds. + */ + TrackerWrapTreeNode::~TrackerWrapTreeNode() { + delete m_trackerWrap; + } + + /** + * TrackerWrapTreeNode::Children() + * + * Returns a reference to the children nodes of this. + */ + const std::unordered_set& TrackerWrapTreeNode::Children() const { + return m_children; + } + + /** + * TrackerWrapTreeNode::TrackerWrap() + * + * Returns a pointer to the node's TrackerWrap object. + */ + nodegit::TrackerWrap* TrackerWrapTreeNode::TrackerWrap() { + return m_trackerWrap; + } + + /** + * TrackerWrapTreeNode::AddChild() + */ + void TrackerWrapTreeNode::AddChild(TrackerWrapTreeNode *child) { + m_children.insert(child); + } + + /** + * \class TrackerWrapTrees + * + * Class containing a list of trees with nodes holding TrackerWrap objects. + * For a TrackerWrap object 'P' which owns another TrackerWrap object 'C', + * 'P' will be held in a node which will be the parent of the child node + * that holds 'C'. + * On destruction, nodes will be freed in a children-first way. + * + * NOTE: nodegit code previous to this change is prepared to manage an array of + * owners, so class TrackerWrapTrees considers multiple owners (parent nodes) too. + */ + class TrackerWrapTrees + { + public: + TrackerWrapTrees(nodegit::TrackerWrap::TrackerList *trackerList); + TrackerWrapTrees() = delete; + ~TrackerWrapTrees(); + TrackerWrapTrees(const TrackerWrapTrees &other) = delete; + TrackerWrapTrees(TrackerWrapTrees &&other) = delete; + TrackerWrapTrees& operator=(const TrackerWrapTrees &other) = delete; + TrackerWrapTrees& operator=(TrackerWrapTrees &&other) = delete; + + private: + void addNode(nodegit::TrackerWrap *trackerWrap); + void addParentNode(nodegit::TrackerWrap *owner, TrackerWrapTreeNode *child); + void deleteTree(TrackerWrapTreeNode *node); + void freeAllTreesChildrenFirst(); + + using TrackerWrapTreeNodeMap = std::unordered_map>; + + TrackerWrapTreeNodeMap m_mapTrackerWrapNode {}; + std::vector m_roots {}; + }; + + /** + * TrackerWrapTrees::TrackerWrapTrees(nodegit::TrackerWrap::TrackerList *trackerList) + * + * Unlinks items from trackerList and adds them to a tree. + * For each root (TrackerWrap item without owners), it adds a new tree root. + * + * \param trackerList TrackerList pointer from which the TrackerWrapTrees object will be created. + */ + TrackerWrapTrees::TrackerWrapTrees(nodegit::TrackerWrap::TrackerList *trackerList) + { + nodegit::TrackerWrap *trackerWrap {}; + while ((trackerWrap = nodegit::TrackerWrap::UnlinkFirst(trackerList)) != nullptr) { + addNode(trackerWrap); + } + } + + /* + * TrackerWrapTrees::~TrackerWrapTrees + */ + TrackerWrapTrees::~TrackerWrapTrees() { + freeAllTreesChildrenFirst(); + } + + /** + * TrackerWrapTrees::addNode + * + * \param trackerWrap pointer to the TrackerWrap object to add as a node in a tree. + */ + void TrackerWrapTrees::addNode(nodegit::TrackerWrap *trackerWrap) { + // add trackerWrap as a node + // NOTE: 'emplace' will create a temporal TrackerWrapTreeNode and will + // free it if trackerWrap already exists as a key. To prevent freeing + // the node at this moment we have to find it first. + auto addedNodeIter = m_mapTrackerWrapNode.find(trackerWrap); + if (addedNodeIter == m_mapTrackerWrapNode.end()) { + addedNodeIter = m_mapTrackerWrapNode.emplace(std::make_pair( + trackerWrap, std::make_unique(trackerWrap))).first; + } + TrackerWrapTreeNode *addedNode = addedNodeIter->second.get(); + + // if trackerWrap has no owners, add it as a root node + const std::vector *owners = trackerWrap->GetTrackerWrapOwners(); + if (owners == nullptr) { + m_roots.push_back(addedNode); + } + else { + // add addedNode's parents and link them with this child + for (nodegit::TrackerWrap *owner : *owners) { + addParentNode(owner, addedNode); + } + } + } + + /** + * TrackerWrapTrees::addParentNode + * + * \param owner TrackerWrap pointer for the new parent node to add. + * \param child TrackerWrapTreeNode pointer to be the child node of the new parent node to add. + */ + void TrackerWrapTrees::addParentNode(nodegit::TrackerWrap *owner, TrackerWrapTreeNode *child) + { + // adds a new parent node (holding the owner) + // NOTE: 'emplace' will create a temporal TrackerWrapTreeNode and will + // free it if trackerWrap already exists as a key. To prevent freeing + // the node at this moment we have to find it first. + auto addedParentNodeIter = m_mapTrackerWrapNode.find(owner); + if (addedParentNodeIter == m_mapTrackerWrapNode.end()) { + addedParentNodeIter = m_mapTrackerWrapNode.emplace(std::make_pair( + owner, std::make_unique(owner))).first; + } + TrackerWrapTreeNode *addedParentNode = addedParentNodeIter->second.get(); + + // links parent to child + addedParentNode->AddChild(child); + } + + /** + * TrackerWrapTrees::deleteTree + * + * Deletes the tree from the node passed as a parameter + * in a children-first way and recursively. + * + * \param node node from where to delete all its children and itself. + */ + void TrackerWrapTrees::deleteTree(TrackerWrapTreeNode *node) + { + // delete all node's children first + const std::unordered_set &children = node->Children(); + for (TrackerWrapTreeNode *child : children) { + // check that child hasn't been removed previously by another parent + if (m_mapTrackerWrapNode.find(child->TrackerWrap()) != m_mapTrackerWrapNode.end()) { + deleteTree(child); + } + } + + // then deletes itself from the container, which will + // actually free 'node' and the TrackerWrap object it holds + m_mapTrackerWrapNode.erase(node->TrackerWrap()); + } + + /** + * TrackerWrapTrees::freeAllTreesChildrenFirst + * + * Deletes all the trees held, in a children-first way. + */ + void TrackerWrapTrees::freeAllTreesChildrenFirst() { + for (TrackerWrapTreeNode *root : m_roots) { + deleteTree(root); + } + m_roots.clear(); + } +} // end anonymous namespace + + +namespace nodegit { + TrackerWrap* TrackerWrap::UnlinkFirst(TrackerList *listStart) { + assert(listStart != nullptr); + return listStart->m_next == nullptr ? nullptr : listStart->m_next->Unlink(); + } + + int TrackerWrap::SizeFromList(TrackerList *listStart) { + assert(listStart != nullptr); + TrackerList *t {listStart}; + int count {0}; + while (t->m_next != nullptr) { + ++count; + t = t->m_next; + } + return count; + } + + void TrackerWrap::DeleteFromList(TrackerList *listStart) { + assert(listStart != nullptr); + // creates an object TrackerWrapTrees, which will free + // the nodes of its trees in a children-first way + TrackerWrapTrees trackerWrapTrees(listStart); + } +} \ No newline at end of file diff --git a/generate/templates/manual/src/v8_helpers.cc b/generate/templates/manual/src/v8_helpers.cc new file mode 100644 index 0000000000..bd97fba34e --- /dev/null +++ b/generate/templates/manual/src/v8_helpers.cc @@ -0,0 +1,19 @@ +#include "../include/v8_helpers.h" + +namespace nodegit { + v8::Local safeGetField(v8::Local &containerObject, std::string field) { + auto maybeFieldName = Nan::New(field); + if (maybeFieldName.IsEmpty()) { + v8::Local emptyResult; + return emptyResult; + } + + auto maybeRetrievedField = Nan::Get(containerObject, maybeFieldName.ToLocalChecked()); + if (maybeRetrievedField.IsEmpty()) { + v8::Local emptyResult; + return emptyResult; + } + + return maybeRetrievedField.ToLocalChecked(); + } +} diff --git a/generate/templates/manual/src/wrapper.cc b/generate/templates/manual/src/wrapper.cc index 3f2ea61215..3bad23c7d4 100644 --- a/generate/templates/manual/src/wrapper.cc +++ b/generate/templates/manual/src/wrapper.cc @@ -16,18 +16,20 @@ Wrapper::Wrapper(void *raw) { this->raw = raw; } -void Wrapper::InitializeComponent(Local target) { +void Wrapper::InitializeComponent(Local target, nodegit::Context *nodegitContext) { Nan::HandleScope scope; - Local tpl = Nan::New(JSNewFunction); + Local nodegitExternal = Nan::New(nodegitContext); + Local tpl = Nan::New(JSNewFunction, nodegitExternal); - tpl->InstanceTemplate()->SetInternalFieldCount(1); + tpl->InstanceTemplate()->SetInternalFieldCount(2); tpl->SetClassName(Nan::New("Wrapper").ToLocalChecked()); - Nan::SetPrototypeMethod(tpl, "toBuffer", ToBuffer); + Nan::SetPrototypeMethod(tpl, "toBuffer", ToBuffer, nodegitExternal); - constructor_template.Reset(tpl); - Nan::Set(target, Nan::New("Wrapper").ToLocalChecked(), Nan::GetFunction(tpl).ToLocalChecked()); + Local constructor_template = Nan::GetFunction(tpl).ToLocalChecked(); + nodegitContext->SaveToPersistent("Wrapper::Template", constructor_template); + Nan::Set(target, Nan::New("Wrapper").ToLocalChecked(), constructor_template); } NAN_METHOD(Wrapper::JSNewFunction) { @@ -47,8 +49,9 @@ Local Wrapper::New(const void *raw) { Local argv[1] = { Nan::New((void *)raw) }; Local instance; - Local constructorHandle = Nan::New(constructor_template); - instance = Nan::NewInstance(Nan::GetFunction(constructorHandle).ToLocalChecked(), 1, argv).ToLocalChecked(); + nodegit::Context *nodegitContext = nodegit::Context::GetCurrentContext(); + Local constructor_template = nodegitContext->GetFromPersistent("Wrapper::Template").As(); + instance = Nan::NewInstance(constructor_template, 1, argv).ToLocalChecked(); return scope.Escape(instance); } @@ -63,7 +66,7 @@ NAN_METHOD(Wrapper::ToBuffer) { return Nan::ThrowError("Number is required."); } - int len = info[0]->ToNumber()->Value(); + int len = Nan::To(info[0]).FromJust(); Local bufferConstructor = Local::Cast( Nan::Get(Nan::GetCurrentContext()->Global(), Nan::New("Buffer").ToLocalChecked()).ToLocalChecked()); @@ -75,6 +78,3 @@ NAN_METHOD(Wrapper::ToBuffer) { info.GetReturnValue().Set(nodeBuffer); } - - -Nan::Persistent Wrapper::constructor_template; diff --git a/generate/templates/manual/tree/get_all_filepaths.cc b/generate/templates/manual/tree/get_all_filepaths.cc new file mode 100644 index 0000000000..758383980a --- /dev/null +++ b/generate/templates/manual/tree/get_all_filepaths.cc @@ -0,0 +1,157 @@ + +namespace TreeFilepathsHelpers { + +int iterateTreePaths(git_repository *repo, git_tree *tree, std::vector *paths,std::string *buffer) { + size_t size = git_tree_entrycount(tree); + for (size_t i = 0; i < size; i++) { + const git_tree_entry *entry = git_tree_entry_byindex(tree, i); + const git_filemode_t filemode = git_tree_entry_filemode(entry); + if (filemode == GIT_FILEMODE_BLOB || filemode == GIT_FILEMODE_BLOB_EXECUTABLE) { + paths->push_back(*buffer + std::string(git_tree_entry_name(entry))); + } + else if (filemode == GIT_FILEMODE_TREE) { + git_tree *subtree; + int error = git_tree_lookup(&subtree, repo, git_tree_entry_id(entry)); + if (error == GIT_OK) { + size_t size = buffer->size(); + /* append the next entry to the path */ + buffer->append(git_tree_entry_name(entry)); + buffer->append("/"); + error = iterateTreePaths(repo, subtree, paths, buffer); + git_tree_free(subtree); + buffer->resize(size); + } + + if (error < 0 ) { + return error; + } + + } + } + return GIT_OK; +} + +} // end anonymous namespace + +NAN_METHOD(GitTree::GetAllFilepaths) +{ + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + GetAllFilepathsBaton* baton = new GetAllFilepathsBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->tree = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + baton->out = new std::vector; + baton->repo = git_tree_owner(baton->tree); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + GetAllFilepathsWorker *worker = new GetAllFilepathsWorker(baton, callback, cleanupHandles); + worker->Reference("tree", info.This()); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + + return; +} + +nodegit::LockMaster GitTree::GetAllFilepathsWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->tree, baton->repo); + return lockMaster; +} + +void GitTree::GetAllFilepathsWorker::Execute() +{ + std::string buffer; + buffer.reserve(4096); + baton->error_code = TreeFilepathsHelpers::iterateTreePaths(baton->repo, baton->tree, baton->out, &buffer); + if (baton->error_code != GIT_OK && git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } +} + +void GitTree::GetAllFilepathsWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + delete baton->out; + + delete baton; +} + +void GitTree::GetAllFilepathsWorker::HandleOKCallback() +{ + if (baton->error_code == GIT_OK) { + std::vector &paths = *(baton->out); + v8::Local result = Nan::New(paths.size()); + for (unsigned int i = 0; i < paths.size(); i++) { + Nan::Set(result, i, Nan::New(paths[i]).ToLocalChecked()); + } + + v8::Local argv[2] = {Nan::Null(), result}; + callback->Call(2, argv, async_resource); + } + else + { + if (baton->error) + { + Local err; + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method getAllFilepaths has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Tree.getAllFilepaths").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + bool callbackFired = false; + if (!callbackErrorHandle.IsEmpty()) { + v8::Local maybeError = Nan::New(callbackErrorHandle); + if (!maybeError->IsNull() && !maybeError->IsUndefined()) { + v8::Local argv[1] = { + maybeError + }; + callback->Call(1, argv, async_resource); + callbackFired = true; + } + } + + if (!callbackFired) + { + Local err = Nan::To(Nan::Error("Method getAllFilepaths has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.getAllFilepaths").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + } + else + { + callback->Call(0, NULL, async_resource); + } + } + + delete baton->out; + delete baton; +} diff --git a/generate/templates/partials/async_function.cc b/generate/templates/partials/async_function.cc index 191b8f20f5..d23ec7f609 100644 --- a/generate/templates/partials/async_function.cc +++ b/generate/templates/partials/async_function.cc @@ -2,252 +2,367 @@ {%partial doc .%} NAN_METHOD({{ cppClassName }}::{{ cppFunctionName }}) { {%partial guardArguments .%} - if (info.Length() == {{args|jsArgsCount}} || !info[{{args|jsArgsCount}}]->IsFunction()) { + if (!info[info.Length() - 1]->IsFunction()) { return Nan::ThrowError("Callback is required and must be a Function."); } - {{ cppFunctionName }}Baton* baton = new {{ cppFunctionName }}Baton; + {{ cppFunctionName }}Baton* baton = new {{ cppFunctionName }}Baton(); baton->error_code = GIT_OK; baton->error = NULL; {%each args|argsInfo as arg %} {%if arg.globalPayload %} - {{ cppFunctionName }}_globalPayload* globalPayload = new {{ cppFunctionName }}_globalPayload; + {{ cppFunctionName }}_globalPayload* globalPayload = new {{ cppFunctionName }}_globalPayload; {%endif%} {%endeach%} + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + std::map> cleanupHandles; + {%each args|argsInfo as arg %} {%if not arg.isReturn %} {%if arg.isSelf %} - baton->{{ arg.name }} = Nan::ObjectWrap::Unwrap<{{ arg.cppClassName }}>(info.This())->GetValue(); + baton->{{ arg.name }} = Nan::ObjectWrap::Unwrap<{{ arg.cppClassName }}>(info.This())->GetValue(); {%elsif arg.isCallbackFunction %} - if (!info[{{ arg.jsArg }}]->IsFunction()) { - baton->{{ arg.name }} = NULL; - {%if arg.payload.globalPayload %} - globalPayload->{{ arg.name }} = NULL; - {%else%} - baton->{{ arg.payload.name }} = NULL; - {%endif%} - } - else { - baton->{{ arg.name}} = {{ cppFunctionName }}_{{ arg.name }}_cppCallback; + if (!info[{{ arg.jsArg }}]->IsFunction()) { + baton->{{ arg.name }} = NULL; {%if arg.payload.globalPayload %} - globalPayload->{{ arg.name }} = new Nan::Callback(info[{{ arg.jsArg }}].As()); + globalPayload->{{ arg.name }} = NULL; {%else%} - baton->{{ arg.payload.name }} = new Nan::Callback(info[{{ arg.jsArg }}].As()); + // NOTE this is a dead path + baton->{{ arg.payload.name }} = NULL; {%endif%} - } + } + else { + baton->{{ arg.name}} = {{ cppFunctionName }}_{{ arg.name }}_cppCallback; + {%if arg.payload.globalPayload %} + globalPayload->{{ arg.name }} = new Nan::Callback(info[{{ arg.jsArg }}].As()); + {%else%} + // NOTE this is a dead path + baton->{{ arg.payload.name }} = new Nan::Callback(info[{{ arg.jsArg }}].As()); + {%endif%} + } {%elsif arg.payloadFor %} {%if arg.globalPayload %} - baton->{{ arg.name }} = globalPayload; + baton->{{ arg.name }} = globalPayload; {%endif%} + {% elsif arg.isStructType %} + {% if arg.isOptional %} + if (info[{{ arg.jsArg }}]->IsNull() || info[{{ arg.jsArg }}]->IsUndefined()) { + baton->{{ arg.name }} = nullptr; + } else + {% endif %} + {% if arg.cppClassName == 'Array' %} + { + v8::Local tempArray = v8::Local::Cast(info[{{ arg.jsArg }}]); + baton->{{ arg.name }} = ({{ arg.cType|unPointer }}*)malloc(sizeof({{ arg.cType|unPointer }}) * tempArray->Length()); + for (uint32_t i = 0; i < tempArray->Length(); ++i) { + auto conversionResult = Configurable{{ arg.arrayElementCppClassName }}::fromJavascript( + nodegitContext, + Nan::Get(tempArray, i).ToLocalChecked() + ); + + if (!conversionResult.result) { + // TODO free previously allocated memory + free(baton->{{ arg.name }}); + return Nan::ThrowError(Nan::New(conversionResult.error).ToLocalChecked()); + } + + auto convertedObject = conversionResult.result; + cleanupHandles[std::string("{{ arg.name }}") + std::to_string(i)] = convertedObject; + baton->{{ arg.name }}[i] = *convertedObject->GetValue(); + } + } + {% else %} + { + auto conversionResult = Configurable{{ arg.cppClassName }}::fromJavascript(nodegitContext, info[{{ arg.jsArg }}]); + if (!conversionResult.result) { + return Nan::ThrowError(Nan::New(conversionResult.error).ToLocalChecked()); + } + + auto convertedObject = conversionResult.result; + cleanupHandles["{{ arg.name }}"] = convertedObject; + baton->{{ arg.name }} = convertedObject->GetValue(); + } + {% endif %} {%elsif arg.name %} - {%partial convertFromV8 arg%} + {%partial convertFromV8 arg%} {%if not arg.payloadFor %} - baton->{{ arg.name }} = from_{{ arg.name }}; + baton->{{ arg.name }} = from_{{ arg.name }}; {%if arg | isOid %} - baton->{{ arg.name }}NeedsFree = info[{{ arg.jsArg }}]->IsString(); + baton->{{ arg.name }}NeedsFree = info[{{ arg.jsArg }}]->IsString(); {%endif%} {%endif%} {%endif%} {%elsif arg.shouldAlloc %} - baton->{{arg.name}} = ({{ arg.cType }})malloc(sizeof({{ arg.cType|replace '*' '' }})); + baton->{{arg.name}} = ({{ arg.cType }})malloc(sizeof({{ arg.cType|replace '*' '' }})); {%if arg.cppClassName == "GitBuf" %} baton->{{arg.name}}->ptr = NULL; - baton->{{arg.name}}->size = baton->{{arg.name}}->asize = 0; + baton->{{arg.name}}->size = baton->{{arg.name}}->reserved = 0; {%endif%} {%endif%} {%endeach%} - Nan::Callback *callback = new Nan::Callback(v8::Local::Cast(info[{{args|jsArgsCount}}])); - {{ cppFunctionName }}Worker *worker = new {{ cppFunctionName }}Worker(baton, callback); + Nan::Callback *callback = new Nan::Callback(v8::Local::Cast(info[info.Length() - 1])); + {{ cppFunctionName }}Worker *worker = new {{ cppFunctionName }}Worker(baton, callback, cleanupHandles); + {%each args|argsInfo as arg %} {%if not arg.isReturn %} {%if arg.isSelf %} - worker->SaveToPersistent("{{ arg.name }}", info.This()); + worker->Reference<{{ arg.cppClassName }}>("{{ arg.name }}", info.This()); {%elsif not arg.isCallbackFunction %} - if (!info[{{ arg.jsArg }}]->IsUndefined() && !info[{{ arg.jsArg }}]->IsNull()) - worker->SaveToPersistent("{{ arg.name }}", info[{{ arg.jsArg }}]->ToObject()); + {%if arg.isUnwrappable %} + {% if arg.cppClassName == "Array" %} + if (info[{{ arg.jsArg }}]->IsArray()) { + worker->Reference<{{ arg.arrayElementCppClassName }}>("{{ arg.name }}", info[{{ arg.jsArg }}].As()); + } + {% else %} + worker->Reference<{{ arg.cppClassName }}>("{{ arg.name }}", info[{{ arg.jsArg }}]); + {% endif %} + {% else %} + worker->Reference("{{ arg.name }}", info[{{ arg.jsArg }}]); + {% endif %} {%endif%} {%endif%} {%endeach%} - AsyncLibgit2QueueWorker(worker); + nodegitContext->QueueWorker(worker); return; } -void {{ cppClassName }}::{{ cppFunctionName }}Worker::Execute() { - giterr_clear(); +nodegit::LockMaster {{ cppClassName }}::{{ cppFunctionName }}Worker::AcquireLocks() { + nodegit::LockMaster lockMaster( + /*asyncAction: */true + {%each args|argsInfo as arg %} + {%if arg.cType|isPointer%} + {%if not arg.cType|isDoublePointer%} + ,baton->{{ arg.name }} + {%endif%} + {%endif%} + {%endeach%} + ); + + return lockMaster; +} - { - LockMaster lockMaster(/*asyncAction: */true{%each args|argsInfo as arg %} - {%if arg.cType|isPointer%}{%if not arg.cType|isDoublePointer%} - ,baton->{{ arg.name }} - {%endif%}{%endif%} - {%endeach%}); +void {{ cppClassName }}::{{ cppFunctionName }}Worker::Execute() { + git_error_clear(); {%if .|hasReturnType %} - {{ return.cType }} result = {{ cFunctionName }}( + {{ return.cType }} result = {{ cFunctionName }}( {%else%} - {{ cFunctionName }}( + {{ cFunctionName }}( {%endif%} {%-- Insert Function Arguments --%} {%each args|argsInfo as arg %} {%-- turn the pointer into a ref --%} - {%if arg.isReturn|and arg.cType|isDoublePointer %}&{%endif%}baton->{{ arg.name }}{%if not arg.lastArg %},{%endif%} - + {%if arg.isReturn|and arg.cType|isDoublePointer %}&{%endif%}baton->{{ arg.name }}{%if not arg.lastArg %},{%endif%} {%endeach%} - ); + ); - {%if return.isResultOrError %} - baton->error_code = result; - if (result < GIT_OK && giterr_last() != NULL) { - baton->error = git_error_dup(giterr_last()); - } + {% if return.isResultOrError %} + baton->error_code = result; + if (result < GIT_OK && git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } - {%elsif return.isErrorCode %} - baton->error_code = result; + {% elsif return.isErrorCode %} + baton->error_code = result; - if (result != GIT_OK && giterr_last() != NULL) { - baton->error = git_error_dup(giterr_last()); - } + if (result != GIT_OK && git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } - {%elsif not return.cType == 'void' %} + {%elsif return.cType != 'void' %} - baton->result = result; + baton->result = result; {%endif%} +} + +void {{ cppClassName }}::{{ cppFunctionName }}Worker::HandleErrorCallback() { + if (!GetIsCancelled()) { + v8::Local err = Nan::To(Nan::Error(ErrorMessage())).ToLocalChecked(); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("{{ jsClassName }}.{{ jsFunctionName }}").ToLocalChecked()); + v8::Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); } + + {%each args|argsInfo as arg %} + {%if arg.shouldAlloc %} + {%if not arg.isCppClassStringOrArray %} + {%elsif arg | isOid %} + if (baton->{{ arg.name}}NeedsFree) { + baton->{{ arg.name}}NeedsFree = false; + free((void*)baton->{{ arg.name }}); + } + {%elsif arg.isCallbackFunction %} + {%if not arg.payload.globalPayload %} + delete baton->{{ arg.payload.name }}; + {%endif%} + {%elsif arg.globalPayload %} + delete ({{ cppFunctionName}}_globalPayload*)baton->{{ arg.name }}; + {%else%} + free((void*)baton->{{ arg.name }}); + {%endif%} + {%elsif arg.freeFunctionName|and arg.isReturn|and arg.selfFreeing %} + {{ arg.freeFunctionName }}(baton->{{ arg.name }}); + {%endif%} + {%endeach%} + + {%each args|argsInfo as arg %} + {%if arg.isCppClassStringOrArray %} + {%if arg.freeFunctionName %} + {%elsif not arg.isConst%} + free((void *)baton->{{ arg.name }}); + {%endif%} + {%elsif arg | isOid %} + if (baton->{{ arg.name}}NeedsFree) { + baton->{{ arg.name}}NeedsFree = false; + free((void *)baton->{{ arg.name }}); + } + {%elsif arg.isCallbackFunction %} + {%if not arg.payload.globalPayload %} + delete baton->{{ arg.payload.name }}; + {%endif%} + {%elsif arg.globalPayload %} + delete ({{ cppFunctionName}}_globalPayload*)baton->{{ arg.name }}; + {%endif%} + {%if arg.cppClassName == "GitBuf" %} + {%if cppFunctionName == "Set" %} + {%else%} + git_buf_dispose(baton->{{ arg.name }}); + free((void *)baton->{{ arg.name }}); + {%endif%} + {%endif%} + {%endeach%} + + delete baton; } void {{ cppClassName }}::{{ cppFunctionName }}Worker::HandleOKCallback() { {%if return.isResultOrError %} - if (baton->error_code >= GIT_OK) { + if (baton->error_code >= GIT_OK) { {%else%} - if (baton->error_code == GIT_OK) { + if (baton->error_code == GIT_OK) { {%endif%} - {%if return.isResultOrError %} + + {%if return.isResultOrError %} v8::Local result = Nan::New(baton->error_code); - {%elsif not .|returnsCount %} + {%elsif not .|returnsCount %} v8::Local result = Nan::Undefined(); - {%else%} - v8::Local to; + {%else%} + v8::Local v8ConversionSlot; + {%if .|returnsCount > 1 %} + v8::Local result = Nan::New(); + {%endif%} + {%each .|returnsInfo 0 1 as _return %} + {%partial convertToV8 _return %} {%if .|returnsCount > 1 %} - v8::Local result = Nan::New(); - {%endif%} - {%each .|returnsInfo 0 1 as _return %} - {%partial convertToV8 _return %} - {%if .|returnsCount > 1 %} - Nan::Set(result, Nan::New("{{ _return.returnNameOrName }}").ToLocalChecked(), to); - {%endif%} - {%endeach%} - {%if .|returnsCount == 1 %} - v8::Local result = to; + Nan::Set(result, Nan::New("{{ _return.returnNameOrName }}").ToLocalChecked(), v8ConversionSlot); {%endif%} + {%endeach%} + {%if .|returnsCount == 1 %} + v8::Local result = v8ConversionSlot; {%endif%} + {%endif%} + + {% each args|argsInfo as arg %} + {% if not arg.ignore %} + {% if arg.isStructType %} + {% if arg.preserveOnThis %} + { + {% if args|thisInfo 'isReturn' %} + auto objWrap = Nan::ObjectWrap::Unwrap<{{ args|thisInfo 'cppClassName' }}>(result.As()); + {% else %} + auto objWrap = Nan::ObjectWrap::Unwrap<{{ args|thisInfo 'cppClassName' }}>(GetFromPersistent("{{ args|thisInfo 'name' }}").As()); + {% endif %} + objWrap->SaveCleanupHandle(cleanupHandles["{{ arg.name }}"]); + } + {% endif %} + {% endif %} + {% endif %} + {% endeach %} + v8::Local argv[2] = { Nan::Null(), result }; - callback->Call(2, argv); + callback->Call(2, argv, async_resource); } else { if (baton->error) { v8::Local err; if (baton->error->message) { - err = Nan::Error(baton->error->message)->ToObject(); + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); } else { - err = Nan::Error("Method {{ jsFunctionName }} has thrown an error.")->ToObject(); + err = Nan::To(Nan::Error("Method {{ jsFunctionName }} has thrown an error.")).ToLocalChecked(); } - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("{{ jsClassName }}.{{ jsFunctionName }}").ToLocalChecked()); v8::Local argv[1] = { err }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); if (baton->error->message) free((void *)baton->error->message); free((void *)baton->error); } else if (baton->error_code < 0) { - std::queue< v8::Local > workerArguments; -{%each args|argsInfo as arg %} - {%if not arg.isReturn %} - {%if not arg.isSelf %} - {%if not arg.isCallbackFunction %} - workerArguments.push(GetFromPersistent("{{ arg.name }}")); - {%endif%} - {%endif%} - {%endif%} -{%endeach%} bool callbackFired = false; - while(!workerArguments.empty()) { - v8::Local node = workerArguments.front(); - workerArguments.pop(); - - if ( - !node->IsObject() - || node->IsArray() - || node->IsBooleanObject() - || node->IsDate() - || node->IsFunction() - || node->IsNumberObject() - || node->IsRegExp() - || node->IsStringObject() - ) { - continue; - } - - v8::Local nodeObj = node->ToObject(); - v8::Local checkValue = GetPrivate(nodeObj, Nan::New("NodeGitPromiseError").ToLocalChecked()); - - if (!checkValue.IsEmpty() && !checkValue->IsNull() && !checkValue->IsUndefined()) { + if (!callbackErrorHandle.IsEmpty()) { + v8::Local maybeError = Nan::New(callbackErrorHandle); + if (!maybeError->IsNull() && !maybeError->IsUndefined()) { v8::Local argv[1] = { - checkValue->ToObject() + maybeError }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); callbackFired = true; - break; - } - - v8::Local properties = nodeObj->GetPropertyNames(); - for (unsigned int propIndex = 0; propIndex < properties->Length(); ++propIndex) { - v8::Local propName = properties->Get(propIndex)->ToString(); - v8::Local nodeToQueue = nodeObj->Get(propName); - if (!nodeToQueue->IsUndefined()) { - workerArguments.push(nodeToQueue); - } } } if (!callbackFired) { - v8::Local err = Nan::Error("Method {{ jsFunctionName }} has thrown an error.")->ToObject(); - err->Set(Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + v8::Local err = Nan::To(Nan::Error("Method {{ jsFunctionName }} has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("{{ jsClassName }}.{{ jsFunctionName }}").ToLocalChecked()); v8::Local argv[1] = { err }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); } } else { - callback->Call(0, NULL); + callback->Call(0, NULL, async_resource); } {%each args|argsInfo as arg %} {%if arg.shouldAlloc %} {%if not arg.isCppClassStringOrArray %} {%elsif arg | isOid %} - if (baton->{{ arg.name}}NeedsFree) { - baton->{{ arg.name}}NeedsFree = false; - free((void*)baton->{{ arg.name }}); - } + if (baton->{{ arg.name}}NeedsFree) { + baton->{{ arg.name}}NeedsFree = false; + free((void*)baton->{{ arg.name }}); + } {%elsif arg.isCallbackFunction %} {%if not arg.payload.globalPayload %} - delete baton->{{ arg.payload.name }}; + delete baton->{{ arg.payload.name }}; {%endif%} {%elsif arg.globalPayload %} - delete ({{ cppFunctionName}}_globalPayload*)baton->{{ arg.name }}; + delete ({{ cppFunctionName}}_globalPayload*)baton->{{ arg.name }}; {%else%} - free((void*)baton->{{ arg.name }}); + free((void*)baton->{{ arg.name }}); {%endif%} + {%elsif arg.freeFunctionName|and arg.isReturn|and arg.selfFreeing %} + {{ arg.freeFunctionName }}(baton->{{ arg.name }}); {%endif%} {%endeach%} } @@ -255,26 +370,25 @@ void {{ cppClassName }}::{{ cppFunctionName }}Worker::HandleOKCallback() { {%each args|argsInfo as arg %} {%if arg.isCppClassStringOrArray %} {%if arg.freeFunctionName %} - {{ arg.freeFunctionName }}(baton->{{ arg.name }}); {%elsif not arg.isConst%} - free((void *)baton->{{ arg.name }}); + free((void *)baton->{{ arg.name }}); {%endif%} {%elsif arg | isOid %} - if (baton->{{ arg.name}}NeedsFree) { - baton->{{ arg.name}}NeedsFree = false; - free((void *)baton->{{ arg.name }}); - } + if (baton->{{ arg.name}}NeedsFree) { + baton->{{ arg.name}}NeedsFree = false; + free((void *)baton->{{ arg.name }}); + } {%elsif arg.isCallbackFunction %} {%if not arg.payload.globalPayload %} - delete baton->{{ arg.payload.name }}; + delete baton->{{ arg.payload.name }}; {%endif%} {%elsif arg.globalPayload %} - delete ({{ cppFunctionName}}_globalPayload*)baton->{{ arg.name }}; + delete ({{ cppFunctionName}}_globalPayload*)baton->{{ arg.name }}; {%endif%} {%if arg.cppClassName == "GitBuf" %} {%if cppFunctionName == "Set" %} {%else%} - git_buf_free(baton->{{ arg.name }}); + git_buf_dispose(baton->{{ arg.name }}); free((void *)baton->{{ arg.name }}); {%endif%} {%endif%} diff --git a/generate/templates/partials/callback_helpers.cc b/generate/templates/partials/callback_helpers.cc index c1d0ab74a7..5050350e41 100644 --- a/generate/templates/partials/callback_helpers.cc +++ b/generate/templates/partials/callback_helpers.cc @@ -12,7 +12,13 @@ baton.{{ arg.name }} = {{ arg.name }}; {% endeach %} - return baton.ExecuteAsync({{ cppFunctionName }}_{{ cbFunction.name }}_async); + return baton.ExecuteAsync({{ cppFunctionName }}_{{ cbFunction.name }}_async, {{ cppFunctionName }}_{{ cbFunction.name }}_cancelAsync); +} + +void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_cancelAsync(void *untypedBaton) { + {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton* baton = static_cast<{{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton*>(untypedBaton); + baton->result = {{ cbFunction.return.cancel }}; + baton->Done(); } void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(void *untypedBaton) { @@ -30,31 +36,31 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(void {% endif %} {% endeach %} - v8::Local argv[{{ cbFunction.args|jsArgsCount }}] = { - {% each cbFunction.args|argsInfo as arg %} - {% if arg | isPayload %} - {%-- payload is always the last arg --%} - // payload is null because we can use closure scope in javascript - Nan::Undefined() - {% elsif arg.isJsArg %} - {% if arg.isEnum %} - Nan::New((int)baton->{{ arg.name }}), - {% elsif arg.isLibgitType %} - {{ arg.cppClassName }}::New(baton->{{ arg.name }}, false), - {% elsif arg.cType == "size_t" %} - // HACK: NAN should really have an overload for Nan::New to support size_t - Nan::New((unsigned int)baton->{{ arg.name }}), - {% elsif arg.cppClassName == 'String' %} - Nan::New(baton->{{ arg.name }}).ToLocalChecked(), - {% else %} - Nan::New(baton->{{ arg.name }}), - {% endif %} + v8::Local argv[{{ cbFunction.args|callbackArgsCount }}] = { + {% each cbFunction.args|callbackArgsInfo as arg %} + {% if not arg.firstArg %}, {% endif %} + {% if arg.isEnum %} + Nan::New((int)baton->{{ arg.name }}) + {% elsif arg.isLibgitType %} + {{ arg.cppClassName }}::New(baton->{{ arg.name }}, false) + {% elsif arg.cType == "size_t" %} + // HACK: NAN should really have an overload for Nan::New to support size_t + Nan::New((unsigned int)baton->{{ arg.name }}) + {% elsif arg.cppClassName == 'String' %} + Nan::New(baton->{{ arg.name }}).ToLocalChecked() + {% else %} + Nan::New(baton->{{ arg.name }}) {% endif %} {% endeach %} }; Nan::TryCatch tryCatch; - v8::Local result = callback->Call({{ cbFunction.args|jsArgsCount }}, argv); + Nan::MaybeLocal maybeResult = (*callback)(baton->GetAsyncResource(), {{ cbFunction.args|callbackArgsCount }}, argv); + + v8::Local result; + if (!maybeResult.IsEmpty()) { + result = maybeResult.ToLocalChecked(); + } if(PromiseCompletion::ForwardIfPromise(result, baton, {{ cppFunctionName }}_{{ cbFunction.name }}_promiseCompleted)) { return; @@ -66,14 +72,14 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(void } else if (!result->IsNull() && !result->IsUndefined()) { {% if _return.isOutParam %} - {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); + {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(Nan::To(result).ToLocalChecked()); wrapper->selfFreeing = false; *baton->{{ _return.name }} = wrapper->GetValue(); baton->result = {{ cbFunction.return.success }}; {% else %} if (result->IsNumber()) { - baton->result = (int)result->ToNumber()->Value(); + baton->result = Nan::To(result).FromJust(); } else { baton->result = baton->defaultResult; @@ -88,7 +94,7 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(void baton->Done(); } -void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local result) { +void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local result) { Nan::HandleScope scope; {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton* baton = static_cast<{{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton*>(_baton); @@ -100,14 +106,14 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_promiseComp } else if (!result->IsNull() && !result->IsUndefined()) { {% if _return.isOutParam %} - {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); + {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(Nan::To(result).ToLocalChecked()); wrapper->selfFreeing = false; *baton->{{ _return.name }} = wrapper->GetValue(); baton->result = {{ cbFunction.return.success }}; {% else %} if (result->IsNumber()) { - baton->result = (int)result->ToNumber()->Value(); + baton->result = Nan::To(result).FromJust(); } else { baton->result = baton->defaultResult; diff --git a/generate/templates/partials/configurable_callbacks.cc b/generate/templates/partials/configurable_callbacks.cc new file mode 100644 index 0000000000..79eef554b8 --- /dev/null +++ b/generate/templates/partials/configurable_callbacks.cc @@ -0,0 +1,227 @@ +{% each fields|fieldsInfo as field %} + {% if not field.ignore %} + {% if field.isCallbackFunction %} + Configurable{{ cppClassName }}* Configurable{{ cppClassName }}::{{ field.jsFunctionName }}_getInstanceFromBaton({{ field.name|titleCase }}Baton* baton) { + {% if isExtendedStruct %} + return static_cast((({{cType}}_extended *)baton->self)->payload); + {% else %} + return static_cast(baton-> + {% each field.args|argsInfo as arg %} + {% if arg.payload == true %} + {{arg.name}} + {% elsif arg.lastArg %} + {{arg.name}} + {% endif %} + {% endeach %}); + {% endif %} + } + + {{ field.return.type }} Configurable{{ cppClassName }}::{{ field.jsFunctionName }}_cppCallback ( + {% each field.args|argsInfo as arg %} + {{ arg.cType }} {{ arg.name}}{% if not arg.lastArg %},{% endif %} + {% endeach %} + ) { + {{ field.name|titleCase }}Baton *baton = + new {{ field.name|titleCase }}Baton({{ field.return.noResults }}); + + {% each field.args|argsInfo as arg %} + baton->{{ arg.name }} = {{ arg.name }}; + {% endeach %} + + Configurable{{ cppClassName }}* instance = {{ field.jsFunctionName }}_getInstanceFromBaton(baton); + + {% if field.return.type == "void" %} + if (instance->nodegitContext != nodegit::ThreadPool::GetCurrentContext()) { + delete baton; + } else if (instance->{{ field.jsFunctionName }}.WillBeThrottled()) { + delete baton; + } else if (instance->{{ field.jsFunctionName }}.ShouldWaitForResult()) { + baton->ExecuteAsync({{ field.jsFunctionName }}_async, {{ field.jsFunctionName }}_cancelAsync); + delete baton; + } else { + baton->ExecuteAsync({{ field.jsFunctionName }}_async, {{ field.jsFunctionName }}_cancelAsync, nodegit::deleteBaton); + } + return; + {% else %} + {{ field.return.type }} result; + + if (instance->nodegitContext != nodegit::ThreadPool::GetCurrentContext()) { + result = baton->defaultResult; + delete baton; + } else if (instance->{{ field.jsFunctionName }}.WillBeThrottled()) { + result = baton->defaultResult; + delete baton; + } else if (instance->{{ field.jsFunctionName }}.ShouldWaitForResult()) { + result = baton->ExecuteAsync({{ field.jsFunctionName }}_async, {{ field.jsFunctionName }}_cancelAsync); + delete baton; + } else { + result = baton->defaultResult; + baton->ExecuteAsync({{ field.jsFunctionName }}_async, {{ field.jsFunctionName }}_cancelAsync, nodegit::deleteBaton); + } + return result; + {% endif %} + } + + void Configurable{{ cppClassName }}::{{ field.jsFunctionName }}_cancelAsync(void *untypedBaton) { + {{ field.name|titleCase }}Baton* baton = static_cast<{{ field.name|titleCase }}Baton*>(untypedBaton); + {% if field.return.type != "void" %} + baton->result = {{ field.return.cancel }}; + {% endif %} + baton->Done(); + } + + void Configurable{{ cppClassName }}::{{ field.jsFunctionName }}_async(void *untypedBaton) { + Nan::HandleScope scope; + + {{ field.name|titleCase }}Baton* baton = static_cast<{{ field.name|titleCase }}Baton*>(untypedBaton); + Configurable{{ cppClassName }}* instance = {{ field.jsFunctionName }}_getInstanceFromBaton(baton); + + if (instance->{{ field.jsFunctionName }}.GetCallback()->IsEmpty()) { + {% if field.return.type == "int" %} + baton->result = baton->defaultResult; // no results acquired + {% endif %} + baton->Done(); + return; + } + + {% each field.args|callbackArgsInfo as arg %} + {% if arg.cppClassName == "Array" %} + v8::Local _{{arg.name}}_array = Nan::New(baton->{{ arg.arrayLengthArgumentName }}); + for(uint32_t i = 0; i < _{{arg.name}}_array->Length(); i++) { + Nan::Set(_{{arg.name}}_array, i, {{arg.arrayElementCppClassName}}::New(baton->{{arg.name}}[i], false)); + } + {% endif %} + {% endeach %} + + {% if field.args|callbackArgsCount == 0 %} + v8::Local *argv = NULL; + {% else %} + v8::Local argv[{{ field.args|callbackArgsCount }}] = { + {% each field.args|callbackArgsInfo as arg %} + {% if not arg.firstArg %},{% endif %} + {% if arg.isEnum %} + Nan::New((int)baton->{{ arg.name }}) + {% elsif arg.cppClassName == "Array" %} + _{{arg.name}}_array + {% elsif arg.isLibgitType %} + {{ arg.cppClassName }}::New(baton->{{ arg.name }}, false) + {% elsif arg.cType == "size_t" %} + // HACK: NAN should really have an overload for Nan::New to support size_t + Nan::New((unsigned int)baton->{{ arg.name }}) + {% elsif arg.cppClassName == "String" %} + baton->{{ arg.name }} == NULL + ? Nan::EmptyString() + : Nan::New({%if arg.cType | isDoublePointer %}*{% endif %}baton->{{ arg.name }}).ToLocalChecked() + {% else %} + Nan::New(baton->{{ arg.name }}) + {% endif %} + {% endeach %} + }; + {% endif %} + + Nan::TryCatch tryCatch; + + Nan::MaybeLocal maybeResult = (*(instance->{{ field.jsFunctionName }}.GetCallback()))( + baton->GetAsyncResource(), + {{ field.args|callbackArgsCount }}, + argv + ); + v8::Local result; + if (!maybeResult.IsEmpty()) { + result = maybeResult.ToLocalChecked(); + } + + if (PromiseCompletion::ForwardIfPromise(result, baton, Configurable{{ cppClassName }}::{{ field.jsFunctionName }}_promiseCompleted)) { + return; + } + + {% if field.return.type == "void" %} + baton->Done(); + {% else %} + {% each field|returnsInfo false true as _return %} + if (result.IsEmpty() || result->IsNativeError()) { + baton->result = {{ field.return.error }}; + } + else if (!result->IsNull() && !result->IsUndefined()) { + {% if _return.isOutParam %} + {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(Nan::To(result).ToLocalChecked()); + wrapper->selfFreeing = false; + + {% if _return.cppClassName == "GitOid" %} + git_oid_cpy(baton->{{ _return.name }}, wrapper->GetValue()); + {% else %} + *baton->{{ _return.name }} = wrapper->GetValue(); + {% endif %} + baton->result = {{ field.return.success }}; + {% else %} + if (result->IsNumber()) { + baton->result = Nan::To(result).FromJust(); + } + else { + baton->result = baton->defaultResult; + } + {% endif %} + } + else { + baton->result = baton->defaultResult; + } + {% endeach %} + baton->Done(); + {% endif %} + } + + void Configurable{{ cppClassName }}::{{ field.jsFunctionName }}_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local result) { + Nan::HandleScope scope; + + {{ field.name|titleCase }}Baton* baton = static_cast<{{ field.name|titleCase }}Baton*>(_baton); + {% if field.return.type == "void" %} + baton->Done(); + {% else %} + if (isFulfilled) { + {% each field|returnsInfo false true as _return %} + if (result.IsEmpty() || result->IsNativeError()) { + baton->result = {{ field.return.error }}; + } + else if (!result->IsNull() && !result->IsUndefined()) { + {% if _return.isOutParam %} + {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(Nan::To(result).ToLocalChecked()); + wrapper->selfFreeing = false; + + {% if _return.cppClassName == "GitOid" %} + git_oid_cpy(baton->{{ _return.name }}, wrapper->GetValue()); + {% else %} + *baton->{{ _return.name }} = wrapper->GetValue(); + {% endif %} + baton->result = {{ field.return.success }}; + {% else %} + if (result->IsNumber()) { + baton->result = Nan::To(result).FromJust(); + } + else { + baton->result = baton->defaultResult; + } + {% endif %} + } + else { + baton->result = baton->defaultResult; + } + {% endeach %} + } + else { + // promise was rejected + {% if isExtendedStruct %} + Configurable{{ cppClassName }}* instance = static_cast((({{cType}}_extended *)baton->self)->payload); + {% else %} + Configurable{{ cppClassName }}* instance = static_cast(baton->{% each field.args|argsInfo as arg %} + {% if arg.payload == true %}{{arg.name}}{% elsif arg.lastArg %}{{arg.name}}{% endif %} + {% endeach %}); + {% endif %} + baton->SetCallbackError(result); + baton->result = {{ field.return.error }}; + } + baton->Done(); + {% endif %} + } + {% endif %} + {% endif %} +{% endeach %} diff --git a/generate/templates/partials/convert_from_v8.cc b/generate/templates/partials/convert_from_v8.cc index f7c4da469b..f33eddd0f6 100644 --- a/generate/templates/partials/convert_from_v8.cc +++ b/generate/templates/partials/convert_from_v8.cc @@ -14,12 +14,12 @@ {% elsif cppClassName == 'GitBuf' %} {%-- Print nothing --%} {%else%} - if (info[{{ jsArg }}]->Is{{ cppClassName|cppToV8 }}()) { + if ((info.Length() - 1) > {{ jsArg }} && info[{{ jsArg }}]->Is{{ cppClassName|cppToV8 }}()) { {%endif%} {%endif%} {%if cppClassName == 'String'%} - String::Utf8Value {{ name }}(info[{{ jsArg }}]->ToString()); + Nan::Utf8String {{ name }}(Nan::To(info[{{ jsArg }}]).ToLocalChecked()); // malloc with one extra byte so we can add the terminating null character C-strings expect: from_{{ name }} = ({{ cType }}) malloc({{ name }}.length() + 1); // copy the characters from the nodejs string into our C-string (used instead of strdup or strcpy because nulls in @@ -36,7 +36,7 @@ from_{{ name }} = GitBufConverter::Convert(info[{{ jsArg }}]); {%elsif cppClassName == 'Wrapper'%} - String::Utf8Value {{ name }}(info[{{ jsArg }}]->ToString()); + Nan::Utf8String {{ name }}(Nan::To(info[{{ jsArg }}]).ToLocalChecked()); // malloc with one extra byte so we can add the terminating null character C-strings expect: from_{{ name }} = ({{ cType }}) malloc({{ name }}.length() + 1); // copy the characters from the nodejs string into our C-string (used instead of strdup or strcpy because nulls in @@ -47,36 +47,51 @@ memset((void *)(((char *)from_{{ name }}) + {{ name }}.length()), 0, 1); {%elsif cppClassName == 'Array'%} - Array *tmp_{{ name }} = Array::Cast(*info[{{ jsArg }}]); - from_{{ name }} = ({{ cType }})malloc(tmp_{{ name }}->Length() * sizeof({{ cType|replace '**' '*' }})); - for (unsigned int i = 0; i < tmp_{{ name }}->Length(); i++) { + v8::Local tmp_{{ name }} = v8::Local::Cast(info[{{ jsArg }}]); + from_{{ name }} = ({{ cType }})malloc(tmp_{{ name }}->Length() * sizeof({{ cType|unPointer }})); + for (unsigned int i = 0; i < tmp_{{ name }}->Length(); i++) { {%-- // FIXME: should recursively call convertFromv8. --%} - from_{{ name }}[i] = Nan::ObjectWrap::Unwrap<{{ arrayElementCppClassName }}>(tmp_{{ name }}->Get(Nan::New(static_cast(i)))->ToObject())->GetValue(); + const v8::Local arrayVal = Nan::Get(tmp_{{ name }},i).ToLocalChecked(); + {%if arrayElementCppClassName == 'GitOid'%} + if (arrayVal->IsString()) { + // Try and parse in a string to a git_oid + Nan::Utf8String oidString(Nan::To(arrayVal).ToLocalChecked()); + + if (git_oid_fromstr(&from_{{ name }}[i], (const char *) strdup(*oidString)) != GIT_OK) { + return Nan::ThrowError(git_error_last()->message); + } + } + else { + git_oid_cpy(&from_{{ name }}[i], Nan::ObjectWrap::Unwrap(Nan::To(arrayVal).ToLocalChecked())->GetValue()); } + {%else%} + from_{{ name }}[i] = Nan::ObjectWrap::Unwrap<{{ arrayElementCppClassName }}>(Nan::To(arrayVal).ToLocalChecked())->GetValue(); + {%endif%} + } {%elsif cppClassName == 'Function'%} {%elsif cppClassName == 'Buffer'%} - from_{{ name }} = Buffer::Data(info[{{ jsArg }}]->ToObject()); + from_{{ name }} = Buffer::Data(Nan::To(info[{{ jsArg }}]).ToLocalChecked()); {%elsif cppClassName|isV8Value %} {%if cType|isPointer %} - *from_{{ name }} = ({{ cType|unPointer }}) {{ cast }} {%if isEnum %}(int){%endif%} info[{{ jsArg }}]->To{{ cppClassName }}()->Value(); + *from_{{ name }} = ({{ cType|unPointer }}) {{ cast }} {%if isEnum %}(int){%endif%} info[{{ jsArg }}].As()->Value(); {%else%} - from_{{ name }} = ({{ cType }}) {{ cast }} {%if isEnum %}(int){%endif%} info[{{ jsArg }}]->To{{ cppClassName }}()->Value(); + from_{{ name }} = ({{ cType }}) {{ cast }} {%if isEnum %}(int){%endif%} info[{{ jsArg }}].As()->Value(); {%endif%} {%elsif cppClassName == 'GitOid'%} if (info[{{ jsArg }}]->IsString()) { // Try and parse in a string to a git_oid - String::Utf8Value oidString(info[{{ jsArg }}]->ToString()); + Nan::Utf8String oidString(Nan::To(info[{{ jsArg }}]).ToLocalChecked()); git_oid *oidOut = (git_oid *)malloc(sizeof(git_oid)); if (git_oid_fromstr(oidOut, (const char *) strdup(*oidString)) != GIT_OK) { free(oidOut); - if (giterr_last()) { - return Nan::ThrowError(giterr_last()->message); + if (git_error_last()->klass != GIT_ERROR_NONE) { + return Nan::ThrowError(git_error_last()->message); } else { return Nan::ThrowError("Unknown Error"); } @@ -89,10 +104,10 @@ {%endif%} } else { - {%if cType|isDoublePointer %}*{%endif%}from_{{ name }} = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info[{{ jsArg }}]->ToObject())->GetValue(); + {%if cType|isDoublePointer %}*{%endif%}from_{{ name }} = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(Nan::To(info[{{ jsArg }}]).ToLocalChecked())->GetValue(); } {%else%} - {%if cType|isDoublePointer %}*{%endif%}from_{{ name }} = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info[{{ jsArg }}]->ToObject())->GetValue(); + {%if cType|isDoublePointer %}*{%endif%}from_{{ name }} = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(Nan::To(info[{{ jsArg }}]).ToLocalChecked())->GetValue(); {%endif%} {%if isBoolean %} diff --git a/generate/templates/partials/convert_to_v8.cc b/generate/templates/partials/convert_to_v8.cc index 3d3bdf834f..ccba9b330f 100644 --- a/generate/templates/partials/convert_to_v8.cc +++ b/generate/templates/partials/convert_to_v8.cc @@ -2,15 +2,18 @@ {% if cppClassName == 'String' %} if ({{= parsedName =}}){ {% if size %} - to = Nan::New({{= parsedName =}}, {{ size }}).ToLocalChecked(); + v8ConversionSlot = Nan::New({{= parsedName =}}, {{ size }}).ToLocalChecked(); {% elsif cType == 'char **' %} - to = Nan::New(*{{= parsedName =}}).ToLocalChecked(); + v8ConversionSlot = Nan::New(*{{= parsedName =}}).ToLocalChecked(); + {% elsif cType == 'char' %} + char convertToNullTerminated[2] = { {{= parsedName =}}, '\0' }; + v8ConversionSlot = Nan::New(convertToNullTerminated).ToLocalChecked(); {% else %} - to = Nan::New({{= parsedName =}}).ToLocalChecked(); + v8ConversionSlot = Nan::New({{= parsedName =}}).ToLocalChecked(); {% endif %} } else { - to = Nan::Null(); + v8ConversionSlot = Nan::Null(); } {% if freeFunctionName %} @@ -18,16 +21,27 @@ {% endif %} {% elsif cppClassName|isV8Value %} - - {% if isCppClassIntType %} - to = Nan::New<{{ cppClassName }}>(({{ parsedClassName }}){{= parsedName =}}); + {% if cType|isArrayType %} + v8::Local tmpArray = Nan::New({{ cType|toSizeOfArray }}); + for (unsigned int i = 0; i < {{ cType|toSizeOfArray }}; i++) { + v8::Local element; + {% if isCppClassIntType %} + element = Nan::New<{{ cppClassName }}>(({{ parsedClassName }}){{= parsedName =}}[i]); + {% else %} + element = Nan::New<{{ cppClassName }}>({% if needsDereference %}*{% endif %}{{= parsedName =}}[i]); + {% endif %} + Nan::Set(tmpArray, Nan::New(i), element); + } + v8ConversionSlot = tmpArray; + {% elsif isCppClassIntType %} + v8ConversionSlot = Nan::New<{{ cppClassName }}>(({{ parsedClassName }}){{= parsedName =}}); {% else %} - to = Nan::New<{{ cppClassName }}>({% if needsDereference %}*{% endif %}{{= parsedName =}}); + v8ConversionSlot = Nan::New<{{ cppClassName }}>({% if needsDereference %}*{% endif %}{{= parsedName =}}); {% endif %} {% elsif cppClassName == 'External' %} - to = Nan::New((void *){{= parsedName =}}); + v8ConversionSlot = Nan::New((void *){{= parsedName =}}); {% elsif cppClassName == 'Array' %} @@ -35,42 +49,91 @@ {% if size %} v8::Local tmpArray = Nan::New({{= parsedName =}}->{{ size }}); for (unsigned int i = 0; i < {{= parsedName =}}->{{ size }}; i++) { - Nan::Set(tmpArray, Nan::New(i), Nan::New({{= parsedName =}}->{{ key }}[i]).ToLocalChecked()); + v8::Local element; + {% if arrayElementCppClassName %} + element = {{ arrayElementCppClassName }}::New( + {{ cType|asElementPointer parsedName }}->{{ key }}[i], + {{ selfFreeing|toBool }} + {% if hasOwner %} + , owners + {% endif %} + ); + {% else %} + element = Nan::New({{= parsedName =}}->{{ key }}[i]).ToLocalChecked(); + {% endif %} + Nan::Set(tmpArray, Nan::New(i), element); } {% else %} v8::Local tmpArray = Nan::New({{= parsedName =}}); {% endif %} - to = tmpArray; + v8ConversionSlot = tmpArray; {% elsif cppClassName == 'GitBuf' %} {% if doNotConvert %} - to = Nan::Null(); + v8ConversionSlot = Nan::Null(); {% else %} if ({{= parsedName =}}) { - to = Nan::New({{= parsedName =}}->ptr, {{= parsedName = }}->size).ToLocalChecked(); + v8ConversionSlot = Nan::New({{= parsedName =}}->ptr, {{= parsedName = }}->size).ToLocalChecked(); } else { - to = Nan::Null(); + v8ConversionSlot = Nan::Null(); } {% endif %} {% else %} - {% if copy %} - if ({{= parsedName =}} != NULL) { - {{= parsedName =}} = ({{ cType|replace '**' '*' }} {% if not cType|isPointer %}*{% endif %}){{ copy }}({{= parsedName =}}); - } + {% if cType|isArrayType %} + v8::Local tmpArray = Nan::New({{ cType|toSizeOfArray }}); + for (unsigned int i = 0; i < {{ cType|toSizeOfArray }}; i++) { {% endif %} - - if ({{= parsedName =}} != NULL) { - // {{= cppClassName }} {{= parsedName }} + if ({{ cType|asElementPointer parsedName }} != NULL) { + {% if hasOwner %} + v8::Local owners = Nan::New(0); + {% if ownedBy %} + {% if isAsync %} + {% each ownedBy as owner %} + {%-- If the owner of this object is "this" in an async method, it will be stored in the persistent handle by name. --%} + Nan::Set(owners, Nan::New(owners->Length()), Nan::To(this->GetFromPersistent("{{= owner =}}")).ToLocalChecked()); + {% endeach %} + {% else %} + {% each ownedByIndices as ownedByIndex %} + Nan::Set(owners, Nan::New(owners->Length()), Nan::To(info[{{= ownedByIndex =}}]).ToLocalChecked()); + {% endeach %} + {% endif %} + {% endif %} + {%if isAsync %} + {% elsif ownedByThis %} + {%-- If the owner of this object is "this", it will be retrievable from the info object in a sync method. --%} + Nan::Set(owners, owners->Length(), info.This()); + {% endif %} + {% if ownerFn | toBool %} + Nan::Set( + owners, + Nan::New(owners->Length()), + Nan::To({{= ownerFn.singletonCppClassName =}}::New( + {{= ownerFn.name =}}({{ cType|asElementPointer parsedName }}), + true + )).ToLocalChecked() + ); + {% endif %} + {% endif %} {% if cppClassName == 'Wrapper' %} - to = {{ cppClassName }}::New({{= parsedName =}}); + v8ConversionSlot = {{ cppClassName }}::New({{ cType|asElementPointer parsedName }}); {% else %} - to = {{ cppClassName }}::New({{= parsedName =}}, {{ selfFreeing|toBool }} {% if ownedByThis %}, info.This(){% endif %}); + v8ConversionSlot = {{ cppClassName }}::New( + {{ cType|asElementPointer parsedName }}, + {{ selfFreeing|toBool }} + {% if hasOwner %} + , owners + {% endif %} + ); {% endif %} } else { - to = Nan::Null(); + v8ConversionSlot = Nan::Null(); } - + {% if cType|isArrayType %} + Nan::Set(tmpArray, Nan::New(i), v8ConversionSlot); + } + v8ConversionSlot = tmpArray; + {% endif %} {% endif %} // end convert_to_v8 block diff --git a/generate/templates/partials/field_accessors.cc b/generate/templates/partials/field_accessors.cc index 480adc76fc..bcd5e5f870 100644 --- a/generate/templates/partials/field_accessors.cc +++ b/generate/templates/partials/field_accessors.cc @@ -7,16 +7,9 @@ {% if field.isEnum %} info.GetReturnValue().Set(Nan::New((int)wrapper->GetValue()->{{ field.name }})); - {% elsif field.isLibgitType | or field.payloadFor %} + {% elsif field.isLibgitType %} info.GetReturnValue().Set(Nan::New(wrapper->{{ field.name }})); - {% elsif field.isCallbackFunction %} - if (wrapper->{{field.name}}.HasCallback()) { - info.GetReturnValue().Set(wrapper->{{ field.name }}.GetCallback()->GetFunction()); - } else { - info.GetReturnValue().SetUndefined(); - } - {% elsif field.cppClassName == 'String' %} if (wrapper->GetValue()->{{ field.name }}) { info.GetReturnValue().Set(Nan::New(wrapper->GetValue()->{{ field.name }}).ToLocalChecked()); @@ -39,60 +32,32 @@ } {% elsif field.isLibgitType %} - v8::Local {{ field.name }}(value->ToObject()); + v8::Local {{ field.name }}(Nan::To(value).ToLocalChecked()); wrapper->{{ field.name }}.Reset({{ field.name }}); - wrapper->raw->{{ field.name }} = {% if not field.cType | isPointer %}*{% endif %}{% if field.cppClassName == 'GitStrarray' %}StrArrayConverter::Convert({{ field.name }}->ToObject()){% else %}Nan::ObjectWrap::Unwrap<{{ field.cppClassName }}>({{ field.name }}->ToObject())->GetValue(){% endif %}; - - {% elsif field.isCallbackFunction %} - Nan::Callback *callback = NULL; - int throttle = {%if field.return.throttle %}{{ field.return.throttle }}{%else%}0{%endif%}; - bool waitForResult = true; - - if (value->IsFunction()) { - callback = new Nan::Callback(value.As()); - } else if (value->IsObject()) { - v8::Local object = value.As(); - v8::Local callbackKey; - Nan::MaybeLocal maybeObjectCallback = Nan::Get(object, Nan::New("callback").ToLocalChecked()); - if (!maybeObjectCallback.IsEmpty()) { - v8::Local objectCallback = maybeObjectCallback.ToLocalChecked(); - if (objectCallback->IsFunction()) { - callback = new Nan::Callback(objectCallback.As()); - - Nan::MaybeLocal maybeObjectThrottle = Nan::Get(object, Nan::New("throttle").ToLocalChecked()); - if(!maybeObjectThrottle.IsEmpty()) { - v8::Local objectThrottle = maybeObjectThrottle.ToLocalChecked(); - if (objectThrottle->IsNumber()) { - throttle = (int)objectThrottle.As()->Value(); - } - } - - Nan::MaybeLocal maybeObjectWaitForResult = Nan::Get(object, Nan::New("waitForResult").ToLocalChecked()); - if(!maybeObjectWaitForResult.IsEmpty()) { - Local objectWaitForResult = maybeObjectWaitForResult.ToLocalChecked(); - waitForResult = (bool)objectWaitForResult->BooleanValue(); - } + {% if field.cppClassName == 'GitStrarray' %} + wrapper->raw->{{ field.name }} = {% if not field.cType | isPointer %}*{% endif %}StrArrayConverter::Convert({{ field.name }}); + {% else %} + auto wrappedObject = Nan::ObjectWrap::Unwrap<{{ field.cppClassName }}>({{ field.name }}); + wrapper->raw->{{ field.name }} = {% if not field.cType | isPointer %}*{% endif %}wrappedObject->GetValue(); + {%-- We are assuming that users are responsible enough to not replace fields on their structs mid-operation, and would rather build out code to prevent that than be smarter here --%} + wrapper->AddReferenceCallbacks( + {{ field.index }}, + [wrappedObject]() { + wrappedObject->Reference(); + }, + [wrappedObject]() { + wrappedObject->Unreference(); } - } - } - if (callback) { - if (!wrapper->raw->{{ field.name }}) { - wrapper->raw->{{ field.name }} = ({{ field.cType }}){{ field.name }}_cppCallback; - } - - wrapper->{{ field.name }}.SetCallback(callback, throttle, waitForResult); - } - - {% elsif field.payloadFor %} - wrapper->{{ field.name }}.Reset(value); + ); + {% endif %} {% elsif field.cppClassName == 'String' %} if (wrapper->GetValue()->{{ field.name }}) { } - String::Utf8Value str(value); + Nan::Utf8String str(value); wrapper->GetValue()->{{ field.name }} = strdup(*str); {% elsif field.isCppClassIntType %} @@ -106,249 +71,5 @@ } {% endif %} } - - {% if field.isCallbackFunction %} - {{ cppClassName }}* {{ cppClassName }}::{{ field.name }}_getInstanceFromBaton({{ field.name|titleCase }}Baton* baton) { - {% if isExtendedStruct %} - return static_cast<{{ cppClassName }}*>((({{cType}}_extended *)baton->self)->payload); - {% else %} - return static_cast<{{ cppClassName }}*>(baton-> - {% each field.args|argsInfo as arg %} - {% if arg.payload == true %} - {{arg.name}} - {% elsif arg.lastArg %} - {{arg.name}} - {% endif %} - {% endeach %}); - {% endif %} - } - - {{ field.return.type }} {{ cppClassName }}::{{ field.name }}_cppCallback ( - {% each field.args|argsInfo as arg %} - {{ arg.cType }} {{ arg.name}}{% if not arg.lastArg %},{% endif %} - {% endeach %} - ) { - {{ field.name|titleCase }}Baton *baton = - new {{ field.name|titleCase }}Baton({{ field.return.noResults }}); - - {% each field.args|argsInfo as arg %} - baton->{{ arg.name }} = {{ arg.name }}; - {% endeach %} - - {{ cppClassName }}* instance = {{ field.name }}_getInstanceFromBaton(baton); - - {% if field.return.type == "void" %} - if (instance->{{ field.name }}.WillBeThrottled()) { - delete baton; - } else if (instance->{{ field.name }}.ShouldWaitForResult()) { - baton->ExecuteAsync({{ field.name }}_async); - delete baton; - } else { - baton->ExecuteAsync({{ field.name }}_async, deleteBaton); - } - return; - {% else %} - {{ field.return.type }} result; - - if (instance->{{ field.name }}.WillBeThrottled()) { - result = baton->defaultResult; - delete baton; - } else if (instance->{{ field.name }}.ShouldWaitForResult()) { - result = baton->ExecuteAsync({{ field.name }}_async); - delete baton; - } else { - result = baton->defaultResult; - baton->ExecuteAsync({{ field.name }}_async, deleteBaton); - } - return result; - {% endif %} - } - - - void {{ cppClassName }}::{{ field.name }}_async(void *untypedBaton) { - Nan::HandleScope scope; - - {{ field.name|titleCase }}Baton* baton = static_cast<{{ field.name|titleCase }}Baton*>(untypedBaton); - {{ cppClassName }}* instance = {{ field.name }}_getInstanceFromBaton(baton); - - if (instance->{{ field.name }}.GetCallback()->IsEmpty()) { - {% if field.return.type == "int" %} - baton->result = baton->defaultResult; // no results acquired - {% endif %} - baton->Done(); - return; - } - - {% each field.args|argsInfo as arg %} - {% if arg.name == "payload" %} - {%-- Do nothing --%} - {% elsif arg.isJsArg %} - {% if arg.cType == "const char *" %} - if (baton->{{ arg.name }} == NULL) { - baton->{{ arg.name }} = ""; - } - {% elsif arg.cppClassName == "String" %} - v8::Local src; - if (baton->{{ arg.name }} == NULL) { - src = Nan::Null(); - } - else { - src = Nan::New(*baton->{{ arg.name }}).ToLocalChecked(); - } - {% endif %} - {% endif %} - {% endeach %} - - {% if field.isSelfReferential %} - {% if field.args|jsArgsCount|subtract 2| setUnsigned == 0 %} - v8::Local *argv = NULL; - {% else %} - v8::Local argv[{{ field.args|jsArgsCount|subtract 2| setUnsigned }}] = { - {% endif %} - {% else %} - v8::Local argv[{{ field.args|jsArgsCount }}] = { - {% endif %} - {% each field.args|argsInfo as arg %} - {% if field.isSelfReferential %} - {% if not arg.firstArg %} - {% if field.args|jsArgsCount|subtract 1|or 0 %} - {% if arg.cppClassName == "String" %} - {%-- src is always the last arg --%} - src - {% elsif arg.isJsArg %} - {% if arg.isEnum %} - Nan::New((int)baton->{{ arg.name }}), - {% elsif arg.isLibgitType %} - {{ arg.cppClassName }}::New(baton->{{ arg.name }}, false), - {% elsif arg.cType == "size_t" %} - Nan::New((unsigned int)baton->{{ arg.name }}), - {% elsif arg.name == "payload" %} - {%-- skip, filters should not have a payload --%} - {% else %} - Nan::New(baton->{{ arg.name }}), - {% endif %} - {% endif %} - {% endif %} - {% endif %} - {% else %} - {% if arg.name == "payload" %} - {%-- payload is always the last arg --%} - Nan::New(instance->{{ fields|payloadFor field.name }}) - {% elsif arg.isJsArg %} - {% if arg.isEnum %} - Nan::New((int)baton->{{ arg.name }}), - {% elsif arg.isLibgitType %} - {{ arg.cppClassName }}::New(baton->{{ arg.name }}, false), - {% elsif arg.cType == "size_t" %} - // HACK: NAN should really have an overload for Nan::New to support size_t - Nan::New((unsigned int)baton->{{ arg.name }}), - {% elsif arg.cppClassName == "String" %} - Nan::New(baton->{{ arg.name }}).ToLocalChecked(), - {% else %} - Nan::New(baton->{{ arg.name }}), - {% endif %} - {% endif %} - {% endif %} - {% endeach %} - {% if not field.isSelfReferential %} - }; - {% elsif field.args|jsArgsCount|subtract 2| setUnsigned > 0 %} - }; - {% endif %} - - Nan::TryCatch tryCatch; - - {% if field.isSelfReferential %} - v8::Local result = instance->{{ field.name }}.GetCallback()->Call({{ field.args|jsArgsCount|subtract 2| setUnsigned }}, argv); - {% else %} - v8::Local result = instance->{{ field.name }}.GetCallback()->Call({{ field.args|jsArgsCount }}, argv); - {% endif %} - - if(PromiseCompletion::ForwardIfPromise(result, baton, {{ cppClassName }}::{{ field.name }}_promiseCompleted)) { - return; - } - - {% if field.return.type == "void" %} - baton->Done(); - {% else %} - {% each field|returnsInfo false true as _return %} - if (result.IsEmpty() || result->IsNativeError()) { - baton->result = {{ field.return.error }}; - } - else if (!result->IsNull() && !result->IsUndefined()) { - {% if _return.isOutParam %} - {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); - wrapper->selfFreeing = false; - - *baton->{{ _return.name }} = wrapper->GetValue(); - baton->result = {{ field.return.success }}; - {% else %} - if (result->IsNumber()) { - baton->result = (int)result->ToNumber()->Value(); - } - else { - baton->result = baton->defaultResult; - } - {% endif %} - } - else { - baton->result = baton->defaultResult; - } - {% endeach %} - baton->Done(); - {% endif %} - } - - void {{ cppClassName }}::{{ field.name }}_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local result) { - Nan::HandleScope scope; - - {{ field.name|titleCase }}Baton* baton = static_cast<{{ field.name|titleCase }}Baton*>(_baton); - {% if field.return.type == "void" %} - baton->Done(); - {% else %} - if (isFulfilled) { - {% each field|returnsInfo false true as _return %} - if (result.IsEmpty() || result->IsNativeError()) { - baton->result = {{ field.return.error }}; - } - else if (!result->IsNull() && !result->IsUndefined()) { - {% if _return.isOutParam %} - {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); - wrapper->selfFreeing = false; - - *baton->{{ _return.name }} = wrapper->GetValue(); - baton->result = {{ field.return.success }}; - {% else %} - if (result->IsNumber()) { - baton->result = (int)result->ToNumber()->Value(); - } - else{ - baton->result = baton->defaultResult; - } - {% endif %} - } - else { - baton->result = baton->defaultResult; - } - {% endeach %} - } - else { - // promise was rejected - {% if isExtendedStruct %} - {{ cppClassName }}* instance = static_cast<{{ cppClassName }}*>((({{cType}}_extended *)baton->self)->payload); - {% else %} - {{ cppClassName }}* instance = static_cast<{{ cppClassName }}*>(baton->{% each field.args|argsInfo as arg %} - {% if arg.payload == true %}{{arg.name}}{% elsif arg.lastArg %}{{arg.name}}{% endif %} - {% endeach %}); - {% endif %} - v8::Local parent = instance->handle(); - SetPrivate(parent, Nan::New("NodeGitPromiseError").ToLocalChecked(), result); - - baton->result = {{ field.return.error }}; - } - baton->Done(); - {% endif %} - } - {% endif %} {% endif %} {% endeach %} diff --git a/generate/templates/partials/fields.cc b/generate/templates/partials/fields.cc index 9d6e6e39d1..d9478549e5 100644 --- a/generate/templates/partials/fields.cc +++ b/generate/templates/partials/fields.cc @@ -1,28 +1,32 @@ {% each fields|fieldsInfo as field %} {% if not field.ignore %} + // start field block NAN_METHOD({{ cppClassName }}::{{ field.cppFunctionName }}) { - v8::Local to; + v8::Local v8ConversionSlot; {% if field | isFixedLengthString %} char* {{ field.name }} = (char *)Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This())->GetValue()->{{ field.name }}; {% else %} - {{ field.cType }} - {% if not field.cppClassName|isV8Value %} - {% if not field.cType|isPointer %} - * + {% if field.cType|isArrayType %} + {{ field.cType|arrayTypeToPlainType }} *{{ field.name }} = + {% else %} + {{ field.cType }} + {% if not field.cppClassName|isV8Value %} + {% if not field.cType|isPointer %}*{% endif %} {% endif %} - {% endif %} - {{ field.name }} = - {% if not field.cppClassName|isV8Value %} - {% if not field.cType|isPointer %} - & + {{ field.name }} = + {% if not field.cppClassName|isV8Value %} + {% if field.cType|isArrayType %}{% elsif not field.cType|isPointer %} + & + {% endif %} {% endif %} {% endif %} Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This())->GetValue()->{{ field.name }}; {% endif %} {% partial convertToV8 field %} - info.GetReturnValue().Set(to); + info.GetReturnValue().Set(v8ConversionSlot); } + // end field block {% endif %} {% endeach %} diff --git a/generate/templates/partials/sync_function.cc b/generate/templates/partials/sync_function.cc index c07c77b51e..cf6febe67a 100644 --- a/generate/templates/partials/sync_function.cc +++ b/generate/templates/partials/sync_function.cc @@ -6,9 +6,9 @@ NAN_METHOD({{ cppClassName }}::{{ cppFunctionName }}) { {%each .|returnsInfo 'true' as _return %} {%if _return.shouldAlloc %} - {{ _return.cType }}{{ _return.name }} = ({{ _return.cType }})malloc(sizeof({{ _return.cType|unPointer }})); + {{ _return.cType }}{{ _return.name }} = ({{ _return.cType }})malloc(sizeof({{ _return.cType|unPointer }})); {%else%} - {{ _return.cType|unPointer }} {{ _return.name }} = {{ _return.cType|unPointer|defaultValue }}; + {{ _return.cType|unPointer }} {{ _return.name }} = {{ _return.cType|unPointer|defaultValue }}; {%endif%} {%endeach%} @@ -17,112 +17,115 @@ NAN_METHOD({{ cppClassName }}::{{ cppFunctionName }}) { {%if not arg.isReturn %} {%partial convertFromV8 arg %} {%if arg.saveArg %} - v8::Local {{ arg.name }}(info[{{ arg.jsArg }}]->ToObject()); - {{ cppClassName }} *thisObj = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This()); + v8::Local {{ arg.name }}(Nan::To(info[{{ arg.jsArg }}]).ToLocalChecked()); + {{ cppClassName }} *thisObj = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This()); - thisObj->{{ cppFunctionName }}_{{ arg.name }}.Reset({{ arg.name }}); + thisObj->{{ cppFunctionName }}_{{ arg.name }}.Reset({{ arg.name }}); {%endif%} {%endif%} {%endif%} {%endeach%} -{%each args|argsInfo as arg %} -{%endeach%} - -{%-- Inside a free call, if the value is already free'd don't do it again.--%} -{% if cppFunctionName == "Free" %} -if (Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This())->GetValue() != NULL) { -{% endif %} + {%-- Inside a free call, if the value is already free'd don't do it again.--%} + {%if cppFunctionName == "Free" %} + if (Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This())->GetValue() != NULL) { + {%endif%} - giterr_clear(); + git_error_clear(); + + { // lock master scope start + nodegit::LockMaster lockMaster( + /*asyncAction: */false + {%each args|argsInfo as arg %} + {%if arg.cType|isPointer%} + {%if not arg.isReturn%} + , + {%if arg.isSelf %} + Nan::ObjectWrap::Unwrap<{{ arg.cppClassName }}>(info.This())->GetValue() + {%else%} + from_{{ arg.name }} + {%endif%} + {%endif%} + {%endif%} + {%endeach%} + ); - { - LockMaster lockMaster(/*asyncAction: */false{%each args|argsInfo as arg %} - {%if arg.cType|isPointer%}{%if not arg.isReturn%} - ,{%if arg.isSelf %} - Nan::ObjectWrap::Unwrap<{{ arg.cppClassName }}>(info.This())->GetValue() + {%if .|hasReturnType %} {{ return.cType }} result = {%endif%} + {{ cFunctionName }}( + {%each args|argsInfo as arg %} + {%if arg.isReturn %} + {%if not arg.shouldAlloc %}&{%endif%} + {%endif%} + {%if arg.isSelf %} + Nan::ObjectWrap::Unwrap<{{ arg.cppClassName }}>(info.This())->GetValue() + {%elsif arg.isReturn %} + {{ arg.name }} {%else%} - from_{{ arg.name }} - {%endif%} - {%endif%}{%endif%} - {%endeach%}); - - {%if .|hasReturnValue %} - {{ return.cType }} result = {%endif%}{{ cFunctionName }}( - {%each args|argsInfo as arg %} - {%if arg.isReturn %} - {%if not arg.shouldAlloc %}&{%endif%} - {%endif%} - {%if arg.isSelf %} - Nan::ObjectWrap::Unwrap<{{ arg.cppClassName }}>(info.This())->GetValue() - {%elsif arg.isReturn %} - {{ arg.name }} - {%else%} - from_{{ arg.name }} - {%endif%} - {%if not arg.lastArg %},{%endif%} - {%endeach%} + from_{{ arg.name }} + {%endif%} + {%if not arg.lastArg %},{%endif%} + {%endeach%} ); - {%if .|hasReturnValue |and return.isErrorCode %} - if (result != GIT_OK) { + {%if .|hasReturnType |and return.isErrorCode %} + if (result != GIT_OK) { + {%each args|argsInfo as arg %} + {%if arg | isOid %} + if (info[{{ arg.jsArg }}]->IsString()) { + free((void *)from_{{ arg.name }}); + } + {%elsif arg.shouldAlloc %} + free({{ arg.name }}); + {%endif%} + {%endeach%} + + if (git_error_last()->klass != GIT_ERROR_NONE) { + return Nan::ThrowError(git_error_last()->message); + } else { + return Nan::ThrowError("Unknown Error"); + } + } // lock master scope end + {%endif%} + + {%if cppFunctionName == "Free" %} + Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This())->ClearValue(); + } // lock master scope end + {%endif%} + + {%each args|argsInfo as arg %} - {%if arg.shouldAlloc %} - free({{ arg.name }}); - {%elsif arg | isOid %} + {%if arg | isOid %} if (info[{{ arg.jsArg }}]->IsString()) { - free({{ arg.name }}); + free((void *)from_{{ arg.name }}); } {%endif%} {%endeach%} - if (giterr_last()) { - return Nan::ThrowError(giterr_last()->message); - } else { - return Nan::ThrowError("Unknown Error"); - } - } - {%endif%} - - {% if cppFunctionName == "Free" %} - Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This())->ClearValue(); - } - {% endif %} - - - {%each args|argsInfo as arg %} - {%if arg | isOid %} - if (info[{{ arg.jsArg }}]->IsString()) { - free((void *)from_{{ arg.name }}); - } - {%endif%} - {%endeach%} - - {%if not .|returnsCount %} - return info.GetReturnValue().Set(scope.Escape(Nan::Undefined())); - {%else%} - {%if return.cType | isPointer %} - // null checks on pointers - if (!result) { + {%if not .|returnsCount %} return info.GetReturnValue().Set(scope.Escape(Nan::Undefined())); - } - {%endif%} + {%else%} + {%if return.cType | isPointer %} + // null checks on pointers + if (!result) { + return info.GetReturnValue().Set(scope.Escape(Nan::Undefined())); + } + {%endif%} - v8::Local to; - {%if .|returnsCount > 1 %} - v8::Local toReturn = Nan::New(); - {%endif%} - {%each .|returnsInfo as _return %} - {%partial convertToV8 _return %} + v8::Local v8ConversionSlot; {%if .|returnsCount > 1 %} - Nan::Set(toReturn, Nan::New("{{ _return.returnNameOrName }}").ToLocalChecked(), to); + v8::Local toReturn = Nan::New(); + {%endif%} + {%each .|returnsInfo as _return %} + {%partial convertToV8 _return %} + {%if .|returnsCount > 1 %} + Nan::Set(toReturn, Nan::New("{{ _return.returnNameOrName }}").ToLocalChecked(), v8ConversionSlot); + {%endif%} + {%endeach%} + {%if .|returnsCount == 1 %} + return info.GetReturnValue().Set(scope.Escape(v8ConversionSlot)); + {%else%} + return info.GetReturnValue().Set(scope.Escape(toReturn)); {%endif%} - {%endeach%} - {%if .|returnsCount == 1 %} - return info.GetReturnValue().Set(scope.Escape(to)); - {%else%} - return info.GetReturnValue().Set(scope.Escape(toReturn)); {%endif%} - {%endif%} } } diff --git a/generate/templates/partials/traits.h b/generate/templates/partials/traits.h index efcc4b49ad..9f1f2eed76 100644 --- a/generate/templates/partials/traits.h +++ b/generate/templates/partials/traits.h @@ -1,8 +1,14 @@ class {{ cppClassName }}; +{% if type == 'struct' %} +class Configurable{{ cppClassName }}; +{% endif %} struct {{ cppClassName }}Traits { typedef {{ cppClassName }} cppClass; typedef {{ cType }} cType; + {% if type == 'struct' %} + typedef Configurable{{ cppClassName }} configurableCppClass; + {% endif %} static const bool isDuplicable = {{ dupFunction|toBool |or cpyFunction|toBool}}; static void duplicate({{ cType }} **dest, {{ cType }} *src) { @@ -17,10 +23,18 @@ struct {{ cppClassName }}Traits { {% endif %} } + static std::string className() { return "{{ cppClassName }}"; }; + static const bool isSingleton = {{ isSingleton | toBool }}; static const bool isFreeable = {{ freeFunctionName | toBool}}; static void free({{ cType }} *raw) { {% if freeFunctionName %} - ::{{ freeFunctionName }}(raw); // :: to avoid calling this free recursively + unsigned long referenceCount = 0; + {% if isSingleton %} + referenceCount = ReferenceCounter::decrementCountForPointer((void *)raw); + {% endif %} + if (referenceCount == 0) { + ::{{ freeFunctionName }}(raw); // :: to avoid calling this free recursively + } {% else %} Nan::ThrowError("free called on {{ cppClassName }} which cannot be freed"); {% endif %} diff --git a/generate/templates/templates/binding.gyp b/generate/templates/templates/binding.gyp index 1be9be4900..4476c9236d 100644 --- a/generate/templates/templates/binding.gyp +++ b/generate/templates/templates/binding.gyp @@ -1,4 +1,19 @@ { + "variables": { + "variables": { + "target%": "none", + }, + "is_electron%": " target) { + void {{ cppClassName }}::InitializeComponent(v8::Local target, nodegit::Context *nodegitContext) { Nan::HandleScope scope; - v8::Local tpl = Nan::New(JSNewFunction); + v8::Local nodegitExternal = Nan::New(nodegitContext); + v8::Local tpl = Nan::New(JSNewFunction, nodegitExternal); - tpl->InstanceTemplate()->SetInternalFieldCount(1); + tpl->InstanceTemplate()->SetInternalFieldCount(2); tpl->SetClassName(Nan::New("{{ jsClassName }}").ToLocalChecked()); {% each functions as function %} {% if not function.ignore %} {% if function.isPrototypeMethod %} - Nan::SetPrototypeMethod(tpl, "{{ function.jsFunctionName }}", {{ function.cppFunctionName }}); + Nan::SetPrototypeMethod(tpl, "{{ function.jsFunctionName }}", {{ function.cppFunctionName }}, nodegitExternal); {% else %} - Nan::SetMethod(tpl, "{{ function.jsFunctionName }}", {{ function.cppFunctionName }}); + Nan::SetMethod(tpl, "{{ function.jsFunctionName }}", {{ function.cppFunctionName }}, nodegitExternal); {% endif %} {% endif %} {% endeach %} {% each fields as field %} {% if not field.ignore %} - Nan::SetPrototypeMethod(tpl, "{{ field.jsFunctionName }}", {{ field.cppFunctionName }}); + Nan::SetPrototypeMethod(tpl, "{{ field.jsFunctionName }}", {{ field.cppFunctionName }}, nodegitExternal); {% endif %} {% endeach %} InitializeTemplate(tpl); - v8::Local _constructor_template = Nan::GetFunction(tpl).ToLocalChecked(); - constructor_template.Reset(_constructor_template); - Nan::Set(target, Nan::New("{{ jsClassName }}").ToLocalChecked(), _constructor_template); + v8::Local constructor_template = Nan::GetFunction(tpl).ToLocalChecked(); + nodegitContext->SaveToPersistent("{{ cppClassName }}::Template", constructor_template); + Nan::Set(target, Nan::New("{{ jsClassName }}").ToLocalChecked(), constructor_template); } {% else %} - void {{ cppClassName }}::InitializeComponent(v8::Local target) { + void {{ cppClassName }}::InitializeComponent(v8::Local target, nodegit::Context *nodegitContext) { Nan::HandleScope scope; + Local nodegitExternal = Nan::New(nodegitContext); - v8::Local object = Nan::New(); + {% if functions|hasFunctionOnRootProto %} + v8::Local object = Nan::New({{ functions|getCPPFunctionForRootProto }}, nodegitExternal); + {% else %} + v8::Local object = Nan::New(); + {% endif %} {% each functions as function %} {% if not function.ignore %} - Nan::SetMethod(object, "{{ function.jsFunctionName }}", {{ function.cppFunctionName }}); + Nan::SetMethod(object, "{{ function.jsFunctionName }}", {{ function.cppFunctionName }}, nodegitExternal); {% endif %} {% endeach %} - Nan::Set(target, Nan::New("{{ jsClassName }}").ToLocalChecked(), object); + Nan::Set( + target, + Nan::New("{{ jsClassName }}").ToLocalChecked(), + {% if functions|hasFunctionOnRootProto %} + Nan::GetFunction(object).ToLocalChecked() + {% else %} + object + {% endif %} + ); } {% endif %} diff --git a/generate/templates/templates/class_header.h b/generate/templates/templates/class_header.h index ea04c120fb..9112347825 100644 --- a/generate/templates/templates/class_header.h +++ b/generate/templates/templates/class_header.h @@ -2,15 +2,25 @@ #define {{ cppClassName|upper }}_H #include #include -#include #include +#include +#include +#include +#include #include "async_baton.h" +#include "async_worker.h" +#include "cleanup_handle.h" +#include "context.h" +#include "lock_master.h" #include "nodegit_wrapper.h" #include "promise_completion.h" +#include "reference_counter.h" +#include "worker_pool.h" extern "C" { #include +#include {%each cDependencies as dependency %} #include <{{ dependency }}> {%endeach%} @@ -52,7 +62,12 @@ class {{ cppClassName }} : public friend class NodeGitWrapper<{{ cppClassName }}Traits>; {%endif %} public: - static void InitializeComponent (v8::Local target); + {{ cppClassName }}(const {{ cppClassName }} &) = delete; + {{ cppClassName }}({{ cppClassName }} &&) = delete; + {{ cppClassName }} &operator=(const {{ cppClassName }} &) = delete; + {{ cppClassName }} &operator=({{ cppClassName }} &&) = delete; + + static void InitializeComponent (v8::Local target, nodegit::Context *nodegitContext); {% each functions as function %} {% if not function.ignore %} @@ -67,15 +82,18 @@ class {{ cppClassName }} : public {% endeach %} ); + static void {{ function.cppFunctionName }}_{{ arg.name }}_cancelAsync(void *baton); static void {{ function.cppFunctionName }}_{{ arg.name }}_async(void *baton); - static void {{ function.cppFunctionName }}_{{ arg.name }}_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local result); - struct {{ function.cppFunctionName }}_{{ arg.name|titleCase }}Baton : public AsyncBatonWithResult<{{ arg.return.type }}> { + static void {{ function.cppFunctionName }}_{{ arg.name }}_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local result); + class {{ function.cppFunctionName }}_{{ arg.name|titleCase }}Baton : public nodegit::AsyncBatonWithResult<{{ arg.return.type }}> { + public: {% each arg.args|argsInfo as cbArg %} {{ cbArg.cType }} {{ cbArg.name }}; {% endeach %} + {{ function.cppFunctionName }}_{{ arg.name|titleCase }}Baton(const {{ arg.return.type }} &defaultResult) - : AsyncBatonWithResult<{{ arg.return.type }}>(defaultResult) { + : nodegit::AsyncBatonWithResult<{{ arg.return.type }}>(defaultResult) { } }; {% endif %} @@ -101,16 +119,6 @@ class {{ cppClassName }} : public ~{{ cppClassName }}(); {%endif%} - {% each functions as function %} - {% if not function.ignore %} - {% each function.args as arg %} - {% if arg.saveArg %} - Nan::Persistent {{ function.cppFunctionName }}_{{ arg.name }}; - {% endif %} - {% endeach %} - {% endif %} - {% endeach %} - {%each fields as field%} {%if not field.ignore%} static NAN_METHOD({{ field.cppFunctionName }}); @@ -134,17 +142,29 @@ class {{ cppClassName }} : public {%endif%} {%endif%} {%endeach%} + {% if function.return.isResultOrError %} + {% elsif function.return.isErrorCode %} + {% elsif function.return.cType != 'void' %} + {{ function.return.cType }} result; + {% endif %} }; - class {{ function.cppFunctionName }}Worker : public Nan::AsyncWorker { + class {{ function.cppFunctionName }}Worker : public nodegit::AsyncWorker { public: {{ function.cppFunctionName }}Worker( {{ function.cppFunctionName }}Baton *_baton, - Nan::Callback *callback - ) : Nan::AsyncWorker(callback) + Nan::Callback *callback, + std::map> &cleanupHandles + ) : nodegit::AsyncWorker(callback, "nodegit:AsyncWorker:{{ cppClassName }}:{{ function.cppFunctionName }}", cleanupHandles) , baton(_baton) {}; + {{ function.cppFunctionName }}Worker(const {{ function.cppFunctionName }}Worker &) = delete; + {{ function.cppFunctionName }}Worker({{ function.cppFunctionName }}Worker &&) = delete; + {{ function.cppFunctionName }}Worker &operator=(const {{ function.cppFunctionName }}Worker &) = delete; + {{ function.cppFunctionName }}Worker &operator=({{ function.cppFunctionName }}Worker &&) = delete; ~{{ function.cppFunctionName }}Worker() {}; void Execute(); + void HandleErrorCallback(); void HandleOKCallback(); + nodegit::LockMaster AcquireLocks(); private: {{ function.cppFunctionName }}Baton *baton; @@ -174,6 +194,11 @@ class {{ cppClassName }} : public {%endeach%} } + {{ function.cppFunctionName }}_globalPayload(const {{ function.cppFunctionName }}_globalPayload &) = delete; + {{ function.cppFunctionName }}_globalPayload({{ function.cppFunctionName }}_globalPayload &&) = delete; + {{ function.cppFunctionName }}_globalPayload &operator=(const {{ function.cppFunctionName }}_globalPayload &) = delete; + {{ function.cppFunctionName }}_globalPayload &operator=({{ function.cppFunctionName }}_globalPayload &&) = delete; + ~{{ function.cppFunctionName }}_globalPayload() { {%each function.args as arg %} {%if arg.isCallbackFunction %} diff --git a/generate/templates/templates/nodegit.cc b/generate/templates/templates/nodegit.cc index e81bbb85f4..e43f8b2ae5 100644 --- a/generate/templates/templates/nodegit.cc +++ b/generate/templates/templates/nodegit.cc @@ -5,12 +5,13 @@ #include #include #include - #include +#include #include "../include/init_ssh2.h" #include "../include/lock_master.h" #include "../include/nodegit.h" +#include "../include/context.h" #include "../include/wrapper.h" #include "../include/promise_completion.h" #include "../include/functions/copy.h" @@ -23,76 +24,22 @@ #include "../include/convenient_hunk.h" #include "../include/filter_registry.h" -#if (NODE_MODULE_VERSION > 48) - v8::Local GetPrivate(v8::Local object, - v8::Local key) { - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - v8::Local context = isolate->GetCurrentContext(); - v8::Local privateKey = v8::Private::ForApi(isolate, key); - v8::Local value; - v8::Maybe result = object->HasPrivate(context, privateKey); - if (!(result.IsJust() && result.FromJust())) - return v8::Local(); - if (object->GetPrivate(context, privateKey).ToLocal(&value)) - return value; - return v8::Local(); - } - - void SetPrivate(v8::Local object, - v8::Local key, - v8::Local value) { - if (value.IsEmpty()) - return; - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - v8::Local context = isolate->GetCurrentContext(); - v8::Local privateKey = v8::Private::ForApi(isolate, key); - object->SetPrivate(context, privateKey, value); - } -#else - v8::Local GetPrivate(v8::Local object, - v8::Local key) { - return object->GetHiddenValue(key); - } - - void SetPrivate(v8::Local object, - v8::Local key, - v8::Local value) { - object->SetHiddenValue(key, value); - } -#endif +using namespace v8; -void LockMasterEnable(const FunctionCallbackInfo& info) { - LockMaster::Enable(); +Local GetPrivate(Local object, Local key) { + Local value; + Nan::Maybe result = Nan::HasPrivate(object, key); + if (!(result.IsJust() && result.FromJust())) + return Local(); + if (Nan::GetPrivate(object, key).ToLocal(&value)) + return value; + return Local(); } -void LockMasterSetStatus(const FunctionCallbackInfo& info) { - Nan::HandleScope scope; - - // convert the first argument to Status - if(info.Length() >= 0 && info[0]->IsNumber()) { - v8::Local value = info[0]->ToInt32(); - LockMaster::Status status = static_cast(value->Value()); - if(status >= LockMaster::Disabled && status <= LockMaster::Enabled) { - LockMaster::SetStatus(status); - return; - } - } - - // argument error - Nan::ThrowError("Argument must be one 0, 1 or 2"); -} - -void LockMasterGetStatus(const FunctionCallbackInfo& info) { - info.GetReturnValue().Set(Nan::New(LockMaster::GetStatus())); -} - -void LockMasterGetDiagnostics(const FunctionCallbackInfo& info) { - LockMaster::Diagnostics diagnostics(LockMaster::GetDiagnostics()); - - // return a plain JS object with properties - v8::Local result = Nan::New(); - result->Set(Nan::New("storedMutexesCount").ToLocalChecked(), Nan::New(diagnostics.storedMutexesCount)); - info.GetReturnValue().Set(result); +void SetPrivate(Local object, Local key, Local value) { + if (value.IsEmpty()) + return; + Nan::SetPrivate(object, key, value); } static uv_mutex_t *opensslMutexes; @@ -105,8 +52,8 @@ void OpenSSL_LockingCallback(int mode, int type, const char *, int) { } } -unsigned long OpenSSL_IDCallback() { - return (unsigned long)uv_thread_self(); +void OpenSSL_IDCallback(CRYPTO_THREADID *id) { + CRYPTO_THREADID_set_numeric(id, (unsigned long)uv_thread_self()); } void OpenSSL_ThreadSetup() { @@ -117,45 +64,65 @@ void OpenSSL_ThreadSetup() { } CRYPTO_set_locking_callback(OpenSSL_LockingCallback); - CRYPTO_set_id_callback(OpenSSL_IDCallback); + CRYPTO_THREADID_set_callback(OpenSSL_IDCallback); } -ThreadPool libgit2ThreadPool(10, uv_default_loop()); +// diagnostic function +NAN_METHOD(GetNumberOfTrackedObjects) { + nodegit::Context *currentNodeGitContext = nodegit::Context::GetCurrentContext(); + assert (currentNodeGitContext != nullptr); + info.GetReturnValue().Set(currentNodeGitContext->TrackerListSize()); +} -extern "C" void init(v8::Local target) { - // Initialize thread safety in openssl and libssh2 - OpenSSL_ThreadSetup(); - init_ssh2(); - // Initialize libgit2. - git_libgit2_init(); +static std::once_flag libraryInitializedFlag; +static std::mutex libraryInitializationMutex; + +NAN_MODULE_INIT(init) { + { + // We only want to do initialization logic once, and we also want to prevent any thread from completely loading + // the module until initialization has occurred. + // All of this initialization logic ends up being shared. + const std::lock_guard lock(libraryInitializationMutex); + std::call_once(libraryInitializedFlag, []() { + // Initialize thread safety in openssl and libssh2 + OpenSSL_ThreadSetup(); + init_ssh2(); + // Initialize libgit2. + git_libgit2_init(); + + // Register thread pool with libgit2 + nodegit::ThreadPool::InitializeGlobal(); + }); + } + + // Exports function 'getNumberOfTrackedObjects' + Nan::Set(target + , Nan::New("getNumberOfTrackedObjects").ToLocalChecked() + , Nan::GetFunction(Nan::New(GetNumberOfTrackedObjects)).ToLocalChecked() + ); Nan::HandleScope scope; + Local context = Nan::GetCurrentContext(); + Isolate *isolate = context->GetIsolate(); + nodegit::Context *nodegitContext = new nodegit::Context(isolate); - Wrapper::InitializeComponent(target); - PromiseCompletion::InitializeComponent(); + Wrapper::InitializeComponent(target, nodegitContext); + PromiseCompletion::InitializeComponent(nodegitContext); {% each %} - {% if type != "enum" %} - {{ cppClassName }}::InitializeComponent(target); + {% if type == 'class' %} + {{ cppClassName }}::InitializeComponent(target, nodegitContext); + {% elsif type == 'struct' %} + {% if isReturnable %} + {{ cppClassName }}::InitializeComponent(target, nodegitContext); + {% endif %} {% endif %} {% endeach %} - ConvenientHunk::InitializeComponent(target); - ConvenientPatch::InitializeComponent(target); - GitFilterRegistry::InitializeComponent(target); - - NODE_SET_METHOD(target, "enableThreadSafety", LockMasterEnable); - NODE_SET_METHOD(target, "setThreadSafetyStatus", LockMasterSetStatus); - NODE_SET_METHOD(target, "getThreadSafetyStatus", LockMasterGetStatus); - NODE_SET_METHOD(target, "getThreadSafetyDiagnostics", LockMasterGetDiagnostics); - - v8::Local threadSafety = Nan::New(); - threadSafety->Set(Nan::New("DISABLED").ToLocalChecked(), Nan::New((int)LockMaster::Disabled)); - threadSafety->Set(Nan::New("ENABLED_FOR_ASYNC_ONLY").ToLocalChecked(), Nan::New((int)LockMaster::EnabledForAsyncOnly)); - threadSafety->Set(Nan::New("ENABLED").ToLocalChecked(), Nan::New((int)LockMaster::Enabled)); - - target->Set(Nan::New("THREAD_SAFETY").ToLocalChecked(), threadSafety); + ConvenientHunk::InitializeComponent(target, nodegitContext); + ConvenientPatch::InitializeComponent(target, nodegitContext); + GitFilterRegistry::InitializeComponent(target, nodegitContext); - LockMaster::Initialize(); + nodegit::LockMaster::InitializeContext(); } -NODE_MODULE(nodegit, init) +NAN_MODULE_WORKER_ENABLED(nodegit, init) diff --git a/generate/templates/templates/nodegit.js b/generate/templates/templates/nodegit.js index 246f5b26b9..43e7d9de02 100644 --- a/generate/templates/templates/nodegit.js +++ b/generate/templates/templates/nodegit.js @@ -1,4 +1,11 @@ -var promisify = require("promisify-node"); +var _ = require("lodash"); +var util = require("util"); +var worker; + +try { + worker = require("worker_threads"); +} catch (e) {} + var rawApi; // Attempt to load the production release first, if it fails fall back to the @@ -15,10 +22,25 @@ catch (ex) { rawApi = require("../build/Debug/nodegit.node"); } +var promisify = fn => fn && util.promisify(fn); // jshint ignore:line + +// For disccussion on why `cloneDeep` is required, see: +// https://github.com/facebook/jest/issues/3552 +// https://github.com/facebook/jest/issues/3550 +// https://github.com/nodejs/node/issues/5016 +rawApi = _.cloneDeep(rawApi); + // Native methods do not return an identifiable function, so we // have to override them here /* jshint ignore:start */ {% each . as idef %} + {% if idef.type == 'struct' %} + rawApi.{{ idef.jsClassName }} = util.deprecate(function {{ idef.jsClassName }}() { + try { + require("./deprecated/structs/{{ idef.jsClassName }}").call(this, rawApi); + } catch (error) {/* allow these to be undefined */} + }, "Instantiation of {{ idef.jsClassName }} is deprecated and will be removed in an upcoming version"); + {% endif %} {% if idef.type != "enum" %} {% if idef.functions.length > 0 %} @@ -85,9 +107,7 @@ var importExtension = function(name) { // Load up utils rawApi.Utils = {}; require("./utils/lookup_wrapper"); -require("./utils/normalize_options"); require("./utils/shallow_clone"); -require("./utils/normalize_fetch_options"); // Load up extra types; require("./status_file"); @@ -125,9 +145,6 @@ importExtension("filter_registry"); {% endeach %} /* jshint ignore:end */ -// Wrap asynchronous methods to return promises. -promisify(exports); - // Set version. exports.version = require("../package").version; diff --git a/generate/templates/templates/struct_content.cc b/generate/templates/templates/struct_content.cc index 9840cfe4f2..d7355d2a29 100644 --- a/generate/templates/templates/struct_content.cc +++ b/generate/templates/templates/struct_content.cc @@ -1,3 +1,4 @@ +// generated from struct_content.cc #include #include #ifdef WIN32 @@ -28,107 +29,336 @@ using namespace v8; using namespace node; using namespace std; - -// generated from struct_content.cc -{{ cppClassName }}::{{ cppClassName }}() : NodeGitWrapper<{{ cppClassName }}Traits>(NULL, true, v8::Local()) -{ - {% if ignoreInit == true %} - this->raw = new {{ cType }}; - {% else %} - {% if isExtendedStruct %} - {{ cType }}_extended wrappedValue = {{ cType|upper }}_INIT; - this->raw = ({{ cType }}*) malloc(sizeof({{ cType }}_extended)); - memcpy(this->raw, &wrappedValue, sizeof({{ cType }}_extended)); +{% if isReturnable %} + {{ cppClassName }}::{{ cppClassName }}() : NodeGitWrapper<{{ cppClassName }}Traits>(NULL, true, v8::Local()) + { + {% if ignoreInit == true %} + this->raw = new {{ cType }}; {% else %} - {{ cType }} wrappedValue = {{ cType|upper }}_INIT; - this->raw = ({{ cType }}*) malloc(sizeof({{ cType }})); - memcpy(this->raw, &wrappedValue, sizeof({{ cType }})); + {% if isExtendedStruct %} + {{ cType }}_extended wrappedValue = {{ cType|upper }}_INIT; + this->raw = ({{ cType }}*) malloc(sizeof({{ cType }}_extended)); + memcpy(this->raw, &wrappedValue, sizeof({{ cType }}_extended)); + {% else %} + {{ cType }} wrappedValue = {{ cType|upper }}_INIT; + this->raw = ({{ cType }}*) malloc(sizeof({{ cType }})); + memcpy(this->raw, &wrappedValue, sizeof({{ cType }})); + {% endif %} {% endif %} - {% endif %} - this->ConstructFields(); -} + this->ConstructFields(); + } + + {{ cppClassName }}::{{ cppClassName }}({{ cType }}* raw, bool selfFreeing, v8::Local owner) + : NodeGitWrapper<{{ cppClassName }}Traits>(raw, selfFreeing, owner) + { + this->ConstructFields(); + } + + {{ cppClassName }}::~{{ cppClassName }}() { + {% each fields|fieldsInfo as field %} + {% if not field.ignore %} + {% if not field.isEnum %} + {% if field.isLibgitType %} + this->{{ field.name }}.Reset(); + {% endif %} + {% endif %} + {% endif %} + {% endeach %} + } + + void {{ cppClassName }}::ConstructFields() { + {% each fields|fieldsInfo as field %} + {% if not field.ignore %} + {% if not field.isEnum %} + {% if field.isLibgitType %} + v8::Local {{ field.name }}Temp = Nan::To({{ field.cppClassName }}::New( + {%if not field.cType|isPointer %}&{%endif%}this->raw->{{ field.name }}, + false + )).ToLocalChecked(); + this->{{ field.name }}.Reset({{ field.name }}Temp); + {% endif %} + {% endif %} + {% endif %} + {% endeach %} + } + + void {{ cppClassName }}::InitializeComponent(Local target, nodegit::Context *nodegitContext) { + Nan::HandleScope scope; + + Local nodegitExternal = Nan::New(nodegitContext); + Local tpl = Nan::New(JSNewFunction, nodegitExternal); + + tpl->InstanceTemplate()->SetInternalFieldCount(2); + tpl->SetClassName(Nan::New("{{ jsClassName }}").ToLocalChecked()); + + {% each fields as field %} + {% if not field.ignore %} + {% if not field | isPayload %} + Nan::SetAccessor(tpl->InstanceTemplate(), Nan::New("{{ field.jsFunctionName }}").ToLocalChecked(), Get{{ field.cppFunctionName}}, Set{{ field.cppFunctionName}}, nodegitExternal); + {% endif %} + {% endif %} + {% endeach %} + + InitializeTemplate(tpl); + + v8::Local constructor_template = Nan::GetFunction(tpl).ToLocalChecked(); + nodegitContext->SaveToPersistent("{{ cppClassName }}::Template", constructor_template); + } -{{ cppClassName }}::{{ cppClassName }}({{ cType }}* raw, bool selfFreeing, v8::Local owner) - : NodeGitWrapper<{{ cppClassName }}Traits>(raw, selfFreeing, owner) + {% partial fieldAccessors . %} + + // force base class template instantiation, to make sure we get all the + // methods, statics, etc. + template class NodeGitWrapper<{{ cppClassName }}Traits>; + +{% endif %} + +Configurable{{ cppClassName }}::Configurable{{ cppClassName }}(nodegit::Context *nodegitContext) + : nodegit::ConfigurableClassWrapper<{{ cppClassName }}Traits>(nodegitContext) { - this->ConstructFields(); + {% if ignoreInit == true %} + this->raw = ({{ cType }}*) malloc(sizeof({{ cType }})); + {% else %} + {{ cType }}{% if isExtendedStruct %}_extended{% endif %} wrappedValue = {{ cType|upper }}_INIT; + this->raw = ({{ cType }}*) malloc(sizeof({{ cType }}{% if isExtendedStruct %}_extended{% endif %})); + memcpy(this->raw, &wrappedValue, sizeof({{ cType }}{% if isExtendedStruct %}_extended{% endif %})); + {% endif %} } -{{ cppClassName }}::~{{ cppClassName }}() { +Configurable{{ cppClassName }}::~Configurable{{ cppClassName }}() { {% each fields|fieldsInfo as field %} {% if not field.ignore %} - {% if not field.isEnum %} - {% if field.isCallbackFunction %} - if (this->{{ field.name }}.HasCallback()) { - {% if isExtendedStruct %} - (({{ cType }}_extended *)this->raw)->payload = NULL; - {% else %} - this->raw->{{ fields|payloadFor field.name }} = NULL; - {% endif %} + {% if field.cppClassName == 'GitStrarray' %} + if (this->raw->{{ field.name }}.count) { + for (size_t i = 0; i < this->raw->{{ field.name }}.count; ++i) { + free(this->raw->{{ field.name }}.strings[i]); } - {% endif %} + free(this->raw->{{ field.name }}.strings); + } + {% elsif field.cppClassName == 'String' %} + free((void*)this->raw->{{ field.name }}); {% endif %} {% endif %} {% endeach %} } -void {{ cppClassName }}::ConstructFields() { - {% each fields|fieldsInfo as field %} +nodegit::ConfigurableClassWrapper<{{ cppClassName }}Traits>::v8ConversionResult Configurable{{ cppClassName }}::fromJavascript(nodegit::Context *nodegitContext, v8::Local input) { + if (!input->IsObject()) { + return { + "Must pass object for Configurable{{ cppClassName }}" + }; + } + + Nan::HandleScope scope; + v8::Local inputObj = input.As(); + std::shared_ptr output(new Configurable{{ cppClassName }}(nodegitContext)); + + // unpack the data into the correct fields + {% each fields as field %} {% if not field.ignore %} - {% if not field.isEnum %} - {% if field.hasConstructor |or field.isLibgitType %} - v8::Local {{ field.name }}Temp = {{ field.cppClassName }}::New( - {%if not field.cType|isPointer %}&{%endif%}this->raw->{{ field.name }}, - false - )->ToObject(); - this->{{ field.name }}.Reset({{ field.name }}Temp); - - {% elsif field.isCallbackFunction %} - - // Set the static method call and set the payload for this function to be - // the current instance - this->raw->{{ field.name }} = NULL; - {% if isExtendedStruct %} - (({{ cType }}_extended *)this->raw)->payload = (void *)this; - {% else %} - this->raw->{{ fields|payloadFor field.name }} = (void *)this; - {% endif %} - {% elsif field.payloadFor %} + {% if field.isClassType %} + {% if field.cppClassName == 'GitOid' %} + { + v8::Local maybeOid = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeOid.IsEmpty() && !maybeOid->IsUndefined() && !maybeOid->IsNull()) { + if (maybeOid->IsString()) { + Nan::Utf8String oidString(maybeOid.As()); + if (git_oid_fromstr(&output->raw->{{ field.name }}, *oidString) != GIT_OK) { + return { + git_error_last()->message + }; + } + } else if (maybeOid->IsObject()) { + if (git_oid_cpy(&output->raw->{{ field.name }}, Nan::ObjectWrap::Unwrap<{{ field.cppClassName }}>(maybeOid.As())->GetValue()) != GIT_OK) { + return { + git_error_last()->message + }; + } + } else { + return { + "Must pass String or NodeGit.Oid to {{ field.jsFunctionName }}" + }; + } + } + } + {% elsif field.cppClassName == 'GitStrarray' %} + output->raw->{{ field.name }}.count = 0; + output->raw->{{ field.name }}.strings = nullptr; + + { + v8::Local maybeStrarray = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeStrarray.IsEmpty() && !maybeStrarray->IsUndefined() && !maybeStrarray->IsNull()) { + if (maybeStrarray->IsArray()) { + v8::Local strarrayValue = maybeStrarray.As(); + // validate the StrArray is indeed a list of strings + for (uint32_t i = 0; i < strarrayValue->Length(); ++i) { + // TODO confirm that sparse array at least boils down to undefined + v8::Local arrayValue = Nan::Get(strarrayValue, i).ToLocalChecked(); + if (!arrayValue->IsString()) { + return { + "Must pass String or Array of strings to {{ field.jsFunctionName }}" + }; + } + } + + StrArrayConverter::ConvertInto(&output->raw->{{ field.name }}, strarrayValue); + } else if (maybeStrarray->IsString()) { + v8::Local strarrayValue = maybeStrarray.As(); + StrArrayConverter::ConvertInto(&output->raw->{{ field.name }}, strarrayValue); + } else { + return { + "Must pass String or Array of strings to {{ field.jsFunctionName }}" + }; + } + } + } + {% else %} + { + v8::Local maybeObject = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeObject.IsEmpty() && !maybeObject->IsUndefined() && !maybeObject->IsNull()) { + if (!maybeObject->IsObject()) { + return { + "Must pass NodeGit.{{ field.jsClassName }} to {{ field.jsFunctionName }}" + }; + } - v8::Local {{ field.name }} = Nan::Undefined(); - this->{{ field.name }}.Reset({{ field.name }}); + v8::Local objectValue = maybeObject.As(); + output->raw->{{ field.name }} = Nan::ObjectWrap::Unwrap<{{ field.cppClassName }}>(objectValue)->GetValue(); + output->{{ field.jsFunctionName }}.Reset(objectValue); + } + } {% endif %} - {% endif %} - {% endif %} - {% endeach %} -} + {% elsif field.isCallbackFunction %} + { + v8::Local maybeCallback = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeCallback.IsEmpty() && !maybeCallback->IsUndefined() && !maybeCallback->IsNull()) { + if (!maybeCallback->IsFunction() && !maybeCallback->IsObject()) { + return { + "Must pass Function or CallbackSpecifier to {{ field.jsFunctionName}}" + }; + } -void {{ cppClassName }}::InitializeComponent(v8::Local target) { - Nan::HandleScope scope; + std::unique_ptr callback; + uint32_t throttle = {% if field.return.throttle %}{{ field.return.throttle }}{% else %}0{% endif %}; + bool waitForResult = true; - v8::Local tpl = Nan::New(JSNewFunction); + if (maybeCallback->IsFunction()) { + callback.reset(new Nan::Callback(maybeCallback.As())); + } else { + v8::Local callbackSpecifier = maybeCallback.As(); + v8::Local maybeCallback = nodegit::safeGetField(callbackSpecifier, "callback"); + if (maybeCallback.IsEmpty() || !maybeCallback->IsFunction()) { + return { + "Must pass callback to CallbackSpecifier" + }; + } - tpl->InstanceTemplate()->SetInternalFieldCount(1); - tpl->SetClassName(Nan::New("{{ jsClassName }}").ToLocalChecked()); + callback.reset(new Nan::Callback(maybeCallback.As())); - {% each fields as field %} - {% if not field.ignore %} - {% if not field | isPayload %} - Nan::SetAccessor(tpl->InstanceTemplate(), Nan::New("{{ field.jsFunctionName }}").ToLocalChecked(), Get{{ field.cppFunctionName}}, Set{{ field.cppFunctionName}}); - {% endif %} + v8::Local maybeThrottle = nodegit::safeGetField(callbackSpecifier, "throttle"); + if (!maybeThrottle.IsEmpty() && !maybeThrottle->IsUndefined() && !maybeThrottle->IsNull()) { + if (!maybeThrottle->IsNumber()) { + return { + "Must pass zero or positive number as throttle to CallbackSpecifier" + }; + } + + throttle = maybeThrottle->Uint32Value(Nan::GetCurrentContext()).FromJust(); + } + + v8::Local maybeWaitForResult = nodegit::safeGetField(callbackSpecifier, "waitForResult"); + if (!maybeWaitForResult.IsEmpty() && !maybeWaitForResult->IsUndefined() && !maybeWaitForResult->IsNull()) { + if (!maybeWaitForResult->IsBoolean()) { + return { + "Must pass a boolean as waitForResult to callbackSpecifier" + }; + } + + waitForResult = Nan::To(maybeWaitForResult).FromJust(); + } + } + + output->{{ field.jsFunctionName }}.SetCallback(std::move(callback), throttle, waitForResult); + output->raw->{{ field.name }} = ({{ field.cType }}){{ field.jsFunctionName }}_cppCallback; + } + } + {% elsif field.isStructType %} + { + v8::Local maybeNestedObject = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeNestedObject.IsEmpty() && !maybeNestedObject->IsUndefined() && !maybeNestedObject->IsNull()) { + auto conversionResult = Configurable{{ field.cppClassName }}::fromJavascript(nodegitContext, maybeNestedObject); + if (!conversionResult.result) { + std::string error = "Failed to set {{ field.jsFunctionName }}: "; + error += conversionResult.error; + return { + error + }; + } + + auto child = conversionResult.result; + output->childCleanupVector.push_back(child); + output->raw->{{ field.name }} = *child->GetValue(); + } + } + {% elsif field.payloadFor %} + output->raw->{{ field.name }} = (void *)output.get(); + {% elsif field.cppClassName == 'String' %} + output->raw->{{ field.name }} = nullptr; + { + v8::Local maybeString = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeString.IsEmpty() && !maybeString->IsUndefined() && !maybeString->IsNull()) { + if (!maybeString->IsString()) { + return { + "Must pass string to {{ field.jsFunctionName }}" + }; + } + + Nan::Utf8String utf8String(maybeString.As()); + output->raw->{{ field.name }} = strdup(*utf8String); + } + } + {% elsif field.isCppClassIntType %} + { + v8::Local maybeNumber = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeNumber.IsEmpty() && !maybeNumber->IsUndefined() && !maybeNumber->IsNull()) { + if (!maybeNumber->IsNumber()) { + return { + "Must pass {{ field.cppClassName }} to {{ field.jsFunctionName }}" + }; + } + + output->raw->{{ field.name }} = maybeNumber->{{ field.cppClassName }}Value(); + } + } + {% else %} + { + v8::Local maybeNumber = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeNumber.IsEmpty() && !maybeNumber->IsUndefined() && !maybeNumber->IsNull()) { + if (!maybeNumber->IsNumber()) { + return { + "Must pass Int32 to {{ field.jsFunctionName }}" + }; + } + + output->raw->{{ field.name }} = static_cast<{{ field.cType }}>(maybeNumber->Int32Value(Nan::GetCurrentContext()).FromJust()); + } + } + {% endif %} {% endif %} {% endeach %} - InitializeTemplate(tpl); + {% if isExtendedStruct %} + (({{ cType }}_extended *)output->raw)->payload = (void *)output.get(); + {% endif %} - v8::Local _constructor_template = Nan::GetFunction(tpl).ToLocalChecked(); - constructor_template.Reset(_constructor_template); - Nan::Set(target, Nan::New("{{ jsClassName }}").ToLocalChecked(), _constructor_template); + return { + output + }; } -{% partial fieldAccessors . %} +{% partial configurableCallbacks %} // force base class template instantiation, to make sure we get all the // methods, statics, etc. -template class NodeGitWrapper<{{ cppClassName }}Traits>; +template class nodegit::ConfigurableClassWrapper<{{ cppClassName }}Traits>; diff --git a/generate/templates/templates/struct_header.h b/generate/templates/templates/struct_header.h index 4d2ec2af50..ac05fb3543 100644 --- a/generate/templates/templates/struct_header.h +++ b/generate/templates/templates/struct_header.h @@ -1,16 +1,22 @@ +// generated from struct_header.h #ifndef {{ cppClassName|upper }}_H #define {{ cppClassName|upper }}_H #include #include -#include #include #include "async_baton.h" +#include "async_worker.h" #include "callback_wrapper.h" +#include "context.h" +#include "reference_counter.h" #include "nodegit_wrapper.h" +#include "configurable_class_wrapper.h" +#include "v8_helpers.h" extern "C" { #include + #include {% each cDependencies as dependency %} #include <{{ dependency }}> {% endeach %} @@ -30,77 +36,120 @@ struct {{ cType }}_extended { void* payload; }; {% endif %} -class {{ cppClassName }} : public NodeGitWrapper<{{ cppClassName }}Traits> { - // grant full access to base class - friend class NodeGitWrapper<{{ cppClassName }}Traits>; - public: - {{ cppClassName }}({{ cType }}* raw, bool selfFreeing, v8::Local owner = v8::Local()); - static void InitializeComponent (v8::Local target); - - {% each fields as field %} - {% if not field.ignore %} - {% if field.isCallbackFunction %} - static {{ field.return.type }} {{ field.name }}_cppCallback ( +{% if isReturnable %} + class {{ cppClassName }} : public NodeGitWrapper<{{ cppClassName }}Traits> { + // grant full access to base class + friend class NodeGitWrapper<{{ cppClassName }}Traits>; + + public: + {{ cppClassName }}({{ cType }}* raw, bool selfFreeing, v8::Local owner = v8::Local()); + {{ cppClassName }}(const {{ cppClassName }} &) = delete; + {{ cppClassName }}({{ cppClassName }} &&) = delete; + {{ cppClassName }} &operator=(const {{ cppClassName }} &) = delete; + {{ cppClassName }} &operator=({{ cppClassName }} &&) = delete; + static void InitializeComponent (v8::Local target, nodegit::Context *nodegitContext); + + private: + {{ cppClassName }}(); + ~{{ cppClassName }}(); + + void ConstructFields(); + + {% each fields as field %} + {% if not field.ignore %} + {% if not field.isEnum %} + {% if field.isLibgitType %} + Nan::Global {{ field.name }}; + {% endif %} + {% endif %} + + static NAN_GETTER(Get{{ field.cppFunctionName }}); + static NAN_SETTER(Set{{ field.cppFunctionName }}); + + {% endif %} + {% endeach %} + }; +{% endif %} + +class Configurable{{ cppClassName }} : public nodegit::ConfigurableClassWrapper<{{ cppClassName }}Traits> { + friend class nodegit::ConfigurableClassWrapper<{{ cppClassName }}Traits>; + +public: + static v8ConversionResult fromJavascript(nodegit::Context *nodegitContext, v8::Local input); + ~Configurable{{ cppClassName }}(); + + Configurable{{ cppClassName }}(const Configurable{{ cppClassName }} &) = delete; + Configurable{{ cppClassName }}(Configurable{{ cppClassName }} &&) = delete; + Configurable{{ cppClassName }} &operator=(const Configurable{{ cppClassName }} &) = delete; + Configurable{{ cppClassName }} &operator=(Configurable{{ cppClassName }} &&) = delete; + + {% each fields as field %} + {% if not field.ignore %} + {% if field.isCallbackFunction %} + static {{ field.return.type }} {{ field.jsFunctionName }}_cppCallback ( + {% each field.args|argsInfo as arg %} + {{ arg.cType }} {{ arg.name}} + {% if not arg.lastArg %} + , + {% endif %} + {% endeach %} + ); + + static void {{ field.jsFunctionName }}_cancelAsync(void *baton); + static void {{ field.jsFunctionName }}_async(void *baton); + static void {{ field.jsFunctionName }}_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local result); + {% if field.return.type == 'void' %} + class {{ field.name|titleCase }}Baton : public nodegit::AsyncBatonWithNoResult { + public: {% each field.args|argsInfo as arg %} - {{ arg.cType }} {{ arg.name}} - {% if not arg.lastArg %} - , - {% endif %} + {{ arg.cType }} {{ arg.name }}; {% endeach %} - ); - - static void {{ field.name }}_async(void *baton); - static void {{ field.name }}_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local result); - {% if field.return.type == 'void' %} - struct {{ field.name|titleCase }}Baton : public AsyncBatonWithNoResult { - {% each field.args|argsInfo as arg %} - {{ arg.cType }} {{ arg.name }}; - {% endeach %} - - {{ field.name|titleCase }}Baton() - : AsyncBatonWithNoResult() { - } - }; - {% else %} - struct {{ field.name|titleCase }}Baton : public AsyncBatonWithResult<{{ field.return.type }}> { - {% each field.args|argsInfo as arg %} - {{ arg.cType }} {{ arg.name }}; - {% endeach %} - - {{ field.name|titleCase }}Baton(const {{ field.return.type }} &defaultResult) - : AsyncBatonWithResult<{{ field.return.type }}>(defaultResult) { - } - }; - {% endif %} - static {{ cppClassName }} * {{ field.name }}_getInstanceFromBaton ( - {{ field.name|titleCase }}Baton *baton); + + {{ field.name|titleCase }}Baton() + : nodegit::AsyncBatonWithNoResult() { + } + }; + {% else %} + class {{ field.name|titleCase }}Baton : public nodegit::AsyncBatonWithResult<{{ field.return.type }}> { + public: + {% each field.args|argsInfo as arg %} + {{ arg.cType }} {{ arg.name }}; + {% endeach %} + + {{ field.name|titleCase }}Baton(const {{ field.return.type }} &defaultResult) + : nodegit::AsyncBatonWithResult<{{ field.return.type }}>(defaultResult) { + } + }; {% endif %} + static Configurable{{ cppClassName }} * {{ field.jsFunctionName }}_getInstanceFromBaton ( + {{ field.name|titleCase }}Baton *baton); {% endif %} - {% endeach %} - - private: - {{ cppClassName }}(); - ~{{ cppClassName }}(); - - void ConstructFields(); - - {% each fields as field %} - {% if not field.ignore %} - {% if not field.isEnum %} - {% if field.isLibgitType %} - Nan::Persistent {{ field.name }}; - {% elsif field.isCallbackFunction %} - CallbackWrapper {{ field.name }}; - {% elsif field.payloadFor %} - Nan::Persistent {{ field.name }}; - {% endif %} - {% endif %} + {% endif %} + {% endeach %} - static NAN_GETTER(Get{{ field.cppFunctionName }}); - static NAN_SETTER(Set{{ field.cppFunctionName }}); +private: + Configurable{{ cppClassName }}(nodegit::Context *nodegitContext); + Configurable{{ cppClassName }}() = delete; + Nan::Global promiseError; + {% each fields as field %} + {% if not field.ignore %} + {% if not field.isEnum %} + {% if field.isClassType %} + {% if field.cppClassName == 'GitOid' %} + {%-- We do not need to generate anything here --%} + {% elsif field.cppClassName == 'GitStrarray' %} + {%-- We do not need to generate anything here --%} + {% else %} + Nan::Global {{ field.jsFunctionName }}; + {% endif %} + {% elsif field.isCallbackFunction %} + CallbackWrapper {{ field.jsFunctionName }}; + {% endif %} {% endif %} - {% endeach %} + {% endif %} + {% endeach %} + }; #endif diff --git a/guides/cloning/README.md b/guides/cloning/README.md index 7a44d0cf69..8b8390f236 100644 --- a/guides/cloning/README.md +++ b/guides/cloning/README.md @@ -85,7 +85,7 @@ to passthrough the certificate check. ``` javascript cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; } + certificateCheck: function() { return 0; } } }; ``` @@ -112,7 +112,7 @@ a function to attempt opening in this case. ``` javascript var errorAndAttemptOpen = function() { - return NodeGit.Repository.open(local); + return NodeGit.Repository.open(localPath); }; ``` diff --git a/guides/cloning/gh-two-factor/README.md b/guides/cloning/gh-two-factor/README.md index 1a9190ab32..a6d24d40dd 100644 --- a/guides/cloning/gh-two-factor/README.md +++ b/guides/cloning/gh-two-factor/README.md @@ -101,7 +101,7 @@ to passthrough the certificate check. ``` javascript cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; } + certificateCheck: function() { return 0; } } }; ``` @@ -119,7 +119,7 @@ The `fetchOpts` object now looks like this: ``` javascript cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; }, + certificateCheck: function() { return 0; }, credentials: function() { return NodeGit.Cred.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic"); } @@ -149,7 +149,7 @@ a function to attempt opening in this case. ``` javascript var errorAndAttemptOpen = function() { - return NodeGit.Repository.open(local); + return NodeGit.Repository.open(localPath); }; ``` diff --git a/guides/cloning/gh-two-factor/index.js b/guides/cloning/gh-two-factor/index.js index d723e52ccf..945aac3514 100644 --- a/guides/cloning/gh-two-factor/index.js +++ b/guides/cloning/gh-two-factor/index.js @@ -22,9 +22,9 @@ var cloneOptions = {}; // with libgit2 being able to verify certificates from GitHub. cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; }, + certificateCheck: function() { return 0; }, credentials: function() { - return NodeGit.Cred.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic"); + return NodeGit.Credential.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic"); } } }; diff --git a/guides/cloning/index.js b/guides/cloning/index.js index f6b7c7a370..ec455fbd7f 100644 --- a/guides/cloning/index.js +++ b/guides/cloning/index.js @@ -18,7 +18,7 @@ var cloneOptions = {}; // with libgit2 being able to verify certificates from GitHub. cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; } + certificateCheck: function() { return 0; } } }; diff --git a/guides/cloning/ssh-with-agent/README.md b/guides/cloning/ssh-with-agent/README.md index ae14cfe390..46a72b823a 100644 --- a/guides/cloning/ssh-with-agent/README.md +++ b/guides/cloning/ssh-with-agent/README.md @@ -83,7 +83,7 @@ to passthrough the certificate check. ``` javascript cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; } + certificateCheck: function() { return 0; } } }; ``` @@ -102,7 +102,7 @@ The `fetchOpts` object now looks like this: ``` javascript cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; }, + certificateCheck: function() { return 0; }, credentials: function(url, userName) { return NodeGit.Cred.sshKeyFromAgent(userName); } @@ -137,7 +137,7 @@ a function to attempt opening in this case. ``` javascript var errorAndAttemptOpen = function() { - return NodeGit.Repository.open(local); + return NodeGit.Repository.open(localPath); }; ``` diff --git a/guides/cloning/ssh-with-agent/index.js b/guides/cloning/ssh-with-agent/index.js index f3926392c6..655f07e242 100644 --- a/guides/cloning/ssh-with-agent/index.js +++ b/guides/cloning/ssh-with-agent/index.js @@ -17,13 +17,13 @@ var cloneOptions = {}; // with libgit2 being able to verify certificates from GitHub. cloneOptions.fetchOpts = { callbacks: { - certificateCheck: function() { return 1; }, + certificateCheck: function() { return 0; }, // Credentials are passed two arguments, url and username. We forward the // `userName` argument to the `sshKeyFromAgent` function to validate // authentication. credentials: function(url, userName) { - return NodeGit.Cred.sshKeyFromAgent(userName); + return NodeGit.Credential.sshKeyFromAgent(userName); } } }; diff --git a/guides/install/from-source/README.md b/guides/install/from-source/README.md index c85e2e3faf..64bfce18b3 100644 --- a/guides/install/from-source/README.md +++ b/guides/install/from-source/README.md @@ -64,6 +64,16 @@ npm install nodegit --msvs_version=2013 # Or whatever version you've installed. ``` +### Electron and OpenSSL ### +A local version of OpenSSL is required when building for Electron. This is due to Electron using BoringSSL, as we are not able to link to it like we are OpenSSL in Node. + +`acquireOpenSSL.js` will attempt to download OpenSSL prebuilts from S3. If preferred, it can also be built locally by setting the environment variable `npm_config_openssl_bin_url=skip`. On macOS, this should Just Work(tm). On Windows, things are a little trickier. + +- We rely on the Visual Studio dev tools to be installed, specifically `vcvarsall.bat` to provide access to the tools. If this is not in the default location for VS2017, you'll need to `npm config set vcvarsall_path ` or set the environment variable `npm_config_vcvarsall_path` pointing to it. +- See [Compilation and Installation](https://wiki.openssl.org/index.php/Compilation_and_Installation#Windows) regarding required dependencies, specifically `Perl` (Strawberry Perl is known to work) and `NASM`. Make sure they're on the PATH. + +Alternatively, you can provide your own OpenSSL binaries and headers. These can either go in `vendor/openssl` (e.g. `/vendor/openssl/{lib,bin,include}` should exist) or in an external directory located by `npm config set openssl_dir ` or the environment variable `npm_config_openssl_dir`. Additionally, you can `npm config set openssl_bin_url ` or the environment variable `npm_config_openssl_bin_url` to download and extract prebuilt binaries (only supports tar.gz files). `npm config set openssl_bin_sha256 ` or the environment variable `npm_config_openssl_bin_sha256` can be set to verify the download. + ##### A note on environment variables in Windows ##### In many of the npm scripts (and examples above), things are run like `BUILD_ONLY=true npm install`. This sets the `BUILD_ONLY` environment variable @@ -76,7 +86,7 @@ See here for more details: ### Debug build: ### -In order to track down possible bugs, you will need a debug buid so you +In order to track down possible bugs, you will need a debug build so you can get a backtrace with [gdb](http://www.gnu.org/software/gdb/) or [lldb](http://lldb.llvm.org/). diff --git a/lib/README.md b/lib/README.md new file mode 100644 index 0000000000..3d12686af6 --- /dev/null +++ b/lib/README.md @@ -0,0 +1,3 @@ +## /lib + + Contains javascript extensions for the generated NodeGit modules. Any additional behavior on top of the standard libgit2 behavior will be found here. diff --git a/lib/attr.js b/lib/attr.js new file mode 100644 index 0000000000..8ecdd5eeeb --- /dev/null +++ b/lib/attr.js @@ -0,0 +1,20 @@ +var util = require("util"); +var NodeGit = require("../"); + +NodeGit.Attr.STATES = {}; +var DEPRECATED_STATES = { + UNSPECIFIED_T: "UNSPECIFIED", + TRUE_T: "TRUE", + FALSE_T: "FALSE", + VALUE_T: "STRING" +}; + +Object.keys(DEPRECATED_STATES).forEach((key) => { + const newKey = DEPRECATED_STATES[key]; + Object.defineProperty(NodeGit.Attr.STATES, key, { + get: util.deprecate( + () => NodeGit.Attr.VALUE[newKey], + `Use NodeGit.Attr.VALUE.${newKey} instead of NodeGit.Attr.STATES.${key}.` + ) + }); +}); diff --git a/lib/blame.js b/lib/blame.js deleted file mode 100644 index 77f3ad9a3e..0000000000 --- a/lib/blame.js +++ /dev/null @@ -1,18 +0,0 @@ -var NodeGit = require("../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; -var Blame = NodeGit.Blame; - -var _file = Blame.file; - -/** - * Retrieve the blame of a file - * - * @param {Repository} repo that contains the file - * @param {String} path to the file to get the blame of - * @param {BlameOptions} [options] Options for the blame - */ -Blame.file = function(repo, path, options) { - options = normalizeOptions(options, NodeGit.BlameOptions); - - return _file.call(this, repo, path, options); -}; diff --git a/lib/blob.js b/lib/blob.js index 073623fdd4..be63312485 100644 --- a/lib/blob.js +++ b/lib/blob.js @@ -1,8 +1,11 @@ +var util = require("util"); var NodeGit = require("../"); var Blob = NodeGit.Blob; var LookupWrapper = NodeGit.Utils.lookupWrapper; var TreeEntry = NodeGit.TreeEntry; +var _filteredContent = Blob.filteredContent; + /** * Retrieves the blob pointed to by the oid * @async @@ -40,3 +43,9 @@ Blob.prototype.filemode = function() { Blob.prototype.toString = function() { return this.content().toString(); }; + +Blob.filteredContent = util.deprecate( + _filteredContent, + "NodeGit.Blob.filteredContent is deprecated" + + " use NodeGit.Blob.prototype.filter instead." +); diff --git a/lib/buf.js b/lib/buf.js new file mode 100644 index 0000000000..aec6ba693d --- /dev/null +++ b/lib/buf.js @@ -0,0 +1,43 @@ +var util = require("util"); +var NodeGit = require("../"); +var Buf = NodeGit.Buf; + +var _set = Buf.prototype.set; +var _grow = Buf.prototype.grow; +var _isBinary = Buf.prototype.isBinary; +var _containsNul = Buf.prototype.containsNul; + +/** + * Sets the content of a GitBuf to a string. + * @param {string} The utf8 value to set in the buffer. + * The string will be null terminated. + */ +var _setString = function(content) { + const buf = Buffer.from(content + "\0", "utf8"); + this.set(buf, buf.length); +}; + +Buf.prototype.set = util.deprecate( + _set, + "NodeGit.Buf.prototype.set is deprecated." +); + +Buf.prototype.setString = util.deprecate( + _setString, + "NodeGit.Buf.prototype.setString is deprecated." +); + +Buf.prototype.grow = util.deprecate( + _grow, + "NodeGit.Buf.prototype.grow is deprecated." +); + +Buf.prototype.isBinary = util.deprecate( + _isBinary, + "NodeGit.Buf.prototype.isBinary is deprecated." +); + +Buf.prototype.containsNul = util.deprecate( + _containsNul, + "NodeGit.Buf.prototype.containsNul is deprecated." +); \ No newline at end of file diff --git a/lib/checkout.js b/lib/checkout.js deleted file mode 100644 index dd94b3cfb5..0000000000 --- a/lib/checkout.js +++ /dev/null @@ -1,51 +0,0 @@ -var NodeGit = require("../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; - -var Checkout = NodeGit.Checkout; -var _head = Checkout.head; -var _index = Checkout.index; -var _tree = Checkout.tree; - -/** -* Patch head checkout to automatically coerce objects. -* -* @async -* @param {Repository} repo The repo to checkout head -* @param {CheckoutOptions} [options] Options for the checkout -* @return {Void} checkout complete -*/ -Checkout.head = function(url, options) { - options = normalizeOptions(options || {}, NodeGit.CheckoutOptions); - - return _head.call(this, url, options); -}; - -/** -* Patch index checkout to automatically coerce objects. -* -* @async -* @param {Repository} repo The repo to checkout an index -* @param {Index} index The index to checkout -* @param {CheckoutOptions} [options] Options for the checkout -* @return {Void} checkout complete -*/ -Checkout.index = function(repo, index, options) { - options = normalizeOptions(options || {}, NodeGit.CheckoutOptions); - - return _index.call(this, repo, index, options); -}; - -/** -* Patch tree checkout to automatically coerce objects. -* -* @async -* @param {Repository} repo -* @param {String|Tree|Commit|Reference} treeish -* @param {CheckoutOptions} [options] -* @return {Void} checkout complete -*/ -Checkout.tree = function(repo, treeish, options) { - options = normalizeOptions(options || {}, NodeGit.CheckoutOptions); - - return _tree.call(this, repo, treeish, options); -}; diff --git a/lib/cherrypick.js b/lib/cherrypick.js deleted file mode 100644 index cf003c2a5f..0000000000 --- a/lib/cherrypick.js +++ /dev/null @@ -1,73 +0,0 @@ -var NodeGit = require("../"); -var shallowClone = NodeGit.Utils.shallowClone; -var normalizeOptions = NodeGit.Utils.normalizeOptions; - -var Cherrypick = NodeGit.Cherrypick; -var _cherrypick = Cherrypick.cherrypick; -var _commit = Cherrypick.commit; - -/** -* Cherrypick a commit and, changing the index and working directory -* -* @async -* @param {Repository} repo The repo to checkout head -* @param {Commit} commit The commit to cherrypick -* @param {CherrypickOptions} [options] Options for the cherrypick -* @return {int} 0 on success, -1 on failure -*/ -Cherrypick.cherrypick = function(repo, commit, options) { - var mergeOpts; - var checkoutOpts; - - if (options) { - options = shallowClone(options); - mergeOpts = options.mergeOpts; - checkoutOpts = options.checkoutOpts; - delete options.mergeOpts; - delete options.checkoutOpts; - } - - options = normalizeOptions(options, NodeGit.CherrypickOptions); - - if (mergeOpts) { - options.mergeOpts = - normalizeOptions(mergeOpts, NodeGit.MergeOptions); - } - - if (checkoutOpts) { - options.checkoutOpts = - normalizeOptions(checkoutOpts, NodeGit.CheckoutOptions); - } - - return _cherrypick.call(this, repo, commit, options); -}; - -/** -* Cherrypicks the given commit against "our" commit, producing an index that -* reflects the result of the cherrypick. The index is not backed by a repo. -* -* @async -* @param {Repository} repo The repo to cherrypick commits -* @param {Commit} cherrypick_commit The commit to cherrypick -* @param {Commit} our_commit The commit to revert against -* @param {int} mainline The parent of the revert commit (1 or -* 2) if it's a merge, 0 otherwise -* @param {MergeOptions} [merge_options] Merge options for the cherrypick -* @return {int} 0 on success, -1 on failure -*/ -Cherrypick.commit = function( - repo, - cherrypick_commit, - our_commit, - mainline, - merge_options) { - merge_options = normalizeOptions(merge_options, NodeGit.MergeOptions); - - return _commit.call( - this, - repo, - cherrypick_commit, - our_commit, - mainline, - merge_options); -}; diff --git a/lib/clone.js b/lib/clone.js deleted file mode 100644 index d81e1a5dac..0000000000 --- a/lib/clone.js +++ /dev/null @@ -1,47 +0,0 @@ -var NodeGit = require("../"); -var shallowClone = NodeGit.Utils.shallowClone; -var normalizeFetchOptions = NodeGit.Utils.normalizeFetchOptions; -var normalizeOptions = NodeGit.Utils.normalizeOptions; - -var Clone = NodeGit.Clone; -var _clone = Clone.clone; - -/** - * Patch repository cloning to automatically coerce objects. - * - * @async - * @param {String} url url of the repository - * @param {String} local_path local path to store repository - * @param {CloneOptions} [options] - * @return {Repository} repo - */ -Clone.clone = function(url, local_path, options) { - var fetchOpts = normalizeFetchOptions(options && options.fetchOpts); - - if (options) { - options = shallowClone(options); - delete options.fetchOpts; - } - - options = normalizeOptions(options, NodeGit.CloneOptions); - - if (options) { - options.fetchOpts = fetchOpts; - } - - // This is required to clean up after the clone to avoid file locking - // issues in Windows and potentially other issues we don't know about. - var freeRepository = function(repository) { - repository.free(); - }; - - // We want to provide a valid repository object, so reopen the repository - // after clone and cleanup. - var openRepository = function() { - return NodeGit.Repository.open(local_path); - }; - - return _clone.call(this, url, local_path, options) - .then(freeRepository) - .then(openRepository); -}; diff --git a/lib/commit.js b/lib/commit.js index 73d3f62b44..8eb561e585 100644 --- a/lib/commit.js +++ b/lib/commit.js @@ -1,9 +1,12 @@ var events = require("events"); +var fp = require("lodash/fp"); var NodeGit = require("../"); var Commit = NodeGit.Commit; var LookupWrapper = NodeGit.Utils.lookupWrapper; var _amend = Commit.prototype.amend; +var _parent = Commit.prototype.parent; + /** * Retrieves the commit pointed to by the oid * @async @@ -13,6 +16,19 @@ var _amend = Commit.prototype.amend; */ Commit.lookup = LookupWrapper(Commit); +/** + * @async + * @param {Number} n + * @return {Commit} + */ +Commit.prototype.parent = function(n) { + var repo = this.repo; + return _parent.call(this, n).then(p => { + p.repo = repo; + return p; + }); +}; + /** * Amend a commit * @async @@ -22,10 +38,10 @@ Commit.lookup = LookupWrapper(Commit); * @param {String} message_encoding * @param {String} message * @param {Tree|Oid} tree - * @param {Oid} callback + * @return {Oid} */ Commit.prototype.amend = function ( - updateRef, author, committer, message_encoding, message, tree, callback) { + updateRef, author, committer, message_encoding, message, tree) { var repo = this.repo; var _this = this; var treePromise; @@ -49,6 +65,167 @@ Commit.prototype.amend = function ( }); }; +/** + * Amend a commit with the given signature + * @async + * @param {String} updateRef + * @param {Signature} author + * @param {Signature} committer + * @param {String} messageEncoding + * @param {String} message + * @param {Tree|Oid} tree + * @param {Function} onSignature Callback to be called with string to be signed + * @return {Oid} +*/ +Commit.prototype.amendWithSignature = function( + updateRef, + author, + committer, + messageEncoding, + message, + tree, + onSignature +) { + let repo = this.repo; + let parentOids = this.parents(); + let _this = this; + let promises = []; + + if (tree instanceof NodeGit.Oid) { + promises.push(repo.getTree(tree)); + } else { + promises.push(Promise.resolve(tree)); + } + + parentOids.forEach(function (parentOid) { + promises.push(repo.getCommit(parentOid)); + }); + + let treeObject; + let parents; + let commitContent; + let commit; + let skippedSigning; + let resolvedAuthor; + let resolvedCommitter; + let resolvedMessageEncoding; + let resolvedMessage; + let resolvedTree; + + let createCommitPromise = Promise.all(promises) + .then(function(results) { + treeObject = fp.head(results); + parents = fp.tail(results); + return _this.getTree(); + }) + .then(function(commitTreeResult) { + let commitTree = commitTreeResult; + + let truthyArgs = fp.omitBy( + fp.isNil, + { + author, + committer, + messageEncoding, + message, + tree: treeObject + } + ); + + let commitFields = { + author: _this.author(), + committer: _this.committer(), + messageEncoding: _this.messageEncoding(), + message: _this.message(), + tree: commitTree + }; + + ({ + author: resolvedAuthor, + committer: resolvedCommitter, + messageEncoding: resolvedMessageEncoding, + message: resolvedMessage, + tree: resolvedTree + } = fp.assign( + commitFields, + truthyArgs + )); + + return Commit.createBuffer( + repo, + resolvedAuthor, + resolvedCommitter, + resolvedMessageEncoding, + resolvedMessage, + resolvedTree, + parents.length, + parents + ); + }) + .then(function(commitContentResult) { + commitContent = commitContentResult; + if (!commitContent.endsWith("\n")) { + commitContent += "\n"; + } + return onSignature(commitContent); + }) + .then(function({ code, field, signedData }) { + switch (code) { + case NodeGit.Error.CODE.OK: + return Commit.createWithSignature( + repo, + commitContent, + signedData, + field + ); + case NodeGit.Error.CODE.PASSTHROUGH: + skippedSigning = true; + return Commit.create( + repo, + updateRef, + resolvedAuthor, + resolvedCommitter, + resolvedMessageEncoding, + resolvedMessage, + resolvedTree, + parents.length, + parents + ); + default: { + const error = new Error( + `Commit.amendWithSignature threw with error code ${code}` + ); + error.errno = code; + throw error; + } + } + }); + + if (!updateRef) { + return createCommitPromise; + } + + return createCommitPromise + .then(function(commitOid) { + if (skippedSigning) { + return commitOid; + } + + return repo.getCommit(commitOid) + .then(function(commitResult) { + commit = commitResult; + return repo.getReference(updateRef); + }).then(function(ref) { + return ref.setTarget( + commitOid, + `commit (amend): ${commit.summary()}` + ); + }).then(function() { + return commitOid; + }); + }); +}; + /** * Retrieve the commit time as a Date object. * @return {Date} @@ -62,11 +239,10 @@ Commit.prototype.date = function() { * and its parent(s). * * @async - * @param {Function} callback * @return {Array} an array of diffs */ -Commit.prototype.getDiff = function(callback) { - return this.getDiffWithOptions(null, callback); +Commit.prototype.getDiff = function() { + return this.getDiffWithOptions(null); }; /** @@ -75,10 +251,9 @@ Commit.prototype.getDiff = function(callback) { * * @async * @param {Object} options - * @param {Function} callback * @return {Array} an array of diffs */ -Commit.prototype.getDiffWithOptions = function(options, callback) { +Commit.prototype.getDiffWithOptions = function(options) { var commit = this; return commit.getTree().then(function(thisTree) { @@ -96,13 +271,7 @@ Commit.prototype.getDiffWithOptions = function(options, callback) { return Promise.all(diffs); }); - }).then(function(diffs) { - if (typeof callback === "function") { - callback(null, diffs); - } - - return diffs; - }, callback); + }); }; /** @@ -113,16 +282,10 @@ Commit.prototype.getDiffWithOptions = function(options, callback) { * @param {String} path * @return {TreeEntry} */ -Commit.prototype.getEntry = function(path, callback) { +Commit.prototype.getEntry = function(path) { return this.getTree().then(function(tree) { - return tree.getEntry(path).then(function(entry) { - if (typeof callback === "function") { - callback(null, entry); - } - - return entry; - }); - }, callback); + return tree.getEntry(path); + }); }; /** @@ -130,17 +293,11 @@ Commit.prototype.getEntry = function(path, callback) { * * @async * @param {number} limit Optional amount of parents to return. - * @param {Function} callback * @return {Array} array of commits */ -Commit.prototype.getParents = function(limit, callback) { +Commit.prototype.getParents = function(limit) { var parents = []; - // Shift arguments. - if (typeof limit === "function") { - callback = limit; - } - // If no limit was set, default to the maximum parents. limit = typeof limit === "number" ? limit : this.parentcount(); limit = Math.min(limit, this.parentcount()); @@ -153,13 +310,24 @@ Commit.prototype.getParents = function(limit, callback) { } // Wait for all parents to complete, before returning. - return Promise.all(parents).then(function(parents) { - if (typeof callback === "function") { - callback(null, parents); - } + return Promise.all(parents); +}; - return parents; - }, callback); +/** + * @typedef extractedSignature + * @type {Object} + * @property {String} signature the signature of the commit + * @property {String} signedData the extracted signed data + */ + +/** + * Retrieve the signature and signed data for a commit. + * @param {String} field Optional field to get from the signature, + * defaults to gpgsig + * @return {extractedSignature} + */ +Commit.prototype.getSignature = function(field) { + return Commit.extractSignature(this.repo, this.id(), field); }; /** @@ -168,8 +336,8 @@ Commit.prototype.getParents = function(limit, callback) { * @async * @return {Tree} */ -Commit.prototype.getTree = function(callback) { - return this.repo.getTree(this.treeId(), callback); +Commit.prototype.getTree = function() { + return this.repo.getTree(this.treeId()); }; /** @@ -214,6 +382,21 @@ Commit.prototype.history = function() { return event; }; +/** + * Get the specified parent of the commit. + * + * @param {number} the position of the parent, starting from 0 + * @async + * @return {Commit} the parent commit at the specified position + */ +Commit.prototype.parent = function (id) { + var repository = this.repo; + return _parent.call(this, id).then(function(parent) { + parent.repo = repository; + return parent; + }); +}; + /** * Retrieve the commit's parent shas. * diff --git a/lib/config.js b/lib/config.js index 1527ede7be..37b792da85 100644 --- a/lib/config.js +++ b/lib/config.js @@ -1,8 +1,48 @@ +var util = require("util"); var NodeGit = require("../"); var Config = NodeGit.Config; +var _getBool = Config.prototype.getBool; +var _setBool = Config.prototype.setBool; + +/** + * @async + * @param {String} name The variable's name + * @return {Boolean} The variable's value + */ +Config.prototype.getBool = function(name) { + return _getBool.call(this, name) + .then(result => Boolean(result)); +}; + +/** + * @async + * @param {String} name The variable's name + * @param {Boolean} name The variable's value + * @return {Number} 0 or an error code + */ +Config.prototype.setBool = function(name, value) { + return _setBool.call(this, name, value ? 1 : 0); +}; + // Backwards compatibility. Config.prototype.getString = function() { return this.getStringBuf.apply(this, arguments); }; + +NodeGit.Enums.CVAR = {}; +var DEPRECATED_CVAR_ENUMS = [ + "FALSE", + "TRUE", + "INT32", + "STRING" +]; +DEPRECATED_CVAR_ENUMS.forEach((key) => { + Object.defineProperty(NodeGit.Enums.CVAR, key, { + get: util.deprecate( + () => Config.MAP[key], + `Use NodeGit.Config.MAP.${key} instead of NodeGit.Enums.CVAR.${key}.` + ) + }); +}); diff --git a/lib/credential.js b/lib/credential.js new file mode 100644 index 0000000000..af1a59125e --- /dev/null +++ b/lib/credential.js @@ -0,0 +1,34 @@ +var util = require("util"); +var NodeGit = require("../"); + +var Credential = NodeGit.Credential; + +var deprecatedFn = (method) => + util.deprecate( + Credential[method].bind(Credential), + `Use NodeGit.Credential.${method} instead of NodeGit.Cred.${method}` + ); + +var createCredTypeDeprecationMessage = type => + `Use NodeGit.Credential.TYPE.${type} instead of NodeGit.Cred.TYPE.${type}`; + +NodeGit.Cred = { + defaultNew: deprecatedFn("defaultNew"), + sshKeyFromAgent: deprecatedFn("sshKeyFromAgent"), + sshKeyNew: deprecatedFn("sshKeyNew"), + sshKeyMemoryNew: deprecatedFn("sshKeyMemoryNew"), + usernameNew: deprecatedFn("usernameNew"), + userpassPlaintextNew: deprecatedFn("userpassPlaintextNew"), + TYPE: Object.keys(Credential.TYPE).reduce( + (type, key) => { + Object.defineProperty(type, key, { + get: util.deprecate( + () => Credential.TYPE[key], + createCredTypeDeprecationMessage(type) + ) + }); + return type; + }, + {} + ) +}; diff --git a/lib/deprecated/structs/ApplyOptions.js b/lib/deprecated/structs/ApplyOptions.js new file mode 100644 index 0000000000..cd9f22ca07 --- /dev/null +++ b/lib/deprecated/structs/ApplyOptions.js @@ -0,0 +1,3 @@ +module.exports = function() { + this.flags = 0; +}; diff --git a/lib/deprecated/structs/BlameOptions.js b/lib/deprecated/structs/BlameOptions.js new file mode 100644 index 0000000000..8ffd415de9 --- /dev/null +++ b/lib/deprecated/structs/BlameOptions.js @@ -0,0 +1,6 @@ +module.exports = function() { + this.flags = 0; + this.minMatchCharacters = 0; + this.minLine = 0; + this.maxLine = 0; +}; diff --git a/lib/deprecated/structs/BlobFilterOptions.js b/lib/deprecated/structs/BlobFilterOptions.js new file mode 100644 index 0000000000..df9a3d762b --- /dev/null +++ b/lib/deprecated/structs/BlobFilterOptions.js @@ -0,0 +1,3 @@ +module.exports = function() { + this.flags = 1; +}; diff --git a/lib/deprecated/structs/CheckoutOptions.js b/lib/deprecated/structs/CheckoutOptions.js new file mode 100644 index 0000000000..89e28d0939 --- /dev/null +++ b/lib/deprecated/structs/CheckoutOptions.js @@ -0,0 +1,8 @@ +module.exports = function() { + this.checkoutStrategy = 1; + this.disableFilters = 0; + this.dirMode = 0; + this.fileMode = 0; + this.fileOpenFlags = 0; + this.notifyFlags = 0; +}; diff --git a/lib/deprecated/structs/CherrypickOptions.js b/lib/deprecated/structs/CherrypickOptions.js new file mode 100644 index 0000000000..fce5efa102 --- /dev/null +++ b/lib/deprecated/structs/CherrypickOptions.js @@ -0,0 +1,5 @@ +module.exports = function(NodeGit) { + this.checkoutOpts = new NodeGit.CheckoutOptions(); + this.mainline = 0; + this.mergeOpts = new NodeGit.MergeOptions(); +}; diff --git a/lib/deprecated/structs/CloneOptions.js b/lib/deprecated/structs/CloneOptions.js new file mode 100644 index 0000000000..84deb60da8 --- /dev/null +++ b/lib/deprecated/structs/CloneOptions.js @@ -0,0 +1,6 @@ +module.exports = function(NodeGit) { + this.bare = 0; + this.checkoutOpts = new NodeGit.CheckoutOptions(); + this.fetchOpts = new NodeGit.FetchOptions(); + this.local = 0; +}; diff --git a/lib/deprecated/structs/DescribeFormatOptions.js b/lib/deprecated/structs/DescribeFormatOptions.js new file mode 100644 index 0000000000..6e9d25031a --- /dev/null +++ b/lib/deprecated/structs/DescribeFormatOptions.js @@ -0,0 +1,4 @@ +module.exports = function() { + this.abbreviatedSize = 7; + this.alwaysUseLongFormat = 0; +}; diff --git a/lib/deprecated/structs/DescribeOptions.js b/lib/deprecated/structs/DescribeOptions.js new file mode 100644 index 0000000000..a4c29a2a7b --- /dev/null +++ b/lib/deprecated/structs/DescribeOptions.js @@ -0,0 +1,6 @@ +module.exports = function() { + this.describeStrategy = 0; + this.maxCandidatesTags = 10; + this.onlyFollowFirstParent = 0; + this.showCommitOidAsFallback = 0; +}; diff --git a/lib/deprecated/structs/DiffFindOptions.js b/lib/deprecated/structs/DiffFindOptions.js new file mode 100644 index 0000000000..459bc0ac16 --- /dev/null +++ b/lib/deprecated/structs/DiffFindOptions.js @@ -0,0 +1,8 @@ +module.exports = function() { + this.breakRewriteThreshold = 0; + this.copyThreshold = 0; + this.flags = 0; + this.renameFromRewriteThreshold = 0; + this.renameLimit = 0; + this.renameThreshold = 0; +}; diff --git a/lib/deprecated/structs/DiffOptions.js b/lib/deprecated/structs/DiffOptions.js new file mode 100644 index 0000000000..eeb6c5c3a1 --- /dev/null +++ b/lib/deprecated/structs/DiffOptions.js @@ -0,0 +1,8 @@ +module.exports = function() { + this.contextLines = 3; + this.flags = 0; + this.idAbbrev = 0; + this.ignoreSubmodules = -1; + this.interhunkLines = 0; + this.maxSize = 0; +}; diff --git a/lib/deprecated/structs/FetchOptions.js b/lib/deprecated/structs/FetchOptions.js new file mode 100644 index 0000000000..cd3f890dc2 --- /dev/null +++ b/lib/deprecated/structs/FetchOptions.js @@ -0,0 +1,7 @@ +module.exports = function(NodeGit) { + this.callbacks = new NodeGit.RemoteCallbacks(); + this.downloadTags = 0; + this.proxyOpts = new NodeGit.ProxyOptions(); + this.prune = 0; + this.updateFetchhead = 1; +}; diff --git a/lib/deprecated/structs/MergeFileInput.js b/lib/deprecated/structs/MergeFileInput.js new file mode 100644 index 0000000000..0b77f13830 --- /dev/null +++ b/lib/deprecated/structs/MergeFileInput.js @@ -0,0 +1,4 @@ +module.exports = function() { + this.mode = 0; + this.size = 0; +}; diff --git a/lib/deprecated/structs/MergeFileOptions.js b/lib/deprecated/structs/MergeFileOptions.js new file mode 100644 index 0000000000..fd7101514d --- /dev/null +++ b/lib/deprecated/structs/MergeFileOptions.js @@ -0,0 +1,5 @@ +module.exports = function() { + this.favor = 0; + this.flags = 0; + this.markerSize = 0; +}; diff --git a/lib/deprecated/structs/MergeOptions.js b/lib/deprecated/structs/MergeOptions.js new file mode 100644 index 0000000000..3c73243a27 --- /dev/null +++ b/lib/deprecated/structs/MergeOptions.js @@ -0,0 +1,8 @@ +module.exports = function() { + this.fileFavor = 0; + this.fileFlags = 0; + this.flags = 1; + this.recursionLimit = 0; + this.renameThreshold = 0; + this.targetLimit = 0; +}; diff --git a/lib/deprecated/structs/ProxyOptions.js b/lib/deprecated/structs/ProxyOptions.js new file mode 100644 index 0000000000..d1b3260bae --- /dev/null +++ b/lib/deprecated/structs/ProxyOptions.js @@ -0,0 +1,3 @@ +module.exports = function() { + this.type = 0; +}; diff --git a/lib/deprecated/structs/PushOptions.js b/lib/deprecated/structs/PushOptions.js new file mode 100644 index 0000000000..bab5bc14f9 --- /dev/null +++ b/lib/deprecated/structs/PushOptions.js @@ -0,0 +1,5 @@ +module.exports = function(NodeGit) { + this.callbacks = new NodeGit.RemoteCallbacks(); + this.pbParallelism = 1; + this.proxyOpts = new NodeGit.ProxyOptions(); +}; diff --git a/lib/deprecated/structs/RebaseOptions.js b/lib/deprecated/structs/RebaseOptions.js new file mode 100644 index 0000000000..414b296b5a --- /dev/null +++ b/lib/deprecated/structs/RebaseOptions.js @@ -0,0 +1,6 @@ +module.exports = function(NodeGit) { + this.checkoutOptions = new NodeGit.CheckoutOptions(); + this.inmemory = 0; + this.mergeOptions = new NodeGit.MergeOptions(); + this.quiet = 0; +}; diff --git a/lib/deprecated/structs/RemoteCreateOptions.js b/lib/deprecated/structs/RemoteCreateOptions.js new file mode 100644 index 0000000000..cd9f22ca07 --- /dev/null +++ b/lib/deprecated/structs/RemoteCreateOptions.js @@ -0,0 +1,3 @@ +module.exports = function() { + this.flags = 0; +}; diff --git a/lib/deprecated/structs/RepositoryInitOptions.js b/lib/deprecated/structs/RepositoryInitOptions.js new file mode 100644 index 0000000000..39657b17ea --- /dev/null +++ b/lib/deprecated/structs/RepositoryInitOptions.js @@ -0,0 +1,4 @@ +module.exports = function() { + this.flags = 0; + this.mode = 0; +}; diff --git a/lib/deprecated/structs/RevertOptions.js b/lib/deprecated/structs/RevertOptions.js new file mode 100644 index 0000000000..fce5efa102 --- /dev/null +++ b/lib/deprecated/structs/RevertOptions.js @@ -0,0 +1,5 @@ +module.exports = function(NodeGit) { + this.checkoutOpts = new NodeGit.CheckoutOptions(); + this.mainline = 0; + this.mergeOpts = new NodeGit.MergeOptions(); +}; diff --git a/lib/deprecated/structs/StashApplyOptions.js b/lib/deprecated/structs/StashApplyOptions.js new file mode 100644 index 0000000000..a7a9fcc839 --- /dev/null +++ b/lib/deprecated/structs/StashApplyOptions.js @@ -0,0 +1,4 @@ +module.exports = function(NodeGit) { + this.checkoutOptions = new NodeGit.CheckoutOptions(); + this.flags = 0; +}; diff --git a/lib/deprecated/structs/StatusOptions.js b/lib/deprecated/structs/StatusOptions.js new file mode 100644 index 0000000000..d7c35c0f4d --- /dev/null +++ b/lib/deprecated/structs/StatusOptions.js @@ -0,0 +1,4 @@ +module.exports = function() { + this.flags = 0; + this.show = 0; +}; diff --git a/lib/deprecated/structs/SubmoduleUpdateOptions.js b/lib/deprecated/structs/SubmoduleUpdateOptions.js new file mode 100644 index 0000000000..8dad87f119 --- /dev/null +++ b/lib/deprecated/structs/SubmoduleUpdateOptions.js @@ -0,0 +1,5 @@ +module.exports = function(NodeGit) { + this.allowFetch = 1; + this.checkoutOpts = new NodeGit.CheckoutOptions(); + this.fetchOpts = new NodeGit.FetchOptions(); +}; diff --git a/lib/diff.js b/lib/diff.js index b393595f8e..2ae41a62b6 100644 --- a/lib/diff.js +++ b/lib/diff.js @@ -1,16 +1,8 @@ var NodeGit = require("../"); var Diff = NodeGit.Diff; -var normalizeOptions = NodeGit.Utils.normalizeOptions; var Patch = NodeGit.Patch; var _blobToBuffer = Diff.blobToBuffer; -var _indexToWorkdir = Diff.indexToWorkdir; -var _treeToIndex = Diff.treeToIndex; -var _treeToTree = Diff.treeToTree; -var _treeToWorkdir = Diff.treeToWorkdir; -var _treeToWorkdirWithIndex = Diff.treeToWorkdirWithIndex; - -var _findSimilar = Diff.prototype.findSimilar; /** * Directly run a diff between a blob and a buffer. @@ -48,8 +40,6 @@ Diff.blobToBuffer= function( bufferLength = !buffer ? 0 : Buffer.byteLength(buffer, "utf8"); } - opts = normalizeOptions(opts, NodeGit.DiffOptions); - return _blobToBuffer.call( this, old_blob, @@ -65,42 +55,6 @@ Diff.blobToBuffer= function( null); }; -// Override Diff.indexToWorkdir to normalize opts -Diff.indexToWorkdir = function(repo, index, opts) { - opts = normalizeOptions(opts, NodeGit.DiffOptions); - return _indexToWorkdir(repo, index, opts); -}; - -// Override Diff.treeToIndex to normalize opts -Diff.treeToIndex = function(repo, tree, index, opts) { - opts = normalizeOptions(opts, NodeGit.DiffOptions); - return _treeToIndex(repo, tree, index, opts); -}; - -// Override Diff.treeToTree to normalize opts -Diff.treeToTree = function(repo, from_tree, to_tree, opts) { - opts = normalizeOptions(opts, NodeGit.DiffOptions); - return _treeToTree(repo, from_tree, to_tree, opts); -}; - -// Override Diff.treeToWorkdir to normalize opts -Diff.treeToWorkdir = function(repo, tree, opts) { - opts = normalizeOptions(opts, NodeGit.DiffOptions); - return _treeToWorkdir(repo, tree, opts); -}; - -// Override Diff.treeToWorkdir to normalize opts -Diff.treeToWorkdirWithIndex = function(repo, tree, opts) { - opts = normalizeOptions(opts, NodeGit.DiffOptions); - return _treeToWorkdirWithIndex(repo, tree, opts); -}; - -// Override Diff.findSimilar to normalize opts -Diff.prototype.findSimilar = function(opts) { - opts = normalizeOptions(opts, NodeGit.DiffFindOptions); - return _findSimilar.call(this, opts); -}; - /** * Retrieve patches in this difflist * @@ -108,6 +62,6 @@ Diff.prototype.findSimilar = function(opts) { * @return {Array} a promise that resolves to an array of * ConvenientPatches */ -Diff.prototype.patches = function() { - return Patch.convenientFromDiff(this); +Diff.prototype.patches = function(idxs) { + return Patch.convenientFromDiff(this, idxs); }; diff --git a/lib/diff_line.js b/lib/diff_line.js index 83e4344013..f856f07c7d 100644 --- a/lib/diff_line.js +++ b/lib/diff_line.js @@ -13,7 +13,7 @@ DiffLine.prototype.content = function() { } if (!this._cache.content) { - this._cache.content = new Buffer(this.rawContent()) + this._cache.content = Buffer.from(this.rawContent()) .slice(0, this.contentLen()) .toString("utf8"); } diff --git a/lib/error.js b/lib/error.js new file mode 100644 index 0000000000..819299681c --- /dev/null +++ b/lib/error.js @@ -0,0 +1,17 @@ +var util = require("util"); +var NodeGit = require("../"); + +// Deprecated ----------------------------------------------------------------- + +// In 0.28.0 git_error was majorly refactored to have better naming in libgit2 +// We will continue to support the old enum entries but with a deprecation +// warning as they will go away soon. +Object.keys(NodeGit.Error.CODE).forEach((key) => { + Object.defineProperty(NodeGit.Error.CODE, `GITERR_${key}`, { + get: util.deprecate( + () => NodeGit.Error.CODE[key], + `Use NodeGit.Error.CODE.${key} instead of ` + + `NodeGit.Error.CODE.GETERR_${key}.` + ) + }); +}); diff --git a/lib/filter_registry.js b/lib/filter_registry.js index 76dfba5733..cfa17415e0 100644 --- a/lib/filter_registry.js +++ b/lib/filter_registry.js @@ -1,42 +1,22 @@ var NodeGit = require("../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; var FilterRegistry = NodeGit.FilterRegistry; var _register = FilterRegistry.register; -var _unregister = FilterRegistry.unregister; // register should add filter by name to dict and return // Override FilterRegistry.register to normalize Filter -FilterRegistry.register = function(name, filter, priority, callback) { +FilterRegistry.register = function(name, filter, priority) { // setting default value of attributes if (filter.attributes === undefined) { filter.attributes = ""; } - filter = normalizeOptions(filter, NodeGit.Filter); - if (!filter.check || !filter.apply) { - return callback(new Error( + return Promise.reject(new Error( "ERROR: please provide check and apply callbacks for filter" )); } - return _register(name, filter, priority) - .then(function(result) { - if (typeof callback === "function") { - callback(null, result); - } - return result; - }, callback); -}; - -FilterRegistry.unregister = function(name, callback) { - return _unregister(name) - .then(function(result) { - if (typeof callback === "function") { - callback(null, result); - } - return result; - }, callback); + return _register(name, filter, priority); }; diff --git a/lib/graph.js b/lib/graph.js new file mode 100644 index 0000000000..7371410076 --- /dev/null +++ b/lib/graph.js @@ -0,0 +1,15 @@ +var NodeGit = require("../"); + +var Graph = NodeGit.Graph; + +var _reachableFromAny = Graph.reachableFromAny; + +/** + * Determine if a commit is reachable from any of a list of commits by following parent edges. + * @param {repository} the repository where the commits exist + * @param {commit} a previously loaded commit + * @param {descendant_array} oids of the commits + */ +Graph.reachableFromAny = function(repository, commit, descendant_array) { + return _reachableFromAny(repository, commit, descendant_array, descendant_array.length); +}; diff --git a/lib/index.js b/lib/index.js index cb87784d3c..ad37cea782 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,3 +1,4 @@ +var util = require("util"); var NodeGit = require("../"); var Index = NodeGit.Index; @@ -32,3 +33,71 @@ Index.prototype.removeAll = function(pathspec, matchedCallback) { Index.prototype.updateAll = function(pathspec, matchedCallback) { return _updateAll.call(this, pathspec || "*", matchedCallback, null); }; + +// Deprecated ----------------------------------------------------------------- + +NodeGit.Index.CAP = {}; +Object.keys(NodeGit.Index.CAPABILITY).forEach((key) => { + Object.defineProperty(NodeGit.Index.CAP, key, { + get: util.deprecate( + () => NodeGit.Index.CAPABILITY[key], + `Use NodeGit.Index.CAPABILITY.${key} instead of ` + + `NodeGit.Index.CAP.${key}.` + ) + }); +}); + +NodeGit.Enums.INDXENTRY_FLAG = {}; +Object.defineProperty(NodeGit.Enums.INDXENTRY_FLAG, "IDXENTRY_EXTENDED", { + get: util.deprecate( + () => NodeGit.Index.ENTRY_FLAG.ENTRY_EXTENDED, + "Use NodeGit.Index.ENTRY_FLAG.ENTRY_EXTENDED instead of " + + "NodeGit.Enums.INDXENTRY_FLAG.IDXENTRY_EXTENDED." + ) +}); +Object.defineProperty(NodeGit.Enums.INDXENTRY_FLAG, "IDXENTRY_VALID", { + get: util.deprecate( + () => NodeGit.Index.ENTRY_FLAG.ENTRY_VALID, + "Use NodeGit.Index.ENTRY_FLAG.ENTRY_VALID instead of " + + "NodeGit.Enums.INDXENTRY_FLAG.IDXENTRY_VALID." + ) +}); + +NodeGit.Enums.IDXENTRY_EXTENDED_FLAG = {}; +var EXTENDED_FLAGS_MAP = { + IDXENTRY_INTENT_TO_ADD: "ENTRY_INTENT_TO_ADD", + IDXENTRY_SKIP_WORKTREE: "ENTRY_SKIP_WORKTREE", + S: "S", + IDXENTRY_UPTODATE: "ENTRY_UPTODATE" +}; +Object.keys(EXTENDED_FLAGS_MAP).forEach((key) => { + const newKey = EXTENDED_FLAGS_MAP[key]; + Object.defineProperty(NodeGit.Enums.IDXENTRY_EXTENDED_FLAG, key, { + get: util.deprecate( + () => NodeGit.Index.ENTRY_EXTENDED_FLAG[newKey], + `Use NodeGit.Index.ENTRY_EXTENDED_FLAG.${newKey} instead of ` + + `NodeGit.Enums.IDXENTRY_EXTENDED_FLAG.${key}.` + ) + }); +}); + +var DEPRECATED_EXTENDED_FLAGS = { + IDXENTRY_EXTENDED2: 32768, + IDXENTRY_UPDATE: 1, + IDXENTRY_REMOVE: 2, + IDXENTRY_ADDED: 8, + IDXENTRY_HASHED: 16, + IDXENTRY_UNHASHED: 32, + IDXENTRY_WT_REMOVE: 64, + IDXENTRY_CONFLICTED: 128, + IDXENTRY_UNPACKED: 256, + IDXENTRY_NEW_SKIP_WORKTREE: 512, +}; +Object.keys(DEPRECATED_EXTENDED_FLAGS).forEach((key) => { + Object.defineProperty(NodeGit.Enums.IDXENTRY_EXTENDED_FLAG, key, { + get: util.deprecate( + () => DEPRECATED_EXTENDED_FLAGS[key], + "LibGit2 has removed this flag for public usage." + ) + }); +}); diff --git a/lib/merge.js b/lib/merge.js index e9b9b5c18b..549bbad919 100644 --- a/lib/merge.js +++ b/lib/merge.js @@ -1,5 +1,4 @@ var NodeGit = require("../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; var Merge = NodeGit.Merge; var _commits = Merge.commits; @@ -15,8 +14,6 @@ var _merge = Merge.merge; * @param {MergeOptions} [options] The merge tree options (null for default) */ Merge.commits = function(repo, ourCommit, theirCommit, options) { - options = normalizeOptions(options, NodeGit.MergeOptions); - return Promise.all([ repo.getCommit(ourCommit), repo.getCommit(theirCommit) @@ -35,9 +32,6 @@ Merge.commits = function(repo, ourCommit, theirCommit, options) { * (null for default) */ Merge.merge = function(repo, theirHead, mergeOpts, checkoutOpts) { - mergeOpts = normalizeOptions(mergeOpts || {}, NodeGit.MergeOptions); - checkoutOpts = normalizeOptions(checkoutOpts || {}, NodeGit.CheckoutOptions); - // Even though git_merge takes an array of annotated_commits, it expects // exactly one to have been passed in or it will throw an error... ¯\_(ツ)_/¯ var theirHeads = [theirHead]; diff --git a/lib/object.js b/lib/object.js index 85917987a3..680aebd121 100644 --- a/lib/object.js +++ b/lib/object.js @@ -1,3 +1,4 @@ +var util = require("util"); var NodeGit = require("../"); var Obj = NodeGit.Object; @@ -33,3 +34,12 @@ Obj.prototype.isTag = function() { Obj.prototype.isTree = function() { return this.type() == Obj.TYPE.TREE; }; + +// Deprecated ----------------------------------------------------------------- + +Object.defineProperty(Obj.TYPE, "BAD", { + get: util.deprecate( + () => Obj.TYPE.INVALID, + "Use NodeGit.Object.TYPE.INVALID instead of NodeGit.Object.TYPE.BAD." + ) +}); diff --git a/lib/odb.js b/lib/odb.js deleted file mode 100644 index 8bbd15a623..0000000000 --- a/lib/odb.js +++ /dev/null @@ -1,15 +0,0 @@ -var NodeGit = require("../"); - -var Odb = NodeGit.Odb; - -var _read = Odb.prototype.read; - -Odb.prototype.read = function(oid, callback) { - return _read.call(this, oid).then(function(odbObject) { - if (typeof callback === "function") { - callback(null, odbObject); - } - - return odbObject; - }, callback); -}; diff --git a/lib/rebase.js b/lib/rebase.js index 28882ea6c5..821d470ddd 100644 --- a/lib/rebase.js +++ b/lib/rebase.js @@ -1,12 +1,52 @@ var NodeGit = require("../"); var Rebase = NodeGit.Rebase; -var normalizeOptions = NodeGit.Utils.normalizeOptions; -var shallowClone = NodeGit.Utils.shallowClone; var _init = Rebase.init; var _open = Rebase.open; -var _abort = Rebase.prototype.abort; -var _commit = Rebase.prototype.commit; + +function defaultRebaseOptions(repository, options, checkoutStrategy) { + if (options) { + // Ensure we don't modify the passed-in options object. + // This could lead to us recursing commitCreateCb if the same + // options object is later re-used. + options = Object.assign({}, options); + + if (options.signingCb && !options.commitCreateCb) { + console.warn("signingCb is deperecated, use commitCreateCb instead."); + + let signingCb = options.signingCb; + options.commitCreateCb = function ( + author, + committer, + message_encoding, + message, + tree, + parent_count, + parents + ) { + return repository.createCommitWithSignature( + null, + author, + committer, + message, + tree, + parents, + signingCb).then((oid) => { + return oid; + }); + }; + } + } else if (checkoutStrategy) { + options = { + checkoutOptions: { + checkoutStrategy: checkoutStrategy + } + }; + } + + return options; +} + /** * Initializes a rebase * @async @@ -19,54 +59,14 @@ var _commit = Rebase.prototype.commit; * onto the given upstream * @param {RebaseOptions} options Options to specify how rebase is performed, * or NULL - * @param {Function} callback * @return {Remote} */ - -function defaultRebaseOptions(options, checkoutStrategy) { - var checkoutOptions; - var mergeOptions; - - if (options) { - options = shallowClone(options); - checkoutOptions = options.checkoutOptions; - mergeOptions = options.mergeOptions; - delete options.checkoutOptions; - delete options.mergeOptions; - - options = normalizeOptions(options, NodeGit.RebaseOptions); - } else { - options = normalizeOptions({}, NodeGit.RebaseOptions); - if (checkoutStrategy) { - checkoutOptions = { - checkoutStrategy: checkoutStrategy - }; - } - } - - if (checkoutOptions) { - options.checkoutOptions = normalizeOptions( - checkoutOptions, - NodeGit.CheckoutOptions - ); - } - - if (mergeOptions) { - options.mergeOptions = normalizeOptions( - mergeOptions, - NodeGit.MergeOptions - ); - } - - return options; -} - Rebase.init = function(repository, branch, upstream, onto, options) { - options = defaultRebaseOptions( + return _init(repository, branch, upstream, onto, defaultRebaseOptions( + repository, options, NodeGit.Checkout.STRATEGY.FORCE - ); - return _init(repository, branch, upstream, onto, options); + )); }; /** @@ -75,22 +75,12 @@ Rebase.init = function(repository, branch, upstream, onto, options) { * @async * @param {Repository} repo The repository that has a rebase in-progress * @param {RebaseOptions} options Options to specify how rebase is performed - * @param {Function} callback * @return {Remote} */ Rebase.open = function(repository, options) { - options = defaultRebaseOptions( + return _open(repository, defaultRebaseOptions( + repository, options, NodeGit.Checkout.STRATEGY.SAFE - ); - return _open(repository, options); -}; - -Rebase.prototype.commit = function(author, committer, encoding, message) { - return _commit.call(this, author, committer, encoding, message); -}; - -Rebase.prototype.abort = function() { - return _abort.call(this); + )); }; - diff --git a/lib/reference.js b/lib/reference.js index 8cfdded6c1..af3e006216 100644 --- a/lib/reference.js +++ b/lib/reference.js @@ -1,3 +1,4 @@ +var util = require("util"); var NodeGit = require("../"); var LookupWrapper = NodeGit.Utils.lookupWrapper; @@ -29,12 +30,12 @@ Reference.lookup = LookupWrapper(Reference); * @return {Boolean} */ Reference.prototype.isConcrete = function() { - return this.type() == Reference.TYPE.OID; + return this.type() == Reference.TYPE.DIRECT; }; /** * Returns if the ref is pointed at by HEAD - * @return {bool} + * @return {Boolean} */ Reference.prototype.isHead = function() { return Branch.isHead(this); @@ -63,3 +64,150 @@ Reference.prototype.isValid = function() { Reference.prototype.toString = function() { return this.name(); }; + +const getTerminal = (repo, refName, depth = 10, prevRef = null) => { + if (depth <= 0) { + return Promise.resolve({ + error: NodeGit.Error.CODE.ENOTFOUND, + out: prevRef + }); + } + + return NodeGit.Reference.lookup(repo, refName) + .then((ref) => { + if (ref.type() === NodeGit.Reference.TYPE.DIRECT) { + return { + error: NodeGit.Error.CODE.OK, + out: ref + }; + } else { + return getTerminal(repo, ref.symbolicTarget(), depth - 1, ref) + .then(({ error, out }) => { + if (error === NodeGit.Error.CODE.ENOTFOUND && !out) { + return { error, out: ref }; + } else { + return { error, out }; + } + }); + } + }) + .catch((error) => { + return { + error: error.errno, + out: null + }; + }); +}; + +const getSignatureForReflog = (repo) => { + const { email, name } = repo.ident(); + if (email && name) { + return Promise.resolve(NodeGit.Signature.now(name, email)); + } + + return NodeGit.Signature.default(repo) + .catch(() => NodeGit.Signature.now("unknown", "unknown")); +}; + +/** + * Given a reference name, follows symbolic links and updates the direct + * reference to point to a given OID. Updates the reflog with a given message. + * + * @async + * @param {Repository} repo The repo where the reference and objects live + * @param {String} refName The reference name to update + * @param {Oid} oid The target OID that the reference will point to + * @param {String} logMessage The reflog message to be writted + * @param {Signature} signature Optional signature to use for the reflog entry + */ +Reference.updateTerminal = function ( + repo, + refName, + oid, + logMessage, + signature +) { + let signatureToUse; + let promiseChain = Promise.resolve(); + + if (!signature) { + promiseChain = promiseChain + .then(() => getSignatureForReflog(repo)) + .then((sig) => { + signatureToUse = sig; + return Promise.resolve(); + }); + } else { + signatureToUse = signature; + } + + return promiseChain + .then(() => getTerminal(repo, refName)) + .then(({ error, out }) => { + if (error === NodeGit.Error.CODE.ENOTFOUND && out) { + return NodeGit.Reference.create( + repo, + out.symbolicTarget(), + oid, + 0, + logMessage + ); + } else if (error === NodeGit.Error.CODE.ENOTFOUND) { + return NodeGit.Reference.create( + repo, + refName, + oid, + 0, + logMessage + ); + } else { + return NodeGit.Reference.createMatching( + repo, + out.name(), + oid, + 1, + out.target(), + logMessage + ); + } + }) + .then(() => NodeGit.Reflog.read(repo, refName)) + .then((reflog) => { + // Janky, but works. Ideally, we would want to generate the correct reflog + // entry in the first place, rather than drop the most recent entry and + // write the correct one. + // NOTE: There is a theoretical race condition that could happen here. + // We may want to consider some kind of transactional logic to make sure + // that the reflog on disk isn't modified before we can write back. + reflog.drop(0, 1); + reflog.append(oid, signatureToUse, logMessage); + return reflog.write(); + }); +}; + +// Deprecated ----------------------------------------------------------------- + +Object.defineProperty(NodeGit.Reference.TYPE, "OID", { + get: util.deprecate( + () => NodeGit.Reference.TYPE.DIRECT, + "Use NodeGit.Reference.TYPE.DIRECT instead of NodeGit.Reference.TYPE.OID." + ) +}); + +Object.defineProperty(NodeGit.Reference.TYPE, "LISTALL", { + get: util.deprecate( + () => NodeGit.Reference.TYPE.ALL, + "Use NodeGit.Reference.TYPE.ALL instead of NodeGit.Reference.TYPE.LISTALL." + ) +}); + +NodeGit.Reference.NORMALIZE = {}; +Object.keys(NodeGit.Reference.FORMAT).forEach((key) => { + Object.defineProperty(NodeGit.Reference.NORMALIZE, `REF_FORMAT_${key}`, { + get: util.deprecate( + () => NodeGit.Reference.FORMAT[key], + `Use NodeGit.Reference.FORMAT.${key} instead of ` + + `NodeGit.Reference.NORMALIZE.REF_FORMAT_${key}.` + ) + }); +}); diff --git a/lib/remote.js b/lib/remote.js index b7c8979577..c0483ca87a 100644 --- a/lib/remote.js +++ b/lib/remote.js @@ -1,15 +1,8 @@ +var util = require("util"); var NodeGit = require("../"); -var normalizeFetchOptions = NodeGit.Utils.normalizeFetchOptions; -var normalizeOptions = NodeGit.Utils.normalizeOptions; var lookupWrapper = NodeGit.Utils.lookupWrapper; -var shallowClone = NodeGit.Utils.shallowClone; var Remote = NodeGit.Remote; -var _connect = Remote.prototype.connect; -var _download = Remote.prototype.download; -var _fetch = Remote.prototype.fetch; -var _push = Remote.prototype.push; -var _upload = Remote.prototype.upload; /** * Retrieves the remote by name @@ -21,97 +14,6 @@ var _upload = Remote.prototype.upload; */ Remote.lookup = lookupWrapper(Remote); -/** - * Connects to a remote - * - * @async - * @param {Enums.DIRECTION} direction The direction for the connection - * @param {RemoteCallbacks} callbacks The callback functions for the connection - * @param {ProxyOptions} proxyOpts Proxy settings - * @param {Array} customHeaders extra HTTP headers to use - * @param {Function} callback - * @return {Number} error code - */ -Remote.prototype.connect = function( - direction, - callbacks, - proxyOpts, - customHeaders -) { - callbacks = normalizeOptions(callbacks || {}, NodeGit.RemoteCallbacks); - proxyOpts = normalizeOptions(proxyOpts || {}, NodeGit.ProxyOptions); - customHeaders = customHeaders || []; - - return _connect.call(this, direction, callbacks, proxyOpts, customHeaders); -}; - -/** - * Connects to a remote - * - * @async - * @param {Array} refSpecs The ref specs that should be pushed - * @param {FetchOptions} opts The fetch options for download, contains callbacks - * @param {Function} callback - * @return {Number} error code - */ -Remote.prototype.download = function(refspecs, opts) { - return _download - .call(this, refspecs, normalizeFetchOptions(opts)); -}; - -/** - * Connects to a remote - * - * @async - * @param {Array} refSpecs The ref specs that should be pushed - * @param {FetchOptions} opts The fetch options for download, contains callbacks - * @param {String} message The message to use for the update reflog messages - * @param {Function} callback - * @return {Number} error code - */ -Remote.prototype.fetch = function(refspecs, opts, reflog_message) { - return _fetch - .call(this, refspecs, normalizeFetchOptions(opts), reflog_message); -}; - -/** - * Pushes to a remote - * - * @async - * @param {Array} refSpecs The ref specs that should be pushed - * @param {PushOptions} options Options for the checkout - * @param {Function} callback - * @return {Number} error code - */ -Remote.prototype.push = function(refSpecs, opts) { - var callbacks; - var proxyOpts; - - if (opts) { - opts = shallowClone(opts); - callbacks = opts.callbacks; - proxyOpts = opts.proxyOpts; - delete opts.callbacks; - delete opts.proxyOpts; - } else { - opts = {}; - } - - opts = normalizeOptions(opts, NodeGit.PushOptions); - - if (callbacks) { - opts.callbacks = - normalizeOptions(callbacks, NodeGit.RemoteCallbacks); - } - - if (proxyOpts) { - opts.proxyOpts = - normalizeOptions(proxyOpts, NodeGit.ProxyOptions); - } - - return _push.call(this, refSpecs, opts); -}; - /** * Lists advertised references from a remote. You must connect to the remote * before using referenceList. @@ -124,55 +26,20 @@ Remote.prototype.push = function(refSpecs, opts) { */ Remote.prototype.referenceList = Remote.prototype.referenceList; -/** - * Connects to a remote - * - * @async - * @param {Array} refSpecs The ref specs that should be pushed - * @param {FetchOptions} opts The fetch options for download, contains callbacks - * @param {String} message The message to use for the update reflog messages - * @param {Function} callback - * @return {Number} error code - */ -Remote.prototype.fetch = function(refspecs, opts, reflog_message) { - return _fetch - .call(this, refspecs, normalizeFetchOptions(opts), reflog_message); +NodeGit.Remote.COMPLETION_TYPE = {}; +var DEPRECATED_STATES = { + COMPLETION_DOWNLOAD: "DOWNLOAD", + COMPLETION_INDEXING: "INDEXING", + COMPLETION_ERROR: "ERROR" }; -/** - * Pushes to a remote - * - * @async - * @param {Array} refSpecs The ref specs that should be pushed - * @param {PushOptions} options Options for the checkout - * @param {Function} callback - * @return {Number} error code - */ -Remote.prototype.upload = function(refSpecs, opts) { - var callbacks; - var proxyOpts; - - if (opts) { - opts = shallowClone(opts); - callbacks = opts.callbacks; - proxyOpts = opts.proxyOpts; - delete opts.callbacks; - delete opts.proxyOpts; - } else { - opts = {}; - } - - opts = normalizeOptions(opts, NodeGit.PushOptions); - - if (callbacks) { - opts.callbacks = - normalizeOptions(callbacks, NodeGit.RemoteCallbacks); - } - - if (proxyOpts) { - opts.proxyOpts = - normalizeOptions(proxyOpts, NodeGit.ProxyOptions); - } - - return _upload.call(this, refSpecs, opts); -}; +Object.keys(DEPRECATED_STATES).forEach((key) => { + const newKey = DEPRECATED_STATES[key]; + Object.defineProperty(NodeGit.Remote.COMPLETION_TYPE, key, { + get: util.deprecate( + () => NodeGit.Remote.COMPLETION[newKey], + `Use NodeGit.Remote.COMPLETION.${newKey} instead of ` + + `NodeGit.Remote.COMPLETION_TYPE.${key}.` + ) + }); +}); diff --git a/lib/repository.js b/lib/repository.js index 33adcc4987..64d566dcdc 100644 --- a/lib/repository.js +++ b/lib/repository.js @@ -1,13 +1,13 @@ -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var fp = require("lodash/fp"); var NodeGit = require("../"); var Blob = NodeGit.Blob; var Checkout = NodeGit.Checkout; var Commit = NodeGit.Commit; -var normalizeOptions = NodeGit.Utils.normalizeOptions; var shallowClone = NodeGit.Utils.shallowClone; var path = require("path"); +var Filter = NodeGit.Filter; +var FilterList = NodeGit.FilterList; var Reference = NodeGit.Reference; var Remote = NodeGit.Remote; var Repository = NodeGit.Repository; @@ -21,7 +21,6 @@ var Tree = NodeGit.Tree; var TreeBuilder = NodeGit.Treebuilder; var _discover = Repository.discover; -var _initExt = Repository.initExt; var _fetchheadForeach = Repository.prototype.fetchheadForeach; var _mergeheadForeach = Repository.prototype.mergeheadForeach; @@ -37,7 +36,6 @@ function applySelectedLinesToTarget var oldIndex = 0; var linesPromises = []; - // split the original file into lines var oldLines = originalContent.toString().split("\n"); // if no selected lines were sent, return the original content @@ -121,6 +119,7 @@ function applySelectedLinesToTarget } } } + return newContent; }); } @@ -155,7 +154,7 @@ function getPathHunks(repo, index, filePath, isStaged, additionalDiffOptions) { if (!(status & NodeGit.Status.STATUS.WT_MODIFIED) && !(status & NodeGit.Status.STATUS.INDEX_MODIFIED)) { return Promise.reject - ("Selected staging is only available on modified files."); + ("Selected staging is only available on modified files."); } return diff.patches(); }); @@ -173,6 +172,22 @@ function getPathHunks(repo, index, filePath, isStaged, additionalDiffOptions) { }); } +function getReflogMessageForCommit(commit) { + var parentCount = commit.parentcount(); + var summary = commit.summary(); + var commitType; + + if (parentCount >= 2) { + commitType = " (merge)"; + } else if (parentCount == 0) { + commitType = " (initial)"; + } else { + commitType = ""; + } + + return `commit${commitType}: ${summary}`; +} + /** * Goes through a rebase's rebase operations and commits them if there are * no merge conflicts @@ -202,12 +217,21 @@ function performRebase( ) { var beforeNextFnResult; - function readRebaseMetadataFile(fileName) { + /* In the case of FF merges and a beforeFinishFn, this will fail + * when looking for 'rewritten' so we need to handle that case. + */ + function readRebaseMetadataFile(fileName, continueOnError) { return fse.readFile( path.join(repository.path(), "rebase-merge", fileName), { encoding: "utf8" } ) - .then(fp.trim); + .then(fp.trim) + .catch(function(err) { + if (continueOnError) { + return null; + } + throw err; + }); } function calcHeadName(input) { @@ -238,9 +262,12 @@ function performRebase( }) .catch(function(error) { if (error && error.errno === NodeGit.Error.CODE.ITEROVER) { - const calcRewritten = fp.flow([ - fp.split("\n"), - fp.map(fp.split(" ")) + const calcRewritten = fp.cond([ + [fp.isEmpty, fp.constant(null)], + [fp.stubTrue, fp.flow([ + fp.split("\n"), + fp.map(fp.split(" ")) + ])] ]); const beforeFinishFnPromise = !beforeFinishFn ? @@ -250,7 +277,7 @@ function performRebase( readRebaseMetadataFile("onto"), readRebaseMetadataFile("head-name").then(calcHeadName), readRebaseMetadataFile("orig-head"), - readRebaseMetadataFile("rewritten").then(calcRewritten) + readRebaseMetadataFile("rewritten", true).then(calcRewritten) ]) .then(function([ ontoName, @@ -290,7 +317,7 @@ function performRebase( } /** - * Creates a branch with the passed in name pointing to the commit + * Look for a git repository, returning its path. * * @async * @param {String} startPath The base path where the lookup starts. @@ -302,62 +329,27 @@ function performRebase( are hit. This may be set to null * @return {String} Path of the git repository */ -Repository.discover = function(startPath, acrossFs, ceilingDirs, callback) { +Repository.discover = function(startPath, acrossFs, ceilingDirs) { return _discover(startPath, acrossFs, ceilingDirs) .then(function(foundPath) { - foundPath = path.resolve(foundPath); - if (typeof callback === "function") { - callback(null, foundPath); - } - return foundPath; - }, callback); -}; - -// Override Repository.initExt to normalize initoptions -Repository.initExt = function(repo_path, opts) { - opts = normalizeOptions(opts, NodeGit.RepositoryInitOptions); - return _initExt(repo_path, opts); + return path.resolve(foundPath); + }); }; -Repository.getReferences = function(repo, type, refNamesOnly, callback) { - return Reference.list(repo).then(function(refList) { - var refFilterPromises = []; - var filteredRefs = []; - - refList.forEach(function(refName) { - refFilterPromises.push(Reference.lookup(repo, refName) - .then(function(ref) { - if (type == Reference.TYPE.LISTALL || ref.type() == type) { - if (refNamesOnly) { - filteredRefs.push(refName); - return; - } - - if (ref.isSymbolic()) { - return ref.resolve().then(function(resolvedRef) { - resolvedRef.repo = repo; - - filteredRefs.push(resolvedRef); - }) - .catch(function() { - // If we can't resolve the ref then just ignore it. - }); - } - else { - filteredRefs.push(ref); - } - } - }) - ); +Repository.getReferences = function(repo, type, refNamesOnly) { + return repo.getReferences().then(function(refList) { + var filteredRefList = refList.filter(function(reference) { + return type === Reference.TYPE.ALL || reference.type( ) === type; }); - return Promise.all(refFilterPromises).then(function() { - if (typeof callback === "function") { - callback(null, filteredRefs); - } - return filteredRefs; - }, callback); + if (refNamesOnly) { + return filteredRefList.map(function(reference) { + return reference.name(); + }); + } + + return filteredRefList; }); }; @@ -426,38 +418,56 @@ Repository.prototype.checkoutRef = function(reference, opts) { * promise, finish() will be called when the * promise resolves. This callback will be * provided a detailed overview of the rebase + * @param {RebaseOptions} rebaseOptions Options to initialize the rebase object + * with * @return {Oid|Index} A commit id for a succesful merge or an index for a * rebase with conflicts */ Repository.prototype.continueRebase = function( signature, beforeNextFn, - beforeFinishFn + beforeFinishFn, + rebaseOptions ) { - var repo = this; + const repo = this; - signature = signature || repo.defaultSignature(); + let rebase; + let promiseChain = Promise.resolve(); - var rebase; - return repo.refreshIndex() - .then(function(index) { + if (!signature) { + promiseChain = promiseChain + .then(() => repo.defaultSignature()) + .then((signatureResult) => { + signature = signatureResult; + }); + } + + return promiseChain + .then(() => repo.refreshIndex()) + .then((index) => { if (index.hasConflicts()) { throw index; } - return NodeGit.Rebase.open(repo); + return NodeGit.Rebase.open(repo, rebaseOptions); }) - .then(function(_rebase) { + .then((_rebase) => { rebase = _rebase; return rebase.commit(null, signature) - .catch(function() { - // Ignore all errors to prevent - // this routine from choking now - // that we made rebase.commit - // asynchronous + .catch((e) => { + // If the first commit on continueRebase is a + // "patch already applied" error, + // interpret that as an explicit "skip commit" + // and ignore the error. + const errno = fp.get(["errno"], e); + if (errno === NodeGit.Error.CODE.EAPPLIED) { + return; + } + + throw e; }); }) - .then(function() { + .then(() => { return performRebase( repo, rebase, @@ -466,7 +476,7 @@ Repository.prototype.continueRebase = function( beforeFinishFn ); }) - .then(function(error) { + .then((error) => { if (error) { throw error; } @@ -481,7 +491,7 @@ Repository.prototype.continueRebase = function( * @async * @param {String} name Branch name, e.g. "master" * @param {Commit|String|Oid} commit The commit the branch will point to - * @param {bool} force Overwrite branch if it exists + * @param {Boolean} force Overwrite branch if it exists * @return {Reference} */ Repository.prototype.createBranch = function(name, commit, force) { @@ -508,6 +518,7 @@ Repository.prototype.createBranch = function(name, commit, force) { /** * Create a blob from a buffer * + * @async * @param {Buffer} buffer * @return {Oid} */ @@ -523,12 +534,12 @@ Repository.prototype.createBlobFromBuffer = function(buffer) { * @param {Signature} author * @param {Signature} committer * @param {String} message - * @param {Tree|Oid|String} Tree + * @param {Oid|String} Tree * @param {Array} parents * @return {Oid} The oid of the commit */ Repository.prototype.createCommit = function( - updateRef, author, committer, message, tree, parents, callback) { + updateRef, author, committer, message, tree, parents) { var repo = this; var promises = []; @@ -563,13 +574,166 @@ Repository.prototype.createCommit = function( parents.length, parents ); - }).then(function(commit) { - if (typeof callback === "function") { - callback(null, commit); + }); +}; + +/** + * Create a commit + * + * @async + * @param {Signature} author + * @param {Signature} committer + * @param {String} message + * @param {Oid|String} treeOid + * @param {Array} parents + * @return {String} The content of the commit object + * as a string + */ +Repository.prototype.createCommitBuffer = function( + author, committer, message, treeOid, parents) { + + const repo = this; + const promises = (parents || []) + .reduce(function(acc, parent) { + acc.push(repo.getCommit(parent)); + return acc; + }, [repo.getTree(treeOid)]); + + return Promise.all(promises) + .then(function([tree, ...parentCommits]) { + return Commit.createBuffer( + repo, + author, + committer, + null /* use default message encoding */, + message, + tree, + parentCommits.length, + parentCommits + ); + }); +}; + +/** + * Create a commit that is digitally signed + * + * @async + * @param {String} updateRef + * @param {Signature} author + * @param {Signature} committer + * @param {String} message + * @param {Tree|Oid|String} Tree + * @param {Array} parents + * @param {Function} onSignature Callback to be called with string to be signed + * @return {Oid} The oid of the commit + */ +Repository.prototype.createCommitWithSignature = function( + updateRef, + author, + committer, + message, + tree, + parents, + onSignature +) { + + var repo = this; + var promises = []; + var commitContent; + var skippedSigning; + + parents = parents || []; + + promises.push(repo.getTree(tree)); + + parents.forEach(function(parent) { + promises.push(repo.getCommit(parent)); + }); + + const createCommitPromise = Promise.all(promises).then(function(results) { + tree = results[0]; + + // Get the normalized values for our input into the function + var parentsLength = parents.length; + parents = []; + + for (var i = 0; i < parentsLength; i++) { + parents.push(results[i + 1]); + } + + return Commit.createBuffer( + repo, + author, + committer, + null /* use default message encoding */, + message, + tree, + parents.length, + parents + ); + }).then(function(commitContentResult) { + commitContent = commitContentResult; + if (!commitContent.endsWith("\n")) { + commitContent += "\n"; } + return onSignature(commitContent); + }).then(function({ code, field, signedData }) { + switch (code) { + case NodeGit.Error.CODE.OK: + return Commit.createWithSignature( + repo, + commitContent, + signedData, + field + ); + case NodeGit.Error.CODE.PASSTHROUGH: + skippedSigning = true; + return Commit.create( + repo, + updateRef, + author, + committer, + null /* use default message encoding */, + message, + tree, + parents.length, + parents + ); + default: { + const error = new Error( + "Repository.prototype.createCommitWithSignature " + + `threw with error code ${code}` + ); + error.errno = code; + throw error; + } + } + }); - return commit; - }, callback); + if (!updateRef) { + return createCommitPromise; + } + + return createCommitPromise + .then(function(commitOid) { + if (skippedSigning) { + return commitOid; + } + + return repo.getCommit(commitOid) + .then(function(commitResult) { + return Reference.updateTerminal( + repo, + updateRef, + commitOid, + getReflogMessageForCommit(commitResult), + committer + ); + }) + .then(function() { + return commitOid; + }); + }); }; /** @@ -586,8 +750,7 @@ Repository.prototype.createCommitOnHead = function( filesToAdd, author, committer, - message, - callback) { + message) { var repo = this; @@ -626,7 +789,7 @@ Repository.prototype.createCommitOnHead = function( parent ); }); - }, callback); + }); }; /** @@ -637,7 +800,7 @@ Repository.prototype.createCommitOnHead = function( * @param {String} name the name of the tag * @return {Reference} */ -Repository.prototype.createLightweightTag = function(oid, name, callback) { +Repository.prototype.createLightweightTag = function(oid, name) { var repository = this; return Commit.lookup(repository, oid) @@ -654,8 +817,7 @@ Repository.prototype.createLightweightTag = function(oid, name, callback) { * Instantiate a new revision walker for browsing the Repository"s history. * See also `Commit.prototype.history()` * - * @param {String|Oid} String sha or Oid - * @return {RevWalk} + * @return {Revwalk} */ Repository.prototype.createRevWalk = function() { return Revwalk.create(this); @@ -671,32 +833,41 @@ Repository.prototype.createRevWalk = function() { * annotated tag * @return {Tag} */ -Repository.prototype.createTag = function(oid, name, message, callback) { - var repository = this; - var signature = repository.defaultSignature(); - - return Commit.lookup(repository, oid) - .then(function(commit) { +Repository.prototype.createTag = function(oid, name, message) { + const repository = this; + let signature = null; + + return repository.defaultSignature() + .then((signatureResult) => { + signature = signatureResult; + return Commit.lookup(repository, oid); + }) + .then((commit) => { // Final argument is `force` which overwrites any previous tag return Tag.create(repository, name, commit, signature, message, 0); }) - .then(function(tagOid) { - return repository.getTag(tagOid, callback); + .then((tagOid) => { + return repository.getTag(tagOid); }); }; /** * Gets the default signature for the default user and now timestamp + * + * @async * @return {Signature} */ Repository.prototype.defaultSignature = function() { - var result = NodeGit.Signature.default(this); - - if (!result || !result.name()) { - result = NodeGit.Signature.now("unknown", "unknown@example.com"); - } - - return result; + return NodeGit.Signature.default(this) + .then((result) => { + if (!result || !result.name()) { + result = NodeGit.Signature.now("unknown", "unknown@example.com"); + } + return result; + }) + .catch(() => { + return NodeGit.Signature.now("unknown", "unknown@example.com"); + }); }; /** @@ -729,16 +900,30 @@ Repository.prototype.discardLines = var fullFilePath = path.join(repo.workdir(), filePath); var index; var originalContent; + var filterList; return repo.refreshIndex() .then(function(indexResult) { index = indexResult; + return FilterList.load( + repo, + null, + filePath, + Filter.MODE.CLEAN, + Filter.FLAG.DEFAULT + ); + }) + .then(function(_filterList) { + filterList = _filterList; + + if (filterList) { + return filterList.applyToFile(repo, filePath); + } return fse.readFile(fullFilePath, "utf8"); }) .then(function(content) { originalContent = content; - return getPathHunks(repo, index, filePath, false, additionalDiffOptions); }) .then(function(hunks) { @@ -747,7 +932,28 @@ Repository.prototype.discardLines = ); }) .then(function(newContent) { - return fse.writeFile(fullFilePath, newContent); + return FilterList.load( + repo, + null, + filePath, + Filter.MODE.SMUDGE, + Filter.FLAG.DEFAULT + ) + .then(function(_filterList) { + filterList = _filterList; + if (filterList) { + /* jshint ignore:start */ + // We need the constructor for the check in NodeGit's C++ layer + // to accept an object, and this seems to be a nice way to do it + return filterList.applyToData(new String(newContent)); + /* jshint ignore:end */ + } + + return newContent; + }); + }) + .then(function(filteredContent) { + return fse.writeFile(fullFilePath, filteredContent); }); }; @@ -761,28 +967,16 @@ Repository.prototype.discardLines = */ Repository.prototype.fetch = function( remote, - fetchOptions, - callback) + fetchOptions) { var repo = this; - function finallyFn(error) { - if (typeof callback === "function") { - callback(error); - } - } - return repo.getRemote(remote) .then(function(remote) { return remote.fetch(null, fetchOptions, "Fetch from " + remote) .then(function() { return remote.disconnect(); }); - }) - .then(finallyFn) - .catch(function(error) { - finallyFn(error); - throw error; }); }; @@ -793,12 +987,8 @@ Repository.prototype.fetch = function( * @async * @param {Object|FetchOptions} fetchOptions Options for the fetch, includes * callbacks for fetching - * @param {Function} callback */ -Repository.prototype.fetchAll = function( - fetchOptions, - callback) -{ +Repository.prototype.fetchAll = function(fetchOptions) { var repo = this; function createCallbackWrapper(fn, remote) { @@ -818,7 +1008,7 @@ Repository.prototype.fetchAll = function( var certificateCheck = remoteCallbacks.certificateCheck; var transferProgress = remoteCallbacks.transferProgress; - return repo.getRemotes() + return repo.getRemoteNames() .then(function(remotes) { return remotes.reduce(function(fetchPromise, remote) { var wrappedFetchOptions = shallowClone(fetchOptions); @@ -845,11 +1035,6 @@ Repository.prototype.fetchAll = function( return repo.fetch(remote, wrappedFetchOptions); }); }, Promise.resolve()); - }) - .then(function() { - if (typeof callback === "function") { - callback(); - } }); }; @@ -869,18 +1054,13 @@ Repository.prototype.fetchheadForeach = function(callback) { * @param {String|Oid} String sha or Oid * @return {Blob} */ -Repository.prototype.getBlob = function(oid, callback) { +Repository.prototype.getBlob = function(oid) { var repository = this; return Blob.lookup(repository, oid).then(function(blob) { blob.repo = repository; - - if (typeof callback === "function") { - callback(null, blob); - } - return blob; - }, callback); + }); }; /** @@ -891,8 +1071,8 @@ Repository.prototype.getBlob = function(oid, callback) { * or Branch Ref * @return {Reference} */ -Repository.prototype.getBranch = function(name, callback) { - return this.getReference(name, callback); +Repository.prototype.getBranch = function(name) { + return this.getReference(name); }; /** @@ -903,8 +1083,8 @@ Repository.prototype.getBranch = function(name, callback) { * or Branch Ref * @return {Commit} */ -Repository.prototype.getBranchCommit = function(name, callback) { - return this.getReferenceCommit(name, callback); +Repository.prototype.getBranchCommit = function(name) { + return this.getReferenceCommit(name); }; /** @@ -914,18 +1094,10 @@ Repository.prototype.getBranchCommit = function(name, callback) { * @param {String|Oid} String sha or Oid * @return {Commit} */ -Repository.prototype.getCommit = function(oid, callback) { +Repository.prototype.getCommit = function(oid) { var repository = this; - return Commit.lookup(repository, oid).then(function(commit) { - commit.repo = repository; - - if (typeof callback === "function") { - callback(null, commit); - } - - return commit; - }, callback); + return Commit.lookup(repository, oid); }; /** @@ -945,12 +1117,12 @@ Repository.prototype.getCurrentBranch = function() { * @async * @return {Commit} */ -Repository.prototype.getHeadCommit = function(callback) { +Repository.prototype.getHeadCommit = function() { var repo = this; return Reference.nameToId(repo, "HEAD") .then(function(head) { - return repo.getCommit(head, callback); + return repo.getCommit(head); }) .catch(function() { return null; @@ -963,8 +1135,8 @@ Repository.prototype.getHeadCommit = function(callback) { * @async * @return {Commit} */ -Repository.prototype.getMasterCommit = function(callback) { - return this.getBranchCommit("master", callback); +Repository.prototype.getMasterCommit = function() { + return this.getBranchCommit("master"); }; /** @@ -975,28 +1147,20 @@ Repository.prototype.getMasterCommit = function(callback) { * or Branch Ref * @return {Reference} */ -Repository.prototype.getReference = function(name, callback) { +Repository.prototype.getReference = function(name) { var repository = this; return Reference.dwim(this, name).then(function(reference) { if (reference.isSymbolic()) { return reference.resolve().then(function(reference) { reference.repo = repository; - - if (typeof callback === "function") { - callback(null, reference); - } - return reference; - }, callback); - } else { - reference.repo = repository; - if (typeof callback === "function") { - callback(null, reference); - } - return reference; + }); } - }, callback); + + reference.repo = repository; + return reference; + }); }; /** @@ -1007,18 +1171,12 @@ Repository.prototype.getReference = function(name, callback) { * or Branch Ref * @return {Commit} */ -Repository.prototype.getReferenceCommit = function(name, callback) { +Repository.prototype.getReferenceCommit = function(name) { var repository = this; return this.getReference(name).then(function(reference) { - return repository.getCommit(reference.target()).then(function(commit) { - if (typeof callback === "function") { - callback(null, commit); - } - - return commit; - }); - }, callback); + return repository.getCommit(reference.target()); + }); }; /** @@ -1028,8 +1186,8 @@ Repository.prototype.getReferenceCommit = function(name, callback) { * @param {Reference.TYPE} type Type of reference to look up * @return {Array} */ -Repository.prototype.getReferenceNames = function(type, callback) { - return Repository.getReferences(this, type, true, callback); +Repository.prototype.getReferenceNames = function(type) { + return Repository.getReferences(this, type, true); }; /** @@ -1039,53 +1197,30 @@ Repository.prototype.getReferenceNames = function(type, callback) { * @param {Reference.TYPE} type Type of reference to look up * @return {Array} */ -Repository.prototype.getReferences = function(type, callback) { - return Repository.getReferences(this, type, false, callback); -}; /** * Gets a remote from the repo * * @async * @param {String|Remote} remote - * @param {Function} callback * @return {Remote} The remote object */ -Repository.prototype.getRemote = function(remote, callback) { +Repository.prototype.getRemote = function(remote) { if (remote instanceof NodeGit.Remote) { - return Promise.resolve(remote).then(function(remoteObj) { - if (typeof callback === "function") { - callback(null, remoteObj); - } - - return remoteObj; - }, callback); + return Promise.resolve(remote); } - return NodeGit.Remote.lookup(this, remote).then(function(remoteObj) { - if (typeof callback === "function") { - callback(null, remoteObj); - } - - return remoteObj; - }, callback); + return NodeGit.Remote.lookup(this, remote); }; /** * Lists out the remotes in the given repository. * * @async -* @param {Function} Optional callback * @return {Object} Promise object. */ -Repository.prototype.getRemotes = function(callback) { - return Remote.list(this).then(function(remotes) { - if (typeof callback === "function") { - callback(null, remotes); - } - - return remotes; - }, callback); +Repository.prototype.getRemoteNames = function() { + return Remote.list(this); }; /** @@ -1151,17 +1286,13 @@ Repository.prototype.getStatusExt = function(opts) { * @async * @return {Array} */ -Repository.prototype.getSubmoduleNames = function(callback) { +Repository.prototype.getSubmoduleNames = function() { var names = []; var submoduleCallback = function(submodule, name, payload) { names.push(name); }; return Submodule.foreach(this, submoduleCallback).then(function() { - if (typeof callback === "function") { - callback(null, names); - } - return names; }); }; @@ -1173,18 +1304,13 @@ Repository.prototype.getSubmoduleNames = function(callback) { * @param {String|Oid} String sha or Oid * @return {Tag} */ -Repository.prototype.getTag = function(oid, callback) { +Repository.prototype.getTag = function(oid) { var repository = this; return Tag.lookup(repository, oid).then(function(reference) { reference.repo = repository; - - if (typeof callback === "function") { - callback(null, reference); - } - return reference; - }, callback); + }); }; /** @@ -1194,22 +1320,18 @@ Repository.prototype.getTag = function(oid, callback) { * @param {String} Short or full tag name * @return {Tag} */ -Repository.prototype.getTagByName = function(name, callback) { +Repository.prototype.getTagByName = function(name) { var repo = this; name = ~name.indexOf("refs/tags/") ? name : "refs/tags/" + name; - return Reference.nameToId(repo, name).then(function(oid) { - return Tag.lookup(repo, oid).then(function(reference) { + return Reference.nameToId(repo, name) + .then(function(oid) { + return Tag.lookup(repo, oid); + }).then(function(reference) { reference.repo = repo; - - if (typeof callback === "function") { - callback(null, reference); - } - return reference; }); - }, callback); }; /** @@ -1219,18 +1341,13 @@ Repository.prototype.getTagByName = function(name, callback) { * @param {String|Oid} String sha or Oid * @return {Tree} */ -Repository.prototype.getTree = function(oid, callback) { +Repository.prototype.getTree = function(oid) { var repository = this; return Tree.lookup(repository, oid).then(function(tree) { tree.repo = repository; - - if (typeof callback === "function") { - callback(null, tree); - } - return tree; - }, callback); + }); }; /** @@ -1314,6 +1431,8 @@ Repository.prototype.isReverting = function() { * promise, finish() will be called when the * promise resolves. This callback will be * provided a detailed overview of the rebase + * @param {RebaseOptions} rebaseOptions Options to initialize the rebase object + * with * @return {Oid|Index} A commit id for a succesful merge or an index for a * rebase with conflicts */ @@ -1327,12 +1446,21 @@ Repository.prototype.rebaseBranches = function( rebaseOptions ) { - var repo = this; - var branchCommit; - var upstreamCommit; - var ontoCommit; - var mergeOptions = (rebaseOptions || {}).mergeOptions; - signature = signature || repo.defaultSignature(); + const repo = this; + let branchCommit; + let upstreamCommit; + let ontoCommit; + let mergeOptions = (rebaseOptions || {}).mergeOptions; + + let promiseChain = Promise.resolve(); + + if (!signature) { + promiseChain = promiseChain + .then(() => repo.defaultSignature()) + .then((signatureResult) => { + signature = signatureResult; + }); + } return Promise.all([ repo.getReference(branch), @@ -1401,19 +1529,12 @@ Repository.prototype.rebaseBranches = function( * @async * @return {Index} */ -Repository.prototype.refreshIndex = function(callback) { +Repository.prototype.refreshIndex = function() { var repo = this; repo.setIndex(); // clear the index - return repo.index() - .then(function(index) { - if (typeof callback === "function") { - callback(null, index); - } - - return index; - }, callback); + return repo.index(); }; /** @@ -1425,6 +1546,7 @@ Repository.prototype.refreshIndex = function(callback) { * @param {Signature} signature * @param {Merge.PREFERENCE} mergePreference * @param {MergeOptions} mergeOptions + * @param {MergeBranchOptions} mergeBranchOptions * @return {Oid|Index} A commit id for a succesful merge or an index for a * merge with conflicts */ @@ -1434,23 +1556,41 @@ Repository.prototype.mergeBranches = function( signature, mergePreference, mergeOptions, - processMergeMessageCallback + mergeBranchOptions ) { - var repo = this; - var fromBranch; - var toBranch; - processMergeMessageCallback = processMergeMessageCallback || + const repo = this; + let fromBranch; + let toBranch; + // Support old parameter `processMergeMessageCallback` + const isOldOptionParameter = typeof mergeBranchOptions === "function"; + if (isOldOptionParameter) { + console.error("DeprecationWarning: Repository#mergeBranches parameter " + + "processMergeMessageCallback, use MergeBranchOptions"); + } + const processMergeMessageCallback = mergeBranchOptions && + (isOldOptionParameter ? + mergeBranchOptions : + mergeBranchOptions.processMergeMessageCallback) || function (message) { return message; }; + const signingCallback = mergeBranchOptions && mergeBranchOptions.signingCb; mergePreference = mergePreference || NodeGit.Merge.PREFERENCE.NONE; - mergeOptions = normalizeOptions(mergeOptions, NodeGit.MergeOptions); - signature = signature || repo.defaultSignature(); + let promiseChain = Promise.resolve(); - return Promise.all([ - repo.getBranch(to), - repo.getBranch(from) - ]).then(function(objects) { + if (!signature) { + promiseChain = promiseChain + .then(() => repo.defaultSignature()) + .then((signatureResult) => { + signature = signatureResult; + }); + } + + return promiseChain.then(() => Promise.all([ + repo.getBranch(to), + repo.getBranch(from) + ])) + .then((objects) => { toBranch = objects[0]; fromBranch = objects[1]; @@ -1459,12 +1599,12 @@ Repository.prototype.mergeBranches = function( repo.getBranchCommit(fromBranch) ]); }) - .then(function(branchCommits) { + .then((branchCommits) => { var toCommitOid = branchCommits[0].toString(); var fromCommitOid = branchCommits[1].toString(); return NodeGit.Merge.base(repo, toCommitOid, fromCommitOid) - .then(function(baseCommit) { + .then((baseCommit) => { if (baseCommit.toString() == fromCommitOid) { // The commit we're merging to is already in our history. // nothing to do so just return the commit the branch is on @@ -1480,7 +1620,7 @@ Repository.prototype.mergeBranches = function( fromBranch.shorthand(); return branchCommits[1].getTree() - .then(function(tree) { + .then((tree) => { if (toBranch.isHead()) { // Checkout the tree if we're on the branch var opts = { @@ -1490,11 +1630,11 @@ Repository.prototype.mergeBranches = function( return NodeGit.Checkout.tree(repo, tree, opts); } }) - .then(function() { + .then(() => { return toBranch.setTarget( fromCommitOid, message) - .then(function() { + .then(() => { return fromCommitOid; }); }); @@ -1503,10 +1643,10 @@ Repository.prototype.mergeBranches = function( var updateHead; // We have to merge. Lets do it! return NodeGit.Reference.lookup(repo, "HEAD") - .then(function(headRef) { + .then((headRef) => { return headRef.resolve(); }) - .then(function(headRef) { + .then((headRef) => { updateHead = !!headRef && (headRef.name() === toBranch.name()); return NodeGit.Merge.commits( repo, @@ -1515,7 +1655,7 @@ Repository.prototype.mergeBranches = function( mergeOptions ); }) - .then(function(index) { + .then((index) => { // if we have conflicts then throw the index if (index.hasConflicts()) { throw index; @@ -1524,7 +1664,7 @@ Repository.prototype.mergeBranches = function( // No conflicts so just go ahead with the merge return index.writeTreeTo(repo); }) - .then(function(oid) { + .then((oid) => { var mergeDecorator; if (fromBranch.isTag()) { mergeDecorator = "tag"; @@ -1548,7 +1688,18 @@ Repository.prototype.mergeBranches = function( return Promise.all([oid, processMergeMessageCallback(message)]); }) - .then(function([oid, message]) { + .then(([oid, message]) => { + if (signingCallback) { + return repo.createCommitWithSignature( + toBranch.name(), + signature, + signature, + message, + oid, + [toCommitOid, fromCommitOid], + signingCallback + ); + } return repo.createCommit( toBranch.name(), signature, @@ -1558,25 +1709,25 @@ Repository.prototype.mergeBranches = function( [toCommitOid, fromCommitOid] ); }) - .then(function(commit) { + .then((commit) => { // we've updated the checked out branch, so make sure we update // head so that our index isn't messed up if (updateHead) { return repo.getBranch(to) - .then(function(branch) { + .then((branch) => { return repo.getBranchCommit(branch); }) - .then(function(branchCommit) { + .then((branchCommit) => { return branchCommit.getTree(); }) - .then(function(tree) { + .then((tree) => { var opts = { checkoutStrategy: NodeGit.Checkout.STRATEGY.SAFE | NodeGit.Checkout.STRATEGY.RECREATE_MISSING }; return NodeGit.Checkout.tree(repo, tree, opts); }) - .then(function() { + .then(() => { return commit; }); } @@ -1782,7 +1933,7 @@ Repository.prototype.stageLines = ); }) .then(function(newContent) { - var newContentBuffer = new Buffer(newContent); + var newContentBuffer = Buffer.from(newContent); return repo.createBlobFromBuffer(newContentBuffer); }) diff --git a/lib/reset.js b/lib/reset.js index df770304af..38b6b1bffc 100644 --- a/lib/reset.js +++ b/lib/reset.js @@ -1,10 +1,8 @@ var NodeGit = require("../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; var Reset = NodeGit.Reset; var _default = Reset.default; var _reset = Reset.reset; -var _fromAnnotated = Reset.fromAnnotated; /** * Look up a refs's commit. @@ -22,7 +20,7 @@ Reset.default = function(repo, target, pathspecs) { }; /** - * Look up a refs's commit. + * Reset a repository's current HEAD to the specified target. * * @async * @param {Repository} repo Repository where to perform the reset operation. @@ -41,35 +39,13 @@ Reset.default = function(repo, target, pathspecs) { * used to propagate notify and progress * callbacks. * - * @param {String|Ref} name Ref name, e.g. "master", "refs/heads/master" - * or Branch Ref - * * @return {Number} 0 on success or an error code */ Reset.reset = function(repo, target, resetType, opts) { - opts = normalizeOptions(opts, NodeGit.CheckoutOptions); - + if (repo !== target.repo) { + // this is the same that is performed on libgit2's side + // https://github.com/nodegit/libgit2/blob/8d89e409616831b7b30a5ca7b89354957137b65e/src/reset.c#L120-L124 + throw new Error("Repository and target commit's repository does not match"); + } return _reset.call(this, repo, target, resetType, opts); }; - -/** - * Sets the current head to the specified commit oid and optionally - * resets the index and working tree to match. - * - * This behaves like reset but takes an annotated commit, which lets - * you specify which extended sha syntax string was specified by a - * user, allowing for more exact reflog messages. - * - * See the documentation for reset. - * - * @async - * @param {Repository} repo - * @param {AnnotatedCommit} target - * @param {Number} resetType - * @param {CheckoutOptions} opts - */ -Reset.fromAnnotated = function(repo, target, resetType, opts) { - opts = normalizeOptions(opts, NodeGit.CheckoutOptions); - - return _fromAnnotated.call(this, repo, target, resetType, opts); -}; diff --git a/lib/revert.js b/lib/revert.js deleted file mode 100644 index aee3f0baf0..0000000000 --- a/lib/revert.js +++ /dev/null @@ -1,46 +0,0 @@ -var NodeGit = require("../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; - -var Revert = NodeGit.Revert; -var _commit = Revert.commit; - -/** - * Reverts the given commit against the given "our" commit, producing an index - * that reflects the result of the revert. - * - * @async - * @param {Repository} repo the repository that contains the given commits. - * @param {Commit} revert_commit the commit to revert - * @param {Commit} our_commit the commit to revert against (e.g. HEAD) - * @param {Number} mainline the parent of the revert commit, if it is a merge - * @param {MergeOptions} merge_options the merge options (or null for defaults) - * - * @return {Index} the index result - */ -Revert.commit = function( - repo, - revert_commit, - our_commit, - mainline, - merge_options, - callback -) -{ - merge_options = normalizeOptions(merge_options, NodeGit.MergeOptions); - - return _commit.call( - this, - repo, - revert_commit, - our_commit, - mainline, - merge_options - ) - .then(function(result) { - if (typeof callback === "function") { - callback(null, result); - } - - return result; - }, callback); -}; diff --git a/lib/revparse.js b/lib/revparse.js new file mode 100644 index 0000000000..74c1fa4c24 --- /dev/null +++ b/lib/revparse.js @@ -0,0 +1,18 @@ +var util = require("util"); +var NodeGit = require("../"); + +const MODE = { + SINGLE: 1, + RANGE: 2, + MERGE_BASE: 4, +}; + +NodeGit.Revparse.MODE = {}; +Object.keys(MODE).forEach((key) => { + Object.defineProperty(NodeGit.Revparse.MODE, key, { + get: util.deprecate( + () => MODE[key], + `Use NodeGit.Revspec.TYPE.${key} instead of NodeGit.Revparse.MODE.${key}.` + ) + }); +}); diff --git a/lib/revwalk.js b/lib/revwalk.js index 80205fb222..7787fc89b1 100644 --- a/lib/revwalk.js +++ b/lib/revwalk.js @@ -2,7 +2,8 @@ var NodeGit = require("../"); var Revwalk = NodeGit.Revwalk; Object.defineProperty(Revwalk.prototype, "repo", { - get: function () { return this.repository(); } + get: function () { return this.repository(); }, + configurable: true }); var _sorting = Revwalk.prototype.sorting; @@ -111,7 +112,6 @@ Revwalk.prototype.sorting = function() { * * @param {Oid} oid * @param {Function} callback - * @return {Commit} */ Revwalk.prototype.walk = function(oid, callback) { var revwalk = this; @@ -119,7 +119,7 @@ Revwalk.prototype.walk = function(oid, callback) { this.push(oid); function walk() { - revwalk.next().done(function(oid) { + revwalk.next().then(function(oid) { if (!oid) { if (typeof callback === "function") { return callback(); diff --git a/lib/signature.js b/lib/signature.js index 7fc8e274d3..4dfe84a363 100644 --- a/lib/signature.js +++ b/lib/signature.js @@ -1,11 +1,38 @@ var NodeGit = require("../"); var Signature = NodeGit.Signature; +const toPaddedDoubleDigitString = (number) => { + if (number < 10) { + return `0${number}`; + } + + return `${number}`; +}; + /** * Standard string representation of an author. - * - * @return {string} Representation of the author. + * @param {Boolean} withTime Whether or not to include timestamp + * @return {String} Representation of the author. */ -Signature.prototype.toString = function() { - return this.name().toString() + " <" + this.email().toString() + ">"; +Signature.prototype.toString = function(withTime) { + const name = this.name().toString(); + const email = this.email().toString(); + + let stringifiedSignature = `${name} <${email}>`; + + if (!withTime) { + return stringifiedSignature; + } + + const when = this.when(); + const offset = when.offset(); + const offsetMagnitude = Math.abs(offset); + const time = when.time(); + + const sign = (offset < 0 || when.sign() === "-") ? "-" : "+"; + const hours = toPaddedDoubleDigitString(Math.floor(offsetMagnitude / 60)); + const minutes = toPaddedDoubleDigitString(offsetMagnitude % 60); + + stringifiedSignature += ` ${time} ${sign}${hours}${minutes}`; + return stringifiedSignature; }; diff --git a/lib/stash.js b/lib/stash.js index 7067b24ce0..88e9f3510d 100644 --- a/lib/stash.js +++ b/lib/stash.js @@ -1,32 +1,7 @@ var NodeGit = require("../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; -var shallowClone = NodeGit.Utils.shallowClone; var Stash = NodeGit.Stash; -var _apply = Stash.apply; var _foreach = Stash.foreach; -var _pop = Stash.pop; - -Stash.apply = function(repo, index, options) { - var checkoutOptions; - - if (options) { - options = shallowClone(options); - checkoutOptions = options.checkoutOptions; - delete options.checkoutOptions; - } else { - options = {}; - } - - options = normalizeOptions(options, NodeGit.StashApplyOptions); - - if (checkoutOptions) { - options.checkoutOptions = - normalizeOptions(checkoutOptions, NodeGit.CheckoutOptions); - } - - return _apply(repo, index, options); -}; // Override Stash.foreach to eliminate the need to pass null payload Stash.foreach = function(repo, callback) { @@ -39,24 +14,3 @@ Stash.foreach = function(repo, callback) { return _foreach(repo, wrappedCallback, null); }; - -Stash.pop = function(repo, index, options) { - var checkoutOptions; - - if (options) { - options = shallowClone(options); - checkoutOptions = options.checkoutOptions; - delete options.checkoutOptions; - } else { - options = {}; - } - - options = normalizeOptions(options, NodeGit.StashApplyOptions); - - if (checkoutOptions) { - options.checkoutOptions = - normalizeOptions(checkoutOptions, NodeGit.CheckoutOptions); - } - - return _pop(repo, index, options); -}; diff --git a/lib/status.js b/lib/status.js index c5c762baae..93aca08e09 100644 --- a/lib/status.js +++ b/lib/status.js @@ -1,5 +1,4 @@ var NodeGit = require("../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; var Status = NodeGit.Status; @@ -11,8 +10,7 @@ Status.foreach = function(repo, callback) { return _foreach(repo, callback, null); }; -// Override Status.foreachExt to normalize opts +// Override Status.foreachExt to eliminate the need to pass null payload Status.foreachExt = function(repo, opts, callback) { - opts = normalizeOptions(opts, NodeGit.StatusOptions); return _foreachExt(repo, opts, callback, null); }; diff --git a/lib/status_list.js b/lib/status_list.js deleted file mode 100644 index efccbad2ef..0000000000 --- a/lib/status_list.js +++ /dev/null @@ -1,12 +0,0 @@ -var NodeGit = require("../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; - -var StatusList = NodeGit.StatusList; - -var _create = StatusList.create; - -// Override StatusList.create to normalize opts -StatusList.create = function(repo, opts) { - opts = normalizeOptions(opts, NodeGit.StatusOptions); - return _create(repo, opts); -}; diff --git a/lib/submodule.js b/lib/submodule.js index 92b0e6ec04..2b0cb530db 100644 --- a/lib/submodule.js +++ b/lib/submodule.js @@ -1,51 +1,10 @@ var NodeGit = require("../"); -var normalizeFetchOptions = NodeGit.Utils.normalizeFetchOptions; -var normalizeOptions = NodeGit.Utils.normalizeOptions; -var shallowClone = NodeGit.Utils.shallowClone; var Submodule = NodeGit.Submodule; var _foreach = Submodule.foreach; -var _update = Submodule.prototype.update; // Override Submodule.foreach to eliminate the need to pass null payload Submodule.foreach = function(repo, callback) { return _foreach(repo, callback, null); }; - -/** - * Updates a submodule - * - * @async - * @param {Number} init Setting this to 1 will initialize submodule - * before updating - * @param {SubmoduleUpdateOptions} options Submodule update settings - * @return {Number} 0 on success, any non-zero return value from a callback - */ -Submodule.prototype.update = function(init, options) { - var fetchOpts; - var checkoutOpts; - - if (options) { - options = shallowClone(options); - fetchOpts = options.fetchOpts; - checkoutOpts = options.checkoutOpts; - delete options.fetchOpts; - delete options.checkoutOpts; - } - - options = normalizeOptions(options, NodeGit.SubmoduleUpdateOptions); - - if (fetchOpts) { - options.fetchOpts = normalizeFetchOptions(fetchOpts); - } - - if (checkoutOpts) { - options.checkoutOpts = normalizeOptions( - checkoutOpts, - NodeGit.CheckoutOptions - ); - } - - return _update.call(this, init, options); -}; diff --git a/lib/tag.js b/lib/tag.js index bf8ddff49f..aae20c9302 100644 --- a/lib/tag.js +++ b/lib/tag.js @@ -1,12 +1,141 @@ +var util = require("util"); var NodeGit = require("../"); var LookupWrapper = NodeGit.Utils.lookupWrapper; var Tag = NodeGit.Tag; +const signatureRegexesBySignatureType = { + gpgsig: [ + /-----BEGIN PGP SIGNATURE-----[\s\S]+?-----END PGP SIGNATURE-----/gm, + /-----BEGIN PGP MESSAGE-----[\s\S]+?-----END PGP MESSAGE-----/gm, + ], + x509: [ + /-----BEGIN SIGNED MESSAGE-----[\s\S]+?-----END SIGNED MESSAGE-----/gm, + ] +}; + /** -* Retrieves the tag pointed to by the oid -* @async -* @param {Repository} repo The repo that the tag lives in -* @param {String|Oid|Tag} id The tag to lookup -* @return {Tag} -*/ + * Retrieves the tag pointed to by the oid + * @async + * @param {Repository} repo The repo that the tag lives in + * @param {String|Oid|Tag} id The tag to lookup + * @return {Tag} + */ Tag.lookup = LookupWrapper(Tag); + +/** + * @async + * @param {Repository} repo + * @param {String} tagName + * @param {Oid} target + * @param {Signature} tagger + * @return {String} + */ +Tag.createBuffer = function(repo, tagName, target, tagger, message) { + return NodeGit.Object.lookup(repo, target, NodeGit.Object.TYPE.ANY) + .then((object) => { + if (!NodeGit.Object.typeisloose(object.type())) { + throw new Error("Object must be a loose type"); + } + + const id = object.id().toString(); + const objectType = NodeGit.Object.type2String(object.type()); + const lines = [ + `object ${id}`, + `type ${objectType}`, + `tag ${tagName}`, + `tagger ${tagger.toString(true)}\n`, + `${message}${message.endsWith("\n") ? "" : "\n"}` + ]; + return lines.join("\n"); + }); +}; + +const deprecatedCreateWithSignatureHelper = util.deprecate(function(repo, oidTarget) { + return repo.getCommit(oidTarget); +}, "Tag.createWithSignature target should be a Git Object, not Oid"); + +/** + * @async + * @param {Repository} repo + * @param {String} tagName + * @param {Object} target + * @param {Signature} tagger + * @param {String} message + * @param {Number} force + * @param {Function} signingCallback Takes a string and returns a string + * representing the signed message + * @return {Oid} + */ +Tag.createWithSignature = async ( + repo, + tagName, + target, + tagger, + message, + force, + signingCallback +) => { + let targetOid; + if (!target.id) { + targetOid = await deprecatedCreateWithSignatureHelper(repo, target); + } else { + targetOid = target; + } + + const tagBuffer = await Tag.createBuffer(repo, tagName, targetOid.id(), tagger, message); + const { code, signedData } = await signingCallback(tagBuffer); + switch (code) { + case NodeGit.Error.CODE.OK: { + const normalizedEnding = signedData.endsWith("\n") ? "" : "\n"; + const signedTagString = tagBuffer + signedData + normalizedEnding; + return Tag.createFromBuffer(repo, signedTagString, force); + } + case NodeGit.Error.CODE.PASSTHROUGH: + return Tag.create( + repo, + tagName, + targetOid, + tagger, + message, + force + ); + default: { + const error = new Error( + `Tag.createWithSignature threw with error code ${code}` + ); + error.errno = code; + throw error; + } + } +}; + +/** + * Retrieves the signature of an annotated tag + * @async + * @param {String} signatureType + * @return {String|null} + */ +Tag.prototype.extractSignature = function(signatureType = "gpgsig") { + const id = this.id(); + const repo = this.repo; + const signatureRegexes = signatureRegexesBySignatureType[signatureType]; + if (!signatureRegexes) { + throw new Error("Unsupported signature type"); + } + + return repo.odb().then((odb) => { + return odb.read(id); + }).then((odbObject) => { + const odbData = odbObject.toString(); + + for (const regex of signatureRegexes) { + const matchResult = odbData.match(regex); + + if (matchResult !== null) { + return matchResult[0]; + } + } + + throw new Error("this tag is not signed"); + }); +}; diff --git a/lib/tree.js b/lib/tree.js index 1be6870751..1067fa3f2d 100644 --- a/lib/tree.js +++ b/lib/tree.js @@ -11,7 +11,6 @@ var Treebuilder = NodeGit.Treebuilder; * @async * @param {Repository} repo The repo that the tree lives in * @param {String|Oid|Tree} id The tree to lookup -* @param {Function} callback * @return {Tree} */ Tree.lookup = LookupWrapper(Tree); @@ -33,11 +32,10 @@ Tree.prototype.builder = function() { * Diff two trees * @async * @param {Tree} tree to diff against - * @param {Function} callback - * @return {DiffList} + * @return {Diff} */ -Tree.prototype.diff = function(tree, callback) { - return this.diffWithOptions(tree, null, callback); +Tree.prototype.diff = function(tree) { + return this.diffWithOptions(tree, null); }; /** @@ -45,17 +43,10 @@ Tree.prototype.diff = function(tree, callback) { * @async * @param {Tree} tree to diff against * @param {Object} options - * @param {Function} callback - * @return {DiffList} + * @return {Diff} */ -Tree.prototype.diffWithOptions = function(tree, options, callback) { - return Diff.treeToTree(this.repo, tree, this, options).then(function(diff) { - if (typeof callback === "function") { - callback(null, diff); - } - - return diff; - }, callback); +Tree.prototype.diffWithOptions = function(tree, options) { + return Diff.treeToTree(this.repo, tree, this, options); }; /** @@ -104,17 +95,12 @@ Tree.prototype.entryByName = function(name) { * @param {String} filePath * @return {TreeEntry} */ -Tree.prototype.getEntry = function(filePath, callback) { +Tree.prototype.getEntry = function(filePath) { var tree = this; return this.entryByPath(filePath).then(function(entry) { entry.parent = tree; entry.dirtoparent = path.dirname(filePath); - - if (typeof callback === "function") { - callback(null, entry); - } - return entry; }); }; @@ -171,7 +157,8 @@ Tree.prototype.walk = function(blobsOnly) { if (entry.isTree()) { total++; - entry.getTree(bfs); + entry.getTree() + .then(result => bfs(null, result), bfs); } }); diff --git a/lib/tree_entry.js b/lib/tree_entry.js index a65d851725..a978de9a3c 100644 --- a/lib/tree_entry.js +++ b/lib/tree_entry.js @@ -1,4 +1,4 @@ -var path = require("path"); +var path = require("path").posix; var NodeGit = require("../"); var TreeEntry = NodeGit.TreeEntry; @@ -7,14 +7,8 @@ var TreeEntry = NodeGit.TreeEntry; * @async * @return {Blob} */ -TreeEntry.prototype.getBlob = function(callback) { - return this.parent.repo.getBlob(this.id()).then(function(blob) { - if (typeof callback === "function") { - callback(null, blob); - } - - return blob; - }, callback); +TreeEntry.prototype.getBlob = function() { + return this.parent.repo.getBlob(this.id()); }; /** @@ -22,18 +16,13 @@ TreeEntry.prototype.getBlob = function(callback) { * @async * @return {Tree} */ -TreeEntry.prototype.getTree = function(callback) { +TreeEntry.prototype.getTree = function() { var entry = this; return this.parent.repo.getTree(this.id()).then(function(tree) { tree.entry = entry; - - if (typeof callback === "function") { - callback(null, tree); - } - return tree; - }, callback); + }); }; /** @@ -89,7 +78,7 @@ TreeEntry.prototype.oid = function() { * Returns the path for this entry. * @return {String} */ -TreeEntry.prototype.path = function(callback) { +TreeEntry.prototype.path = function() { var dirtoparent = this.dirtoparent || ""; return path.join(this.parent.path(), dirtoparent, this.name()); }; diff --git a/lib/utils/normalize_fetch_options.js b/lib/utils/normalize_fetch_options.js deleted file mode 100644 index 2b43707056..0000000000 --- a/lib/utils/normalize_fetch_options.js +++ /dev/null @@ -1,43 +0,0 @@ -var NodeGit = require("../../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; -var shallowClone = NodeGit.Utils.shallowClone; - -/** - * Normalize an object to match a struct. - * - * @param {String, Object} oid - The oid string or instance. - * @return {Object} An Oid instance. - */ -function normalizeFetchOptions(options) { - if (options instanceof NodeGit.FetchOptions) { - return options; - } - - var callbacks; - var proxyOpts; - - if (options) { - options = shallowClone(options); - callbacks = options.callbacks; - proxyOpts = options.proxyOpts; - delete options.callbacks; - delete options.proxyOpts; - } else { - options = {}; - } - - options = normalizeOptions(options, NodeGit.FetchOptions); - - if (callbacks) { - options.callbacks = - normalizeOptions(callbacks, NodeGit.RemoteCallbacks); - } - - if (proxyOpts) { - options.proxyOpts = - normalizeOptions(proxyOpts, NodeGit.ProxyOptions); - } - return options; -} - -NodeGit.Utils.normalizeFetchOptions = normalizeFetchOptions; diff --git a/lib/utils/normalize_options.js b/lib/utils/normalize_options.js deleted file mode 100644 index a1a46255c0..0000000000 --- a/lib/utils/normalize_options.js +++ /dev/null @@ -1,29 +0,0 @@ -var NodeGit = require("../../"); - -/** - * Normalize an object to match a struct. - * - * @param {String, Object} oid - The oid string or instance. - * @return {Object} An Oid instance. - */ -function normalizeOptions(options, Ctor) { - if (!options) { - return null; - } - - if (options instanceof Ctor) { - return options; - } - - var instance = new Ctor(); - - Object.keys(options).forEach(function(key) { - if (typeof options[key] !== "undefined") { - instance[key] = options[key]; - } - }); - - return instance; -} - -NodeGit.Utils.normalizeOptions = normalizeOptions; diff --git a/lifecycleScripts/README.md b/lifecycleScripts/README.md new file mode 100644 index 0000000000..cc1feeb148 --- /dev/null +++ b/lifecycleScripts/README.md @@ -0,0 +1,5 @@ +## /lifecycleScripts + + These scripts are responsible for downloading the right dependencies, configuring vendors, and all other dependencies that are required to build, generate, and clean the module. + + \ No newline at end of file diff --git a/lifecycleScripts/configureLibssh2.js b/lifecycleScripts/configureLibssh2.js deleted file mode 100644 index 4036a4fdd9..0000000000 --- a/lifecycleScripts/configureLibssh2.js +++ /dev/null @@ -1,51 +0,0 @@ -var cp = require("child_process"); -var path = require("path"); -var rooted = function (dir) { - var fullPath = path.join(__dirname, "..", dir); - var escapedPathForShell = fullPath.replace(/ /g, "\\ "); - return escapedPathForShell; -}; - -module.exports = function retrieveExternalDependencies() { - if (process.platform === "win32") { - return Promise.resolve(""); - } - - return new Promise(function(resolve, reject) { - console.info("[nodegit] Configuring libssh2."); - var opensslDir = rooted("vendor/openssl/openssl"); - var newEnv = {}; - Object.keys(process.env).forEach(function(key) { - newEnv[key] = process.env[key]; - }); - newEnv.CPPFLAGS = newEnv.CPPFLAGS || ""; - newEnv.CPPFLAGS += " -I" + path.join(opensslDir, "include"); - newEnv.CPPFLAGS = newEnv.CPPFLAGS.trim(); - - cp.exec( - rooted("vendor/libssh2/configure") + - " --with-libssl-prefix=" + opensslDir, - {cwd: rooted("vendor/libssh2/"), env: newEnv}, - function(err, stdout, stderr) { - if (err) { - console.error(err); - console.error(stderr); - reject(err, stderr); - } - else { - resolve(stdout); - } - } - ); - }); -}; - -// Called on the command line -if (require.main === module) { - if (process.platform === "win32") { - console.log("nothing to do"); - } - else { - module.exports().done(); - } -} diff --git a/lifecycleScripts/install.js b/lifecycleScripts/install.js old mode 100644 new mode 100755 index 16b0471201..96e47afbe5 --- a/lifecycleScripts/install.js +++ b/lifecycleScripts/install.js @@ -1,5 +1,8 @@ var buildFlags = require("../utils/buildFlags"); var spawn = require("child_process").spawn; +var path = require("path"); + +const nodePreGypModulePath = require.resolve("@mapbox/node-pre-gyp"); module.exports = function install() { console.log("[nodegit] Running install script"); @@ -28,7 +31,17 @@ module.exports = function install() { } return new Promise(function(resolve, reject) { - var spawnedNodePreGyp = spawn(nodePreGyp, args); + const gypPath = path.join(__dirname, "..", "node_modules", "node-gyp", "bin", "node-gyp.js"); + + const nodePreGypPath = path.resolve(path.dirname(nodePreGypModulePath), path.join("..", "bin", nodePreGyp)); + console.log("node-pre-gyp path", nodePreGypPath); + var spawnedNodePreGyp = spawn(nodePreGypPath, args, { + env: { + ...process.env, + npm_config_node_gyp: gypPath + }, + shell: process.platform === "win32" + }); spawnedNodePreGyp.stdout.on("data", function(data) { console.info(data.toString().trim()); diff --git a/lifecycleScripts/postinstall.js b/lifecycleScripts/postinstall.js index 7e44aef28f..f8260e3b73 100755 --- a/lifecycleScripts/postinstall.js +++ b/lifecycleScripts/postinstall.js @@ -30,7 +30,7 @@ module.exports = function install() { return Promise.resolve(); } - return exec("node \"" + path.join(rootPath, "dist/nodegit.js\"")) + return exec("node \"" + path.join(rootPath, "lib/nodegit.js\"")) .catch(function(e) { if (~e.toString().indexOf("Module version mismatch")) { console.warn( @@ -46,7 +46,7 @@ module.exports = function install() { } }) .then(function() { - // Is we're using NodeGit from a package manager then let's clean up after + // If we're using NodeGit from a package manager then let's clean up after // ourselves when we install successfully. if (!buildFlags.mustBuild) { // We can't remove the source files yet because apparently the diff --git a/lifecycleScripts/preinstall.js b/lifecycleScripts/preinstall.js old mode 100644 new mode 100755 index 4d712aa830..870cf15580 --- a/lifecycleScripts/preinstall.js +++ b/lifecycleScripts/preinstall.js @@ -2,24 +2,28 @@ var path = require("path"); var local = path.join.bind(path, __dirname); var exec = require(local("../utils/execPromise")); -var configure = require(local("configureLibssh2")); var buildFlags = require(local("../utils/buildFlags")); module.exports = function prepareForBuild() { console.log("[nodegit] Running pre-install script"); return exec("npm -v") - .then(function(npmVersion) { - if (npmVersion.split(".")[0] < 3) { - console.log("[nodegit] npm@2 installed, pre-loading required packages"); - return exec("npm install --ignore-scripts"); - } + .then( + function(npmVersion) { + if (npmVersion.split(".")[0] < 3) { + console.log( + "[nodegit] npm@2 installed, pre-loading required packages" + ); + return exec("npm install --ignore-scripts"); + } - return Promise.resolve(); - }) - .then(function() { - return configure(); - }) + return Promise.resolve(); + }, + function() { + // We're installing via yarn, so don't + // care about compability with npm@2 + } + ) .then(function() { if (buildFlags.isGitRepo) { var submodules = require(local("submodules")); diff --git a/lifecycleScripts/submodules/index.js b/lifecycleScripts/submodules/index.js index 17a2e55651..2d13d3c891 100644 --- a/lifecycleScripts/submodules/index.js +++ b/lifecycleScripts/submodules/index.js @@ -61,17 +61,22 @@ module.exports = function submodules() { console.warn("\nThey will not be updated."); } - return Promise.all(statuses + return statuses .filter(function(status) { return !status.onNewCommit; }) - .map(function(submoduleToUpdate) { - console.log("[nodegit] Initializing submodules"); - - return exec( - "git submodule update --init --recursive " + submoduleToUpdate.name - ); - }) - ); + .reduce(function(chainPromise, submoduleToUpdate) { + return chainPromise + .then(function() { + console.log( + "[nodegit] Initializing submodule", + submoduleToUpdate.name + ); + return exec( + "git submodule update --init --recursive " + + submoduleToUpdate.name + ); + }); + }, Promise.resolve()); }); }; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..93f2f440d8 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,10243 @@ +{ + "name": "nodegit", + "version": "0.28.0-alpha.36", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "nodegit", + "version": "0.28.0-alpha.36", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@mapbox/node-pre-gyp": "^2.0.0", + "fs-extra": "^7.0.0", + "got": "^14.4.7", + "json5": "^2.1.0", + "lodash": "^4.17.14", + "nan": "^2.23.1", + "node-gyp": "^11.2.0", + "tar-fs": "^3.0.9" + }, + "devDependencies": { + "aws-sdk": "^2.1095.0", + "clean-for-publish": "~1.0.2", + "combyne": "~0.8.1", + "js-beautify": "~1.5.10", + "jshint": "^2.10.0", + "lcov-result-merger": "^3.1.0", + "mocha": "^11.4.0", + "nyc": "^17.1.0", + "walk": "^2.3.9" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.5.tgz", + "integrity": "sha512-XvcZi1KWf88RVbF9wn8MN6tYFloU5qX8KjuF3E1PVBmJ9eypXfs4GRiJwLuTZL0iSnJUKn1BFPa5BPZZJyFzPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.7.tgz", + "integrity": "sha512-SRijHmF0PSPgLIBYlWnG0hyeJLwXE2CgpsXaMOrtt2yp9/86ALw6oUlj9KYuZ0JN07T4eBMVIW4li/9S1j2BGA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.5", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.7", + "@babel/parser": "^7.26.7", + "@babel/template": "^7.25.9", + "@babel/traverse": "^7.26.7", + "@babel/types": "^7.26.7", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.5.tgz", + "integrity": "sha512-2caSP6fN9I7HOe6nqhtft7V4g7/V/gfDsC3Ag4W7kEzzvRGKqiv0pu0HogPiZ3KaVSoNDhUws6IJjDjpfmYIXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.26.5", + "@babel/types": "^7.26.5", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", + "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.26.5", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.1.tgz", + "integrity": "sha512-FCvFTm0sWV8Fxhpp2McP5/W53GPllQ9QeQ7SiqGWjMf/LVG07lFa5+pgK05IRhVwtvafT22KF+ZSnM9I545CvQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.2.tgz", + "integrity": "sha512-QYLs8299NA7WM/bZAdp+CviYYkVoYXlDW2rzliy3chxd1PQjej7JORuMJDJXJUb9g0TT+B99EwaVLKmX+sPXWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.27.1" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.7.tgz", + "integrity": "sha512-1x1sgeyRLC3r5fQOM0/xtQKsYjyxmFjaOrLJNtZ81inNjyJHGIolTULPiSc/2qe1/qfpFLisLQYFnnZl7QoedA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.5", + "@babel/parser": "^7.26.7", + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.7", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", + "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@isaacs/fs-minipass/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-2.0.0.tgz", + "integrity": "sha512-llMXd39jtP0HpQLVI37Bf1m2ADlEb35GYSh1SDSLsBhR+5iCxiNGlT31yqbNtVHygHAtMy6dWFERpU2JgufhPg==", + "license": "BSD-3-Clause", + "dependencies": { + "consola": "^3.2.3", + "detect-libc": "^2.0.0", + "https-proxy-agent": "^7.0.5", + "node-fetch": "^2.6.7", + "nopt": "^8.0.0", + "semver": "^7.5.3", + "tar": "^7.4.0" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@npmcli/agent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-3.0.0.tgz", + "integrity": "sha512-S79NdEgDQd/NGCay6TCoVzXSj74skRZIKJcpJjC5lOq34SZzyI6MqtiiWoiVWoVrTcGjNeC4ipbh1VIHlpfF5Q==", + "license": "ISC", + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/fs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-4.0.0.tgz", + "integrity": "sha512-/xGlezI6xfGO9NwuJlnwz/K14qD1kCSAGtacBHnGzeAIuJGazcp45KP5NuyARXoKb7cwulAGWVsbeSxdG/cb0Q==", + "license": "ISC", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@sec-ant/readable-stream": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", + "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==", + "license": "MIT" + }, + "node_modules/@sindresorhus/is": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.0.1.tgz", + "integrity": "sha512-QWLl2P+rsCJeofkDNIT3WFmb6NrRud1SUYW8dIhXK/46XFV8Q/g7Bsvib0Askb0reRLe+WYPeeE+l5cH7SlkuQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "license": "MIT", + "dependencies": { + "defer-to-connect": "^2.0.1" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/@types/http-cache-semantics": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", + "license": "MIT" + }, + "node_modules/abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "node_modules/agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/append-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", + "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", + "dev": true, + "dependencies": { + "buffer-equal": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "default-require-extensions": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", + "dev": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/aws-sdk": { + "version": "2.1692.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1692.0.tgz", + "integrity": "sha512-x511uiJ/57FIsbgUe5csJ13k3uzu25uWQE+XqfBis/sB0SFoiElJWXRkgEAUh0U6n40eT3ay5Ue4oPkRMu1LYw==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "buffer": "4.9.2", + "events": "1.1.1", + "ieee754": "1.1.13", + "jmespath": "0.16.0", + "querystring": "0.2.0", + "sax": "1.2.1", + "url": "0.10.3", + "util": "^0.12.4", + "uuid": "8.0.0", + "xml2js": "0.6.2" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/b4a": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", + "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==", + "license": "Apache-2.0" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/bare-events": { + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.4.tgz", + "integrity": "sha512-+gFfDkR8pj4/TrWCGUGWmJIkBwuxPS5F+a5yWjOHQt2hHvNZd5YLzadjmDUtFmMM4y429bnKLa8bYBMHcYdnQA==", + "license": "Apache-2.0", + "optional": true + }, + "node_modules/bare-fs": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.1.5.tgz", + "integrity": "sha512-1zccWBMypln0jEE05LzZt+V/8y8AQsQQqxtklqaIyg5nu6OAYFhZxPXinJTSG+kU5qyNmeLgcn9AW7eHiCHVLA==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "bare-events": "^2.5.4", + "bare-path": "^3.0.0", + "bare-stream": "^2.6.4" + }, + "engines": { + "bare": ">=1.16.0" + }, + "peerDependencies": { + "bare-buffer": "*" + }, + "peerDependenciesMeta": { + "bare-buffer": { + "optional": true + } + } + }, + "node_modules/bare-os": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.6.1.tgz", + "integrity": "sha512-uaIjxokhFidJP+bmmvKSgiMzj2sV5GPHaZVAIktcxcpCyBFFWO+YlikVAdhmUo2vYFvFhOXIAlldqV29L8126g==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "bare": ">=1.14.0" + } + }, + "node_modules/bare-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz", + "integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "bare-os": "^3.0.1" + } + }, + "node_modules/bare-stream": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.6.5.tgz", + "integrity": "sha512-jSmxKJNJmHySi6hC42zlZnq00rga4jjxcgNZjY9N5WlOe/iOoGRtdwGsHzQv2RlH2KOYMwGUXhf2zXd32BA9RA==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "streamx": "^2.21.0" + }, + "peerDependencies": { + "bare-buffer": "*", + "bare-events": "*" + }, + "peerDependenciesMeta": { + "bare-buffer": { + "optional": true + }, + "bare-events": { + "optional": true + } + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "node_modules/browserslist": { + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "dev": true, + "dependencies": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "node_modules/buffer-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", + "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/cacache": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-19.0.1.tgz", + "integrity": "sha512-hdsUxulXCi5STId78vRVYEtDAjq99ICAUktLTeTYsLoTE6Z8dS0c8pWNCxwdrk9YfJeobDZc2Y186hD/5ZQgFQ==", + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^4.0.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^7.0.2", + "ssri": "^12.0.0", + "tar": "^7.4.3", + "unique-filename": "^4.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/cacache/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/cacache/node_modules/fs-minipass": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", + "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/cacache/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/cacheable-lookup": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", + "license": "MIT", + "engines": { + "node": ">=14.16" + } + }, + "node_modules/cacheable-request": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-12.0.1.tgz", + "integrity": "sha512-Yo9wGIQUaAfIbk+qY0X4cDQgCosecfBe3V9NSyeY4qPC2SAkbCS4Xj79VP8WOzitpJUZKc/wsRCYF5ariDIwkg==", + "license": "MIT", + "dependencies": { + "@types/http-cache-semantics": "^4.0.4", + "get-stream": "^9.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.4", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.1", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cacheable-request/node_modules/mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001696", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001696.tgz", + "integrity": "sha512-pDCPkvzfa39ehJtJ+OwGT/2yvT2SbjfHhiIW2LWOAcMQ7BzwxT/XuyUp4OTOd0XFWA6BKw0JalnBHgSi5DGJBQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/clean-for-publish": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clean-for-publish/-/clean-for-publish-1.0.4.tgz", + "integrity": "sha1-KZMj50qzSwXSIHBsWd+B3QTKAYo=", + "dev": true, + "dependencies": { + "fs-extra": "^0.26.2", + "glob": "~5.0.15", + "yargs": "~3.29.0" + }, + "bin": { + "clean-for-publish": "lib/cli.js" + } + }, + "node_modules/clean-for-publish/node_modules/fs-extra": { + "version": "0.26.7", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.26.7.tgz", + "integrity": "sha1-muH92UiXeY7at20JGM9C0MMYT6k=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "node_modules/clean-for-publish/node_modules/jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/clean-for-publish/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/clean-for-publish/node_modules/rimraf/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", + "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", + "dev": true, + "dependencies": { + "exit": "0.1.2", + "glob": "^7.1.1" + }, + "engines": { + "node": ">=0.2.5" + } + }, + "node_modules/cli/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "dependencies": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cliui/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cliui/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "node_modules/cloneable-readable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", + "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + } + }, + "node_modules/cloneable-readable/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/cloneable-readable/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/cloneable-readable/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/combyne": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/combyne/-/combyne-0.8.1.tgz", + "integrity": "sha1-WJ3kcEXVcVbcHs4YXWTDidzLR9g=", + "dev": true + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "dev": true, + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "dependencies": { + "date-now": "^0.1.4" + } + }, + "node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/convert-source-map/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-require-extensions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz", + "integrity": "sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "strip-bom": "^4.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "dependencies": { + "object-keys": "^1.0.12" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/detect-libc": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", + "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/diff": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/duplexify/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/duplexify/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/duplexify/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.90", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.90.tgz", + "integrity": "sha512-C3PN4aydfW91Natdyd449Kw+BzhLmof6tzy5W1pFC5SpQxVXT+oyiyOG9AgYYSN9OdA/ik3YkCrpwqI8ug5Tug==", + "dev": true, + "license": "ISC" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "license": "MIT" + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "dev": true, + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/exponential-backoff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.1.tgz", + "integrity": "sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==" + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", + "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "license": "MIT", + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "node_modules/flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + } + }, + "node_modules/flush-write-stream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/flush-write-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/flush-write-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/foreachasync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/foreachasync/-/foreachasync-3.0.0.tgz", + "integrity": "sha1-VQKYfchxS+M5IJfzLgBxyd7gfPY=", + "dev": true + }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/form-data-encoder": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-4.0.2.tgz", + "integrity": "sha512-KQVhvhK8ZkWzxKxOr56CPulAhH3dobtuQ4+hNQ+HekH/Wp5gSOafqRAeTphQUJAIk0GBvHZgJ2ZGRWd5kphMuw==", + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs-mkdirp-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", + "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "through2": "^2.0.3" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-stream": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz", + "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==", + "license": "MIT", + "dependencies": { + "@sec-ant/readable-stream": "^0.4.1", + "is-stream": "^4.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-stream/node_modules/is-stream": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", + "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "dev": true, + "dependencies": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "node_modules/glob-stream": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", + "integrity": "sha512-uMbLGAP3S2aDOHUDfdoYcdIePUCfysbAd0IAoWVZbeGU/oNQ8asHVSshLDJUPWxfzj8zsCG7/XeHPHTtow0nsw==", + "dev": true, + "dependencies": { + "extend": "^3.0.0", + "glob": "^7.1.1", + "glob-parent": "^3.1.0", + "is-negated-glob": "^1.0.0", + "ordered-read-streams": "^1.0.0", + "pumpify": "^1.3.5", + "readable-stream": "^2.1.5", + "remove-trailing-separator": "^1.0.1", + "to-absolute-glob": "^2.0.0", + "unique-stream": "^2.0.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/glob-stream/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-stream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/glob-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/glob-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/got": { + "version": "14.4.7", + "resolved": "https://registry.npmjs.org/got/-/got-14.4.7.tgz", + "integrity": "sha512-DI8zV1231tqiGzOiOzQWDhsBmncFW7oQDH6Zgy6pDPrqJuVZMtoSgPLLsBZQj8Jg4JFfwoOsDA8NGtLQLnIx2g==", + "license": "MIT", + "dependencies": { + "@sindresorhus/is": "^7.0.1", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^12.0.1", + "decompress-response": "^6.0.0", + "form-data-encoder": "^4.0.2", + "http2-wrapper": "^2.2.1", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^4.0.1", + "responselike": "^3.0.0", + "type-fest": "^4.26.1" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, + "node_modules/got/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasha": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/http2-wrapper": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", + "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", + "license": "MIT", + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.2.0" + }, + "engines": { + "node": ">=10.19.0" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "license": "MIT", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/ip-address/node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "license": "BSD-3-Clause" + }, + "node_modules/is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "dependencies": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-arguments": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", + "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-function": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "dependencies": { + "is-unc-path": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "node_modules/is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "dependencies": { + "unc-path-regex": "^0.1.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "node_modules/is-valid-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", + "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "append-transform": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-processinfo": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", + "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", + "dev": true, + "license": "ISC", + "dependencies": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.3", + "istanbul-lib-coverage": "^3.2.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-processinfo/node_modules/p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-processinfo/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jmespath": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.16.0.tgz", + "integrity": "sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/js-beautify": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.5.10.tgz", + "integrity": "sha1-TZU3FwJpk0SlFsomv1nwonu3Vxk=", + "dev": true, + "dependencies": { + "config-chain": "~1.1.5", + "mkdirp": "~0.5.0", + "nopt": "~3.0.1" + }, + "bin": { + "css-beautify": "js/bin/css-beautify.js", + "html-beautify": "js/bin/html-beautify.js", + "js-beautify": "js/bin/js-beautify.js" + } + }, + "node_modules/js-beautify/node_modules/nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/js-yaml/node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jshint": { + "version": "2.13.4", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.13.4.tgz", + "integrity": "sha512-HO3bosL84b2qWqI0q+kpT/OpRJwo0R4ivgmxaO848+bo10rc50SkPnrtwSFXttW0ym4np8jbJvLwk5NziB7jIw==", + "dev": true, + "dependencies": { + "cli": "~1.0.0", + "console-browserify": "1.1.x", + "exit": "0.1.x", + "htmlparser2": "3.8.x", + "lodash": "~4.17.21", + "minimatch": "~3.0.2", + "strip-json-comments": "1.0.x" + }, + "bin": { + "jshint": "bin/jshint" + } + }, + "node_modules/jshint/node_modules/dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "dev": true, + "dependencies": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + } + }, + "node_modules/jshint/node_modules/dom-serializer/node_modules/domelementtype": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", + "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/jshint/node_modules/dom-serializer/node_modules/entities": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/jshint/node_modules/domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, + "node_modules/jshint/node_modules/domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "dev": true, + "dependencies": { + "domelementtype": "1" + } + }, + "node_modules/jshint/node_modules/domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "dependencies": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "node_modules/jshint/node_modules/entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", + "dev": true + }, + "node_modules/jshint/node_modules/htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "dev": true, + "dependencies": { + "domelementtype": "1", + "domhandler": "2.3", + "domutils": "1.5", + "entities": "1.0", + "readable-stream": "1.1" + } + }, + "node_modules/jshint/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "node_modules/jshint/node_modules/minimatch": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/jshint/node_modules/readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/jshint/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.9" + } + }, + "node_modules/lazystream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "dev": true, + "dependencies": { + "readable-stream": "^2.0.5" + }, + "engines": { + "node": ">= 0.6.3" + } + }, + "node_modules/lazystream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/lazystream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/lazystream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "dependencies": { + "invert-kv": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lcov-result-merger": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lcov-result-merger/-/lcov-result-merger-3.3.0.tgz", + "integrity": "sha512-Krg9p24jGaIT93RBMA8b5qLHDEiAXTavaTiEdMAZaJS93PsBKIcg/89cw/8rgeSfRuQX+I9x7h73SHFjCZ6cHg==", + "dev": true, + "dependencies": { + "through2": "^2.0.3", + "vinyl": "^2.1.0", + "vinyl-fs": "^3.0.2", + "yargs": "^16.2.0" + }, + "bin": { + "lcov-result-merger": "bin/lcov-result-merger.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/lcov-result-merger/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/lcov-result-merger/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/lcov-result-merger/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/lcov-result-merger/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/lead": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", + "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", + "dev": true, + "dependencies": { + "flush-write-stream": "^1.0.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/make-fetch-happen": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-14.0.3.tgz", + "integrity": "sha512-QMjGbFTP0blj97EeidG5hk/QhKQ3T4ICckQGLgz38QF7Vgbk6e6FTARN8KhKxyBbWn8R0HU+bnw8aSoFPD4qtQ==", + "license": "ISC", + "dependencies": { + "@npmcli/agent": "^3.0.0", + "cacache": "^19.0.1", + "http-cache-semantics": "^4.1.1", + "minipass": "^7.0.2", + "minipass-fetch": "^4.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^1.0.0", + "proc-log": "^5.0.0", + "promise-retry": "^2.0.1", + "ssri": "^12.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/make-fetch-happen/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz", + "integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-collect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-2.0.1.tgz", + "integrity": "sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-collect/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-fetch": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-4.0.1.tgz", + "integrity": "sha512-j7U11C5HXigVuutxebFadoYBbd7VSdZWggSe64NVdvWNBqGAiXPL2QVCehjmw7lY1oF9gOllYbORh+hiNgfPgQ==", + "license": "MIT", + "dependencies": { + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^3.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" + } + }, + "node_modules/minipass-fetch/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.2.tgz", + "integrity": "sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==", + "license": "MIT", + "dependencies": { + "minipass": "^7.1.2" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mocha": { + "version": "11.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.4.0.tgz", + "integrity": "sha512-O6oi5Y9G6uu8f9iqXR6iKNLWHLRex3PKbmHynfpmUnMJJGrdgXh8ZmS85Ei5KR2Gnl+/gQ9s+Ktv5CqKybNw4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "browser-stdout": "^1.3.1", + "chokidar": "^4.0.1", + "debug": "^4.3.5", + "diff": "^7.0.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^10.4.5", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "picocolors": "^1.1.1", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/mocha/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/mocha/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/mocha/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/mocha/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/mocha/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mocha/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/mocha/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nan": { + "version": "2.23.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.23.1.tgz", + "integrity": "sha512-r7bBUGKzlqk8oPBDYxt6Z0aEdF1G1rwlMcLk8LCOMbOzf0mG+JUfUzG4fIMWwHWP0iyaLWEQZJmtB7nOHEm/qw==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-gyp": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-11.2.0.tgz", + "integrity": "sha512-T0S1zqskVUSxcsSTkAsLc7xCycrRYmtDHadDinzocrThjyQCn5kMlEBSj6H4qDbgsIOSLmmlRIeb0lZXj+UArA==", + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.0", + "exponential-backoff": "^3.1.1", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^14.0.3", + "nopt": "^8.0.0", + "proc-log": "^5.0.0", + "semver": "^7.3.5", + "tar": "^7.4.3", + "tinyglobby": "^0.2.12", + "which": "^5.0.0" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "process-on-spawn": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "dev": true, + "license": "MIT" + }, + "node_modules/nopt": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-8.1.0.tgz", + "integrity": "sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==", + "license": "ISC", + "dependencies": { + "abbrev": "^3.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/nopt/node_modules/abbrev": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.1.tgz", + "integrity": "sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==", + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-url": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", + "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==", + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/now-and-later": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", + "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", + "dev": true, + "dependencies": { + "once": "^1.3.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nyc": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-17.1.0.tgz", + "integrity": "sha512-U42vQ4czpKa0QdI1hu950XuNhYqgoM+ZF1HT+VuUHL9hPfDPVvNQyltmMqdE9bUHMVa+8yNbc3QKTj8zQhlVxQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^3.3.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^6.0.2", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "bin": { + "nyc": "bin/nyc.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/nyc/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/nyc/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/nyc/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/nyc/node_modules/p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/nyc/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/ordered-read-streams": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", + "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", + "dev": true, + "dependencies": { + "readable-stream": "^2.0.1" + } + }, + "node_modules/ordered-read-streams/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/ordered-read-streams/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/ordered-read-streams/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "dependencies": { + "lcid": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-cancelable": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-4.0.1.tgz", + "integrity": "sha512-wBowNApzd45EIKdO1LaU+LrMBwAcjfPaYtVzV3lmfM3gf8Z4CHZsiIqlM8TZZ8okYvh5A1cP6gTfCRQtwUpaUg==", + "license": "MIT", + "engines": { + "node": ">=14.16" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-map": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.3.tgz", + "integrity": "sha512-VkndIv2fIB99swvQoA65bm+fsmt6UNdGeIB0oxBs+WhAhdh08QA04JXpI7rbB9r08/nkbysKoya9rtDERYOYMA==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "license": "BlueOak-1.0.0" + }, + "node_modules/path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/proc-log": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-5.0.0.tgz", + "integrity": "sha512-Azwzvl90HaF0aCz1JrDdXQykFakSSNPaPoiZ9fm5qJIMHioDZEi7OAdRwSm6rSoPtY3Qutnm3L7ogmg3dc+wbQ==", + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/process-on-spawn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.1.0.tgz", + "integrity": "sha512-JOnOPQ/8TZgjs1JIH/m9ni7FfimjNa/PRx7y/Wb5qdItsnhO0jE4AT7fC0HjC28DUQWDr50dwSYZLdRMlqDq3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "fromentries": "^1.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "license": "MIT", + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", + "dev": true + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "dependencies": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "node_modules/pumpify/node_modules/pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", + "dev": true, + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==", + "dev": true, + "license": "ISC", + "dependencies": { + "es6-error": "^4.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/remove-bom-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", + "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5", + "is-utf8": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/remove-bom-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", + "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", + "dev": true, + "dependencies": { + "remove-bom-buffer": "^3.0.0", + "safe-buffer": "^5.1.0", + "through2": "^2.0.3" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "node_modules/replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true, + "license": "ISC" + }, + "node_modules/resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", + "license": "MIT" + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-options": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", + "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", + "dev": true, + "dependencies": { + "value-or-function": "^3.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/responselike": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", + "license": "MIT", + "dependencies": { + "lowercase-keys": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "optional": true + }, + "node_modules/sax": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", + "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==", + "dev": true, + "license": "ISC" + }, + "node_modules/semver": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.0.tgz", + "integrity": "sha512-DrfFnPzblFmNrIZzg5RzHegbiRWg7KMR7btwi2yjHwx06zsUbO5g613sVwEV7FTwmzJu+Io0lJe2GJ3LxqpvBQ==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.4.tgz", + "integrity": "sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==", + "license": "MIT", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/spawn-wrap/node_modules/foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/spawn-wrap/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/ssri": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-12.0.0.tgz", + "integrity": "sha512-S7iGNosepx9RadX82oimUkvr0Ct7IjJbEbs4mJcTxst8um95J3sDYU1RBEOvdu6oL1Wek2ODI5i4MAw+dZ6cAQ==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/ssri/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", + "dev": true + }, + "node_modules/streamx": { + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.22.0.tgz", + "integrity": "sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw==", + "license": "MIT", + "dependencies": { + "fast-fifo": "^1.3.2", + "text-decoder": "^1.1.0" + }, + "optionalDependencies": { + "bare-events": "^2.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", + "dev": true, + "bin": { + "strip-json-comments": "cli.js" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/tar": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "license": "ISC", + "dependencies": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/tar-fs": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.1.tgz", + "integrity": "sha512-LZA0oaPOc2fVo82Txf3gw+AkEd38szODlptMYejQUhndHMLQ9M059uXR+AfS7DNo0NpINvSqDsvyaCrBVkptWg==", + "dependencies": { + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^4.0.1", + "bare-path": "^3.0.0" + } + }, + "node_modules/tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "license": "MIT", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/tar/node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/text-decoder": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", + "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.6.4" + } + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/through2-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", + "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", + "dev": true, + "dependencies": { + "through2": "~2.0.0", + "xtend": "~4.0.0" + } + }, + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/through2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz", + "integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==", + "license": "MIT", + "dependencies": { + "fdir": "^6.4.4", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/to-absolute-glob": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", + "dev": true, + "dependencies": { + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-through": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", + "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", + "dev": true, + "dependencies": { + "through2": "^2.0.3" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unique-filename": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-4.0.0.tgz", + "integrity": "sha512-XSnEewXmQ+veP7xX2dS5Q4yZAvO40cBN2MWkJ7D/6sW4Dg6wYBNwM1Vrnz1FhH5AdeLIlUXRI9e28z1YZi71NQ==", + "license": "ISC", + "dependencies": { + "unique-slug": "^5.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/unique-slug": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-5.0.0.tgz", + "integrity": "sha512-9OdaqO5kwqR+1kVgHAhsp5vPNU0hnxRa26rBFNfNgM7M6pNtgzeBn3s/xbyCQL3dcjzOatcef6UUHpB/6MaETg==", + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/unique-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", + "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", + "dev": true, + "dependencies": { + "json-stable-stringify-without-jsonify": "^1.0.1", + "through2-filter": "^3.0.0" + } + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", + "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/url": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", + "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", + "dev": true, + "dependencies": { + "punycode": "1.3.2", + "querystring": "0.2.0" + } + }, + "node_modules/url/node_modules/punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "node_modules/uuid": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.0.0.tgz", + "integrity": "sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/value-or-function": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", + "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vinyl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", + "dev": true, + "dependencies": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vinyl-fs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", + "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", + "dev": true, + "dependencies": { + "fs-mkdirp-stream": "^1.0.0", + "glob-stream": "^6.1.0", + "graceful-fs": "^4.0.0", + "is-valid-glob": "^1.0.0", + "lazystream": "^1.0.0", + "lead": "^1.0.0", + "object.assign": "^4.0.4", + "pumpify": "^1.3.5", + "readable-stream": "^2.3.3", + "remove-bom-buffer": "^3.0.0", + "remove-bom-stream": "^1.2.0", + "resolve-options": "^1.1.0", + "through2": "^2.0.0", + "to-through": "^2.0.0", + "value-or-function": "^3.0.0", + "vinyl": "^2.0.0", + "vinyl-sourcemap": "^1.1.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vinyl-fs/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/vinyl-fs/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/vinyl-fs/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/vinyl-sourcemap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", + "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", + "dev": true, + "dependencies": { + "append-buffer": "^1.0.2", + "convert-source-map": "^1.5.0", + "graceful-fs": "^4.1.6", + "normalize-path": "^2.1.1", + "now-and-later": "^2.0.0", + "remove-bom-buffer": "^3.0.0", + "vinyl": "^2.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/walk": { + "version": "2.3.15", + "resolved": "https://registry.npmjs.org/walk/-/walk-2.3.15.tgz", + "integrity": "sha512-4eRTBZljBfIISK1Vnt69Gvr2w/wc3U6Vtrw7qiN5iqYJPH7LElcYh/iU4XWhdCy2dZqv1ToMyYlybDylfG/5Vg==", + "dev": true, + "dependencies": { + "foreachasync": "^3.0.0" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz", + "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==", + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/which-typed-array": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "license": "ISC", + "engines": { + "node": ">=16" + } + }, + "node_modules/window-size": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", + "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=", + "dev": true, + "bin": { + "window-size": "cli.js" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "dependencies": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/xml2js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", + "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "dev": true, + "license": "MIT", + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", + "dev": true + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yargs": { + "version": "3.29.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.29.0.tgz", + "integrity": "sha1-GquWYOrnnYuPZ1vK7qtu40ws9pw=", + "dev": true, + "dependencies": { + "camelcase": "^1.2.1", + "cliui": "^3.0.3", + "decamelize": "^1.0.0", + "os-locale": "^1.4.0", + "window-size": "^0.1.2", + "y18n": "^3.2.0" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs-unparser/node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + }, + "dependencies": { + "@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + } + }, + "@babel/compat-data": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.5.tgz", + "integrity": "sha512-XvcZi1KWf88RVbF9wn8MN6tYFloU5qX8KjuF3E1PVBmJ9eypXfs4GRiJwLuTZL0iSnJUKn1BFPa5BPZZJyFzPg==", + "dev": true + }, + "@babel/core": { + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.7.tgz", + "integrity": "sha512-SRijHmF0PSPgLIBYlWnG0hyeJLwXE2CgpsXaMOrtt2yp9/86ALw6oUlj9KYuZ0JN07T4eBMVIW4li/9S1j2BGA==", + "dev": true, + "peer": true, + "requires": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.5", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.7", + "@babel/parser": "^7.26.7", + "@babel/template": "^7.25.9", + "@babel/traverse": "^7.26.7", + "@babel/types": "^7.26.7", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "dependencies": { + "convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.5.tgz", + "integrity": "sha512-2caSP6fN9I7HOe6nqhtft7V4g7/V/gfDsC3Ag4W7kEzzvRGKqiv0pu0HogPiZ3KaVSoNDhUws6IJjDjpfmYIXw==", + "dev": true, + "requires": { + "@babel/parser": "^7.26.5", + "@babel/types": "^7.26.5", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", + "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.26.5", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, + "@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "dev": true, + "requires": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + } + }, + "@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" + } + }, + "@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true + }, + "@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "dev": true + }, + "@babel/helpers": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.1.tgz", + "integrity": "sha512-FCvFTm0sWV8Fxhpp2McP5/W53GPllQ9QeQ7SiqGWjMf/LVG07lFa5+pgK05IRhVwtvafT22KF+ZSnM9I545CvQ==", + "dev": true, + "requires": { + "@babel/template": "^7.27.1", + "@babel/types": "^7.27.1" + } + }, + "@babel/parser": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.2.tgz", + "integrity": "sha512-QYLs8299NA7WM/bZAdp+CviYYkVoYXlDW2rzliy3chxd1PQjej7JORuMJDJXJUb9g0TT+B99EwaVLKmX+sPXWw==", + "dev": true, + "requires": { + "@babel/types": "^7.27.1" + } + }, + "@babel/template": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" + } + }, + "@babel/traverse": { + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.7.tgz", + "integrity": "sha512-1x1sgeyRLC3r5fQOM0/xtQKsYjyxmFjaOrLJNtZ81inNjyJHGIolTULPiSc/2qe1/qfpFLisLQYFnnZl7QoedA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.5", + "@babel/parser": "^7.26.7", + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.7", + "debug": "^4.3.1", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", + "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "dev": true, + "requires": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1" + } + }, + "@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "requires": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==" + }, + "ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==" + }, + "emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "requires": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + } + }, + "strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "requires": { + "ansi-regex": "^6.0.1" + } + }, + "wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "requires": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + } + } + } + }, + "@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "requires": { + "minipass": "^7.0.4" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, + "@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "@mapbox/node-pre-gyp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-2.0.0.tgz", + "integrity": "sha512-llMXd39jtP0HpQLVI37Bf1m2ADlEb35GYSh1SDSLsBhR+5iCxiNGlT31yqbNtVHygHAtMy6dWFERpU2JgufhPg==", + "requires": { + "consola": "^3.2.3", + "detect-libc": "^2.0.0", + "https-proxy-agent": "^7.0.5", + "node-fetch": "^2.6.7", + "nopt": "^8.0.0", + "semver": "^7.5.3", + "tar": "^7.4.0" + } + }, + "@npmcli/agent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-3.0.0.tgz", + "integrity": "sha512-S79NdEgDQd/NGCay6TCoVzXSj74skRZIKJcpJjC5lOq34SZzyI6MqtiiWoiVWoVrTcGjNeC4ipbh1VIHlpfF5Q==", + "requires": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" + } + }, + "@npmcli/fs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-4.0.0.tgz", + "integrity": "sha512-/xGlezI6xfGO9NwuJlnwz/K14qD1kCSAGtacBHnGzeAIuJGazcp45KP5NuyARXoKb7cwulAGWVsbeSxdG/cb0Q==", + "requires": { + "semver": "^7.3.5" + } + }, + "@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "optional": true + }, + "@sec-ant/readable-stream": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", + "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==" + }, + "@sindresorhus/is": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.0.1.tgz", + "integrity": "sha512-QWLl2P+rsCJeofkDNIT3WFmb6NrRud1SUYW8dIhXK/46XFV8Q/g7Bsvib0Askb0reRLe+WYPeeE+l5cH7SlkuQ==" + }, + "@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "requires": { + "defer-to-connect": "^2.0.1" + } + }, + "@types/http-cache-semantics": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==" + }, + "abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==" + }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "append-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", + "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", + "dev": true, + "requires": { + "buffer-equal": "^1.0.0" + } + }, + "append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "requires": { + "default-require-extensions": "^3.0.0" + } + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "requires": { + "possible-typed-array-names": "^1.0.0" + } + }, + "aws-sdk": { + "version": "2.1692.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1692.0.tgz", + "integrity": "sha512-x511uiJ/57FIsbgUe5csJ13k3uzu25uWQE+XqfBis/sB0SFoiElJWXRkgEAUh0U6n40eT3ay5Ue4oPkRMu1LYw==", + "dev": true, + "requires": { + "buffer": "4.9.2", + "events": "1.1.1", + "ieee754": "1.1.13", + "jmespath": "0.16.0", + "querystring": "0.2.0", + "sax": "1.2.1", + "url": "0.10.3", + "util": "^0.12.4", + "uuid": "8.0.0", + "xml2js": "0.6.2" + } + }, + "b4a": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", + "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==" + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "bare-events": { + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.4.tgz", + "integrity": "sha512-+gFfDkR8pj4/TrWCGUGWmJIkBwuxPS5F+a5yWjOHQt2hHvNZd5YLzadjmDUtFmMM4y429bnKLa8bYBMHcYdnQA==", + "optional": true + }, + "bare-fs": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.1.5.tgz", + "integrity": "sha512-1zccWBMypln0jEE05LzZt+V/8y8AQsQQqxtklqaIyg5nu6OAYFhZxPXinJTSG+kU5qyNmeLgcn9AW7eHiCHVLA==", + "optional": true, + "requires": { + "bare-events": "^2.5.4", + "bare-path": "^3.0.0", + "bare-stream": "^2.6.4" + } + }, + "bare-os": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.6.1.tgz", + "integrity": "sha512-uaIjxokhFidJP+bmmvKSgiMzj2sV5GPHaZVAIktcxcpCyBFFWO+YlikVAdhmUo2vYFvFhOXIAlldqV29L8126g==", + "optional": true + }, + "bare-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz", + "integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==", + "optional": true, + "requires": { + "bare-os": "^3.0.1" + } + }, + "bare-stream": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.6.5.tgz", + "integrity": "sha512-jSmxKJNJmHySi6hC42zlZnq00rga4jjxcgNZjY9N5WlOe/iOoGRtdwGsHzQv2RlH2KOYMwGUXhf2zXd32BA9RA==", + "optional": true, + "requires": { + "streamx": "^2.21.0" + } + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "browserslist": { + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "dev": true, + "peer": true, + "requires": { + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" + } + }, + "buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "buffer-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", + "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", + "dev": true + }, + "cacache": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-19.0.1.tgz", + "integrity": "sha512-hdsUxulXCi5STId78vRVYEtDAjq99ICAUktLTeTYsLoTE6Z8dS0c8pWNCxwdrk9YfJeobDZc2Y186hD/5ZQgFQ==", + "requires": { + "@npmcli/fs": "^4.0.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^7.0.2", + "ssri": "^12.0.0", + "tar": "^7.4.3", + "unique-filename": "^4.0.0" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "fs-minipass": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", + "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", + "requires": { + "minipass": "^7.0.3" + } + }, + "glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + } + }, + "minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "cacheable-lookup": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==" + }, + "cacheable-request": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-12.0.1.tgz", + "integrity": "sha512-Yo9wGIQUaAfIbk+qY0X4cDQgCosecfBe3V9NSyeY4qPC2SAkbCS4Xj79VP8WOzitpJUZKc/wsRCYF5ariDIwkg==", + "requires": { + "@types/http-cache-semantics": "^4.0.4", + "get-stream": "^9.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.4", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.1", + "responselike": "^3.0.0" + }, + "dependencies": { + "mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==" + } + } + }, + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "requires": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + } + }, + "call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + } + }, + "call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + } + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001696", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001696.tgz", + "integrity": "sha512-pDCPkvzfa39ehJtJ+OwGT/2yvT2SbjfHhiIW2LWOAcMQ7BzwxT/XuyUp4OTOd0XFWA6BKw0JalnBHgSi5DGJBQ==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "requires": { + "readdirp": "^4.0.1" + } + }, + "chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==" + }, + "clean-for-publish": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clean-for-publish/-/clean-for-publish-1.0.4.tgz", + "integrity": "sha1-KZMj50qzSwXSIHBsWd+B3QTKAYo=", + "dev": true, + "requires": { + "fs-extra": "^0.26.2", + "glob": "~5.0.15", + "yargs": "~3.29.0" + }, + "dependencies": { + "fs-extra": { + "version": "0.26.7", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.26.7.tgz", + "integrity": "sha1-muH92UiXeY7at20JGM9C0MMYT6k=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + } + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "cli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", + "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", + "dev": true, + "requires": { + "exit": "0.1.2", + "glob": "^7.1.1" + }, + "dependencies": { + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "cloneable-readable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", + "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "combyne": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/combyne/-/combyne-0.8.1.tgz", + "integrity": "sha1-WJ3kcEXVcVbcHs4YXWTDidzLR9g=", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "dev": true, + "requires": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==" + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "^0.1.4" + } + }, + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "requires": { + "ms": "^2.1.3" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "requires": { + "mimic-response": "^3.1.0" + } + }, + "default-require-extensions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz", + "integrity": "sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==", + "dev": true, + "requires": { + "strip-bom": "^4.0.0" + } + }, + "defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==" + }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "detect-libc": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", + "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==" + }, + "diff": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", + "dev": true + }, + "dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + }, + "electron-to-chromium": { + "version": "1.5.90", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.90.tgz", + "integrity": "sha512-C3PN4aydfW91Natdyd449Kw+BzhLmof6tzy5W1pFC5SpQxVXT+oyiyOG9AgYYSN9OdA/ik3YkCrpwqI8ug5Tug==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, + "env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==" + }, + "err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==" + }, + "es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, + "es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0" + } + }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, + "escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "dev": true + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "exponential-backoff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.1.tgz", + "integrity": "sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==" + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==" + }, + "fdir": { + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", + "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", + "requires": {} + }, + "find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true + }, + "flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "dev": true, + "requires": { + "is-callable": "^1.2.7" + } + }, + "foreachasync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/foreachasync/-/foreachasync-3.0.0.tgz", + "integrity": "sha1-VQKYfchxS+M5IJfzLgBxyd7gfPY=", + "dev": true + }, + "foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "dependencies": { + "signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==" + } + } + }, + "form-data-encoder": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-4.0.2.tgz", + "integrity": "sha512-KQVhvhK8ZkWzxKxOr56CPulAhH3dobtuQ4+hNQ+HekH/Wp5gSOafqRAeTphQUJAIk0GBvHZgJ2ZGRWd5kphMuw==" + }, + "fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", + "dev": true + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs-mkdirp-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", + "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "through2": "^2.0.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + } + }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, + "get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "requires": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + } + }, + "get-stream": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz", + "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==", + "requires": { + "@sec-ant/readable-stream": "^0.4.1", + "is-stream": "^4.0.1" + }, + "dependencies": { + "is-stream": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", + "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==" + } + } + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "glob-stream": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", + "integrity": "sha512-uMbLGAP3S2aDOHUDfdoYcdIePUCfysbAd0IAoWVZbeGU/oNQ8asHVSshLDJUPWxfzj8zsCG7/XeHPHTtow0nsw==", + "dev": true, + "requires": { + "extend": "^3.0.0", + "glob": "^7.1.1", + "glob-parent": "^3.1.0", + "is-negated-glob": "^1.0.0", + "ordered-read-streams": "^1.0.0", + "pumpify": "^1.3.5", + "readable-stream": "^2.1.5", + "remove-trailing-separator": "^1.0.1", + "to-absolute-glob": "^2.0.0", + "unique-stream": "^2.0.2" + }, + "dependencies": { + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true + }, + "got": { + "version": "14.4.7", + "resolved": "https://registry.npmjs.org/got/-/got-14.4.7.tgz", + "integrity": "sha512-DI8zV1231tqiGzOiOzQWDhsBmncFW7oQDH6Zgy6pDPrqJuVZMtoSgPLLsBZQj8Jg4JFfwoOsDA8NGtLQLnIx2g==", + "requires": { + "@sindresorhus/is": "^7.0.1", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^12.0.1", + "decompress-response": "^6.0.0", + "form-data-encoder": "^4.0.2", + "http2-wrapper": "^2.2.1", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^4.0.1", + "responselike": "^3.0.0", + "type-fest": "^4.26.1" + }, + "dependencies": { + "type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==" + } + } + }, + "graceful-fs": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==" + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true + }, + "has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.3" + } + }, + "hasha": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", + "dev": true, + "requires": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + } + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" + }, + "http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "requires": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + } + }, + "http2-wrapper": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", + "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", + "requires": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.2.0" + } + }, + "https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "requires": { + "agent-base": "^7.1.2", + "debug": "4" + } + }, + "iconv-lite": { + "version": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "requires": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "dependencies": { + "sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==" + } + } + }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-arguments": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", + "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "is-generator-function": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + } + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + }, + "is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "dev": true + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true + }, + "is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + } + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "requires": { + "which-typed-array": "^1.1.16" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.2" + } + }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-valid-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", + "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "requires": { + "append-transform": "^2.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "requires": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + } + }, + "istanbul-lib-processinfo": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", + "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.3", + "istanbul-lib-coverage": "^3.2.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^8.3.2" + }, + "dependencies": { + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "requires": { + "semver": "^7.5.3" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "requires": { + "@isaacs/cliui": "^8.0.2", + "@pkgjs/parseargs": "^0.11.0" + } + }, + "jmespath": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.16.0.tgz", + "integrity": "sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw==", + "dev": true + }, + "js-beautify": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.5.10.tgz", + "integrity": "sha1-TZU3FwJpk0SlFsomv1nwonu3Vxk=", + "dev": true, + "requires": { + "config-chain": "~1.1.5", + "mkdirp": "~0.5.0", + "nopt": "~3.0.1" + }, + "dependencies": { + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1" + } + } + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + } + } + }, + "jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" + }, + "jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true + }, + "jshint": { + "version": "2.13.4", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.13.4.tgz", + "integrity": "sha512-HO3bosL84b2qWqI0q+kpT/OpRJwo0R4ivgmxaO848+bo10rc50SkPnrtwSFXttW0ym4np8jbJvLwk5NziB7jIw==", + "dev": true, + "requires": { + "cli": "~1.0.0", + "console-browserify": "1.1.x", + "exit": "0.1.x", + "htmlparser2": "3.8.x", + "lodash": "~4.17.21", + "minimatch": "~3.0.2", + "strip-json-comments": "1.0.x" + }, + "dependencies": { + "dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + }, + "dependencies": { + "domelementtype": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", + "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==", + "dev": true + }, + "entities": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true + } + } + }, + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, + "domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "dev": true, + "requires": { + "domelementtype": "1" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", + "dev": true + }, + "htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "dev": true, + "requires": { + "domelementtype": "1", + "domhandler": "2.3", + "domutils": "1.5", + "entities": "1.0", + "readable-stream": "1.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "minimatch": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==" + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "requires": { + "json-buffer": "3.0.1" + } + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "lazystream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "dev": true, + "requires": { + "readable-stream": "^2.0.5" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "lcov-result-merger": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lcov-result-merger/-/lcov-result-merger-3.3.0.tgz", + "integrity": "sha512-Krg9p24jGaIT93RBMA8b5qLHDEiAXTavaTiEdMAZaJS93PsBKIcg/89cw/8rgeSfRuQX+I9x7h73SHFjCZ6cHg==", + "dev": true, + "requires": { + "through2": "^2.0.3", + "vinyl": "^2.1.0", + "vinyl-fs": "^3.0.2", + "yargs": "^16.2.0" + }, + "dependencies": { + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + } + } + }, + "lead": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", + "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", + "dev": true, + "requires": { + "flush-write-stream": "^1.0.2" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", + "dev": true + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + } + }, + "lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==" + }, + "lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "make-fetch-happen": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-14.0.3.tgz", + "integrity": "sha512-QMjGbFTP0blj97EeidG5hk/QhKQ3T4ICckQGLgz38QF7Vgbk6e6FTARN8KhKxyBbWn8R0HU+bnw8aSoFPD4qtQ==", + "requires": { + "@npmcli/agent": "^3.0.0", + "cacache": "^19.0.1", + "http-cache-semantics": "^4.1.1", + "minipass": "^7.0.2", + "minipass-fetch": "^4.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^1.0.0", + "proc-log": "^5.0.0", + "promise-retry": "^2.0.1", + "ssri": "^12.0.0" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true + }, + "mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==" + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true + }, + "minipass": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz", + "integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==", + "requires": { + "yallist": "^4.0.0" + } + }, + "minipass-collect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-2.0.1.tgz", + "integrity": "sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==", + "requires": { + "minipass": "^7.0.3" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "minipass-fetch": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-4.0.1.tgz", + "integrity": "sha512-j7U11C5HXigVuutxebFadoYBbd7VSdZWggSe64NVdvWNBqGAiXPL2QVCehjmw7lY1oF9gOllYbORh+hiNgfPgQ==", + "requires": { + "encoding": "^0.1.13", + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^3.0.1" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "requires": { + "minipass": "^3.0.0" + } + }, + "minizlib": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.2.tgz", + "integrity": "sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==", + "requires": { + "minipass": "^7.1.2" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "mocha": { + "version": "11.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.4.0.tgz", + "integrity": "sha512-O6oi5Y9G6uu8f9iqXR6iKNLWHLRex3PKbmHynfpmUnMJJGrdgXh8ZmS85Ei5KR2Gnl+/gQ9s+Ktv5CqKybNw4A==", + "dev": true, + "requires": { + "browser-stdout": "^1.3.1", + "chokidar": "^4.0.1", + "debug": "^4.3.5", + "diff": "^7.0.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^10.4.5", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "picocolors": "^1.1.1", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", + "yargs-unparser": "^2.0.0" + }, + "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "dependencies": { + "minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "requires": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + } + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true + } + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "nan": { + "version": "2.23.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.23.1.tgz", + "integrity": "sha512-r7bBUGKzlqk8oPBDYxt6Z0aEdF1G1rwlMcLk8LCOMbOzf0mG+JUfUzG4fIMWwHWP0iyaLWEQZJmtB7nOHEm/qw==" + }, + "negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==" + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "node-gyp": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-11.2.0.tgz", + "integrity": "sha512-T0S1zqskVUSxcsSTkAsLc7xCycrRYmtDHadDinzocrThjyQCn5kMlEBSj6H4qDbgsIOSLmmlRIeb0lZXj+UArA==", + "requires": { + "env-paths": "^2.2.0", + "exponential-backoff": "^3.1.1", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^14.0.3", + "nopt": "^8.0.0", + "proc-log": "^5.0.0", + "semver": "^7.3.5", + "tar": "^7.4.3", + "tinyglobby": "^0.2.12", + "which": "^5.0.0" + } + }, + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "requires": { + "process-on-spawn": "^1.0.0" + } + }, + "node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "dev": true + }, + "nopt": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-8.1.0.tgz", + "integrity": "sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==", + "requires": { + "abbrev": "^3.0.0" + }, + "dependencies": { + "abbrev": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.1.tgz", + "integrity": "sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==" + } + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "normalize-url": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", + "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==" + }, + "now-and-later": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", + "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", + "dev": true, + "requires": { + "once": "^1.3.2" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nyc": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-17.1.0.tgz", + "integrity": "sha512-U42vQ4czpKa0QdI1hu950XuNhYqgoM+ZF1HT+VuUHL9hPfDPVvNQyltmMqdE9bUHMVa+8yNbc3QKTj8zQhlVxQ==", + "dev": true, + "requires": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^3.3.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^6.0.2", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "ordered-read-streams": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", + "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "^1.0.0" + } + }, + "p-cancelable": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-4.0.1.tgz", + "integrity": "sha512-wBowNApzd45EIKdO1LaU+LrMBwAcjfPaYtVzV3lmfM3gf8Z4CHZsiIqlM8TZZ8okYvh5A1cP6gTfCRQtwUpaUg==" + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-map": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.3.tgz", + "integrity": "sha512-VkndIv2fIB99swvQoA65bm+fsmt6UNdGeIB0oxBs+WhAhdh08QA04JXpI7rbB9r08/nkbysKoya9rtDERYOYMA==" + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, + "package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==" + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "requires": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true + }, + "picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "peer": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true + }, + "proc-log": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-5.0.0.tgz", + "integrity": "sha512-Azwzvl90HaF0aCz1JrDdXQykFakSSNPaPoiZ9fm5qJIMHioDZEi7OAdRwSm6rSoPtY3Qutnm3L7ogmg3dc+wbQ==" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "process-on-spawn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.1.0.tgz", + "integrity": "sha512-JOnOPQ/8TZgjs1JIH/m9ni7FfimjNa/PRx7y/Wb5qdItsnhO0jE4AT7fC0HjC28DUQWDr50dwSYZLdRMlqDq3Q==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, + "promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "requires": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + } + }, + "proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", + "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==" + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true + }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, + "remove-bom-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", + "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", + "dev": true, + "requires": { + "is-buffer": "^1.1.5", + "is-utf8": "^0.2.1" + } + }, + "remove-bom-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", + "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", + "dev": true, + "requires": { + "remove-bom-buffer": "^3.0.0", + "safe-buffer": "^5.1.0", + "through2": "^2.0.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "resolve-options": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", + "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", + "dev": true, + "requires": { + "value-or-function": "^3.0.0" + } + }, + "responselike": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", + "requires": { + "lowercase-keys": "^3.0.0" + } + }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==" + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "optional": true + }, + "sax": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", + "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==", + "dev": true + }, + "semver": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.0.tgz", + "integrity": "sha512-DrfFnPzblFmNrIZzg5RzHegbiRWg7KMR7btwi2yjHwx06zsUbO5g613sVwEV7FTwmzJu+Io0lJe2GJ3LxqpvBQ==" + }, + "serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==" + }, + "socks": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.4.tgz", + "integrity": "sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==", + "requires": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + } + }, + "socks-proxy-agent": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", + "requires": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "socks": "^2.8.3" + } + }, + "spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "requires": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "dependencies": { + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "ssri": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-12.0.0.tgz", + "integrity": "sha512-S7iGNosepx9RadX82oimUkvr0Ct7IjJbEbs4mJcTxst8um95J3sDYU1RBEOvdu6oL1Wek2ODI5i4MAw+dZ6cAQ==", + "requires": { + "minipass": "^7.0.3" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", + "dev": true + }, + "streamx": { + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.22.0.tgz", + "integrity": "sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw==", + "requires": { + "bare-events": "^2.2.0", + "fast-fifo": "^1.3.2", + "text-decoder": "^1.1.0" + } + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + }, + "strip-json-comments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", + "dev": true + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "tar": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "requires": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + }, + "mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==" + }, + "yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==" + } + } + }, + "tar-fs": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.1.tgz", + "integrity": "sha512-LZA0oaPOc2fVo82Txf3gw+AkEd38szODlptMYejQUhndHMLQ9M059uXR+AfS7DNo0NpINvSqDsvyaCrBVkptWg==", + "requires": { + "bare-fs": "^4.0.1", + "bare-path": "^3.0.0", + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + } + }, + "tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "requires": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "dependencies": { + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "text-decoder": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", + "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", + "requires": { + "b4a": "^1.6.4" + } + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "through2-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", + "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", + "dev": true, + "requires": { + "through2": "~2.0.0", + "xtend": "~4.0.0" + } + }, + "tinyglobby": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz", + "integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==", + "requires": { + "fdir": "^6.4.4", + "picomatch": "^4.0.2" + } + }, + "to-absolute-glob": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" + } + }, + "to-through": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", + "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", + "dev": true, + "requires": { + "through2": "^2.0.3" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, + "unique-filename": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-4.0.0.tgz", + "integrity": "sha512-XSnEewXmQ+veP7xX2dS5Q4yZAvO40cBN2MWkJ7D/6sW4Dg6wYBNwM1Vrnz1FhH5AdeLIlUXRI9e28z1YZi71NQ==", + "requires": { + "unique-slug": "^5.0.0" + } + }, + "unique-slug": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-5.0.0.tgz", + "integrity": "sha512-9OdaqO5kwqR+1kVgHAhsp5vPNU0hnxRa26rBFNfNgM7M6pNtgzeBn3s/xbyCQL3dcjzOatcef6UUHpB/6MaETg==", + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "unique-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", + "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", + "dev": true, + "requires": { + "json-stable-stringify-without-jsonify": "^1.0.1", + "through2-filter": "^3.0.0" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + }, + "update-browserslist-db": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", + "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", + "dev": true, + "requires": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + } + }, + "url": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", + "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.0.0.tgz", + "integrity": "sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==", + "dev": true + }, + "value-or-function": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", + "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", + "dev": true + }, + "vinyl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + } + }, + "vinyl-fs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", + "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", + "dev": true, + "requires": { + "fs-mkdirp-stream": "^1.0.0", + "glob-stream": "^6.1.0", + "graceful-fs": "^4.0.0", + "is-valid-glob": "^1.0.0", + "lazystream": "^1.0.0", + "lead": "^1.0.0", + "object.assign": "^4.0.4", + "pumpify": "^1.3.5", + "readable-stream": "^2.3.3", + "remove-bom-buffer": "^3.0.0", + "remove-bom-stream": "^1.2.0", + "resolve-options": "^1.1.0", + "through2": "^2.0.0", + "to-through": "^2.0.0", + "value-or-function": "^3.0.0", + "vinyl": "^2.0.0", + "vinyl-sourcemap": "^1.1.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "vinyl-sourcemap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", + "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", + "dev": true, + "requires": { + "append-buffer": "^1.0.2", + "convert-source-map": "^1.5.0", + "graceful-fs": "^4.1.6", + "normalize-path": "^2.1.1", + "now-and-later": "^2.0.0", + "remove-bom-buffer": "^3.0.0", + "vinyl": "^2.0.0" + } + }, + "walk": { + "version": "2.3.15", + "resolved": "https://registry.npmjs.org/walk/-/walk-2.3.15.tgz", + "integrity": "sha512-4eRTBZljBfIISK1Vnt69Gvr2w/wc3U6Vtrw7qiN5iqYJPH7LElcYh/iU4XWhdCy2dZqv1ToMyYlybDylfG/5Vg==", + "dev": true, + "requires": { + "foreachasync": "^3.0.0" + } + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "which": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz", + "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==", + "requires": { + "isexe": "^3.1.1" + }, + "dependencies": { + "isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==" + } + } + }, + "which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "dev": true + }, + "which-typed-array": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + } + }, + "window-size": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", + "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=", + "dev": true + }, + "workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "xml2js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", + "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "dev": true, + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + } + }, + "xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "dev": true + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "y18n": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "yargs": { + "version": "3.29.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.29.0.tgz", + "integrity": "sha1-GquWYOrnnYuPZ1vK7qtu40ws9pw=", + "dev": true, + "requires": { + "camelcase": "^1.2.1", + "cliui": "^3.0.3", + "decamelize": "^1.0.0", + "os-locale": "^1.4.0", + "window-size": "^0.1.2", + "y18n": "^3.2.0" + } + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "requires": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "dependencies": { + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true + }, + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true + } + } + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + } + } +} diff --git a/package.json b/package.json index f05da0693c..41ccc32dc4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegit", "description": "Node.js libgit2 asynchronous native bindings", - "version": "0.20.3", + "version": "0.28.0-alpha.36", "homepage": "http://nodegit.org", "keywords": [ "libgit2", @@ -19,9 +19,13 @@ { "name": "Max Korp", "email": "maxkorp@8bytealchemy.com" + }, + { + "name": "Tyler Ang-Wanek", + "email": "tylerw@axosoft.com" } ], - "main": "dist/nodegit.js", + "main": "lib/nodegit.js", "repository": { "type": "git", "url": "git://github.com/nodegit/nodegit.git" @@ -31,43 +35,37 @@ "lib": "./lib" }, "engines": { - "node": ">= 4" + "node": ">= 20" }, "dependencies": { - "fs-extra": "~0.26.2", - "lodash": "^4.13.1", - "nan": "^2.2.0", - "node-gyp": "^3.5.0", - "node-pre-gyp": "~0.6.32", - "promisify-node": "~0.3.0" + "@mapbox/node-pre-gyp": "^2.0.0", + "fs-extra": "^7.0.0", + "got": "^14.4.7", + "json5": "^2.1.0", + "lodash": "^4.17.14", + "nan": "^2.23.1", + "node-gyp": "^11.2.0", + "tar-fs": "^3.0.9" }, "devDependencies": { - "aws-sdk": "^2.3.19", - "babel-cli": "^6.7.7", - "babel-preset-es2015": "^6.6.0", + "aws-sdk": "^2.1095.0", "clean-for-publish": "~1.0.2", "combyne": "~0.8.1", - "coveralls": "~2.11.4", - "istanbul": "~0.3.20", "js-beautify": "~1.5.10", - "jshint": "~2.8.0", - "lcov-result-merger": "~1.0.2", - "mocha": "~2.3.4", + "jshint": "^2.10.0", + "lcov-result-merger": "^3.1.0", + "mocha": "^11.4.0", + "nyc": "^17.1.0", "walk": "^2.3.9" }, - "vendorDependencies": { - "libssh2": "1.7.0", - "http_parser": "2.5.0" - }, "binary": { + "bucket_name": "axonodegit", "module_name": "nodegit", "module_path": "./build/Release/", - "host": "https://nodegit.s3.amazonaws.com/nodegit/nodegit/" + "host": "https://axonodegit.s3.amazonaws.com/nodegit/nodegit/" }, "scripts": { - "babel": "babel --presets es2015 -d ./dist ./lib", "cov": "npm run cppcov && npm run filtercov && npm run mergecov", - "coveralls": "cat ./test/coverage/merged.lcov | coveralls", "cppcov": "mkdir -p test/coverage/cpp && ./lcov-1.10/bin/lcov --gcov-tool /usr/bin/gcov-4.9 --capture --directory build/Release/obj.target/nodegit/src --output-file test/coverage/cpp/lcov_full.info", "filtercov": "./lcov-1.10/bin/lcov --extract test/coverage/cpp/lcov_full.info $(pwd)/src/* $(pwd)/src/**/* $(pwd)/include/* $(pwd)/include/**/* --output-file test/coverage/cpp/lcov.info && rm test/coverage/cpp/lcov_full.info", "generateJson": "node generate/scripts/generateJson", @@ -75,14 +73,13 @@ "generateNativeCode": "node generate/scripts/generateNativeCode", "install": "node lifecycleScripts/preinstall && node lifecycleScripts/install", "installDebug": "BUILD_DEBUG=true npm install", - "lint": "jshint lib test/tests test/utils examples lifecycleScripts", + "lint": "jshint lib test/tests test/utils lifecycleScripts", "mergecov": "lcov-result-merger 'test/**/*.info' 'test/coverage/merged.lcov' && ./lcov-1.10/bin/genhtml test/coverage/merged.lcov --output-directory test/coverage/report", - "mocha": "mocha test/runner test/tests --timeout 15000", - "mochaDebug": "mocha --debug-brk test/runner test/tests --timeout 15000", + "mocha": "mocha --expose-gc test/runner test/tests --timeout 15000", + "mochaDebug": "mocha --expose-gc --inspect-brk test/runner test/tests --timeout 15000", "postinstall": "node lifecycleScripts/postinstall", - "prepublish": "npm run babel", - "rebuild": "node generate && npm run babel && node-gyp configure build", - "rebuildDebug": "node generate && npm run babel && node-gyp configure --debug build", + "rebuild": "node generate && node-gyp configure build", + "rebuildDebug": "node generate && node-gyp configure --debug build", "recompile": "node-gyp configure build", "recompileDebug": "node-gyp configure --debug build", "test": "npm run lint && node --expose-gc test", diff --git a/test/README.md b/test/README.md new file mode 100644 index 0000000000..e6bdccbc4d --- /dev/null +++ b/test/README.md @@ -0,0 +1,36 @@ +## /test + +Contains all the test scripts, runner, and keys for running the tests. + +----------- + +#### /home +Contains gitconfig for the test repositories. + +#### /repos +Contains blame, empty, nonrepo, and workdir test repositories. + +#### /tests +Unit tests for NodeGit. + +#### /utils +Test utilities with garbage collector, index, and repository setup, that can be used in tests. + + +## Keys + +Note: all files are encoded in base64 in `\*.enc` and decoded before the test suite runs. + +### encrypted_rsa + - passphrase "test-password" + - registered as deploy key on [nodegit/test](https://github.com/nodegit/test) repo named "Encrypted test key" + +### id_rsa + - registered as deploy key on [nodegit/test](https://github.com/nodegit/test) repo named "Unencrypted Test Key" + +### private.ppk + - same key as id_rsa + - ppk format is used by putty/pageant and converted/generated by puttygen + +### nodegit-test-rsa + - registered as deploy key on [nodegit/private](https://github.com/nodegit/private) repo named "Tests" diff --git a/test/id_rsa b/test/id_rsa deleted file mode 100644 index 91ae66320a..0000000000 --- a/test/id_rsa +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEA5E3IF5x7qkdIG8HoJ6/Wcc+IU5I41f0qYCTTyc+5qPxyjW8d -K6o49T9MhkdOd0fRkhRYptrreDSvQzz1JEHcrnMPg6C5GERyZpSeATWvTUwg9LJf -nklztvevZGaIwmEjoG5pAicfJnYE8Ic3YBP44Qa7GNITxOqUU5VPh+vP83jXSVAC -CX9Cy1zpt4aUyiwNfVSApbZf4/VbwSaYER3QcpVxMi/B6JGKY5EEJNWV495uzZaP -Mg3YOFXJYziVgvl4fJMUTHyucf1UVbGCgkFzeUJcynqn+1EkQ1Ev+5haD1AVvneJ -MCrRsUbFriC9snqs4n2VEzoLIffmVgFsVn30GQIDAQABAoIBAQDPQm2sQbti0mN8 -D4Uawl8D40v30n8WhUa7EbPTOmlqKAQ2sfDhex9KRbTLEmEBmImA/Eee8o9iCTIy -8Fv8Fm6pUHt9G6Pti/XvemwW3Q3QNpSUkHqN0FDkgecQVqVBEb6uHo3mDm4RFINX -eOmkp30BjIK9/blEw1D0sFALLOEUPaDdPMwiXtFgqfrFSgpDET3TvQIwZ2LxxTm0 -cNmP3sCSlZHJNkZI4hBEWaaXR+V5/+C1qblDCo5blAWTcX3UzqrwUUJgFi6VnBuh -7S9Q6+CEIU+4JRyWQNmY8YgZFaAp6IOr/kyfPxTP1+UEVVgcLn3WDYwfG9og0tmz -fzlruAgBAoGBAPfz73Pey86tNZEanhJhbX8gVjzy2hvyhT0paHg0q/H6c1VWOtUH -OwZ3Ns2xAZqJhlDqCHnQYSCZDly042U/theP4N8zo1APb4Yg4qdmXF9QE1+2M03r -kS6138gU/CSCLf8pCYa6pA/GmsaXxloeJGLvT4fzOZRsVav80/92XHRhAoGBAOu2 -mKh4Gr1EjgN9QNbk9cQTSFDtlBEqO/0pTepvL73UvNp/BAn4iYZFU4WnklFVBSWc -L84Sc732xU12TAbTTUsa6E7W29pS8u7zVTxlIdQIIU5pzDyU1pNNk2kpxzte5p3Y -PDtniPFsoYLWoH0LpsKL93t2pLAj+IOkE6f3XBq5AoGAIKaYo5N1FxQr952frx/x -QUpK0N/R5Ng8v18SiLG26rhmM5iVSrQXC7TrHI7wfR8a9tC6qP/NqnM9NuwC/bQ0 -EEo7/GhaWxKNRwZRkmWiSFLNGk9t1hbtGU+N1lUdFtmloPIQdRNiw0kN3JTj474Q -YI7O1EItFORnK6yxZfR6HEECgYEA1CT7MGUoa8APsMRCXyaiq15Pb8bjxK8mXquW -HLEFXuzhLCW1FORDoj0y9s/iuKC0iS0ROX8R/J7k5NrbgikbH8WP36UxKkYNr1IC -HOFImPTYRSKjVsL+fIUNb1DSp3S6SsYbL7v3XJJQqtlQiDq8U8x1aQFXJ9C4EoLR -zhKrKsECgYBtU/TSF/TATZY5XtrN9O+HX1Fbz70Ci8XgvioheVI2fezOcXPRzDcC -OYPaCMNKA5E8gHdg4s0TN7uDvKTJ+KhSg2V7gZ39A28dHrJaRX7Nz4k6t2uEBjX9 -a1JidpAIbJ+3w7+hj6L299tVZvS+Y/6Dz/uuEQGXfJg/l/5CCvQPsA== ------END RSA PRIVATE KEY----- diff --git a/test/id_rsa.enc b/test/id_rsa.enc new file mode 100644 index 0000000000..8c992bebde --- /dev/null +++ b/test/id_rsa.enc @@ -0,0 +1 @@ +LS0tLS1CRUdJTiBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0KYjNCbGJuTnphQzFyWlhrdGRqRUFBQUFBQkc1dmJtVUFBQUFFYm05dVpRQUFBQUFBQUFBQkFBQUNGd0FBQUFkemMyZ3RjbgpOaEFBQUFBd0VBQVFBQUFnRUFzRG5CRGV2dVZTNzFLVHg0OEdiRzlMeHp3UUJ1OVVYc25Qd3ROdGh3bHdpRmpYL1M5U0lKCnhwNENIdVBjS3JYdjJLcTI1NnRMby9jcENkZk9waFhjSWNpZ09RNzc1MGQwSDAvZkpyMHpzWjh3akFiZ1ZPOXpPanlRbXUKbE15WWNzWmpkMURESjQ2djBwNGU4YTZsbldwbHduVFNzVVB3OVVXRkt0MDRDcDZSNVpXaHdlTDg5cmI2Qk13SEJySURNWQpWY2VZSVlGZFRsZWU5MStGQWhLZVVFVE9LNzF6aWRPQXY0Ti9jdnRUQWNtYmlhTTgvUEtXVDEvRDFCeDJ6YzJsY0d3Y2RWCkJiaUxWQmNZKzJReGZzWjVlMGk5SGhKdjdCcWw4SXgxTTYzaVlkQU0yQUFseEZkTU1ONEMwUW1YeDlkSkxTdFdFcXRXZ2gKSHNGY05MSnpDTUs5MGRnSEh3OHZnOTFtdGNMVjVUS01nb3RXaEI2YjRMdkZEUUlac2V5RnY0cVJnM2NOb1hlUFY3bmg3OQp1YVlhL0NremJrNEdZQytsbXhENndFZDhHOGM4d0s4cjJ3NW04ZTAwWmdrQUVhbnovZGZRZ1dzdHBkajRmK05RdUVXRnN6CnNpeGlrTUtOVnJhWnpoRmFUaE9DbTNUUHNmY05LZ2NBN3VXVGJZNllNMlQ1SmowU3ZHRW5Ka1EzUitIK1RIamxqc0wrMnUKWVRCM2NlZ2dXc1dzSmlyazFTdjNlMURxUlhUeGNTcDlyRWlMaHVxV0NLL0t4QzZyWGpBMGJWSkgxMENnRjJNZWtVRTJtNApmeVZjUE5ML0VYWVN1V2t6elZzTDFjdzJSc3psS3RIQVJMNzRISlp6Z3RZMjZ2SlFLOTlub09QMk10aEc0dWI5aWRyajN1CmtBQUFkQVVoVnBRRklWYVVBQUFBQUhjM05vTFhKellRQUFBZ0VBc0RuQkRldnVWUzcxS1R4NDhHYkc5THh6d1FCdTlVWHMKblB3dE50aHdsd2lGalgvUzlTSUp4cDRDSHVQY0tyWHYyS3EyNTZ0TG8vY3BDZGZPcGhYY0ljaWdPUTc3NTBkMEgwL2ZKcgowenNaOHdqQWJnVk85ek9qeVFtdWxNeVljc1pqZDFEREo0NnYwcDRlOGE2bG5XcGx3blRTc1VQdzlVV0ZLdDA0Q3A2UjVaCldod2VMODlyYjZCTXdIQnJJRE1ZVmNlWUlZRmRUbGVlOTErRkFoS2VVRVRPSzcxemlkT0F2NE4vY3Z0VEFjbWJpYU04L1AKS1dUMS9EMUJ4MnpjMmxjR3djZFZCYmlMVkJjWSsyUXhmc1o1ZTBpOUhoSnY3QnFsOEl4MU02M2lZZEFNMkFBbHhGZE1NTgo0QzBRbVh4OWRKTFN0V0VxdFdnaEhzRmNOTEp6Q01LOTBkZ0hIdzh2ZzkxbXRjTFY1VEtNZ290V2hCNmI0THZGRFFJWnNlCnlGdjRxUmczY05vWGVQVjduaDc5dWFZYS9Da3piazRHWUMrbG14RDZ3RWQ4RzhjOHdLOHIydzVtOGUwMFpna0FFYW56L2QKZlFnV3N0cGRqNGYrTlF1RVdGc3pzaXhpa01LTlZyYVp6aEZhVGhPQ20zVFBzZmNOS2djQTd1V1RiWTZZTTJUNUpqMFN2RwpFbkprUTNSK0grVEhqbGpzTCsydVlUQjNjZWdnV3NXc0ppcmsxU3YzZTFEcVJYVHhjU3A5ckVpTGh1cVdDSy9LeEM2clhqCkEwYlZKSDEwQ2dGMk1la1VFMm00ZnlWY1BOTC9FWFlTdVdrenpWc0wxY3cyUnN6bEt0SEFSTDc0SEpaemd0WTI2dkpRSzkKOW5vT1AyTXRoRzR1YjlpZHJqM3VrQUFBQURBUUFCQUFBQ0FGL2pUUlNTSitEWjZEUkQzMXFQMGZvaEFLc24zVGhBai9ycgpqSDZuVHJ3ZnV1dS9mYjQ4Z3kwN2xOUFNFRjU5R01EQVF6M1RpeGp3eDdlL1lZWWxwdDRMR0lOemo4WE1yM2JLTXhZVkpTCmVsQXZsdVZHcGkwRVFENkhzaUx0SUpaek5IUWIwZFNZWXpzckpwTkRBSUtpL2pQTTlVZlhQQ2w1Wm5ob1hySUlqa0pxSk4KWW0rSllXQWZ6U041Q0JGQlBDQ1F0a3FrNVd4WGFQd1pVWHBMUHpGVi93ajEwUVJSdldCMzRNVmowMHJKdElReitsOTRjQwpsSVpubm44dzBRdE5CelF4amlYS3dLVkUzQ2NONFpDbDFqd3EzQnljMDZHWTdtbnhRMlNYWFBMMERja0thNEptTGVMNUtuCmNyelJiRUllRWVEM3VoRnpVM0kwckVOUVJoNjY5SXByYWpmUnpMY0Z4bkM3M0JTMVJUeWNmcGRTR0ZPUFhULzJOZDM2MlgKU2VwNlZOeFN0NWE2d2tXZ0hKaDJIOGRQY25pREgxRG1yQWRQOTdBa2VpMWxtWHFiekNJVjlwaWQzbWZNQUpiSm00UmhRcApURHZldUU4TmlCZ0k2MlRrd3Vjb1cyeTNMZFN2MTM3aUpCbkpTYzExRzlBNWJHMnlRWEUyYWlYUXhIeW9UMlF0VmY1WklYClJhVkx1YlFuY1NnTEJqZ0NkMUNsakI1amxSWU10U2M4YkZhL1RKNW9YT1ZNdENYNHhhcVo3Z3JHS05CcUJsRFRXblRnWk0KbXZ3UFZ1Y2xlNzI4MzZPSlBYbzFMajNLM2ttcnhDMXVORzA3NjMvemJLOWl2QWF1SFRMMnQ0cHkra0k0NC9ZcERvR2sybgp4bFdNZEQzTDNKVXgzUXo5THhBQUFCQVFDVzh6YVI5T2VPMXAzWGkxNFg5MDNuOWNjY1JVcGRMOEZSUDZ5MWkrVFpmN2RSClpla3ltWDZGbU9qbTAvbm9XM0hwZVoyYmJEaUFQRFp1VzRmUW1nWjBnemxvZERDZUp2UHF2U1FzUWVISjRjMkdzVG4xVHMKMzNYU1RWeFVLd3dqbEZ2TGpvMkJBdmlBaGZ3YUN3UmxUaGlrRy9CdC8wbVhObTF6cHFZbnFBc1pXb3JqOVVWQTYyT1c4MQpDVVgxL2RVMWtjUkFpY2NsUWxqTlNEWGJ6aWJVN2pvdXpzQzNFVUVEcG1HZG1UUVh4WHNCNTFVTmh5eVZoMmdBVnFDMDAyCm1Kd2dFVXNqcHFzYUw2TTczYXo4Mzg4b0RwWGJwMUNLTER5aDh2SnBJTkgwak5OZEQxd1dvQVJRZUhzL05iUUZLUThJTkkKdlBzWnowWkdmRzcvdVMrSkFBQUJBUURiVG94anFOUHJGT1piWDkzeDZONTVJV05DVUt1cUwxVks2MURIYUtYZmlpd0hEeQpRYjEzUnhPREk2RlNXMElIeVpqMDh5ZjBTVElGOXNZTUFwNy9GS1FORElqVVZyMVI2Z0RFZ0F3K2N5L2dpeWowVWxxSE1zCmdUUnNnSmEvSjJQYnViRDRWMzdZUkQ4enB2a0tmOFNKMGJRalEwaUx0YUNVYm9BUDVmYWFYbElLdmUyeHpLdVgzT0l2TTMKTyt1UTBJMDZqZGtMc2JBRzEvZ0E5emJmaW1wTHdJQkJkVUl6djdoRTJqOGJoak9HbTVTSU5rczRZZVROVFZXZHhmcjdiLwowVlFPSXJDd0RQKytCaGM5N2QrWDdZVVVkUUgzUHBTV3JWb0pOc0hNcHVUWmhpd0NnRk1NT1RYSEdWbGpFOHJnZGVTbFBzCmdCMXNRaHhyUlNNQitmQUFBQkFRRE50ZTQrMW5sWUtWNkVRWXhyeUpVQUtPdE1LSmZBNVhSVHNzWGhzRXlSMDBxL1djd3QKcmZmMzV3N2ZBWEJWd2VOemVlaXlwZXZKc1lnUnBBdTlPTVl0d1hFQlY1Rit5SUJRa2lHMTdiU2V6L3NibnlvaVdVNkJBWApHYmRDamZhNGVVRVRGemJjbGp0S2xnQUJSR2pXRDdQRk82V2ZwQWpRcGNqYVFwSVQ2WHpYZnVmV2d0bG5Ga1d5UGRXekpMCjQyV1lDemNhU3JKU0ZLZnpORHZtUjNzbllOZHB1bE1aUEtlRnZtZTJUWmp1VFJSRTd1OEtaRnhQalBkK0E4R2FuQnJOUGkKalBjSXE1SmFDWnpMMzVkaGlYcGJCQzJTMlh5cktwbWMrWEpRODJxZU93ZDZlOW9KVjEzUDdKU3NZYUVqdlFUeU5yNkE2bgo0ODIvcW1SZHUxUjNBQUFBQm01dmJtRnRaUUVDQXdRPQotLS0tLUVORCBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0K \ No newline at end of file diff --git a/test/id_rsa.pub b/test/id_rsa.pub index bd84623f11..77f36c6534 100644 --- a/test/id_rsa.pub +++ b/test/id_rsa.pub @@ -1 +1 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkTcgXnHuqR0gbwegnr9Zxz4hTkjjV/SpgJNPJz7mo/HKNbx0rqjj1P0yGR053R9GSFFim2ut4NK9DPPUkQdyucw+DoLkYRHJmlJ4BNa9NTCD0sl+eSXO2969kZojCYSOgbmkCJx8mdgTwhzdgE/jhBrsY0hPE6pRTlU+H68/zeNdJUAIJf0LLXOm3hpTKLA19VICltl/j9VvBJpgRHdBylXEyL8HokYpjkQQk1ZXj3m7Nlo8yDdg4VcljOJWC+Xh8kxRMfK5x/VRVsYKCQXN5QlzKeqf7USRDUS/7mFoPUBW+d4kwKtGxRsWuIL2yeqzifZUTOgsh9+ZWAWxWffQZ your_email@example.com +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCwOcEN6+5VLvUpPHjwZsb0vHPBAG71Reyc/C022HCXCIWNf9L1IgnGngIe49wqte/Yqrbnq0uj9ykJ186mFdwhyKA5DvvnR3QfT98mvTOxnzCMBuBU73M6PJCa6UzJhyxmN3UMMnjq/Snh7xrqWdamXCdNKxQ/D1RYUq3TgKnpHllaHB4vz2tvoEzAcGsgMxhVx5ghgV1OV573X4UCEp5QRM4rvXOJ04C/g39y+1MByZuJozz88pZPX8PUHHbNzaVwbBx1UFuItUFxj7ZDF+xnl7SL0eEm/sGqXwjHUzreJh0AzYACXEV0ww3gLRCZfH10ktK1YSq1aCEewVw0snMIwr3R2AcfDy+D3Wa1wtXlMoyCi1aEHpvgu8UNAhmx7IW/ipGDdw2hd49XueHv25phr8KTNuTgZgL6WbEPrAR3wbxzzAryvbDmbx7TRmCQARqfP919CBay2l2Ph/41C4RYWzOyLGKQwo1WtpnOEVpOE4KbdM+x9w0qBwDu5ZNtjpgzZPkmPRK8YScmRDdH4f5MeOWOwv7a5hMHdx6CBaxawmKuTVK/d7UOpFdPFxKn2sSIuG6pYIr8rELqteMDRtUkfXQKAXYx6RQTabh/JVw80v8RdhK5aTPNWwvVzDZGzOUq0cBEvvgclnOC1jbq8lAr32eg4/Yy2Ebi5v2J2uPe6Q== noname diff --git a/test/index.js b/test/index.js index 52cbff50ef..abd2fc2174 100644 --- a/test/index.js +++ b/test/index.js @@ -1,8 +1,14 @@ var fork = require("child_process").fork; var path = require("path"); +var fs = require('fs'); -var bin = "./node_modules/.bin/istanbul"; -var cov = "cover --report=lcov --dir=test/coverage/js _mocha --".split(" "); +var bin = "./node_modules/.bin/nyc"; +var cov = [ + "--reporter=lcov", + "--reporter=text-summary", + "--report-dir=test/coverage/js", + "mocha" +] if (process.platform === 'win32') { bin = "./node_modules/mocha/bin/mocha"; @@ -17,11 +23,26 @@ var args = cov.concat([ "15000" ]); -if (!process.env.APPVEYOR && !process.env.TRAVIS) { +if (!process.env.APPVEYOR && !process.env.TRAVIS && !process.env.GITHUB_ACTION) { var local = path.join.bind(path, __dirname); var dummyPath = local("home"); process.env.HOME = dummyPath; process.env.USERPROFILE = dummyPath; } +// unencrypt test keys +function unencryptKey(fileName) { + var base64Contents = fs.readFileSync( + path.join(__dirname, fileName + '.enc'), + 'utf8' + ); + var asciiContents = Buffer.from(base64Contents, 'base64') + .toString('ascii'); + fs.writeFileSync(path.join(__dirname, fileName), asciiContents, 'utf8'); +} + +unencryptKey('private.ppk'); +unencryptKey('id_rsa'); +unencryptKey('nodegit-test-rsa'); + fork(bin, args, { cwd: path.join(__dirname, "../") }).on("close", process.exit); diff --git a/test/nodegit-test-rsa b/test/nodegit-test-rsa deleted file mode 100644 index f5500849f1..0000000000 --- a/test/nodegit-test-rsa +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQC5VMnDStyy3BDQ4Ilb/XnD5htRn0f3Is8NITe9o/KwZcPy2MFM -RssnQjyp/WoQXl/o3Id+UaTZ+TKzYYmP/bGnYlyZP+FBBTKrCcDDW0fVjLbDazEX -usAYCW58iGG9EomrwpSVrZlrLsZc1CPUdeeC8jmTuBQR7fyDFxM4sdoIyQIDAQAB -AoGBAA7ZZ00Ze3NtRH+n7fmL5qy2jCvPClIX3OUdazzrnO9bSAb2LQ6ygWaE3R11 -q4DiPucGfGi3m/DHEbPjtcTuu8Qdqr7Nb0FU2CS2og0zMO+Z+CcyzIkXN0o7spig -ekEY1Uml5MKGcJxu6afsOn+9LIi05SsYPCdtB5z716IewNgxAkEA2pKXov7jobMb -2vBA4BtEtcryflWFO21uwMDHlJ34mjrUAMCX89NPrY//v8g0eYGLm9ZAj/Ik632+ -uOKHCXaG7QJBANkRBBcnKojqybJoxbL9PLJ3VoJ+EfLllGsbMHzc5VMwQF8ViwBD -dOQ5feVKg601814Y1NGul/nprk896GNbUc0CQQCHD8iV1u1wcQ4IZyeflBoMQAFC -YbQ3ebLTdwyc4FTLcQiqAlijOXNl67J8nskWQB+1x1oT2OxJfGVLN+d7yHstAkBz -GKCwniXhn4z/OqrJc5mBj+GhI7PktXLzL+GP85jteUJIqKWhqCMM+KcWs2IKr/ax -SD1gSVFwREYW4l6cgElpAkBtngXppGinh3nywIIo/SFmUJV/cUlWBi6MMgfsP8b6 -37+bqJI+m56WBdAG2xNz0uk6DIMp6R7JafOpfgOIPPk9 ------END RSA PRIVATE KEY----- diff --git a/test/nodegit-test-rsa.enc b/test/nodegit-test-rsa.enc new file mode 100644 index 0000000000..c90ea0781b --- /dev/null +++ b/test/nodegit-test-rsa.enc @@ -0,0 +1 @@ +LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBekNxSzI3cEV1cU1GQm45b3FIU2pzbkkrOFdxNW9IQUNHRU1tSmMyRHd6VDNNbXZ2ClR1ejZBUTU3L3lLK3lEZnY0VFlseWlVdHZBeUFxSy83TklNRmRTWldVOGIvNkNZQUhMcDZPM0p4WUZLUEQxa2MKdDBwNlVpNHdsY0lNRFZ5a252L3hlY0lYeXNqRVZaUEpUbGdoNDRqWXltOEFXdzg0YzQzQzNqelNJYkhHWlBDcgpxdi91ekgveVdZcFlrb3hBMXcyKy9LTDRBdlBpOUtRdkl6L2FpeUhqdzdEM1k2ZnRadW5GaGNyZ0hHZUhyUjBSCnJXT2ZybXZHYSthZStMRHI4Rk9TSno5U1RmY2dwZXNrYzFjNGorWkFFOHdxdzhhYmd6SVhXckducS9UUE5ScHcKU0hoMHg2T3g2aDJ3VStGTjdkTWZwOGNxekw2dXpiZUY5SXkrVlFJREFRQUJBb0lCQUhmME10dUFhQ3NqNXFyMwpwcHo2MHNiZ1d0enFzSjl6ejdkRGxLRTNTMGdnMFhBZGZGL3AyY1ZQSmtrenQ5WFpENlpKY3hCK29ZMVA1ek8xCkdhbXpwVHc4UnhJMzVGa1lJbzYrZlZ4NkUrVGMvTkt1cjdGOUg3c3pDamFpNlFQY3Y1ZnZsb2ZNSXNCeER2R2MKdi9TNDBVaG5PY0JPVVc0dTFpTUdVa3pTZlQ5dnJtbEFPNnVtaHExSVdFUTZnOUVCUXovNm9RUFNWUCszVGIwbgppemZWK1pIQkpQMS9jVEdsdmFzb2tFOTgvS3VpQmoyeHB3bVJHcy95YndyMVZMbTRWVkVKQTlLREI5aldueXgvCkpVMnpLQ3UreVMxSHBLcXVWdEh5NUw4ditDRzJQUkNtUnpGcEVQbVRpaGpaKy9HbG1xM3Bjc1FhK2FVZFduUW8KcTkyVXFtRUNnWUVBLzVGTEdORGd2blRyZ2dvMnltcXNSbGtaNTV0NjJIVXl2K3NPaUJ5eDc4VXFNSitjZENoRApJUTcvQmE4NE9QU2Jyb0E3WDJ2ZldEK01OcXRUdWFsUUl1eFJ0Ukh6c2hYNFZZODNWdzJRRmJ6RFp2dk5RV25UCjVybWlIK1FXS0N3THFEY3NQTm81eHdxemlXZ3JWdk1ZRFloaTR6enNlQW9yNFB6dTZRREVkUWtDZ1lFQXpJTDcKcUtXRWg1Q2NSRmlrY25mUEpJL2dySHkwckdpRHBneXE1N25sWWNOWm1BTEdaUnRyN2hDeVpNZTMyYVdISVdMcgoxa2hadE16bEFiZlBBYjdNdDIyT2RCWTJ3UDF3WG8wa25YMVdTUlN2RUt5MTFwN1RqRTJFVFBMekJmUkJ2ckR5CkF2T3l2UjVOUWxrQk4yMDhNRHlyUnRhcStpTTZxdmVweFVZUGZlMENnWUVBcUFHUTE3aUE5bE9RZXNWU0xaRWcKdllKWG1EMUs3YjlsNUdxVysvMjVMOEZ5c2RKTG5NVFhGSVZ5T3Y5c08yejZaeVhmWWlSZEIvdUdwbTNNdFpITApuNW14UVJLVEhMQjZ0MnhWMmdHTmhleTRuQnZPWEVGQXp6MmJpZEY4aTE0aEw2MU5oSmVGUWdjVDdiR3dSQkc4Cjd6Q0lxWS9rZUNsZm5TRkp3WjBDaVZrQ2dZQnJOMGdrRkJJMDJCVjBwMXdmUHJ4MEdKSGJHODNFalU1bllVREEKRjI4d0g2LzZ4NG1uUEFjTFdlbU1lRC9rZEtreFVhRCtTQlB2ZTNPYndQZGZuTjNLVkQ5WWtNVEh6Slo2bTFoVQowSDdKOVhRS00rRm8wUDlyRU1DSmJ0MEZoQlpybUd4b0s4Yks2dlhxRUt0WW1ZWHlhL3dIT1VlTnQ2WnNOMGJqCnkyVVh5UUtCZ1FEQTBjTm5aT0FuUllTaE93bjlsR3YxcFJ6SGRZdTduMlVteXpaM2RuRUhsTXRSRlFaQjIvdmYKVFpwWGVNSTJyWGRGUVphb1pydWxmZE1Fa3BDVmlTSGlRWnFKNlkrYXZ3NjQ1dzV3a09RU1F3ZjNzOEYrL0t5agoyNDMyY25pN3grUGVlOXp6R3VmQ3RJNkZSK2hTdDZSdnNsRzdRWFgreHM3dGxCNmU0SEhmUUE9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo= \ No newline at end of file diff --git a/test/nodegit-test-rsa.pub b/test/nodegit-test-rsa.pub index 8092c16421..7321a79e5c 100644 --- a/test/nodegit-test-rsa.pub +++ b/test/nodegit-test-rsa.pub @@ -1 +1 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC5VMnDStyy3BDQ4Ilb/XnD5htRn0f3Is8NITe9o/KwZcPy2MFMRssnQjyp/WoQXl/o3Id+UaTZ+TKzYYmP/bGnYlyZP+FBBTKrCcDDW0fVjLbDazEXusAYCW58iGG9EomrwpSVrZlrLsZc1CPUdeeC8jmTuBQR7fyDFxM4sdoIyQ== +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMKorbukS6owUGf2iodKOycj7xarmgcAIYQyYlzYPDNPcya+9O7PoBDnv/Ir7IN+/hNiXKJS28DICor/s0gwV1JlZTxv/oJgAcuno7cnFgUo8PWRy3SnpSLjCVwgwNXKSe//F5whfKyMRVk8lOWCHjiNjKbwBbDzhzjcLePNIhscZk8Kuq/+7Mf/JZiliSjEDXDb78ovgC8+L0pC8jP9qLIePDsPdjp+1m6cWFyuAcZ4etHRGtY5+ua8Zr5p74sOvwU5InP1JN9yCl6yRzVziP5kATzCrDxpuDMhdasaer9M81GnBIeHTHo7HqHbBT4U3t0x+nxyrMvq7Nt4X0jL5V diff --git a/test/private.ppk.enc b/test/private.ppk.enc new file mode 100644 index 0000000000..c388d98d86 --- /dev/null +++ b/test/private.ppk.enc @@ -0,0 +1,47 @@ +UHVUVFktVXNlci1LZXktRmlsZS0zOiBzc2gtcnNhCkVuY3J5cHRpb246IG5vbmUKQ29tbWVudDog +bm9uYW1lClB1YmxpYy1MaW5lczogMTIKQUFBQUIzTnphQzF5YzJFQUFBQURBUUFCQUFBQ0FRQ3dP +Y0VONis1Vkx2VXBQSGp3WnNiMHZIUEJBRzcxUmV5YwovQzAyMkhDWENJV05mOUwxSWduR25nSWU0 +OXdxdGUvWXFyYm5xMHVqOXlrSjE4Nm1GZHdoeUtBNUR2dm5SM1FmClQ5OG12VE94bnpDTUJ1QlU3 +M002UEpDYTZVekpoeXhtTjNVTU1uanEvU25oN3hycVdkYW1YQ2ROS3hRL0QxUlkKVXEzVGdLbnBI +bGxhSEI0dnoydHZvRXpBY0dzZ014aFZ4NWdoZ1YxT1Y1NzNYNFVDRXA1UVJNNHJ2WE9KMDRDLwpn +Mzl5KzFNQnladUpveno4OHBaUFg4UFVISGJOemFWd2JCeDFVRnVJdFVGeGo3WkRGK3hubDdTTDBl +RW0vc0dxClh3akhVenJlSmgwQXpZQUNYRVYwd3czZ0xSQ1pmSDEwa3RLMVlTcTFhQ0Vld1Z3MHNu +TUl3cjNSMkFjZkR5K0QKM1dhMXd0WGxNb3lDaTFhRUhwdmd1OFVOQWhteDdJVy9pcEdEZHcyaGQ0 +OVh1ZUh2MjVwaHI4S1ROdVRnWmdMNgpXYkVQckFSM3dieHp6QXJ5dmJEbWJ4N1RSbUNRQVJxZlA5 +MTlDQmF5MmwyUGgvNDFDNFJZV3pPeUxHS1F3bzFXCnRwbk9FVnBPRTRLYmRNK3g5dzBxQndEdTVa +TnRqcGd6WlBrbVBSSzhZU2NtUkRkSDRmNU1lT1dPd3Y3YTVoTUgKZHg2Q0JheGF3bUt1VFZLL2Q3 +VU9wRmRQRnhLbjJzU0l1RzZwWUlyOHJFTHF0ZU1EUnRVa2ZYUUtBWFl4NlJRVAphYmgvSlZ3ODB2 +OFJkaEs1YVRQTld3dlZ6RFpHek9VcTBjQkV2dmdjbG5PQzFqYnE4bEFyMzJlZzQvWXkyRWJpCjV2 +MkoydVBlNlE9PQpQcml2YXRlLUxpbmVzOiAyOApBQUFDQUYvalRSU1NKK0RaNkRSRDMxcVAwZm9o +QUtzbjNUaEFqL3Jyakg2blRyd2Z1dXUvZmI0OGd5MDdsTlBTCkVGNTlHTURBUXozVGl4and4N2Uv +WVlZbHB0NExHSU56ajhYTXIzYktNeFlWSlNlbEF2bHVWR3BpMEVRRDZIc2kKTHRJSlp6TkhRYjBk +U1lZenNySnBOREFJS2kvalBNOVVmWFBDbDVabmhvWHJJSWprSnFKTlltK0pZV0FmelNONQpDQkZC +UENDUXRrcWs1V3hYYVB3WlVYcExQekZWL3dqMTBRUlJ2V0IzNE1WajAwckp0SVF6K2w5NGNDbEla +bm5uCjh3MFF0TkJ6UXhqaVhLd0tWRTNDY040WkNsMWp3cTNCeWMwNkdZN21ueFEyU1hYUEwwRGNr +S2E0Sm1MZUw1S24KY3J6UmJFSWVFZUQzdWhGelUzSTByRU5RUmg2NjlJcHJhamZSekxjRnhuQzcz +QlMxUlR5Y2ZwZFNHRk9QWFQvMgpOZDM2MlhTZXA2Vk54U3Q1YTZ3a1dnSEpoMkg4ZFBjbmlESDFE +bXJBZFA5N0FrZWkxbG1YcWJ6Q0lWOXBpZDNtCmZNQUpiSm00UmhRcFREdmV1RThOaUJnSTYyVGt3 +dWNvVzJ5M0xkU3YxMzdpSkJuSlNjMTFHOUE1YkcyeVFYRTIKYWlYUXhIeW9UMlF0VmY1WklYUmFW +THViUW5jU2dMQmpnQ2QxQ2xqQjVqbFJZTXRTYzhiRmEvVEo1b1hPVk10QwpYNHhhcVo3Z3JHS05C +cUJsRFRXblRnWk1tdndQVnVjbGU3MjgzNk9KUFhvMUxqM0sza21yeEMxdU5HMDc2My96CmJLOWl2 +QWF1SFRMMnQ0cHkra0k0NC9ZcERvR2sybnhsV01kRDNMM0pVeDNRejlMeEFBQUJBUURiVG94anFO +UHIKRk9aYlg5M3g2TjU1SVdOQ1VLdXFMMVZLNjFESGFLWGZpaXdIRHlRYjEzUnhPREk2RlNXMElI +eVpqMDh5ZjBTVApJRjlzWU1BcDcvRktRTkRJalVWcjFSNmdERWdBdytjeS9naXlqMFVscUhNc2dU +UnNnSmEvSjJQYnViRDRWMzdZClJEOHpwdmtLZjhTSjBiUWpRMGlMdGFDVWJvQVA1ZmFhWGxJS3Zl +Mnh6S3VYM09Jdk0zTyt1UTBJMDZqZGtMc2IKQUcxL2dBOXpiZmltcEx3SUJCZFVJenY3aEUyajhi +aGpPR201U0lOa3M0WWVUTlRWV2R4ZnI3Yi8wVlFPSXJDdwpEUCsrQmhjOTdkK1g3WVVVZFFIM1Bw +U1dyVm9KTnNITXB1VFpoaXdDZ0ZNTU9UWEhHVmxqRThyZ2RlU2xQc2dCCjFzUWh4clJTTUIrZkFB +QUJBUUROdGU0KzFubFlLVjZFUVl4cnlKVUFLT3RNS0pmQTVYUlRzc1hoc0V5UjAwcS8KV2N3dHJm +ZjM1dzdmQVhCVndlTnplZWl5cGV2SnNZZ1JwQXU5T01ZdHdYRUJWNUYreUlCUWtpRzE3YlNlei9z +YgpueW9pV1U2QkFYR2JkQ2pmYTRlVUVURnpiY2xqdEtsZ0FCUkdqV0Q3UEZPNldmcEFqUXBjamFR +cElUNlh6WGZ1CmZXZ3RsbkZrV3lQZFd6Skw0MldZQ3pjYVNySlNGS2Z6TkR2bVIzc25ZTmRwdWxN +WlBLZUZ2bWUyVFpqdVRSUkUKN3U4S1pGeFBqUGQrQThHYW5Cck5QaWpQY0lxNUphQ1p6TDM1ZGhp +WHBiQkMyUzJYeXJLcG1jK1hKUTgycWVPdwpkNmU5b0pWMTNQN0pTc1lhRWp2UVR5TnI2QTZuNDgy +L3FtUmR1MVIzQUFBQkFRQ1c4emFSOU9lTzFwM1hpMTRYCjkwM245Y2NjUlVwZEw4RlJQNnkxaStU +WmY3ZFJaZWt5bVg2Rm1Pam0wL25vVzNIcGVaMmJiRGlBUERadVc0ZlEKbWdaMGd6bG9kRENlSnZQ +cXZTUXNRZUhKNGMyR3NUbjFUczMzWFNUVnhVS3d3amxGdkxqbzJCQXZpQWhmd2FDdwpSbFRoaWtH +L0J0LzBtWE5tMXpwcVlucUFzWldvcmo5VVZBNjJPVzgxQ1VYMS9kVTFrY1JBaWNjbFFsak5TRFhi +CnppYlU3am91enNDM0VVRURwbUdkbVRRWHhYc0I1MVVOaHl5VmgyZ0FWcUMwMDJtSndnRVVzanBx +c2FMNk03M2EKejgzODhvRHBYYnAxQ0tMRHloOHZKcElOSDBqTk5kRDF3V29BUlFlSHMvTmJRRktR +OElOSXZQc1p6MFpHZkc3Lwp1UytKClByaXZhdGUtTUFDOiBmMjY3ZTM0MzYwOTViZDc5OWYwNzQw +NDExZmJhMDM0YzZjOWNiN2VhYzk1ZDg4NDk3ZGVlYmMxNGZjZWQ0ZDU2Cg== diff --git a/test/runner.js b/test/runner.js index a7a28cf579..3ca48486bd 100644 --- a/test/runner.js +++ b/test/runner.js @@ -1,25 +1,43 @@ -var promisify = require("promisify-node"); -var fse = promisify("fs-extra"); +var fse = require("fs-extra"); var path = require("path"); var local = path.join.bind(path, __dirname); var exec = require('../utils/execPromise'); var NodeGit = require('..'); -if(process.env.NODEGIT_TEST_THREADSAFETY) { - console.log('Enabling thread safety in NodeGit'); - NodeGit.enableThreadSafety(); -} else if (process.env.NODEGIT_TEST_THREADSAFETY_ASYNC) { - console.log('Enabling thread safety for async actions only in NodeGit'); - NodeGit.setThreadSafetyStatus(NodeGit.THREAD_SAFETY.ENABLED_FOR_ASYNC_ONLY); -} - var workdirPath = local("repos/workdir"); +var constWorkdirPath = local("repos/constworkdir"); + +const testRepos = [ + "repos/bare", + "repos/blameRepo", + "repos/cherrypick", + "repos/clone", + "repos/constworkdir", + "repos/convenientLineTest", + "repos/empty", + "repos/index", + "repos/index", + "repos/merge", + "repos/merge-head", + "repos/new", + "repos/newrepo", + "repos/nonrepo", + "repos/rebase", + "repos/renamedFileRepo", + "repos/revertRepo", + "repos/stagingRepo", + "repos/submodule", + "repos/submodule/nodegittest/", + "repos/tree/", + "repos/workdir", +]; before(function() { this.timeout(350000); - var url = "https://github.com/nodegit/test"; + var testUrl = "https://github.com/nodegit/test"; + var constTestUrl = "https://github.com/nodegit/test-frozen"; return fse.remove(local("repos")) .then(function() { fse.remove(local("home")) @@ -31,7 +49,17 @@ before(function() { return exec("git init " + local("repos", "empty")); }) .then(function() { - return exec("git clone " + url + " " + workdirPath); + return exec("git clone " + constTestUrl + " " + constWorkdirPath); + }) + .then(function() { + return exec("git clone " + testUrl + " " + workdirPath); + }) + .then(function() { + //to checkout the longpaths-checkout branch + if(process.platform === "win32") { + return exec("git config core.longpaths true", {cwd: workdirPath}); + } + return Promise.resolve(); }) .then(function() { return exec("git checkout rev-walk", {cwd: workdirPath}); @@ -39,6 +67,9 @@ before(function() { .then(function() { return exec("git checkout checkout-test", {cwd: workdirPath}); }) + .then(function() { + return exec("git checkout longpaths-checkout", {cwd: workdirPath}); + }) .then(function() { return exec("git checkout master", {cwd: workdirPath}); }) @@ -55,7 +86,13 @@ before(function() { .then(function() { return fse.writeFile(local("home", ".gitconfig"), "[user]\n name = John Doe\n email = johndoe@example.com"); - }); + }) + .then( async function() { + //mark all test repos as safe + for(let repo of testRepos) { + await exec(`git config --global --add safe.directory ${local(repo)}`); + } + }) }); beforeEach(function() { diff --git a/test/tests/annotated_commit.js b/test/tests/annotated_commit.js index b6fe278644..c87ba859bf 100644 --- a/test/tests/annotated_commit.js +++ b/test/tests/annotated_commit.js @@ -32,39 +32,43 @@ describe("AnnotatedCommit", function() { }); }); - it("can free an AnnotatedCommit after creating it", function() { + it("can lookup an AnnotatedCommit after creating it", function() { var test = this; + var id; return Branch.lookup(test.repository, branchName, Branch.BRANCH.LOCAL) .then(function(ref) { return AnnotatedCommit.fromRef(test.repository, ref); }) .then(function(annotatedCommit) { - // Annotated commit should exist - assert(annotatedCommit.id()); + id = annotatedCommit.id(); + return AnnotatedCommit.lookup(test.repository, id); + }) + .then(function(annotatedCommit) { + assert(id, annotatedCommit.id()); + }); + }); - // Free the annotated commit - annotatedCommit.free(); + it("can lookup an AnnotatedCommit from a revspec", function() { + var test = this; - // Getting the id should now throw because the commit was freed - assert.throws(annotatedCommit.id); + return AnnotatedCommit.fromRevspec(test.repository, "checkout-test") + .then(function(annotatedCommit) { + assert.equal(annotatedCommit.id().toString(), + "1729c73906bb8467f4095c2f4044083016b4dfde"); }); }); - it("can lookup an AnnotatedCommit after creating it", function() { + it("can lookup an AnnotatedCommit from a fetchhead", function() { var test = this; - var id; - return Branch.lookup(test.repository, branchName, Branch.BRANCH.LOCAL) - .then(function(ref) { - return AnnotatedCommit.fromRef(test.repository, ref); - }) + return AnnotatedCommit.fromFetchhead(test.repository, + "rev-walk", + "https://github.com/nodegit/test", + "32789a79e71fbc9e04d3eff7425e1771eb595150") .then(function(annotatedCommit) { - id = annotatedCommit.id(); - return AnnotatedCommit.lookup(test.repository, id); - }) - .then(function(annotatedCommit) { - assert(id, annotatedCommit.id()); + assert.equal(annotatedCommit.id().toString(), + "32789a79e71fbc9e04d3eff7425e1771eb595150"); }); }); }); diff --git a/test/tests/blob.js b/test/tests/blob.js index dce4ce6196..2d6512c86c 100644 --- a/test/tests/blob.js +++ b/test/tests/blob.js @@ -1,8 +1,7 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); -var promisify = require("promisify-node"); -var fse = promisify("fs-extra"); +var fse = require("fs-extra"); var exec = require("../../utils/execPromise"); describe("Blob", function() { @@ -129,7 +128,7 @@ describe("Blob", function() { describe("createFromBuffer", function() { it("creates a new blob from the buffer", function() { var content = "This is a new buffer"; - var buf = new Buffer(content, content.length); + var buf = Buffer.from(content, content.length); var test = this; return Blob.createFromBuffer(test.repository, buf, content.length) @@ -143,7 +142,7 @@ describe("Blob", function() { it("creates blob with content equal to length", function() { var content = "This is a new buffer"; - var buf = new Buffer(content, content.length); + var buf = Buffer.from(content, content.length); var test = this; return Blob.createFromBuffer(test.repository, buf, 2) @@ -172,7 +171,7 @@ describe("Blob", function() { it("throws an error when no length is provided", function() { var test = this; - return Blob.createFromBuffer(test.repository, new Buffer("testing")) + return Blob.createFromBuffer(test.repository, Buffer.from("testing")) .catch(function(error) { assert.strictEqual(error.message, "Number len is required."); }); @@ -236,7 +235,7 @@ describe("Blob", function() { return fse.readFile(filePath) .then(function(content) { - test.content = content.toString(); + test.content = content.toString(); return Blob.createFromWorkdir(test.repository, fileName); }) .then(function(oid) { @@ -273,7 +272,7 @@ describe("Blob", function() { }); }); - describe("filteredContent", function() { + describe("filteredContent (DEPRECATED)", function() { var attrFileName = ".gitattributes"; var filter = "* text eol=crlf"; var lineEndingRegex = /\r\n|\r|\n/; @@ -281,11 +280,11 @@ describe("Blob", function() { it("retrieves the filtered content", function() { var test = this; - + return commitFile( - test.repository, - attrFileName, - filter, + test.repository, + attrFileName, + filter, "added gitattributes") .then(function() { return commitFile( @@ -309,10 +308,10 @@ describe("Blob", function() { test.lfBlob = lfBlob; var ending = test.lfBlob.toString().match(lineEndingRegex); assert.strictEqual(ending[0], "\n"); - + return Blob.filteredContent( - test.lfBlob, - newFileName, + test.lfBlob, + newFileName, 0 ); }) @@ -325,11 +324,11 @@ describe("Blob", function() { it("returns non-binary filtered content when checking binary", function() { var test = this; - + return commitFile( - test.repository, - attrFileName, - filter, + test.repository, + attrFileName, + filter, "added gitattributes") .then(function() { return commitFile( @@ -353,10 +352,10 @@ describe("Blob", function() { test.lfBlob = lfBlob; var ending = test.lfBlob.toString().match(lineEndingRegex); assert.strictEqual(ending[0], "\n"); - + return Blob.filteredContent( - test.lfBlob, - newFileName, + test.lfBlob, + newFileName, 1 ); }) @@ -369,12 +368,12 @@ describe("Blob", function() { it("returns nothing when checking binary blob", function() { var test = this; - var binary = new Buffer(new Uint8Array([1,2,3,4,5,6])); + var binary = Buffer.from(new Uint8Array([1,2,3,4,5,6])); return commitFile( - test.repository, - attrFileName, - filter, + test.repository, + attrFileName, + filter, "added gitattributes") .then(function() { return commitFile( @@ -397,10 +396,10 @@ describe("Blob", function() { .then(function(binaryBlob) { test.binaryBlob = binaryBlob; assert.equal(true, binaryBlob.isBinary()); - + return Blob.filteredContent( - test.binaryBlob, - newFileName, + test.binaryBlob, + newFileName, 1 ); }) @@ -411,12 +410,12 @@ describe("Blob", function() { it("returns blob when not checking binary on binary blob", function() { var test = this; - var binary = new Buffer(new Uint8Array([1,2,3,4,5,6])); + var binary = Buffer.from(new Uint8Array([1,2,3,4,5,6])); return commitFile( - test.repository, - attrFileName, - filter, + test.repository, + attrFileName, + filter, "added gitattributes") .then(function() { return commitFile( @@ -439,10 +438,10 @@ describe("Blob", function() { .then(function(binaryBlob) { test.binaryBlob = binaryBlob; assert.equal(true, binaryBlob.isBinary()); - + return Blob.filteredContent( - test.binaryBlob, - newFileName, + test.binaryBlob, + newFileName, 0 ); }) @@ -455,7 +454,7 @@ describe("Blob", function() { return Blob.filteredContent(null, "", 0) .catch(function(err) { assert.strictEqual( - err.message, + err.message, "Blob blob is required." ); }); @@ -474,10 +473,190 @@ describe("Blob", function() { return Blob.filteredContent(test.blob, "") .catch(function(err) { assert.strictEqual( - err.message, + err.message, "Number check_for_binary_data is required." ); }); }); }); + + describe("filter", function() { + var attrFileName = ".gitattributes"; + var filter = "* text eol=crlf"; + var lineEndingRegex = /\r\n|\r|\n/; + var newFileName = "testfile.test"; + + it("retrieves the filtered content", function() { + var test = this; + + return commitFile( + test.repository, + attrFileName, + filter, + "added gitattributes") + .then(function() { + return commitFile( + test.repository, + newFileName, + "this\nis\nfun\guys", + "added LF ending file" + ); + }) + .then(function(oid) { + return test.repository.getCommit(oid); + }) + .then(function(commit) { + test.filteredCommit = commit; + return commit.getEntry(newFileName); + }) + .then(function(entry) { + return entry.getBlob(); + }) + .then(function(lfBlob) { + test.lfBlob = lfBlob; + var ending = test.lfBlob.toString().match(lineEndingRegex); + assert.strictEqual(ending[0], "\n"); + + return test.lfBlob.filter(newFileName, { flags: 0 }); + }) + .then(function(content) { + var ending = content.match(lineEndingRegex); + assert.strictEqual(ending[0], "\r\n"); + assert.notStrictEqual(content, test.blob.toString()); + }); + }); + + it("returns non-binary filtered content when checking binary", function() { + var test = this; + + return commitFile( + test.repository, + attrFileName, + filter, + "added gitattributes") + .then(function() { + return commitFile( + test.repository, + newFileName, + "this\nis\nfun\guys", + "added LF ending file" + ); + }) + .then(function(oid) { + return test.repository.getCommit(oid); + }) + .then(function(commit) { + test.filteredCommit = commit; + return commit.getEntry(newFileName); + }) + .then(function(entry) { + return entry.getBlob(); + }) + .then(function(lfBlob) { + test.lfBlob = lfBlob; + var ending = test.lfBlob.toString().match(lineEndingRegex); + assert.strictEqual(ending[0], "\n"); + + return test.lfBlob.filter( + newFileName, + { flags: NodeGit.Blob.FILTER_FLAG.CHECK_FOR_BINARY } + ); + }) + .then(function(content) { + var ending = content.match(lineEndingRegex); + assert.strictEqual(ending[0], "\r\n"); + assert.notStrictEqual(content, test.blob.toString()); + }); + }); + + it("returns nothing when checking binary blob", function() { + var test = this; + var binary = Buffer.from(new Uint8Array([1,2,3,4,5,6])); + + return commitFile( + test.repository, + attrFileName, + filter, + "added gitattributes") + .then(function() { + return commitFile( + test.repository, + newFileName, + binary, + "binary content" + ); + }) + .then(function(oid) { + return test.repository.getCommit(oid); + }) + .then(function(commit) { + test.filteredCommit = commit; + return commit.getEntry(newFileName); + }) + .then(function(entry) { + return entry.getBlob(); + }) + .then(function(binaryBlob) { + test.binaryBlob = binaryBlob; + assert.equal(true, binaryBlob.isBinary()); + + return test.binaryBlob.filter( + newFileName, + { flags: NodeGit.Blob.FILTER_FLAG.CHECK_FOR_BINARY } + ); + }) + .then(function(content) { + assert.strictEqual(content, ""); + }); + }); + + it("returns blob when not checking binary on binary blob", function() { + var test = this; + var binary = Buffer.from(new Uint8Array([1,2,3,4,5,6])); + + return commitFile( + test.repository, + attrFileName, + filter, + "added gitattributes") + .then(function() { + return commitFile( + test.repository, + newFileName, + binary, + "binary content" + ); + }) + .then(function(oid) { + return test.repository.getCommit(oid); + }) + .then(function(commit) { + test.filteredCommit = commit; + return commit.getEntry(newFileName); + }) + .then(function(entry) { + return entry.getBlob(); + }) + .then(function(binaryBlob) { + test.binaryBlob = binaryBlob; + assert.equal(true, binaryBlob.isBinary()); + + return test.binaryBlob.filter( + newFileName, + { flags: 0 } + ); + }) + .then(function(content) { + assert.strictEqual(content, binary.toString()); + }); + }); + + it("throws an error when the path is null", function() { + var test = this; + return test.blob.filter(test.blob, null, { flags: 0 }) + .catch(function(err) { + assert.strictEqual(err.message, "String as_path is required."); + }); + }); + }); }); diff --git a/test/tests/checkout.js b/test/tests/checkout.js index e3815a35f1..c10d50d3a7 100644 --- a/test/tests/checkout.js +++ b/test/tests/checkout.js @@ -14,6 +14,7 @@ describe("Checkout", function() { var readMePath = local("../repos/workdir/" + readMeName); var packageJsonPath = local("../repos/workdir/" + packageJsonName); var checkoutBranchName = "checkout-test"; + var longpathBranchName = "longpaths-checkout"; beforeEach(function() { var test = this; @@ -35,6 +36,52 @@ describe("Checkout", function() { }); }); + it("can checkout a branch with a long file path", function() { + var test = this; + + return (function () { + if(process.platform === "win32") { + return test.repository.config() + .then(function(config) { + return config.setBool("core.longpaths", true); + }); + } + + return Promise.resolve(); + })() + .then(function() { + return test.repository.checkoutBranch(longpathBranchName); + }) + .then(function() { + return test.repository.getStatus(); + }) + .then(function(statuses) { + assert.equal(statuses.length, 0); + }); + }); + + it("cannot checkout long path file if core.longpaths is not set on win32", function() { + var test = this; + + if (process.platform !== "win32") { + this.skip(); + } + + return test.repository.config() + .then(function(config) { + config.setBool("core.longpaths", false); + }) + .then(function () { + return test.repository.checkoutBranch(longpathBranchName); + }) + .then(function() { + assert.fail(); + }) + .catch(function(err) { + assert(~err.message.indexOf("path too long")); + }); + }); + it("can force checkout a single file", function() { var test = this; @@ -109,60 +156,63 @@ describe("Checkout", function() { }); it("can checkout an index with conflicts", function() { - var test = this; + const test = this; - var testBranchName = "test"; - var ourCommit; + const testBranchName = "test"; + let ourCommit; + let signature; - return test.repository.getBranchCommit(checkoutBranchName) - .then(function(commit) { + return test.repository.defaultSignature() + .then((signatureResult) => { + signature = signatureResult; + return test.repository.getBranchCommit(checkoutBranchName); + }) + .then((commit) => { ourCommit = commit; return test.repository.createBranch(testBranchName, commit.id()); }) - .then(function() { + .then(() => { return test.repository.checkoutBranch(testBranchName); }) - .then(function(branch) { + .then((branch) => { fse.writeFileSync(packageJsonPath, "\n"); return test.repository.refreshIndex() - .then(function(index) { + .then((index) => { return index.addByPath(packageJsonName) - .then(function() { + .then(() => { return index.write(); }) - .then(function() { + .then(() => { return index.writeTree(); }); }); }) - .then(function(oid) { + .then((oid) => { assert.equal(oid.toString(), "85135ab398976a4d5be6a8704297a45f2b1e7ab2"); - var signature = test.repository.defaultSignature(); - return test.repository.createCommit("refs/heads/" + testBranchName, signature, signature, "we made breaking changes", oid, [ourCommit]); }) - .then(function(commit) { + .then((commit) => { return Promise.all([ test.repository.getBranchCommit(testBranchName), test.repository.getBranchCommit("master") ]); }) - .then(function(commits) { + .then((commits) => { return NodeGit.Merge.commits(test.repository, commits[0], commits[1], null); }) - .then(function(index) { + .then((index) => { assert.ok(index); assert.ok(index.hasConflicts && index.hasConflicts()); return NodeGit.Checkout.index(test.repository, index); }) - .then(function() { + .then(() => { // Verify that the conflict has been written to disk var conflictedContent = fse.readFileSync(packageJsonPath, "utf-8"); @@ -178,7 +228,7 @@ describe("Checkout", function() { return Checkout.head(test.repository, opts); }) - .then(function() { + .then(() => { var finalContent = fse.readFileSync(packageJsonPath, "utf-8"); assert.equal(finalContent, "\n"); }); diff --git a/test/tests/cherrypick.js b/test/tests/cherrypick.js index e4f2ca7e47..1a1dc92235 100644 --- a/test/tests/cherrypick.js +++ b/test/tests/cherrypick.js @@ -1,8 +1,7 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); describe("Cherrypick", function() { var RepoUtils = require("../utils/repository_setup"); diff --git a/test/tests/clone.js b/test/tests/clone.js index 48205d03de..f256e85f51 100644 --- a/test/tests/clone.js +++ b/test/tests/clone.js @@ -1,16 +1,36 @@ var path = require("path"); var assert = require("assert"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var local = path.join.bind(path, __dirname); var _ = require("lodash"); + +const generatePathWithLength = (base, length) => { + let path = `${base}/`; + const baseLength = path.length; + const remaining = length - baseLength; + + for (let i = 0; i < remaining; ++i) { + // add a slash every 240 characters, but not as first or last character + if (i % 239 == 0 && i != remaining - 1 && i != 0) { + path += "/"; + } else { + path += "a"; + } + } + + assert.ok(path.length === length); + + return path; +}; + describe("Clone", function() { var NodeGit = require("../../"); var Repository = NodeGit.Repository; var Clone = NodeGit.Clone; var clonePath = local("../repos/clone"); + var longClonePath = generatePathWithLength(clonePath, 600); var sshPublicKeyPath = local("../id_rsa.pub"); var sshPrivateKeyPath = local("../id_rsa"); @@ -21,11 +41,14 @@ describe("Clone", function() { this.timeout(30000); beforeEach(function() { - return fse.remove(clonePath).catch(function(err) { - console.log(err); - - throw err; - }); + return fse.remove(clonePath) + .then(function() { + return fse.remove(longClonePath); + }) + .catch(function(err) { + console.log(err); + throw err; + }); }); it.skip("can clone with http", function() { @@ -44,9 +67,7 @@ describe("Clone", function() { var opts = { fetchOpts: { callbacks: { - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } } }; @@ -203,9 +224,7 @@ describe("Clone", function() { var opts = { fetchOpts: { callbacks: { - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } } }; @@ -222,11 +241,9 @@ describe("Clone", function() { var opts = { fetchOpts: { callbacks: { - certificateCheck: function() { - return 1; - }, + certificateCheck: () => 0, credentials: function(url, userName) { - return NodeGit.Cred.sshKeyFromAgent(userName); + return NodeGit.Credential.sshKeyFromAgent(userName); } } } @@ -244,11 +261,9 @@ describe("Clone", function() { var opts = { fetchOpts: { callbacks: { - certificateCheck: function() { - return 1; - }, + certificateCheck: () => 0, credentials: function(url, userName) { - return NodeGit.Cred.sshKeyNew( + return NodeGit.Credential.sshKeyNew( userName, sshPublicKeyPath, sshPrivateKeyPath, @@ -270,11 +285,9 @@ describe("Clone", function() { var opts = { fetchOpts: { callbacks: { - certificateCheck: function() { - return 1; - }, + certificateCheck: () => 0, credentials: function(url, userName) { - return NodeGit.Cred.sshKeyNew( + return NodeGit.Credential.sshKeyNew( userName, sshEncryptedPublicKeyPath, sshEncryptedPrivateKeyPath, @@ -291,15 +304,15 @@ describe("Clone", function() { }); }); - it("can clone with git", function() { + // Since 15 March the unauthenticated git protocol on port 9418 is no longer supported in Github. + // https://github.blog/2021-09-01-improving-git-protocol-security-github/ + it.skip("can clone with git", function() { var test = this; var url = "git://github.com/nodegit/test.git"; var opts = { fetchOpts: { callbacks: { - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } } }; @@ -329,16 +342,14 @@ describe("Clone", function() { return Clone(url, clonePath, { fetchOpts: { callbacks: { - certificateCheck: function() { - return 1; - }, + certificateCheck: () => 0, credentials: function() { if (firstPass) { firstPass = false; - return NodeGit.Cred.userpassPlaintextNew("fake-token", + return NodeGit.Credential.userpassPlaintextNew("fake-token", "x-oauth-basic"); } else { - return NodeGit.Cred.defaultNew(); + return NodeGit.Credential.defaultNew(); } } } diff --git a/test/tests/commit.js b/test/tests/commit.js index 097b45ed77..8ff9b8ea78 100644 --- a/test/tests/commit.js +++ b/test/tests/commit.js @@ -1,7 +1,6 @@ var assert = require("assert"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var garbageCollect = require("../utils/garbage_collect.js"); var leakTest = require("../utils/leak_test"); @@ -13,9 +12,12 @@ var exec = require("../../utils/execPromise"); describe("Commit", function() { var NodeGit = require("../../"); var Repository = NodeGit.Repository; + var Commit = NodeGit.Commit; var Diff = NodeGit.Diff; + var Oid = NodeGit.Oid; var reposPath = local("../repos/workdir"); + var newRepoPath = local("../repos/new"); var oid = "fce88902e66c72b5b93e75bdb5ae717038b221f6"; function reinitialize(test) { @@ -126,6 +128,18 @@ describe("Commit", function() { assert.equal(this.commit.timeOffset(), 780); }); + it("can call getTree on a parent commit", function() { + return this.commit.parent(0) + .then(function(parent) { + return parent.getTree(); + }) + .then(function(tree) { + assert.equal( + tree.id().toString(), "327ff68e59f94f0c25d2c62fb0938efa01e8a107" + ); + }); + }); + it("can create a commit", function() { var test = this; var expectedCommitId = "315e77328ef596f3bc065d8ac6dd2c72c09de8a5"; @@ -197,10 +211,82 @@ describe("Commit", function() { }); }); + it("can create a commit as a buffer", function() { + var test = this; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + const expectedCommitContent = + "tree 11c8685af551550e73e5ab89fa554576bd92ef3f\n" + + "parent 32789a79e71fbc9e04d3eff7425e1771eb595150\n" + + "author Foo Bar 123456789 +0100\n" + + "committer Foo A Bar 987654321 +0130\n\n" + + "message"; + + var repo; + var index; + var treeOid; + var parent; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitBuffer( + author, + committer, + "message", + treeOid, + [parent]); + }) + .then(function(commitContent) { + assert.equal(expectedCommitContent, commitContent); + return reinitialize(test); + }, function(reason) { + return reinitialize(test) + .then(function() { + return Promise.reject(reason); + }); + }); + }); it("can amend commit", function(){ var commitToAmendId = "315e77328ef596f3bc065d8ac6dd2c72c09de8a5"; - var expectedAmendedCommitId = "57836e96555243666ea74ea888310cc7c41d4613"; + var expectedAmendedCommitId = "a41de0d1c3dc169c873dd03bd9240d9f88e60ffc"; var fileName = "newfile.txt"; var fileContent = "hello world"; var newFileName = "newerfile.txt"; @@ -377,6 +463,242 @@ describe("Commit", function() { }); }); + describe("amendWithSignature", function() { + it("can amend with signature", function() { + const signedData = "-----BEGIN PGP SIGNATURE-----\n" + + "\n" + + "iQJHBAEBCAAxFiEEKdxGpJ93wnkLaBKfURjJKedOfEMFAlxPKUYTHHN0ZXZla0Bh\n" + + "eG9zb2Z0LmNvbQAKCRBRGMkp5058Q3vcD/0Uf6P68g98Kbvsgjg/aidM1ujruXaw\n" + + "X5WSsCAw+wWGICOj0n+KBnmQruI4HSFz3zykEshuOpcBv1X/+huwDeB/hBqonCU8\n" + + "QdexCdWR70YbT1bufesUwV9v1qwE4WOmFxWXgwh55K0wDRkc0u2aLcwrJkIEEVfs\n" + + "HqZyFzU4kwbGekY/m7d1DsBhWyKEGW9/25WMYmjWOWOiaFjeBaHLlxiEM8KGnMLH\n" + + "wx37NuFuaABgi23AAcBGdeWy04TEuU4S51+bHM3RotrZ2cryW2lEbkkXodhIJcq0\n" + + "RgrStCbvR0ehnOPdYSiRbxK8JNLZuNjHlK2g7wVi+C83vwMQuhU4H6OlYHGVr664\n" + + "4YzL83FdIo7wiMOFd2OOMLlCfHgTun60FvjCs4WHjrwH1fQl287FRPLa/4olBSQP\n" + + "yUXJaZdxm4cB4L/1pmbb/J/XUiOio3MpaN3GFm2hZloUlag1uPDBtCxTl5odvj4a\n" + + "GOmTBWznXxF/zrKnQVSvv+EccNxYFc0VVjAxGgNqPzIxDAKtw1lE5pbBkFpFpNHz\n" + + "StmwZkP9QIJY4hJYQfM+pzHLe8xjexL+Kh/TrYXgY1m/4vJe0HJSsnRnaR8Yfqhh\n" + + "LReqo94VHRYXR0rZQv4py0D9TrWaI8xHLve6ewhLPNRzyaI9fNrinbcPYZZOWnRi\n" + + "ekgUBx+BX6nJOw==\n" + + "=4Hy5\n" + + "-----END PGP SIGNATURE-----"; + + const onSignature = () => ({ + code: NodeGit.Error.CODE.OK, + field: "gpgsig", + signedData + }); + + var repo; + var oid; + var commit; + var message; + var parents; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + message = headCommit.message() + "\n"; + parents = headCommit.parents(); + + return headCommit.amendWithSignature( + null, + null, + null, + null, + null, + null, + onSignature + ); + }) + .then(function(oidResult) { + oid = oidResult; + return NodeGit.Commit.lookup(repo, oid); + }) + .then(function(commitResult) { + commit = commitResult; + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signatureInfo.signature, signedData); + assert.equal(commit.message(), message); + assert.deepEqual(commit.parents(), parents); + }); + }); + + it("will respects overridden arguments", function() { + const signedData = "-----BEGIN PGP SIGNATURE-----\n" + + "\n" + + "iQJHBAEBCAAxFiEEKdxGpJ93wnkLaBKfURjJKedOfEMFAlxPKUYTHHN0ZXZla0Bh\n" + + "eG9zb2Z0LmNvbQAKCRBRGMkp5058Q3vcD/0Uf6P68g98Kbvsgjg/aidM1ujruXaw\n" + + "X5WSsCAw+wWGICOj0n+KBnmQruI4HSFz3zykEshuOpcBv1X/+huwDeB/hBqonCU8\n" + + "QdexCdWR70YbT1bufesUwV9v1qwE4WOmFxWXgwh55K0wDRkc0u2aLcwrJkIEEVfs\n" + + "HqZyFzU4kwbGekY/m7d1DsBhWyKEGW9/25WMYmjWOWOiaFjeBaHLlxiEM8KGnMLH\n" + + "wx37NuFuaABgi23AAcBGdeWy04TEuU4S51+bHM3RotrZ2cryW2lEbkkXodhIJcq0\n" + + "RgrStCbvR0ehnOPdYSiRbxK8JNLZuNjHlK2g7wVi+C83vwMQuhU4H6OlYHGVr664\n" + + "4YzL83FdIo7wiMOFd2OOMLlCfHgTun60FvjCs4WHjrwH1fQl287FRPLa/4olBSQP\n" + + "yUXJaZdxm4cB4L/1pmbb/J/XUiOio3MpaN3GFm2hZloUlag1uPDBtCxTl5odvj4a\n" + + "GOmTBWznXxF/zrKnQVSvv+EccNxYFc0VVjAxGgNqPzIxDAKtw1lE5pbBkFpFpNHz\n" + + "StmwZkP9QIJY4hJYQfM+pzHLe8xjexL+Kh/TrYXgY1m/4vJe0HJSsnRnaR8Yfqhh\n" + + "LReqo94VHRYXR0rZQv4py0D9TrWaI8xHLve6ewhLPNRzyaI9fNrinbcPYZZOWnRi\n" + + "ekgUBx+BX6nJOw==\n" + + "=4Hy5\n" + + "-----END PGP SIGNATURE-----"; + + const onSignature = () => ({ + code: NodeGit.Error.CODE.OK, + field: "gpgsig", + signedData + }); + + var repo; + var oid; + var commit; + var message; + var parents; + var commitTree; + + var author = NodeGit.Signature.create( + "Scooby Doo", + "scoob@mystery.com", + 123456789, + 60 + ); + var committer = NodeGit.Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + var tree = Oid.fromString("f4661419a6fbbe865f78644fec722c023ce4b65f"); + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + message = headCommit.message() + "\n"; + parents = headCommit.parents(); + + return headCommit.amendWithSignature( + null, + author, + committer, + null, + null, + tree, + onSignature + ); + }) + .then(function(oidResult) { + oid = oidResult; + return NodeGit.Commit.lookup(repo, oid); + }) + .then(function(commitResult) { + commit = commitResult; + return commit.getTree(); + }) + .then(function(commitTreeResult) { + commitTree = commitTreeResult; + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signatureInfo.signature, signedData); + assert.equal(commit.message(), message); + assert.deepEqual(commit.parents(), parents); + assert.deepEqual(commitTree.id(), tree); + assert.deepEqual(commit.author(), author); + assert.deepEqual(commit.committer(), committer); + }); + }); + + it("can optionally skip signing process", function() { + const onSignature = () => ({ + code: NodeGit.Error.CODE.PASSTHROUGH + }); + + var repo; + var oid; + var commit; + var message; + var parents; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + message = headCommit.message(); + parents = headCommit.parents(); + + return headCommit.amendWithSignature( + null, + null, + null, + null, + null, + null, + onSignature + ); + }) + .then(function(oidResult) { + oid = oidResult; + return NodeGit.Commit.lookup(repo, oid); + }) + .then(function(commitResult) { + commit = commitResult; + return commit.getSignature("gpgsig") + .then(function() { + assert.fail("Should not have a signature"); + }, function(error) { + if (error && error.message === "this commit is not signed") { + return; + } + throw error; + }); + }) + .then(function(signatureInfo) { + assert.equal(commit.message(), message); + assert.deepEqual(commit.parents(), parents); + }); + }); + + it("will throw if signing callback returns an error code", function() { + const onSignature = () => ({ + code: NodeGit.Error.CODE.ERROR + }); + + return NodeGit.Repository.open(reposPath) + .then(function(repo) { + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + return headCommit.amendWithSignature( + null, + null, + null, + null, + null, + null, + onSignature + ); + }) + .then(function() { + assert.fail("amendWithSignature should have failed."); + }, function(error) { + if (error && error.errno === NodeGit.Error.CODE.ERROR) { + return; + } + throw error; + }); + }); + }); + it("has an owner", function() { var owner = this.commit.owner(); assert.ok(owner instanceof Repository); @@ -452,6 +774,16 @@ describe("Commit", function() { assert.equal(1, this.commit.parentcount()); }); + it("can fetch a single parent", function() { + return this.commit.parent(0).then(function(parent) { + assert.strictEqual(parent.sha(), + "ecfd36c80a3e9081f200dfda2391acadb56dac27"); + // This used to crash due to a missing .repo property on the retrieved + // parent. + return parent.getTree().then(tree => assert(tree)); + }); + }); + it("can retrieve and walk a commit tree", function() { var commitTreeEntryCount = 0; var expectedCommitTreeEntryCount = 198; @@ -604,6 +936,31 @@ describe("Commit", function() { }); }); + it("can lookup using a short id", function () { + return NodeGit.Repository.open(reposPath) + .then(function (repo) { + return Commit.lookupPrefix(repo, Oid.fromString("bf1da765"), 8); + }) + .then(function (commit) { + assert.equal(commit.id().toString(), + "bf1da765e357a9b936d6d511f2c7b78e0de53632"); + }); + }); + + it("can find nth gen ancestor", function () { + return NodeGit.Repository.open(reposPath) + .then(function (repo) { + return repo.getCommit("b52067acaa755c3b3fc21b484ffed2bce4150f62"); + }) + .then(function (commit) { + return commit.nthGenAncestor(3); + }) + .then(function (commit) { + assert.equal(commit.id().toString(), + "9b2f3a37d46d47248d2704b6a46ec7e197bcd48c"); + }); + }); + describe("Commit's Author", function() { before(function() { this.author = this.commit.author(); @@ -691,4 +1048,559 @@ describe("Commit", function() { // the self-freeing signature should get freed assert.equal(startSelfFreeingCount, endSelfFreeingCount); }); + + describe("Commit's Signature", function() { + it("Can create a signed commit in a repo", function() { + var signedData = "-----BEGIN PGP SIGNATURE-----\n" + + "Version: GnuPG v1.4.12 (Darwin)\n" + + "\n" + + "iQIcBAABAgAGBQJQ+FMIAAoJEH+LfPdZDSs1e3EQAJMjhqjWF+WkGLHju7pTw2al\n" + + "o6IoMAhv0Z/LHlWhzBd9e7JeCnanRt12bAU7yvYp9+Z+z+dbwqLwDoFp8LVuigl8\n" + + "JGLcnwiUW3rSvhjdCp9irdb4+bhKUnKUzSdsR2CK4/hC0N2i/HOvMYX+BRsvqweq\n" + + "AsAkA6dAWh+gAfedrBUkCTGhlNYoetjdakWqlGL1TiKAefEZrtA1TpPkGn92vbLq\n" + + "SphFRUY9hVn1ZBWrT3hEpvAIcZag3rTOiRVT1X1flj8B2vGCEr3RrcwOIZikpdaW\n" + + "who/X3xh/DGbI2RbuxmmJpxxP/8dsVchRJJzBwG+yhwU/iN3MlV2c5D69tls/Dok\n" + + "6VbyU4lm/ae0y3yR83D9dUlkycOnmmlBAHKIZ9qUts9X7mWJf0+yy2QxJVpjaTGG\n" + + "cmnQKKPeNIhGJk2ENnnnzjEve7L7YJQF6itbx5VCOcsGh3Ocb3YR7DMdWjt7f8pu\n" + + "c6j+q1rP7EpE2afUN/geSlp5i3x8aXZPDj67jImbVCE/Q1X9voCtyzGJH7MXR0N9\n" + + "ZpRF8yzveRfMH8bwAJjSOGAFF5XkcR/RNY95o+J+QcgBLdX48h+ZdNmUf6jqlu3J\n" + + "7KmTXXQcOVpN6dD3CmRFsbjq+x6RHwa8u1iGn+oIkX908r97ckfB/kHKH7ZdXIJc\n" + + "cpxtDQQMGYFpXK/71stq\n" + + "=ozeK\n" + + "-----END PGP SIGNATURE-----"; + + const onSignature = () => ({ + code: NodeGit.Error.CODE.OK, + field: "gpgsig", + signedData + }); + + var test = this; + var expectedCommitId = "ccb99bb20716ef7c37e92c7b8db029a7af7f747b"; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + var repo; + var index; + var treeOid; + var parent; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitWithSignature( + null, + author, + committer, + "message", + treeOid, + [parent], + onSignature + ); + }) + .then(function(commitId) { + assert.equal(expectedCommitId, commitId); + return NodeGit.Commit.lookup(repo, commitId); + }) + .then(function(commit) { + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signedData, signatureInfo.signature); + return reinitialize(test); + }, function(reason) { + return reinitialize(test) + .then(function() { + return Promise.reject(reason); + }); + }); + }); + + it("Can create a signed commit in a repo and update existing ref", + function() { + var signedData = "-----BEGIN PGP SIGNATURE-----\n" + + "Version: GnuPG v1.4.12 (Darwin)\n" + + "\n" + + "iQIcBAABAgAGBQJQ+FMIAAoJEH+LfPdZDSs1e3EQAJMjhqjWF+WkGLHju7pTw2al\n" + + "o6IoMAhv0Z/LHlWhzBd9e7JeCnanRt12bAU7yvYp9+Z+z+dbwqLwDoFp8LVuigl8\n" + + "JGLcnwiUW3rSvhjdCp9irdb4+bhKUnKUzSdsR2CK4/hC0N2i/HOvMYX+BRsvqweq\n" + + "AsAkA6dAWh+gAfedrBUkCTGhlNYoetjdakWqlGL1TiKAefEZrtA1TpPkGn92vbLq\n" + + "SphFRUY9hVn1ZBWrT3hEpvAIcZag3rTOiRVT1X1flj8B2vGCEr3RrcwOIZikpdaW\n" + + "who/X3xh/DGbI2RbuxmmJpxxP/8dsVchRJJzBwG+yhwU/iN3MlV2c5D69tls/Dok\n" + + "6VbyU4lm/ae0y3yR83D9dUlkycOnmmlBAHKIZ9qUts9X7mWJf0+yy2QxJVpjaTGG\n" + + "cmnQKKPeNIhGJk2ENnnnzjEve7L7YJQF6itbx5VCOcsGh3Ocb3YR7DMdWjt7f8pu\n" + + "c6j+q1rP7EpE2afUN/geSlp5i3x8aXZPDj67jImbVCE/Q1X9voCtyzGJH7MXR0N9\n" + + "ZpRF8yzveRfMH8bwAJjSOGAFF5XkcR/RNY95o+J+QcgBLdX48h+ZdNmUf6jqlu3J\n" + + "7KmTXXQcOVpN6dD3CmRFsbjq+x6RHwa8u1iGn+oIkX908r97ckfB/kHKH7ZdXIJc\n" + + "cpxtDQQMGYFpXK/71stq\n" + + "=ozeK\n" + + "-----END PGP SIGNATURE-----"; + + const onSignature = () => ({ + code: NodeGit.Error.CODE.OK, + field: "gpgsig", + signedData + }); + + var test = this; + var expectedCommitId = "ccb99bb20716ef7c37e92c7b8db029a7af7f747b"; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + var repo; + var index; + var treeOid; + var parent; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitWithSignature( + "HEAD", + author, + committer, + "message", + treeOid, + [parent], + onSignature); + }) + .then(function(commitId) { + assert.equal(expectedCommitId, commitId); + return NodeGit.Commit.lookup(repo, commitId); + }) + .then(function(commit) { + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signedData, signatureInfo.signature); + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + assert.equal(expectedCommitId, headCommit.id()); + return undoCommit() + .then(function(){ + return reinitialize(test); + }); + }, function(reason) { + return reinitialize(test) + .then(function() { + return Promise.reject(reason); + }); + }); + }); + + it("Can create a signed commit in bare a repo and update non-existent ref", + function() { + var signedData = "-----BEGIN PGP SIGNATURE-----\n" + + "\n" + + "iQIzBAABCAAdFiEEHYpzGBSIRCy6QrNr0R10kNTwiG8FAlxcuSoACgkQ0R10kNTw\n" + + "iG9sZA//Z6mrX5l//gjtn7Fy3Cg5khasNMZA15JUPzfoSyVkaYM7g/iZrJr4uZmm\n" + + "lrhqxTDP4SUEL6dMOT0fjAudulP19Stv0mUMOoQ9cfvU0DAuFlI1z2Ny9IR+3hJK\n" + + "XpIQCHZAAY9KrGajJvDO+WqukrMwKh2dwaQLgB2+cS7ehBpbW45+l+Bq4hTlULiJ\n" + + "ohZ2SQhqj65knErdbfJ2B7yVlQbfG2vbD6qN4qJOkJpkFRdDhLmGnNjUj+vcmYO2\n" + + "Be5CLyjuhYszzUqys6ix4UHr10KihFk31N17CgA2ZsDSzE3VsMCPlVPV9jWuMceJ\n" + + "0IFsJEXFR4SOlRAq23BxD7aaYao6AF/YBhCQnDiuiQLCJ7WdUAmja6VPyEajAjoX\n" + + "CkdDs1P4N9IeIPvJECn8Df4NEEkzW8sV3i96ryk066m1ZmZWemJ2zdGVbfR+AuFZ\n" + + "7QwgBRidj3thIk0geh9g10+pbRuTzxNXklqxq4DQb3VEXIIJMUcqtN1bUPEPiLyA\n" + + "SU3uJ1THyYznAVZy6aqw+mNq7Lg9gV65LRd0WtNqgneknDZoH3zXyzlcJexjHkRF\n" + + "qt4K6w9TDA2Erda3wE4BM4MCgl1Hc629kH3ROCyWTFuJAEZtNDJPgIc2LTRDhHNd\n" + + "+K937RhWU8lUnI2jJLmKdQDk2dnS1ZepFqA5Ynwza1qDSOgUqVw=\n" + + "=M81P\n" + + "-----END PGP SIGNATURE-----"; + + const onSignature = () => ({ + code: NodeGit.Error.CODE.OK, + field: "gpgsig", + signedData + }); + + var expectedCommitId = "ef11571eb3590007712c7ee3b4a11cd9c6094e30"; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + var repo; + var index; + var treeOid; + + return NodeGit.Repository.init(newRepoPath, 0) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitWithSignature( + "HEAD", + author, + committer, + "message", + treeOid, + [], + onSignature); + }) + .then(function(commitId) { + assert.equal(expectedCommitId, commitId); + return NodeGit.Commit.lookup(repo, commitId); + }) + .then(function(commit) { + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signedData, signatureInfo.signature); + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + assert.equal(expectedCommitId, headCommit.id()); + }); + }); + + it("Can create a signed commit raw", function() { + var expectedCommitId = "cc1401eaac4e9e77190e98a9353b305f0c6313d8"; + + var signature = "-----BEGIN PGP SIGNATURE-----\n\n" + + "iQEcBAABCAAGBQJarBhIAAoJEE8pfTd/81lKQA4IAL8Mu5kc4B/MX9s4XB26Ahap\n" + + "n06kCx3RQ1KHMZIRomAjCnb48WieNVuy1y+Ut0RgfCxxrJ1ZnzFG3kF2bIKwIxNI\n" + + "tYIC76iWny+mrVnb2mjKYjn/3F4c4VJGENq9ITiV1WeE4yJ8dHw2ox2D+hACzTvQ\n" + + "KVroedk8BDFJxS6DFb20To35xbAVhwBnAGRcII4Wi5PPMFpqAhGLfq3Czv95ddSz\n" + + "BHlyp27+YWSpV0Og0dqOEhsdDYaPrOBGRcoRiqjue+l5tgK/QerLFZ4aovZzpuEP\n" + + "Xx1yZfqXIiy4Bo40qScSrdnmnp/kMq/NQGR3jYU+SleFHVKNFsya9UwurMaezY0=\n" + + "=eZzi\n-----END PGP SIGNATURE-----"; + + var commit_content = "tree f4661419a6fbbe865f78644fec722c023ce4b65f\n" + + "parent 32789a79e71fbc9e04d3eff7425e1771eb595150\n" + + "author Tyler Ang-Wanek 1521227848 -0700\n" + + "committer Tyler Ang-Wanek 1521227848 -0700\n\n" + + "GPG Signed commit\n"; + + var repo; + var commit; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return Commit.createWithSignature( + repo, + commit_content, + signature, + "gpgsig"); + }) + .then(function(commitId) { + assert.equal(expectedCommitId, commitId); + return NodeGit.Commit.lookup(repo, commitId); + }) + .then(function(commitResult) { + commit = commitResult; + return commit.getSignature(); + }) + .then(function(signatureInfoDefault) { + assert.equal(signature, signatureInfoDefault.signature); + assert.equal(commit_content, signatureInfoDefault.signedData); + + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signature, signatureInfo.signature); + assert.equal(commit_content, signatureInfo.signedData); + }); + }); + + it("Can retrieve the gpg signature from a commit", function() { + var expectedSignedData = + "tree f4661419a6fbbe865f78644fec722c023ce4b65f\n" + + "parent 32789a79e71fbc9e04d3eff7425e1771eb595150\n" + + "author Tyler Ang-Wanek 1521227848 -0700\n" + + "committer Tyler Ang-Wanek 1521227848 -0700\n\n" + + "GPG Signed commit\n"; + + var expectedSignature = + "-----BEGIN PGP SIGNATURE-----\n\n" + + "iQEcBAABCAAGBQJarBhIAAoJEE8pfTd/81lKQA4IAL8Mu5kc4B/MX9s4XB26Ahap\n" + + "n06kCx3RQ1KHMZIRomAjCnb48WieNVuy1y+Ut0RgfCxxrJ1ZnzFG3kF2bIKwIxNI\n" + + "tYIC76iWny+mrVnb2mjKYjn/3F4c4VJGENq9ITiV1WeE4yJ8dHw2ox2D+hACzTvQ\n" + + "KVroedk8BDFJxS6DFb20To35xbAVhwBnAGRcII4Wi5PPMFpqAhGLfq3Czv95ddSz\n" + + "BHlyp27+YWSpV0Og0dqOEhsdDYaPrOBGRcoRiqjue+l5tgK/QerLFZ4aovZzpuEP\n" + + "Xx1yZfqXIiy4Bo40qScSrdnmnp/kMq/NQGR3jYU+SleFHVKNFsya9UwurMaezY0=\n" + + "=eZzi\n-----END PGP SIGNATURE-----"; + + return NodeGit.Commit.lookup( + this.repository, + "cc1401eaac4e9e77190e98a9353b305f0c6313d8" + ) + .then(function(commit) { + return commit.getSignature(); + }) + .then(function(extractSignature) { + assert.equal( + extractSignature.signature, + expectedSignature + ); + assert.equal( + extractSignature.signedData, + expectedSignedData + ); + }); + }); + + it("Can be optionally skipped to create without signature", function() { + const onSignature = () => ({ + code: NodeGit.Error.CODE.PASSTHROUGH + }); + + var test = this; + var expectedCommitId = "c9bffe040519231d32431c101bca4efc0917f64c"; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + var repo; + var index; + var treeOid; + var parent; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitWithSignature( + null, + author, + committer, + "message", + treeOid, + [parent], + onSignature + ); + }) + .then(function(commitId) { + assert.equal(expectedCommitId, commitId); + return NodeGit.Commit.lookup(repo, commitId); + }) + .then(function(commit) { + return commit.getSignature("gpgsig") + .then(function() { + assert.fail("Should not have been able to retrieve gpgsig"); + }, function(error) { + if (error && error.message === "this commit is not signed") { + return; + } + throw error; + }); + }) + .then(function() { + return reinitialize(test); + }, function(reason) { + return reinitialize(test) + .then(function() { + return Promise.reject(reason); + }); + }); + }); + + it("Will throw if the signing cb returns an error code", function() { + const onSignature = () => ({ + code: NodeGit.Error.CODE.ERROR + }); + + var test = this; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + var repo; + var index; + var treeOid; + var parent; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitWithSignature( + null, + author, + committer, + "message", + treeOid, + [parent], + onSignature + ); + }) + .then(function() { + assert.fail("createCommitWithSignature should have failed."); + }, function(error) { + if (error && error.errno === NodeGit.Error.CODE.ERROR) { + return; + } + throw error; + }) + .then(function() { + return reinitialize(test); + }, function(reason) { + return reinitialize(test) + .then(function() { + return Promise.reject(reason); + }); + }); + }); + }); }); diff --git a/test/tests/config.js b/test/tests/config.js index 3ac6fca483..bc4b802f37 100644 --- a/test/tests/config.js +++ b/test/tests/config.js @@ -6,9 +6,104 @@ var exec = require("../../utils/execPromise"); describe("Config", function() { var NodeGit = require("../../"); + var Repository = NodeGit.Repository; + var Config = NodeGit.Config; var reposPath = local("../repos/workdir"); + describe("openOnDisk", function() { + var configPath = path.join(reposPath, ".git/config"); + + it("opens the same config as the repo", function() { + var repo; + var onDiskConfig; + return Repository.open(reposPath) + .then(function(_repo) { + repo = _repo; + return Config.openOndisk(configPath); + }) + .then(function(config) { + onDiskConfig = config; + return repo.config(); + }) + .then(function(repoConfig) { + return Promise.all([ + onDiskConfig.getString("core.filemode"), + onDiskConfig.getString("core.bare"), + repoConfig.getString("core.filemode"), + repoConfig.getString("core.bare") + ]); + }) + .then(function(results) { + var onDiskFileMode = results[0]; + var onDiskBare = results[1]; + var repoFileMode = results[2]; + var repoBare = results[3]; + + assert.equal(onDiskFileMode, repoFileMode); + assert.equal(onDiskBare, repoBare); + }); + }); + + it("opens the config and can change a value", function() { + var repo; + var onDiskConfig; + var repoConfig; + var originalFileMode; + return Repository.open(reposPath) + .then(function(_repo) { + repo = _repo; + return Config.openOndisk(configPath); + }) + .then(function(config) { + onDiskConfig = config; + return repo.config(); + }) + .then(function(_repoConfig) { + repoConfig = _repoConfig; + return Promise.all([ + onDiskConfig.getString("core.filemode"), + repoConfig.getString("core.filemode") + ]); + }) + .then(function(results) { + var onDiskFileMode = results[0]; + var repoFileMode = results[1]; + + assert.equal(onDiskFileMode, repoFileMode); + originalFileMode = onDiskFileMode; + var oppositeFileMode = onDiskFileMode === "true" ? "false" : "true"; + + return onDiskConfig.setString( + "core.filemode", + oppositeFileMode + ); + }) + .then(function() { + return Config.openOndisk(configPath); + }) + .then(function(config) { + return Promise.all([ + config.getString("core.filemode"), + repoConfig.getString("core.filemode") + ]); + }) + .then(function(results) { + var onDiskFileMode = results[0]; + var repoFileMode = results[1]; + assert.notEqual(onDiskFileMode, originalFileMode); + assert.equal(onDiskFileMode, repoFileMode); + }) + .then(function() { + // cleanup + return onDiskConfig.setString( + "core.filemode", + originalFileMode + ); + }); + }); + }); + it("can get and set a global value", function() { var savedUserName; @@ -92,4 +187,24 @@ describe("Config", function() { }); }); }); + + describe("getPath", function() { + it("can get path for a given config", function() { + return NodeGit.Repository.open(reposPath) + .then(function(repo) { + return repo.config(); + }) + .then(function(config) { + return Promise.all([ + config.getPath("core.filemode"), + config.getString("core.filemode") + ]); + }) + .then(function(results) { + var localFilemode = results[0]; + var repoFilemode = results[1]; + assert.equal(localFilemode, repoFilemode); + }); + }); + }); }); diff --git a/test/tests/convenient_line.js b/test/tests/convenient_line.js index d4d51e59cf..994041cb45 100644 --- a/test/tests/convenient_line.js +++ b/test/tests/convenient_line.js @@ -1,7 +1,6 @@ var assert = require("assert"); var repoSetup = require("../utils/repository_setup"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var path = require("path"); var local = path.join.bind(path, __dirname); diff --git a/test/tests/cred.js b/test/tests/cred.js index 6f0bb46ad4..eee98d69bd 100644 --- a/test/tests/cred.js +++ b/test/tests/cred.js @@ -5,23 +5,23 @@ var local = path.join.bind(path, __dirname); describe("Cred", function() { var NodeGit = require("../../"); - + var sshPublicKey = local("../id_rsa.pub"); var sshPrivateKey = local("../id_rsa"); it("can create default credentials", function() { - var defaultCreds = NodeGit.Cred.defaultNew(); - assert.ok(defaultCreds instanceof NodeGit.Cred); + var defaultCreds = NodeGit.Credential.defaultNew(); + assert.ok(defaultCreds instanceof NodeGit.Credential); }); it("can create ssh credentials using passed keys", function() { - var cred = NodeGit.Cred.sshKeyNew( + var cred = NodeGit.Credential.sshKeyNew( "username", sshPublicKey, sshPrivateKey, ""); - assert.ok(cred instanceof NodeGit.Cred); + assert.ok(cred instanceof NodeGit.Credential); }); it("can create ssh credentials using passed keys in memory", function() { @@ -32,42 +32,42 @@ describe("Cred", function() { encoding: "ascii" }); - return NodeGit.Cred.sshKeyMemoryNew( + return NodeGit.Credential.sshKeyMemoryNew( "username", publicKeyContents, privateKeyContents, "").then(function(cred) { - assert.ok(cred instanceof NodeGit.Cred); + assert.ok(cred instanceof NodeGit.Credential); }); }); it("can create credentials using plaintext", function() { - var plaintextCreds = NodeGit.Cred.userpassPlaintextNew + var plaintextCreds = NodeGit.Credential.userpassPlaintextNew ("username", "password"); - assert.ok(plaintextCreds instanceof NodeGit.Cred); + assert.ok(plaintextCreds instanceof NodeGit.Credential); }); - + it("can create credentials using agent", function() { - var fromAgentCreds = NodeGit.Cred.sshKeyFromAgent + var fromAgentCreds = NodeGit.Credential.sshKeyFromAgent ("username"); - assert.ok(fromAgentCreds instanceof NodeGit.Cred); + assert.ok(fromAgentCreds instanceof NodeGit.Credential); }); it("can create credentials using username", function() { - return NodeGit.Cred.usernameNew + return NodeGit.Credential.usernameNew ("username").then(function(cred) { - assert.ok(cred instanceof NodeGit.Cred); + assert.ok(cred instanceof NodeGit.Credential); }); }); it("can return 1 if a username exists", function() { - var plaintextCreds = NodeGit.Cred.userpassPlaintextNew + var plaintextCreds = NodeGit.Credential.userpassPlaintextNew ("username", "password"); assert.ok(plaintextCreds.hasUsername() === 1); }); it("can return 0 if a username does not exist", function() { - var defaultCreds = NodeGit.Cred.defaultNew(); + var defaultCreds = NodeGit.Credential.defaultNew(); assert.ok(defaultCreds.hasUsername() === 0); }); }); diff --git a/test/tests/diff.js b/test/tests/diff.js index fdad25354e..9fd483c388 100644 --- a/test/tests/diff.js +++ b/test/tests/diff.js @@ -1,8 +1,7 @@ var assert = require("assert"); var path = require("path"); -var promisify = require("promisify-node"); var _ = require("lodash"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var local = path.join.bind(path, __dirname); function getLinesFromDiff(diff) { @@ -31,6 +30,7 @@ describe("Diff", function() { var Repository = NodeGit.Repository; var Diff = NodeGit.Diff; var Blob = NodeGit.Blob; + var Index = NodeGit.Index; var reposPath = local("../repos/workdir"); var oid = "fce88902e66c72b5b93e75bdb5ae717038b221f6"; @@ -112,7 +112,7 @@ describe("Diff", function() { }); }); - it("can walk a DiffList", function() { + it("can walk an Array", function() { return this.diff[0].patches() .then(function(patches) { var patch = patches[0]; @@ -246,7 +246,7 @@ describe("Diff", function() { it("can diff the contents of a file to a string with unicode characters", function(done) { var evilString = "Unicode’s fun!\nAnd it’s good for you!\n"; - var buffer = new Buffer(evilString); + var buffer = Buffer.from(evilString); var test = this; Blob.createFromBuffer(test.repository, buffer, buffer.length) .then(function(oid) { @@ -388,13 +388,9 @@ describe("Diff", function() { }); }); - describe( - "merge between commit diff and workdir and index diff", function() { + describe("merge between commit diff and workdir and index diff", function() { beforeEach(function() { var test = this; - var diffOptions = new NodeGit.DiffOptions(); - var IGNORE_CASE_FLAG = 1 << 10; - diffOptions.flags = diffOptions.flags |= IGNORE_CASE_FLAG; return fse.writeFile( path.join(test.repository.workdir(), "newFile.txt"), "some line\n" ) @@ -411,9 +407,17 @@ describe("Diff", function() { return test.repository.getHeadCommit(); }) .then(function(headCommit) { - return headCommit.getTree(); + return Promise.all([ + headCommit.getTree(), + test.repository.index() + ]); }) - .then(function(headTree) { + .then(function([headTree, index]) { + const diffOptions = new NodeGit.DiffOptions(); + if (index.caps() & Index.CAPABILITY.IGNORE_CASE !== 0) { + diffOptions.flags |= Diff.OPTION.IGNORE_CASE; + } + return Promise.all([ Diff.treeToWorkdirWithIndex(test.repository, headTree, diffOptions), test.commit.getDiffWithOptions(diffOptions) diff --git a/test/tests/filter.js b/test/tests/filter.js index 021de64267..06e138ba5d 100644 --- a/test/tests/filter.js +++ b/test/tests/filter.js @@ -1,8 +1,8 @@ var assert = require("assert"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var path = require("path"); var local = path.join.bind(path, __dirname); +var garbageCollect = require("../utils/garbage_collect.js"); describe("Filter", function() { var NodeGit = require("../../"); @@ -12,6 +12,7 @@ describe("Filter", function() { var Registry = NodeGit.FilterRegistry; var Checkout = NodeGit.Checkout; var Repository = NodeGit.Repository; + var FilterList = NodeGit.FilterList; var reposPath = local("../repos/workdir"); var packageJsonPath = path.join(reposPath, "package.json"); @@ -103,7 +104,7 @@ describe("Filter", function() { var secondFilter = "hellofilter"; after(function(done) { - return Registry.unregister(secondFilter) + Registry.unregister(secondFilter) .then(function() { done(); }); @@ -166,228 +167,6 @@ describe("Filter", function() { }); }); - describe("Initialize", function(){ - it("initializes successfully", function() { - var test = this; - var initialized = false; - return Registry.register(filterName, { - initialize: function() { - initialized = true; - return NodeGit.Error.CODE.OK; - }, - apply: function() {}, - check: function() { - return NodeGit.Error.CODE.PASSTHROUGH; - } - }, 0) - .then(function(result) { - assert.strictEqual(result, NodeGit.Error.CODE.OK); - }) - .then(function() { - return fse.writeFile( - packageJsonPath, - "Changing content to trigger checkout" - ); - }) - .then(function() { - var opts = { - checkoutStrategy: Checkout.STRATEGY.FORCE, - paths: "package.json" - }; - return Checkout.head(test.repository, opts); - }) - .then(function() { - assert.strictEqual(initialized, true); - }); - }); - - it("initializes successfully even on garbage collect", function() { - var test = this; - var initialized = false; - return Registry.register(filterName, { - initialize: function() { - initialized = true; - return NodeGit.Error.CODE.OK; - }, - apply: function() {}, - check: function() { - return NodeGit.Error.CODE.PASSTHROUGH; - } - }, 0) - .then(function(result) { - assert.strictEqual(result, NodeGit.Error.CODE.OK); - global.gc(); - - return fse.writeFile( - packageJsonPath, - "Changing content to trigger checkout" - ); - }) - .then(function() { - var opts = { - checkoutStrategy: Checkout.STRATEGY.FORCE, - paths: "package.json" - }; - return Checkout.head(test.repository, opts); - }) - .then(function() { - assert.strictEqual(initialized, true); - }); - }); - - it("does not initialize successfully", function() { - var test = this; - var initialized = false; - return Registry.register(filterName, { - initialize: function() { - initialized = true; - return NodeGit.Error.CODE.ERROR; - }, - apply: function() {}, - check: function() { - return NodeGit.Error.CODE.PASSTHROUGH; - } - }, 0) - .then(function(result) { - assert.strictEqual(result, NodeGit.Error.CODE.OK); - }) - .then(function() { - return fse.writeFile( - packageJsonPath, - "Changing content to trigger checkout" - ); - }) - .then(function() { - var opts = { - checkoutStrategy: Checkout.STRATEGY.FORCE, - paths: "package.json" - }; - return Checkout.head(test.repository, opts); - }) - .then(function(head) { - assert.fail(head, undefined, "Should not have actually checked out"); - }) - .catch(function(error) { - assert.strictEqual(initialized, true); - }); - }); - }); - - describe("Shutdown", function() { - it("filter successfully shuts down", function() { - var test = this; - var shutdown = false; - return Registry.register(filterName, { - apply: function() {}, - check: function(){ - return NodeGit.Error.CODE.PASSTHROUGH; - }, - shutdown: function(){ - shutdown = true; - } - }, 0) - .then(function(result) { - assert.strictEqual(result, NodeGit.Error.CODE.OK); - return fse.writeFile( - packageJsonPath, - "Changing content to trigger checkout", - { encoding: "utf-8" } - ); - }) - .then(function() { - var opts = { - checkoutStrategy: Checkout.STRATEGY.FORCE, - paths: "package.json" - }; - return Checkout.head(test.repository, opts); - }) - .then(function() { - return Registry.unregister(filterName); - }) - .then(function(result) { - assert.strictEqual(result, NodeGit.Error.CODE.OK); - assert.strictEqual(shutdown, true); - }); - }); - - it("filter successfully shuts down on garbage collect", function() { - var test = this; - var shutdown = false; - return Registry.register(filterName, { - apply: function() {}, - check: function(){ - return NodeGit.Error.CODE.PASSTHROUGH; - }, - shutdown: function(){ - shutdown = true; - } - }, 0) - .then(function(result) { - assert.strictEqual(result, NodeGit.Error.CODE.OK); - return fse.writeFile( - packageJsonPath, - "Changing content to trigger checkout", - { encoding: "utf-8" } - ); - }) - .then(function() { - var opts = { - checkoutStrategy: Checkout.STRATEGY.FORCE, - paths: "package.json" - }; - return Checkout.head(test.repository, opts); - }) - .then(function() { - global.gc(); - return Registry.unregister(filterName); - }) - .then(function(result) { - assert.strictEqual(result, NodeGit.Error.CODE.OK); - assert.strictEqual(shutdown, true); - }); - }); - - it("shutdown completes even if there is an error", function() { - var test = this; - var shutdown = false; - return Registry.register(filterName, { - apply: function() {}, - check: function(){ - return NodeGit.Error.CODE.PASSTHROUGH; - }, - shutdown: function(){ - shutdown = true; - throw new Error("I failed"); - } - }, 0) - .then(function(result) { - assert.strictEqual(result, NodeGit.Error.CODE.OK); - return fse.writeFile( - packageJsonPath, - "Changing content to trigger checkout", - { encoding: "utf-8" } - ); - }) - .then(function() { - var opts = { - checkoutStrategy: Checkout.STRATEGY.FORCE, - paths: "package.json" - }; - return Checkout.head(test.repository, opts); - }) - .then(function() { - return Registry.unregister(filterName); - }) - .then(function(result) { - assert.strictEqual(result, NodeGit.Error.CODE.OK); - assert.strictEqual(shutdown, true); - }) - .catch(function(error) { - assert.fail(error, null, "The operation should not have failed"); - }); - }); - }); - describe("Apply", function() { before(function() { var test = this; @@ -404,7 +183,7 @@ describe("Filter", function() { var message = "some new fancy filter"; var length = message.length; - var tempBuffer = new Buffer(message, "utf-8"); + var tempBuffer = Buffer.from(message, "utf-8"); var largeBufferSize = 500000000; it("should not apply when check returns GIT_PASSTHROUGH", function(){ @@ -441,7 +220,7 @@ describe("Filter", function() { it("should apply filter when check succeeds", function() { var test = this; - var applied = true; + var applied = false; return Registry.register(filterName, { apply: function() { @@ -476,10 +255,8 @@ describe("Filter", function() { return Registry.register(filterName, { apply: function(to, from, source) { - return to.set(tempBuffer, length) - .then(function() { - return NodeGit.Error.CODE.PASSTHROUGH; - }); + to.set(tempBuffer, length); + return NodeGit.Error.CODE.PASSTHROUGH; }, check: function() { return NodeGit.Error.CODE.OK; @@ -522,10 +299,8 @@ describe("Filter", function() { return Registry.register(filterName, { apply: function(to, from, source) { - return to.set(tempBuffer, length) - .then(function() { - return NodeGit.Error.CODE.OK; - }); + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; }, check: function(src, attr) { return NodeGit.Error.CODE.OK; @@ -558,6 +333,82 @@ describe("Filter", function() { }); }); + it("can run sync callback on checkout without deadlocking", function() { // jshint ignore:line + var test = this; + var syncCallbackResult = 1; + + return Registry.register(filterName, { + apply: function() { + syncCallbackResult = test.repository.isEmpty(); + }, + check: function() { + return NodeGit.Error.CODE.OK; + } + }, 0) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + return fse.writeFile( + packageJsonPath, + "Changing content to trigger checkout", + { encoding: "utf-8" } + ); + }) + .then(function() { + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: "package.json" + }; + return Checkout.head(test.repository, opts); + }) + .then(function() { + assert.strictEqual(syncCallbackResult, 0); + }); + }); + + // Temporary workaround for LFS checkout. Test skipped. + // To activate when reverting workaround. + // 'Checkout.head' and 'Submodule.lookup' do work with the repo locked. + // They should work together without deadlocking. + it.skip("can run async callback on checkout without deadlocking", function() { // jshint ignore:line + var test = this; + var submoduleNameIn = "vendor/libgit2"; + var asyncCallbackResult = ""; + + return Registry.register(filterName, { + apply: function() { + return NodeGit.Submodule.lookup(test.repository, submoduleNameIn) + .then(function(submodule) { + return submodule.name(); + }) + .then(function(name) { + asyncCallbackResult = name; + return NodeGit.Error.CODE.OK; + }); + }, + check: function() { + return NodeGit.Error.CODE.OK; + } + }, 0) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + return fse.writeFile( + packageJsonPath, + "Changing content to trigger checkout", + { encoding: "utf-8" } + ); + }) + .then(function() { + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: "package.json" + }; + return Checkout.head(test.repository, opts); + }) + .then(function() { + assert.equal(asyncCallbackResult, submoduleNameIn); + }); + }); + // this test is useless on 32 bit CI, because we cannot construct // a buffer big enough to test anything of significance :)... if (process.arch === "x64") { @@ -568,10 +419,8 @@ describe("Filter", function() { return Registry.register(filterName, { apply: function(to, from, source) { - return to.set(largeBuffer, largeBufferSize) - .then(function() { - return NodeGit.Error.CODE.OK; - }); + to.set(largeBuffer, largeBufferSize); + return NodeGit.Error.CODE.OK; }, check: function(src, attr) { return NodeGit.Error.CODE.OK; @@ -626,10 +475,8 @@ describe("Filter", function() { return Registry.register(filterName, { apply: function(to, from, source) { - return to.set(tempBuffer, length) - .then(function() { - return NodeGit.Error.CODE.OK; - }); + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; }, check: function(src, attr) { return NodeGit.Error.CODE.OK; @@ -645,7 +492,7 @@ describe("Filter", function() { ); assert.notStrictEqual(readmeContent, message); fse.writeFileSync(readmePath, "whoa", "utf8"); - global.gc(); + garbageCollect(); var opts = { checkoutStrategy: Checkout.STRATEGY.FORCE, @@ -668,16 +515,13 @@ describe("Filter", function() { return Registry.register(filterName, { apply: function(to, from, source) { - return to.set(tempBuffer, length) - .then(function() { - return NodeGit.Error.CODE.OK; - }); + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; }, check: function(src, attr) { return src.path() === "README.md" ? 0 : NodeGit.Error.CODE.PASSTHROUGH; - }, - cleanup: function() {} + } }, 0) .then(function(result) { assert.strictEqual(result, NodeGit.Error.CODE.OK); @@ -725,19 +569,16 @@ describe("Filter", function() { return Registry.register(filterName, { apply: function(to, from, source) { - return to.set(tempBuffer, length) - .then(function() { - return NodeGit.Error.CODE.OK; - }); + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; }, check: function(src, attr) { return src.path() === "README.md" ? 0 : NodeGit.Error.CODE.PASSTHROUGH; - }, - cleanup: function() {} + } }, 0) .then(function(result) { - global.gc(); + garbageCollect(); assert.strictEqual(result, NodeGit.Error.CODE.OK); }) .then(function() { @@ -754,7 +595,7 @@ describe("Filter", function() { ); }) .then(function(oid) { - global.gc(); + garbageCollect(); return test.repository.getHeadCommit(); }) .then(function(commit) { @@ -767,7 +608,7 @@ describe("Filter", function() { postInitializeReadmeContents, "testing commit contents" ); assert.strictEqual(commit.message(), "test commit"); - global.gc(); + garbageCollect(); return commit.getEntry("README.md"); }) @@ -781,149 +622,223 @@ describe("Filter", function() { }); }); - describe("Cleanup", function() { - it("is called successfully", function() { + describe("Manually Apply", function() { + beforeEach(function() { + var test = this; + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: "README.md" + }; + return Checkout.head(test.repository, opts) + .then(() => fse.readFile(readmePath, "utf8")) + .then((function(content) { + test.originalReadmeContent = content; + })); + }); + + afterEach(function() { + this.timeout(15000); + return fse.writeFile(readmePath, this.originalReadmeContent); + }); + + var message = "This is the filtered content, friends"; + var length = message.length; + var tempBuffer = Buffer.from(message, "utf-8"); + + it("applies the filters for a path on demand", function() { var test = this; - var cleaned = false; + return Registry.register(filterName, { - initialize: function() { - return NodeGit.Error.CODE.OK; - }, - apply: function() { + apply: function(to, from, source) { + to.set(tempBuffer, length); return NodeGit.Error.CODE.OK; }, - check: function() { + check: function(src, attr) { return NodeGit.Error.CODE.OK; - }, - cleanup: function() { - cleaned = true; } }, 0) - .then(function(result) { - assert.strictEqual(result, NodeGit.Error.CODE.OK); - }) - .then(function() { - var packageContent = fse.readFileSync( - packageJsonPath, - "utf-8" - ); - assert.notEqual(packageContent, ""); + .then(function(result) { + assert.strictEqual(result, 0); + }) + .then(function() { + var readmeContent = fse.readFileSync( + readmePath, + "utf-8" + ); + assert.notStrictEqual(readmeContent, message); + fse.writeFileSync(readmePath, "whoa", "utf8"); - return fse.writeFile( - packageJsonPath, - "Changing content to trigger checkout", - { encoding: "utf-8" } - ); - }) - .then(function() { - var opts = { - checkoutStrategy: Checkout.STRATEGY.FORCE, - paths: "package.json" - }; - return Checkout.head(test.repository, opts); - }) - .then(function() { - assert.strictEqual(cleaned, true); - }); + return FilterList.load( + test.repository, + null, + "README.md", + NodeGit.Filter.MODE.CLEAN, + NodeGit.Filter.FLAG.DEFAULT + ); + }) + .then(function(list) { + return list.applyToFile(test.repository, "README.md"); + }) + .then(function(content) { + assert.equal(content, message); + }); }); - it("is called successfully with gc", function() { + it("applies the filters to a buffer on demand", function() { var test = this; - var cleaned = false; + return Registry.register(filterName, { - initialize: function() { - return NodeGit.Error.CODE.OK; - }, - apply: function() { + apply: function(to, from, source) { + to.set(tempBuffer, length); return NodeGit.Error.CODE.OK; }, - check: function() { + check: function(src, attr) { return NodeGit.Error.CODE.OK; - }, - cleanup: function() { - cleaned = true; } }, 0) - .then(function(result) { - assert.strictEqual(result, NodeGit.Error.CODE.OK); - }) - .then(function() { - var packageContent = fse.readFileSync( - packageJsonPath, - "utf-8" - ); - assert.notEqual(packageContent, ""); + .then(function(result) { + assert.strictEqual(result, 0); + }) + .then(function() { + var readmeContent = fse.readFileSync( + readmePath, + "utf-8" + ); + assert.notStrictEqual(readmeContent, message); + fse.writeFileSync(readmePath, "whoa", "utf8"); - global.gc(); - return fse.writeFile( - packageJsonPath, - "Changing content to trigger checkout", - { encoding: "utf-8" } - ); - }) - .then(function() { - var opts = { - checkoutStrategy: Checkout.STRATEGY.FORCE, - paths: "package.json" - }; - return Checkout.head(test.repository, opts); - }) - .then(function() { - assert.strictEqual(cleaned, true); - }); + return FilterList.load( + test.repository, + null, + "README.md", + NodeGit.Filter.MODE.CLEAN, + NodeGit.Filter.FLAG.DEFAULT + ); + }) + .then(function(list) { + /* jshint ignore:start */ + return list.applyToData(new String("garbo garbo garbo garbo")); + /* jshint ignore:end */ + }) + .then(function(content) { + assert.equal(content, message); + }); }); - it("is not called when check returns GIT_PASSTHROUGH", function() { + it("applies the filters to a blob on demand", function() { var test = this; - var cleaned = false; + var list; return Registry.register(filterName, { - initialize: function() { + apply: function(to, from, source) { + to.set(tempBuffer, length); return NodeGit.Error.CODE.OK; }, - apply: function() { + check: function(src, attr) { return NodeGit.Error.CODE.OK; + } + }, 0) + .then(function(result) { + assert.strictEqual(result, 0); + }) + .then(function() { + var readmeContent = fse.readFileSync( + readmePath, + "utf-8" + ); + assert.notStrictEqual(readmeContent, message); + fse.writeFileSync(readmePath, "whoa", "utf8"); + + return FilterList.load( + test.repository, + null, + "README.md", + NodeGit.Filter.MODE.CLEAN, + NodeGit.Filter.FLAG.DEFAULT + ); + }) + .then(function(_list) { + list = _list; + + return test.repository.getHeadCommit(); + }) + .then(function(commit) { + return commit.getTree(); + }) + .then(function(tree) { + return tree.entryByPath("README.md"); + }) + .then(function(entry) { + return test.repository.getBlob(entry.id()); + }) + .then(function(blob) { + return list.applyToBlob(blob); + }) + .then(function(content) { + assert.equal(content, message); + list = null; + }); + }); + }); + + describe("FilterSource", function() { + var message = "some new fancy filter"; + + before(function() { + var test = this; + return fse.readFile(readmePath, "utf8") + .then((function(content) { + test.originalReadmeContent = content; + })); + }); + + afterEach(function() { + this.timeout(15000); + return fse.writeFile(readmePath, this.originalReadmeContent); + }); + + it("a FilterSource has an async repo getter", function() { + var test = this; + + return Registry.register(filterName, { + apply: function(to, from, source) { + return source.repo() + .then(function() { + return NodeGit.Error.CODE.PASSTHROUGH; + }); }, - check: function() { - return NodeGit.Error.CODE.PASSTHROUGH; - }, - cleanup: function() { - cleaned = true; + check: function(source) { + return source.repo() + .then(function() { + return NodeGit.Error.CODE.OK; + }); } }, 0) - .then(function(result) { - assert.strictEqual(result, NodeGit.Error.CODE.OK); - }) - .then(function() { - var packageContent = fse.readFileSync( - packageJsonPath, - "utf-8" - ); - var readmeContent = fse.readFileSync( - readmePath, - "utf-8" - ); + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + }) + .then(function() { + var readmeContent = fse.readFileSync( + packageJsonPath, + "utf-8" + ); + assert.notStrictEqual(readmeContent, message); - assert.notEqual(packageContent, ""); - assert.notEqual(readmeContent, "Initialized"); - }) - .then(function() { - return fse.writeFile( - packageJsonPath, - "Changing content to trigger checkout", - { encoding: "utf-8" } - ); - }) - .then(function() { - var opts = { - checkoutStrategy: Checkout.STRATEGY.FORCE, - paths: "README.md" - }; - return Checkout.head(test.repository, opts); - }) - .then(function() { - assert.notStrictEqual(cleaned, true); - }); + return fse.writeFile( + packageJsonPath, + "Changing content to trigger checkout" + ); + }) + .then(function() { + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: "package.json" + }; + return Checkout.head(test.repository, opts); + }) + .then(function() { + garbageCollect(); + }); }); }); }); diff --git a/test/tests/graph.js b/test/tests/graph.js index 34805cda08..87dcfda544 100644 --- a/test/tests/graph.js +++ b/test/tests/graph.js @@ -58,7 +58,21 @@ describe("Graph", function() { "26744fc697849d370246749b67ac43b792a4af0c" ) .catch(function(result) { - assert(~result.message.indexOf("81b06fac")); + assert(~result.message.indexOf("object not found - no match for id")); + }); + }); + + it("can tell if a commit is reachable from any of a list of commits", function() { + return Graph.reachableFromAny( + this.repository, + "32789a79e71fbc9e04d3eff7425e1771eb595150", + [ + "1729c73906bb8467f4095c2f4044083016b4dfde", + "e0aeedcff0584ebe00aed2c03c8ecd10839df908" + ] + ) + .then(function(result) { + assert.equal(result, 0); }); }); }); diff --git a/test/tests/index.js b/test/tests/index.js index 9f8dea7c0c..f3d29e7f7f 100644 --- a/test/tests/index.js +++ b/test/tests/index.js @@ -1,12 +1,7 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); - -var writeFile = promisify(function(filename, data, callback) { - return require("fs").writeFile(filename, data, {}, callback); -}); +var fse = require("fs-extra"); describe("Index", function() { var IndexUtils = require("../utils/index_setup"); @@ -52,9 +47,9 @@ describe("Index", function() { var addCallbacksCount = 0; return Promise.all(fileNames.map(function(fileName) { - return writeFile( + return fse.writeFile( path.join(repo.workdir(), fileName), - fileContent[fileName]); + fileContent[fileName], {}); })) .then(function() { return index.addAll(undefined, undefined, function() { @@ -97,9 +92,9 @@ describe("Index", function() { var removeCallbacksCount = 0; return Promise.all(fileNames.map(function(fileName) { - return writeFile( + return fse.writeFile( path.join(repo.workdir(), fileName), - fileContent[fileName]); + fileContent[fileName], {}); })) .then(function() { return index.addAll(); @@ -147,9 +142,9 @@ describe("Index", function() { var updateCallbacksCount = 0; return Promise.all(fileNames.map(function(fileName) { - return writeFile( + return fse.writeFile( path.join(repo.workdir(), fileName), - fileContent[fileName]); + fileContent[fileName], {}); })) .then(function() { return index.addAll(); diff --git a/test/tests/merge.js b/test/tests/merge.js index 86531aa2cb..a5010925b2 100644 --- a/test/tests/merge.js +++ b/test/tests/merge.js @@ -1,11 +1,8 @@ var assert = require("assert"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var local = path.join.bind(path, __dirname); -fse.ensureDir = promisify(fse.ensureDir); - describe("Merge", function() { var NodeGit = require("../../"); var RepoUtils = require("../utils/repository_setup"); @@ -649,9 +646,11 @@ describe("Merge", function() { ourSignature, NodeGit.Merge.PREFERENCE.NO_FASTFORWARD, null, - function(message) { - assert(message === "Merge branch 'theirs' into ours"); - return "We manipulated the message, HAH."; + { + processMergeMessageCallback: function(message) { + assert(message === "Merge branch 'theirs' into ours"); + return "We manipulated the message, HAH."; + } } ); }) @@ -806,9 +805,11 @@ describe("Merge", function() { ourSignature, NodeGit.Merge.PREFERENCE.NO_FASTFORWARD, null, - function(message) { - assert(message === "Merge branch 'theirs' into ours"); - return Promise.resolve("We manipulated the message, HAH."); + { + processMergeMessageCallback: function(message) { + assert(message === "Merge branch 'theirs' into ours"); + return Promise.resolve("We manipulated the message, HAH."); + } } ); }) @@ -1591,7 +1592,7 @@ describe("Merge", function() { }) .then(function(commitOid) { assert.equal(commitOid.toString(), - "03ba156a7a1660f179b6b2dbc6a542fcf88d022d"); + "8221726e3f96e3d3e0258f655e107383dc3c7335"); // merge isn't cleaned up automatically assert.ok(fse.existsSync(path.join(repoGitPath, "MERGE_HEAD"))); @@ -1628,6 +1629,7 @@ describe("Merge", function() { "should not be able to retrieve common merge base")); }, function(err) { assert.equal("no merge base found", err.message); + assert.equal("Merge.base", err.errorFunction); assert.equal(NodeGit.Error.CODE.ENOTFOUND, err.errno); }); }); diff --git a/test/tests/note.js b/test/tests/note.js index 47b8cffb68..9622c667de 100644 --- a/test/tests/note.js +++ b/test/tests/note.js @@ -58,7 +58,7 @@ describe("Note", function() { var noteRef = "refs/notes/commits"; var sig = Signature.create("John", "john@doe.com", Date.now(), 0); - return Note.create(this.repository, noteRef, sig, sig, sha, "Testing!", 1) + Note.create(this.repository, noteRef, sig, sig, sha, "Testing!", 1) .then((noteSha) => Note.remove(this.repository, noteRef, sig, sig, sha)) .then(function() { return Note.read(test.repository, noteRef, sha).catch(function(ex) { diff --git a/test/tests/patch.js b/test/tests/patch.js index e426d2b633..fe7fe3734a 100644 --- a/test/tests/patch.js +++ b/test/tests/patch.js @@ -62,5 +62,48 @@ describe("Patch", function() { }); + it("can generate patch from blobs", function() { + // Generates a patch for README.md from commit + // fce88902e66c72b5b93e75bdb5ae717038b221f6 + const file = "README.md"; + return NodeGit.Blob.lookup( + this.repository, + "b252f396b17661462372f78b7bcfc403b8731aaa" + ).then(blob => { + return NodeGit.Blob.lookup( + this.repository, + "b8d014998072c3f9e4b7eba8486011e80d8de98a" + ).then(oldBlob => { + return NodeGit.Patch.fromBlobs(oldBlob, file, blob, file) + .then(patch => { + assert.strictEqual(patch.size(0, 0, 0), 254); + }); + }); + }); + }); + + it("can generate patch from blobs without 'old_blob'", function() { + // Generates a patch for README.md from commit + // fce88902e66c72b5b93e75bdb5ae717038b221f6 without + // old_blob. Should show all lines as additions. + const file = "README.md"; + + return NodeGit.Blob.lookup( + this.repository, + "b252f396b17661462372f78b7bcfc403b8731aaa" + ).then(blob => { + return NodeGit.Patch.fromBlobs(null, file, blob, file) + .then(patch => { + assert.strictEqual(patch.size(0, 0, 0), 8905); + }); + }); + }); + + it("can generate patch from blobs without arguments", function() { + return NodeGit.Patch.fromBlobs() + .then(patch => { + assert.strictEqual(patch.size(0, 0, 0), 0); + }); + }); }); diff --git a/test/tests/rebase.js b/test/tests/rebase.js index d121a6c0fd..d9aae1fbce 100644 --- a/test/tests/rebase.js +++ b/test/tests/rebase.js @@ -1,11 +1,16 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); + +var garbageCollect = require("../utils/garbage_collect.js"); + +const isNode8 = process.versions.node.split(".")[0] === "8"; describe("Rebase", function() { var NodeGit = require("../../"); + var Checkout = NodeGit.Checkout; + var Merge = NodeGit.Merge; var RepoUtils = require("../utils/repository_setup"); var repoPath = local("../repos/rebase"); @@ -144,7 +149,7 @@ describe("Rebase", function() { }); }); - it("can cleanly rebase a branch onto another branch", function() { + it("can cleanly rebase a branch in-memory", function() { var baseFileName = "baseNewFile.txt"; var ourFileName = "ourNewFile.txt"; var theirFileName = "theirNewFile.txt"; @@ -261,6 +266,187 @@ describe("Rebase", function() { var ourAnnotatedCommit = annotatedCommits[0]; var theirAnnotatedCommit = annotatedCommits[1]; + assert.equal(ourAnnotatedCommit.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + assert.equal(theirAnnotatedCommit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + var rebaseOptions = new NodeGit.RebaseOptions(); + rebaseOptions.inmemory = 1; + + return NodeGit.Rebase.init(repository, ourAnnotatedCommit, + theirAnnotatedCommit, undefined, rebaseOptions); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return rebase.commit(null, ourSignature); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "b937100ee0ea17ef20525306763505a7fe2be29e"); + + // git_rebase_operation_current returns the index of the rebase + // operation that was last applied, so after the first operation, it + // should be 0. + assert.equal(rebase.operationCurrent(), 0); + + return rebase.finish(ourSignature, {}); + }) + .then(function(result) { + assert.equal(result, 0); + + return repository.getBranchCommit(ourBranchName); + }) + .then(function(commit) { + // verify that the "ours" branch has NOT moved. + // In-memory rebase does not touch refs. + assert.equal(commit.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + // Lookup the new commit + return NodeGit.Commit.lookup(repository, + "b937100ee0ea17ef20525306763505a7fe2be29e"); + }) + .then(function(commit) { + // Lookup the parent of our new commit + return commit.parent(0); + }) + .then(function(commit) { + // verify that we are on top of "their commit" + assert.equal(commit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + }); + }); + + it("can cleanly rebase a branch onto another branch", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + assert.equal(ourAnnotatedCommit.id().toString(), "e7f37ee070837052937e24ad8ba66f6d83ae7941"); assert.equal(theirAnnotatedCommit.id().toString(), @@ -790,43 +976,49 @@ describe("Rebase", function() { }); }); - it("can rebase using the convenience method", function() { - var baseFileName = "baseNewFile.txt"; + it( + "can fast-forward a merge commit via rebase using the " + + "convenience methods that has a beforeFinishFn", + function() { var ourFileName = "ourNewFile.txt"; var theirFileName = "theirNewFile.txt"; + var theirOtherFileName = "antherNewFile.txt"; - var baseFileContent = "How do you feel about Toll Roads?"; var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; var theirFileContent = "I'm skeptical about Toll Roads"; + var theirOtherFileContent = "This is some more content, guys!"; var ourSignature = NodeGit.Signature.create ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); var theirSignature = NodeGit.Signature.create ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + var theirOtherSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456999, 60); + var ourMergeSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456889, 60); var repository = this.repository; var ourCommit; - var ourBranch; + var theirCommit; var theirBranch; + var ourBranch; - var nextCalls = 0; - - return fse.writeFile(path.join(repository.workdir(), baseFileName), - baseFileContent) + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent) // Load up the repository index and make our initial commit to HEAD .then(function() { - return RepoUtils.addFileToIndex(repository, baseFileName); + return RepoUtils.addFileToIndex(repository, ourFileName); }) .then(function(oid) { assert.equal(oid.toString(), - "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + "11ead82b1135b8e240fb5d61e703312fb9cc3d6a"); return repository.createCommit("HEAD", ourSignature, - ourSignature, "initial commit", oid, []); + ourSignature, "we made a commit", oid, []); }) .then(function(commitOid) { assert.equal(commitOid.toString(), - "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + "91a183f87842ebb7a9b08dad8bc2473985796844"); return repository.getCommit(commitOid).then(function(commit) { ourCommit = commit; @@ -848,74 +1040,105 @@ describe("Rebase", function() { }) .then(function(oid) { assert.equal(oid.toString(), - "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + "76631cb5a290dafe2959152626bb90f2a6d8ec94"); return repository.createCommit(theirBranch.name(), theirSignature, theirSignature, "they made a commit", oid, [ourCommit]); }) .then(function(commitOid) { + theirCommit = commitOid; assert.equal(commitOid.toString(), - "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); - - return removeFileFromIndex(repository, theirFileName); + "0e9231d489b3f4303635fc4b0397830da095e7e7"); }) .then(function() { - return fse.remove(path.join(repository.workdir(), theirFileName)); + return repository.checkoutBranch( + ourBranch, + { checkoutStrategy: Checkout.STRATEGY.FORCE } + ); }) .then(function() { - return fse.writeFile(path.join(repository.workdir(), ourFileName), - ourFileContent); + return repository.mergeBranches( + ourBranchName, + theirBranchName, + ourMergeSignature, + Merge.PREFERENCE.NO_FASTFORWARD + ); }) .then(function() { - return RepoUtils.addFileToIndex(repository, ourFileName); + return repository.getHeadCommit(); + }) + .then(function(headCommit) { + assert.notEqual(ourCommit.id().toString(), headCommit.id().toString()); + }) + .then(function() { + return repository.checkoutBranch( + theirBranch, + { checkoutStrategy: Checkout.STRATEGY.FORCE } + ); + }) + .then(function() { + return fse.writeFile( + path.join(repository.workdir(), theirOtherFileName), + theirOtherFileContent + ); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirOtherFileName); }) .then(function(oid) { assert.equal(oid.toString(), - "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + "c242b53f2c9446544cf9bdac7e8ed6ce583226cb"); - return repository.createCommit(ourBranch.name(), ourSignature, - ourSignature, "we made a commit", oid, [ourCommit]); + return repository.createCommit(theirBranch.name(), theirOtherSignature, + theirOtherSignature, "they made another commit", oid, [theirCommit]); }) .then(function(commitOid) { assert.equal(commitOid.toString(), - "e7f37ee070837052937e24ad8ba66f6d83ae7941"); - - return removeFileFromIndex(repository, ourFileName); - }) - .then(function() { - return fse.remove(path.join(repository.workdir(), ourFileName)); + "8fa0ce25a2accf464b004ddeeb63add7b816b627"); }) .then(function() { - return repository.checkoutBranch(ourBranchName); + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); }) - .then(function() { - return repository.rebaseBranches(ourBranchName, theirBranchName, - null, ourSignature, function(rebase) { - assert.ok(rebase instanceof NodeGit.Rebase); - - nextCalls++; + .then(function(refs) { + assert.equal(refs.length, 2); - return Promise.resolve(); - }); + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); }) - .then(function(commit) { - // verify that the beforeNextFn callback was called - assert.equal(nextCalls, 2); + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); - // verify that the "ours" branch has moved to the correct place - assert.equal(commit.id().toString(), - "b937100ee0ea17ef20525306763505a7fe2be29e"); + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; - return commit.parent(0); + assert.equal(ourAnnotatedCommit.id().toString(), + "0d1d322b59df68bac6eea6a2a189f974cb590368"); + assert.equal(theirAnnotatedCommit.id().toString(), + "8fa0ce25a2accf464b004ddeeb63add7b816b627"); + + return repository.rebaseBranches( + ourBranchName, + theirBranchName, + null, + ourSignature, + null, + function(rebaseData) { + assert.equal(rebaseData.rewritten, null); + } + ); }) .then(function(commit) { - // verify that we are on top of "their commit" assert.equal(commit.id().toString(), - "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + "8fa0ce25a2accf464b004ddeeb63add7b816b627"); }); }); - it("beforeFinishFn sync callback receives correct rebase data", function() { + it("can rebase using the convenience method", function() { var baseFileName = "baseNewFile.txt"; var ourFileName = "ourNewFile.txt"; var theirFileName = "theirNewFile.txt"; @@ -933,9 +1156,134 @@ describe("Rebase", function() { var ourCommit; var ourBranch; var theirBranch; - var ourBranchShaPreRebase; - var ourBranchShaPostRebase = "b937100ee0ea17ef20525306763505a7fe2be29e"; - var theirBranchSha; + + var nextCalls = 0; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return repository.rebaseBranches(ourBranchName, theirBranchName, + null, ourSignature, function(rebase) { + assert.ok(rebase instanceof NodeGit.Rebase); + + nextCalls++; + + return Promise.resolve(); + }); + }) + .then(function(commit) { + // verify that the beforeNextFn callback was called + assert.equal(nextCalls, 2); + + // verify that the "ours" branch has moved to the correct place + assert.equal(commit.id().toString(), + "b937100ee0ea17ef20525306763505a7fe2be29e"); + + return commit.parent(0); + }) + .then(function(commit) { + // verify that we are on top of "their commit" + assert.equal(commit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + }); + }); + + it("beforeFinishFn sync callback receives correct rebase data", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var ourBranchShaPreRebase; + var ourBranchShaPostRebase = "b937100ee0ea17ef20525306763505a7fe2be29e"; + var theirBranchSha; var nextCalls = 0; @@ -1371,4 +1719,825 @@ describe("Rebase", function() { "b3c355bb606ec7da87174dfa1a0b0c0e3dc97bc0"); }); }); + + if (!isNode8) { + it("can sign commits during the rebase", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + assert.equal(theirAnnotatedCommit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return NodeGit.Rebase.init(repository, ourAnnotatedCommit, + theirAnnotatedCommit, null, { + signingCb: (commitContent) => ({ + code: NodeGit.Error.CODE.OK, + field: "moose-sig", + signedData: "A moose was here." + }) + }); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + // Make sure we don't crash calling the signature CB + // after collecting garbage. + garbageCollect(); + + return rebase.commit(null, ourSignature); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "617cd03370dd799f372e9dcfcd0b097aede1bd7f"); + + // git_rebase_operation_current returns the index of the rebase + // operation that was last applied, so after the first operation, it + // should be 0. + assert.equal(rebase.operationCurrent(), 0); + + return rebase.finish(ourSignature, {}); + }) + .then(function(result) { + assert.equal(result, 0); + + return repository.getBranchCommit(ourBranchName); + }) + .then(function(commit) { + // verify that the "ours" branch has moved to the correct place + assert.equal(commit.id().toString(), + "617cd03370dd799f372e9dcfcd0b097aede1bd7f"); + + return Promise.all([ + commit.parent(0), + NodeGit.Commit.extractSignature( + repository, + "617cd03370dd799f372e9dcfcd0b097aede1bd7f", + "moose-sig" + ) + ]); + }) + .then(function([parent, { signature }]) { + // verify that we are on top of "their commit" + assert.equal(parent.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + assert.equal(signature, "A moose was here."); + }); + }); + + it("can optionally skip signing commits", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + assert.equal(theirAnnotatedCommit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return NodeGit.Rebase.init(repository, ourAnnotatedCommit, + theirAnnotatedCommit, null, { + signingCb: () => ({ + code: NodeGit.Error.CODE.PASSTHROUGH + }) + }); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + // Make sure we don't crash calling the signature CB + // after collecting garbage. + garbageCollect(); + + return rebase.commit(null, ourSignature); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "b937100ee0ea17ef20525306763505a7fe2be29e"); + + // git_rebase_operation_current returns the index of the rebase + // operation that was last applied, so after the first operation, it + // should be 0. + assert.equal(rebase.operationCurrent(), 0); + + return rebase.finish(ourSignature, {}); + }) + .then(function(result) { + assert.equal(result, 0); + + return repository.getBranchCommit(ourBranchName); + }) + .then(function(commit) { + // verify that the "ours" branch has moved to the correct place + assert.equal(commit.id().toString(), + "b937100ee0ea17ef20525306763505a7fe2be29e"); + + return commit.parent(0); + }) + .then(function(parent) { + // verify that we are on top of "their commit" + assert.equal(parent.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + return NodeGit.Commit.extractSignature( + repository, + "b937100ee0ea17ef20525306763505a7fe2be29e", + "moose-sig" + ) + .then(function() { + assert.fail("This commit should not be signed."); + }, function (error) { + if (error && error.message === "this commit is not signed") { + return; + } + throw error; + }); + }); + }); + + it("will throw if commit signing cb returns an error code", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + assert.equal(theirAnnotatedCommit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return NodeGit.Rebase.init(repository, ourAnnotatedCommit, + theirAnnotatedCommit, null, { + signingCb: () => ({ + code: NodeGit.Error.CODE.ERROR + }) + }); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + // Make sure we don't crash calling the signature CB + // after collecting garbage. + garbageCollect(); + + return rebase.commit(null, ourSignature); + }) + .then(function() { + assert.fail("rebase.commit should have failed"); + }, function(error) { + if (error && error.errno === NodeGit.Error.CODE.ERROR) { + return; + } + throw error; + }); + }); + } + + it("will not throw on patch already applied errors", function() { + var baseFileName = "baseNewFile.txt"; + var theirFileName = "myFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var theirFileContent = "Hello there"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var initialCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + initialCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile( + path.join(repository.workdir(), theirFileName), + theirFileContent + ); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "6f14d06b24fa8ea26f511dd8a94a003fd37eadc5"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [initialCommit]) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "c4cc225184b9c9682cb48294358d9d65f8ec42c7"); + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [initialCommit]); + }); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "5814ffa17b8a677191d89d5372f1e46d50d976ae"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "5814ffa17b8a677191d89d5372f1e46d50d976ae"); + assert.equal(theirAnnotatedCommit.id().toString(), + "c4cc225184b9c9682cb48294358d9d65f8ec42c7"); + + return NodeGit.Rebase.init( + repository, + ourAnnotatedCommit, + theirAnnotatedCommit + ); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .catch(function(error) { + assert.fail(error); + + throw error; + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "5814ffa17b8a677191d89d5372f1e46d50d976ae"); + + return rebase.commit(null, ourSignature); + }) + .then(function() { + assert.fail("Rebase should have failed."); + }, function (error) { + if (error && error.errno === NodeGit.Error.CODE.EAPPLIED) { + return; + } + + assert.fail(error); + + throw error; + }) + .then(function() { + return repository.continueRebase(); + }) + .then(function() { + return rebase.next(); + }) + .catch(function(error) { + assert.equal(error.errno, NodeGit.Error.CODE.ITEROVER); + }); + }); + + + it("rebase signs correctly if rebaseOptions are re-used", function () { + const ourFileName = "ourNewFile.txt"; + const theirFileName = "theirNewFile.txt"; + + const ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + const theirFileContent = "I'm skeptical about Toll Roads"; + + const ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + const theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + let ourCommit; + let theirCommit; + + let rebase; + let newCommitOid; + + const rebaseOptions = { + signingCb: () => ({ + code: NodeGit.Error.CODE.OK, + field: "moose-sig", + signedData: "A moose was here." + }) + }; + + const repository = this.repository; + + // Create two commits on master + // one + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent) + .then(() => RepoUtils.addFileToIndex(repository, ourFileName)) + .then((oid) => { + assert.equal(oid.toString(), + "11ead82b1135b8e240fb5d61e703312fb9cc3d6a"); + return repository.createCommit("HEAD", ourSignature, ourSignature, + "we made a commit", oid, []); + }) + .then((commitOid) => { + assert.equal(commitOid.toString(), + "91a183f87842ebb7a9b08dad8bc2473985796844"); + return repository.getCommit(commitOid); + }) + .then((_ourCommit) => { + ourCommit = _ourCommit; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(() => RepoUtils.addFileToIndex(repository, theirFileName)) + .then((oid) => { + assert.equal(oid.toString(), + "76631cb5a290dafe2959152626bb90f2a6d8ec94"); + return repository.createCommit("HEAD", theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then((commitOid) => { + assert.equal(commitOid.toString(), + "0e9231d489b3f4303635fc4b0397830da095e7e7"); + return repository.getCommit(commitOid); + + }) + .then((_theirCommit) => { + theirCommit = _theirCommit; + return Promise.all([ + NodeGit.AnnotatedCommit.lookup( + repository, + ourCommit.id() + ), + NodeGit.AnnotatedCommit.lookup( + repository, + theirCommit.id() + ) + ]); + }) + // rebase latest commit + .then(([ourAnnotatedCommit, theirAnnotatedCommit]) => + NodeGit.Rebase.init( + repository, + // branch, upstream, onto + theirAnnotatedCommit, ourAnnotatedCommit, null, + rebaseOptions // use once + )) + .then(() => { + return NodeGit.Rebase.open( + repository, + rebaseOptions // use twice + ); + }) + .then((_rebase) => { + rebase = _rebase; + return rebase.next(); + }) + .then(() => { + const operationCurrentIndex = rebase.operationCurrent(); + assert(operationCurrentIndex === 0); + // Make sure we don't crash calling the signature CB + // after collecting garbage. + garbageCollect(); + return rebase.commit(null, ourSignature); + }) + .then((_newCommitOid) => { + newCommitOid = _newCommitOid; + assert.strictEqual(newCommitOid.toString(), + "9909e435b52322a71dc341d747b29c392a34c745"); + return rebase.next(); + }) + .then(() => { + assert.fail("should throw"); + }) + .catch((error) => { + assert(error.errno === NodeGit.Error.CODE.ITEROVER); + assert.strictEqual(rebase.finish(ourSignature), 0); + return NodeGit.Commit.extractSignature( + repository, + newCommitOid.toString(), + "moose-sig" + ); + }) + .then((sig) => { + assert.strictEqual(sig.signature, "A moose was here."); + }); +}); }); diff --git a/test/tests/refs.js b/test/tests/refs.js index 68b114e85f..1cad9f4084 100644 --- a/test/tests/refs.js +++ b/test/tests/refs.js @@ -109,7 +109,7 @@ describe("Reference", function() { }) .then(function(reflog) { var refEntryMessage = reflog - .entryByIndex(reflog.entrycount() - 1) + .entryByIndex(0) .message(); // The reflog should have the message passed to // the rename diff --git a/test/tests/remote.js b/test/tests/remote.js index 57d77517d3..c9bf8192c7 100644 --- a/test/tests/remote.js +++ b/test/tests/remote.js @@ -5,6 +5,9 @@ var _ = require("lodash"); var fp = require("lodash/fp"); var garbageCollect = require("../utils/garbage_collect.js"); +var RepoUtils = require("../utils/repository_setup"); + +const isNode8 = process.versions.node.split(".")[0] === "8"; describe("Remote", function() { var NodeGit = require("../../"); @@ -12,12 +15,13 @@ describe("Remote", function() { var Remote = NodeGit.Remote; var reposPath = local("../repos/workdir"); + var bareReposPath = local("../repos/bare"); var url = "https://github.com/nodegit/test"; var url2 = "https://github.com/nodegit/test2"; var privateUrl = "git@github.com:nodegit/private"; function removeNonOrigins(repo) { - return repo.getRemotes() + return repo.getRemoteNames() .then(function(remotes) { return remotes.reduce(function(promise, remote) { if (remote !== "origin") { @@ -44,6 +48,9 @@ describe("Remote", function() { test.remote = remote; return removeNonOrigins(test.repository); + }) + .then(function() { + return RepoUtils.createRepository(bareReposPath, 1); }); }); @@ -94,6 +101,31 @@ describe("Remote", function() { }); }); + it("can rename a remote", function() { + var repository = this.repository; + + return Remote.list(repository) + .then(function(remoteNames) { + assert.deepEqual(remoteNames, ["origin"]); + return Remote.rename(repository, "origin", "origin2"); + }) + .then(function(problems) { + assert.deepEqual(problems, []); + return Remote.list(repository); + }) + .then(function(remoteNames) { + assert.deepEqual(remoteNames, ["origin2"]); + return Remote.rename(repository, "origin2", "origin"); + }) + .then(function(problems) { + assert.deepEqual(problems, []); + return Remote.list(repository); + }) + .then(function(remoteNames) { + assert.deepEqual(remoteNames, ["origin"]); + }); + }); + it("can delete a remote", function() { var repository = this.repository; @@ -115,9 +147,7 @@ describe("Remote", function() { return repo.getRemote("origin") .then(function(remote) { remoteCallbacks = { - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 }; return remote.connect(NodeGit.Enums.DIRECTION.FETCH, remoteCallbacks) @@ -129,6 +159,59 @@ describe("Remote", function() { }); }); + it("can monitor transfer progress while pushing", function() { + var repo = this.repository; + var wasCalled = false; + + return Remote.create(repo, "bare", bareReposPath) + .then(function(remote) { + var fetchOpts = { + callbacks: { + pushTransferProgress: function() { + wasCalled = true; + } + } + }; + + var ref = "refs/heads/master"; + var refs = [ref + ":" + ref]; + + return remote.push(refs, fetchOpts) + .then(function(res) { + assert.ok(wasCalled); + }); + }); + }); + + it("can monitor transfer progress while pushing with throttling", + function() { + var repo = this.repository; + var wasCalled = false; + + return Remote.create(repo, "bare", bareReposPath) + .then(function(remote) { + var fetchOpts = { + callbacks: { + pushTransferProgress: { + throttle: 200, + callback: function() { + wasCalled = true; + }, + } + } + }; + + var ref = "refs/heads/master"; + var refs = [ref + ":" + ref]; + + return remote.push(refs, fetchOpts) + .then(function(res) { + assert.ok(wasCalled); + }); + }); + } + ); + it("can monitor transfer progress while downloading", function() { // Set a reasonable timeout here now that our repository has grown. this.timeout(600000); @@ -141,11 +224,9 @@ describe("Remote", function() { var fetchOpts = { callbacks: { credentials: function(url, userName) { - return NodeGit.Cred.sshKeyFromAgent(userName); - }, - certificateCheck: function() { - return 1; + return NodeGit.Credential.sshKeyFromAgent(userName); }, + certificateCheck: () => 0, transferProgress: function() { wasCalled = true; @@ -164,9 +245,7 @@ describe("Remote", function() { it("can get the default branch of a remote", function() { var remoteCallbacks = { - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 }; var remote = this.remote; @@ -182,11 +261,9 @@ describe("Remote", function() { return this.repository.fetch("origin", { callbacks: { credentials: function(url, userName) { - return NodeGit.Cred.sshKeyFromAgent(userName); + return NodeGit.Credential.sshKeyFromAgent(userName); }, - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } }); }); @@ -196,16 +273,14 @@ describe("Remote", function() { var fetchOptions = { callbacks: { credentials: function(url, userName) { - return NodeGit.Cred.sshKeyNew( + return NodeGit.Credential.sshKeyNew( userName, path.resolve("./test/nodegit-test-rsa.pub"), path.resolve("./test/nodegit-test-rsa"), "" ); }, - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } }; @@ -227,12 +302,10 @@ describe("Remote", function() { credentials: function(url, userName) { if (firstPass) { firstPass = false; - return NodeGit.Cred.sshKeyFromAgent(userName); + return NodeGit.Credential.sshKeyFromAgent(userName); } }, - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } }; @@ -263,20 +336,19 @@ describe("Remote", function() { return repository.fetchAll({ callbacks: { credentials: function(url, userName) { - return NodeGit.Cred.sshKeyFromAgent(userName); + return NodeGit.Credential.sshKeyFromAgent(userName); }, - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } }); }); }); - it("will reject if credentials promise rejects", function() { - var repo = this.repository; - var branch = "should-not-exist"; - return Remote.lookup(repo, "origin") + if (!isNode8) { + it("will reject if credentials promise rejects", function() { + var repo = this.repository; + var branch = "should-not-exist"; + return Remote.lookup(repo, "origin") .then(function(remote) { var ref = "refs/heads/" + branch; var refs = [ref + ":" + ref]; @@ -284,17 +356,15 @@ describe("Remote", function() { callbacks: { credentials: function(url, userName) { var test = Promise.resolve("test") - .then(function() { return; }) - .then(function() { return; }) - .then(function() { return; }) - .then(function() { - return Promise.reject(new Error("failure case")); - }); + .then(function() { return; }) + .then(function() { return; }) + .then(function() { return; }) + .then(function() { + return Promise.reject(new Error("failure case")); + }); return test; }, - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 } }; return remote.push(refs, options); @@ -302,105 +372,107 @@ describe("Remote", function() { .then(function() { return Promise.reject( new Error("should not be able to push to the repository")); - }, function(err) { - if (err.message === "failure case") - { - return Promise.resolve(); - } else { - throw err; - } - }) - .then(function() { - return Remote.lookup(repo, "origin"); - }) - .then(function(remote) { - var ref = "refs/heads/" + branch; - var refs = [ref + ":" + ref]; - var options = { - callbacks: { - credentials: function(url, userName) { - var test = Promise.resolve() + }, function(err) { + if (err.message === "failure case") + { + return Promise.resolve(); + } else { + throw err; + } + }) + .then(function() { + return Remote.lookup(repo, "origin"); + }) + .then(function(remote) { + var ref = "refs/heads/" + branch; + var refs = [ref + ":" + ref]; + var options = { + callbacks: { + credentials: function(url, userName) { + var test = Promise.resolve() .then(Promise.resolve.bind(Promise)) .then(Promise.resolve.bind(Promise)) .then(Promise.resolve.bind(Promise)) .then(Promise.reject.bind(Promise)); - return test; - }, - certificateCheck: function() { - return 1; + return test; + }, + certificateCheck: () => 0 } - } - }; - return remote.push(refs, options); - }) - .then(function() { - return Promise.reject( - new Error("should not be able to push to the repository")); - }, function(err) { - if (err.message === "Method push has thrown an error.") - { - return Promise.resolve(); - } else { - throw err; - } - }); - }); + }; + return remote.push(refs, options); + }) + .then(function() { + return Promise.reject( + new Error("should not be able to push to the repository")); + }, function(err) { + if (err.message === "Method push has thrown an error.") + { + return Promise.resolve(); + } else { + throw err; + } + }); + }); - it("cannot push to a repository with invalid credentials", function() { - var repo = this.repository; - var branch = "should-not-exist"; - return Remote.lookup(repo, "origin") - .then(function(remote) { - var ref = "refs/heads/" + branch; - var refs = [ref + ":" + ref]; - var firstPass = true; - var options = { - callbacks: { - credentials: function(url, userName) { - if (firstPass) { - firstPass = false; - if (url.indexOf("https") === -1) { - return NodeGit.Cred.sshKeyFromAgent(userName); - } else { - return NodeGit.Cred.userpassPlaintextNew(userName, ""); - } + it("cannot push to a repository with invalid credentials", function() { + var repo = this.repository; + var branch = "should-not-exist"; + return Remote.lookup(repo, "origin") + .then(function(remote) { + var ref = "refs/heads/" + branch; + var refs = [ref + ":" + ref]; + var firstPass = true; + var options = { + callbacks: { + credentials: function(url, userName) { + if (firstPass) { + firstPass = false; + if (url.indexOf("https") === -1) { + return NodeGit.Credential.sshKeyFromAgent(userName); + } else { + return NodeGit.Credential + .userpassPlaintextNew(userName, ""); + } + } else { + return Promise.reject(); + } + }, + certificateCheck: () => 0 + } + }; + return remote.push(refs, options); + }) + // takes care of windows bug, see the .catch for the proper pathway + // that this flow should take (cred cb doesn't run twice -> + // throws error) + .then(function() { + return Promise.reject( + new Error("should not be able to push to the repository")); + }, function(err) { + if (err.message.indexOf(401) === -1) { + throw err; } else { - return Promise.reject(); + return Promise.resolve(); } - }, - certificateCheck: function() { - return 1; - } - } - }; - return remote.push(refs, options); - }) - // takes care of windows bug, see the .catch for the proper pathway - // that this flow should take (cred cb doesn't run twice -> throws error) - .then(function() { - return Promise.reject( - new Error("should not be able to push to the repository")); - }, function(err) { - if (err.message.indexOf(401) === -1) { - throw err; - } else { - return Promise.resolve(); - } - }) - // catches linux / osx failure to use anonymous credentials - // stops callback infinite loop - .catch(function (reason) { - const messageWithoutNewlines = reason.message.replace(/\n|\r/g, ""); - const validErrors = [ - "Method push has thrown an error.", - "failed to set credentials: The parameter is incorrect." - ]; - assert.ok( - _.includes(validErrors, messageWithoutNewlines), - "Unexpected error: " + reason.message - ); - }); - }); + }) + // catches linux / osx failure to use anonymous credentials + // stops callback infinite loop + .catch(function (reason) { + const messageWithoutNewlines = reason.message.replace( + /\n|\r/g, + "" + ); + const validErrors = [ + "Method push has thrown an error.", + "failed to set credentials: The parameter is incorrect." + ]; + assert.ok( + _.includes(validErrors, messageWithoutNewlines), + "Unexpected error: " + reason.message + ); + }); + }); + } it("is kept alive by refspec", function() { var repo = this.repository; diff --git a/test/tests/repository.js b/test/tests/repository.js index be165b3037..29f2075099 100644 --- a/test/tests/repository.js +++ b/test/tests/repository.js @@ -1,7 +1,6 @@ var assert = require("assert"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var local = path.join.bind(path, __dirname); var IndexUtils = require("../utils/index_setup"); var RepoUtils = require("../utils/repository_setup"); @@ -12,6 +11,7 @@ describe("Repository", function() { var Index = NodeGit.Index; var Signature = NodeGit.Signature; + var constReposPath = local("../repos/constworkdir"); var reposPath = local("../repos/workdir"); var newRepoPath = local("../repos/newrepo"); var emptyRepoPath = local("../repos/empty"); @@ -19,7 +19,13 @@ describe("Repository", function() { beforeEach(function() { var test = this; - return Repository.open(reposPath) + return Repository.open(constReposPath) + .then(function(constRepository) { + test.constRepository = constRepository; + }) + .then(function() { + return Repository.open(reposPath); + }) .then(function(repository) { test.repository = repository; }) @@ -96,7 +102,7 @@ describe("Repository", function() { }); it("can list remotes", function() { - return this.repository.getRemotes() + return this.repository.getRemoteNames() .then(function(remotes) { assert.equal(remotes.length, 1); assert.equal(remotes[0], "origin"); @@ -110,10 +116,21 @@ describe("Repository", function() { }); }); - it("can get the default signature", function() { - var sig = this.repository.defaultSignature(); + it("can get a reference commit", function() { + return this.repository.getReferenceCommit("master") + .then(function(commit) { + assert.equal( + "32789a79e71fbc9e04d3eff7425e1771eb595150", + commit.toString() + ); + }); + }); - assert(sig instanceof Signature); + it("can get the default signature", function() { + this.repository.defaultSignature() + .then((sig) => { + assert(sig instanceof Signature); + }); }); it("gets statuses with StatusFile", function() { @@ -174,11 +191,9 @@ describe("Repository", function() { return repo.fetch("origin", { credentials: function(url, userName) { - return NodeGit.Cred.sshKeyFromAgent(userName); + return NodeGit.Credential.sshKeyFromAgent(userName); }, - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 }) .then(function() { return repo.fetchheadForeach(function(refname, remoteUrl, oid, isMerge) { @@ -200,13 +215,23 @@ describe("Repository", function() { }); }); - it("can discover if a path is part of a repository", function() { + function discover(ceiling) { var testPath = path.join(reposPath, "lib", "util", "normalize_oid.js"); var expectedPath = path.join(reposPath, ".git"); - return NodeGit.Repository.discover(testPath, 0, "") + return NodeGit.Repository.discover(testPath, 0, ceiling) .then(function(foundPath) { assert.equal(expectedPath, foundPath); }); + } + + it("can discover if a path is part of a repository, null ceiling", + function() { + return discover(null); + }); + + it("can discover if a path is part of a repository, empty ceiling", + function() { + return discover(""); }); it("can create a repo using initExt", function() { @@ -256,16 +281,21 @@ describe("Repository", function() { }); it("can commit on head on a empty repo with createCommitOnHead", function() { - var fileName = "my-new-file-that-shouldnt-exist.file"; - var fileContent = "new file from repository test"; - var repo = this.emptyRepo; - var filePath = path.join(repo.workdir(), fileName); - var authSig = repo.defaultSignature(); - var commitSig = repo.defaultSignature(); - var commitMsg = "Doug this has been commited"; - - return fse.writeFile(filePath, fileContent) - .then(function() { + const fileName = "my-new-file-that-shouldnt-exist.file"; + const fileContent = "new file from repository test"; + const repo = this.emptyRepo; + const filePath = path.join(repo.workdir(), fileName); + const commitMsg = "Doug this has been commited"; + let authSig; + let commitSig; + + return repo.defaultSignature() + .then((sig) => { + authSig = sig; + commitSig = sig; + return fse.writeFile(filePath, fileContent); + }) + .then(() => { return repo.createCommitOnHead( [fileName], authSig, @@ -273,7 +303,7 @@ describe("Repository", function() { commitMsg ); }) - .then(function(oidResult) { + .then((oidResult) => { return repo.getHeadCommit() .then(function(commit) { assert.equal( @@ -327,4 +357,38 @@ describe("Repository", function() { assert.equal(numMergeHeads, 1); }); }); + + it("can obtain statistics from a valid constant repository", function() { + return this.constRepository.statistics() + .then(function(analysisReport) { + + assert.equal(analysisReport.repositorySize.commits.count, 992); + assert.equal(analysisReport.repositorySize.commits.size, 265544); + assert.equal(analysisReport.repositorySize.trees.count, 2416); + assert.equal(analysisReport.repositorySize.trees.size, 1188325); + assert.equal(analysisReport.repositorySize.trees.entries, 32571); + assert.equal(analysisReport.repositorySize.blobs.count, 4149); + assert.equal(analysisReport.repositorySize.blobs.size, 48489622); + assert.equal(analysisReport.repositorySize.annotatedTags.count, 1); + assert.equal(analysisReport.repositorySize.references.count, 8); + + assert.equal(analysisReport.biggestObjects.commits.maxSize, 956); + assert.equal(analysisReport.biggestObjects.commits.maxParents, 2); + assert.equal(analysisReport.biggestObjects.trees.maxEntries, 93); + assert.equal(analysisReport.biggestObjects.blobs.maxSize, 1077756); + + assert.equal(analysisReport.historyStructure.maxDepth, 931); + assert.equal(analysisReport.historyStructure.maxTagDepth, 1); + + assert.equal(analysisReport.biggestCheckouts.numDirectories, 128); + assert.equal(analysisReport.biggestCheckouts.maxPathDepth, 10); + assert.equal(analysisReport.biggestCheckouts.maxPathLength, 107); + assert.equal(analysisReport.biggestCheckouts.numFiles, 514); + assert.equal(analysisReport.biggestCheckouts.totalFileSize, 5160886); + assert.equal(analysisReport.biggestCheckouts.numSymlinks, 2); + assert.equal(analysisReport.biggestCheckouts.numSubmodules, 4); + + // console.log(JSON.stringify(analysisReport,null,2)); + }); + }); }); diff --git a/test/tests/reset.js b/test/tests/reset.js index 9bc38fd2b5..214bf08fd1 100644 --- a/test/tests/reset.js +++ b/test/tests/reset.js @@ -1,8 +1,7 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); describe("Reset", function() { var NodeGit = require("../../"); @@ -270,4 +269,43 @@ describe("Reset", function() { return Reset.reset(test.repo, test.currentCommit, Reset.TYPE.HARD); }); }); + + it("reset fails if parameter is not a Commit object", function() { + var test = this; + var commit = test.repo.getReferenceCommit("master"); + try { + Reset.reset(test.repo, commit, Reset.TYPE.HARD); + assert.fail( + "Should not be able to pass a Promise (Commit) into the function" + ); + } catch (err) { + // ok + assert.equal( + "Repository and target commit's repository does not match", + err.message + ); + } + }); + + it("reset fails if originating repository is not the same", function() { + var test = this; + var testCommit = null; + return test.repo.getReferenceCommit("master") + .then(function(commit) { + testCommit = commit; + return Repository.open(reposPath); + }) + .then(function(repo) { + return Reset.reset(repo, testCommit, Reset.TYPE.HARD); + }) + .then(function() { + assert.fail("Different source repository instance should fail"); + }) + .catch(function(err) { + assert.equal( + "Repository and target commit's repository does not match", + err.message + ); + }); + }); }); diff --git a/test/tests/revert.js b/test/tests/revert.js index a16d8c126a..accb529cae 100644 --- a/test/tests/revert.js +++ b/test/tests/revert.js @@ -10,6 +10,7 @@ describe("Revert", function() { var Revert = NodeGit.Revert; var RevertOptions = NodeGit.RevertOptions; + var Status = NodeGit.Status; var test; var fileName = "foobar.js"; @@ -37,34 +38,47 @@ describe("Revert", function() { var fileStats = fs.statSync(path.join(repoPath, fileName)); assert.ok(fileStats.isFile()); - Revert.revert(test.repository, test.firstCommit, new RevertOptions()) + return Revert.revert(test.repository, test.firstCommit, new RevertOptions()) .then(function() { try { fs.statSync(path.join(repoPath, fileName)); - assert.fail("Working directory was not reverted"); - } - catch (error) { - // pass + } catch (e) { + // we expect this not to exist + return; } + + assert.fail("Working directory was not reverted"); }); }); it("revert modifies the index", function() { - Revert.revert(test.repository, test.firstCommit, new RevertOptions()) - .then(function() { - return test.repository.index(); - }) - .then(function(index) { - var entries = index.entries; - assert.equal(1, entries.length); - assert.ok(_.endsWith(fileName, entries[0].path)); - }); + return Revert.revert(test.repository, test.firstCommit, new RevertOptions()) + .then(() => test.repository.getStatus()) + .then((status) => { + assert.equal(1, status.length); + assert.ok(_.endsWith(fileName, status[0].path())); + assert.equal(Status.STATUS.INDEX_DELETED, status[0].statusBit()); + }); }); - it("RevertOptions is optional", function() { + it("RevertOptions is optional (unspecified)", function() { + return Revert.revert(test.repository, test.firstCommit) + .catch(function(error) { + throw error; + }); + }); + + it("RevertOptions is optional (null)", function() { return Revert.revert(test.repository, test.firstCommit, null) .catch(function(error) { throw error; }); }); + + it("RevertOptions without MergeOptions should not segfault", function() { + return Revert.revert(test.repository, test.firstCommit, {}) + .catch(function(error) { + throw error; + }); + }); }); diff --git a/test/tests/revwalk.js b/test/tests/revwalk.js index cc3942c37c..bb1cd06ee5 100644 --- a/test/tests/revwalk.js +++ b/test/tests/revwalk.js @@ -1,7 +1,6 @@ var assert = require("assert"); var RepoUtils = require("../utils/repository_setup"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var path = require("path"); var local = path.join.bind(path, __dirname); @@ -182,6 +181,36 @@ describe("Revwalk", function() { }); }); + it("can get the history of a dir", function() { + var test = this; + var magicShas = [ + "6ed3027eda383d417457b99b38c73f88f601c368", + "95cefff6aabd3c1f6138ec289f42fec0921ff610", + "7ad92a7e4d26a1af93f3450aea8b9d9b8069ea8c", + "96f077977eb1ffcb63f9ce766cdf110e9392fdf5", + "694adc5369687c47e02642941906cfc5cb21e6c2", + "eebd0ead15d62eaf0ba276da53af43bbc3ce43ab", + "1273fff13b3c28cfdb13ba7f575d696d2a8902e1", + "271c65ed16ab147cee715e1076e1d716156cc5a3", + "94d532004323641fd169f375869c36a82b32fac7", + "1c71929a905da9faab64472d53815d46ff4391dd", + "3947245612ae27077517038704b7a679e742658e", + "a44c81558d0f72ccf6c1facbe2ba0b9b711586a9", + "01d469416b26340ee4922d5171ef8dbe46c879f4" + ]; + + return test.walker.fileHistoryWalk("include/functions", 1000) + .then(function(results) { + var shas = results.map(function(result) { + return result.commit.sha(); + }); + assert.equal(magicShas.length, shas.length); + magicShas.forEach(function(sha, i) { + assert.equal(sha, shas[i]); + }); + }); + }); + it("can get the history of a file while ignoring parallel branches", function() { var test = this; @@ -205,6 +234,7 @@ describe("Revwalk", function() { }); magicShas = [ + "be6905d459f1b236e44b2445df25aff1783993e9", "4a34168b80fe706f52417106821c9cbfec630e47", "f80e085e3118bbd6aad49dad7c53bdc37088bf9b", "694b2d703a02501f288269bea7d1a5d643a83cc8", @@ -315,7 +345,9 @@ describe("Revwalk", function() { var test = this; return leakTest(NodeGit.Revwalk, function() { - return Promise.resolve(NodeGit.Revwalk.create(test.repository)); + const walker = test.repository.createRevWalk(); + walker.push("115d114e2c4d5028c7a78428f16a4528c51be7dd"); + return walker.next(); }); }); diff --git a/test/tests/signature.js b/test/tests/signature.js index 8e1187ef6a..e0387c3d3b 100644 --- a/test/tests/signature.js +++ b/test/tests/signature.js @@ -41,45 +41,45 @@ describe("Signature", function() { assert.equal(when.offset(), -now.getTimezoneOffset()); }); - it("can get a default signature when no user name is set", function(done) { + it("can get a default signature when no user name is set", function() { var savedUserName; var savedUserEmail; - var cleanUp = function() { + var cleanUp = () => { return exec("git config --global user.name \"" + savedUserName + "\"") - .then(function() { + .then(() => { exec("git config --global user.email \"" + savedUserEmail + "\""); }); }; return exec("git config --global user.name") - .then(function(userName) { + .then((userName) => { savedUserName = userName.trim(); return exec("git config --global user.email"); }) - .then(function(userEmail) { + .then((userEmail) => { savedUserEmail = userEmail.trim(); return exec("git config --global --unset user.name"); }) - .then(function() { + .then(() => { return exec("git config --global --unset user.email"); }) - .then(function() { + .then(() => { return Repository.open(reposPath); }) - .then(function(repo) { - var sig = repo.defaultSignature(); + .then((repo) => { + return repo.defaultSignature(); + }) + .then((sig) => { assert.equal(sig.name(), "unknown"); assert.equal(sig.email(), "unknown@example.com"); }) .then(cleanUp) - .then(done) - .catch(function(e) { - cleanUp() + .catch((e) => { + return cleanUp() .then(function() { - done(e); return Promise.reject(e); }); }); @@ -106,4 +106,29 @@ describe("Signature", function() { // the self-freeing time should get freed assert.equal(startSelfFreeingCount, endSelfFreeingCount); }); + + it("toString does not provide a timestamp by default", function () { + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + + assert.equal(signature.toString(), "Shaggy Rogers "); + }); + + it("toString provides the correct timestamp when requested", function() { + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + + assert.equal( + signature.toString(true), + "Shaggy Rogers 987654321 +0130" + ); + }); }); diff --git a/test/tests/stage.js b/test/tests/stage.js index 248c3e0f12..34de76630f 100644 --- a/test/tests/stage.js +++ b/test/tests/stage.js @@ -1,7 +1,6 @@ var assert = require("assert"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var exec = require("../../utils/execPromise"); diff --git a/test/tests/stash.js b/test/tests/stash.js index 637ae00c97..811a0c5091 100644 --- a/test/tests/stash.js +++ b/test/tests/stash.js @@ -1,7 +1,6 @@ var assert = require("assert"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var local = path.join.bind(path, __dirname); describe("Stash", function() { @@ -32,22 +31,23 @@ describe("Stash", function() { }); function saveDropStash(repo, stashMessage) { - var fileName = "README.md"; - var fileContent = "Cha-cha-cha-chaaaaaangessssss"; - var filePath = path.join(repo.workdir(), fileName); - var oldContent; - var stashes = []; - var stashOid; + const fileName = "README.md"; + const fileContent = "Cha-cha-cha-chaaaaaangessssss"; + const filePath = path.join(repo.workdir(), fileName); + let oldContent; + let stashes = []; + let stashOid; return fse.readFile(filePath) - .then(function(content) { + .then((content) => { oldContent = content; return fse.writeFile(filePath, fileContent); }) - .then(function() { - return Stash.save(repo, repo.defaultSignature(), stashMessage, 0); + .then(() => repo.defaultSignature()) + .then((signature) => { + return Stash.save(repo, signature, stashMessage, 0); }) - .then(function(oid) { + .then((oid) => { stashOid = oid; var stashCb = function(index, message, oid) { stashes.push({index: index, message: message, oid: oid}); @@ -55,114 +55,119 @@ describe("Stash", function() { return Stash.foreach(repo, stashCb); }) - .then(function() { + .then(() => { assert.equal(stashes.length, 1); assert.equal(stashes[0].index, 0); - assert.equal(stashes[0].message, "On master: " + stashMessage); + const expectedMessage = !stashMessage ? + "WIP on master: 32789a7 Fixes EJS not being installed via NPM" : + "On master: " + stashMessage; + assert.equal(stashes[0].message, expectedMessage); assert.equal(stashes[0].oid.toString(), stashOid.toString()); return Stash.drop(repo, 0); }) - .then(function () { + .then(() => { stashes = []; - var stashCb = function(index, message, oid) { + var stashCb = (index, message, oid) => { stashes.push({index: index, message: message, oid: oid}); }; return Stash.foreach(repo, stashCb); }) - .then(function() { + .then(() => { assert.equal(stashes.length, 0); }) - .catch(function(e) { + .catch((e) => { return fse.writeFile(filePath, oldContent) - .then(function() { + .then(() => { return Promise.reject(e); }); }); } it("can save and drop a stash", function() { - saveDropStash(this.repository, "stash test"); + return saveDropStash(this.repository, "stash test"); }); it("can save a stash with no message and drop it", function() { - saveDropStash(this.repository, null); + return saveDropStash(this.repository, null); }); it("can save and pop a stash", function() { - var fileNameA = "README.md"; - var fileNameB = "install.js"; - var oldContentA; - var oldContentB; - var fileContent = "Cha-cha-cha-chaaaaaangessssss"; - var repo = this.repository; - var filePathA = path.join(repo.workdir(), fileNameA); - var filePathB = path.join(repo.workdir(), fileNameB); - var stashMessage = "stash test"; + const fileNameA = "README.md"; + const fileNameB = "install.js"; + let oldContentA; + let oldContentB; + const fileContent = "Cha-cha-cha-chaaaaaangessssss"; + const repo = this.repository; + const filePathA = path.join(repo.workdir(), fileNameA); + const filePathB = path.join(repo.workdir(), fileNameB); + const stashMessage = "stash test"; return fse.readFile(filePathA, "utf-8") - .then(function(content) { + .then((content) => { oldContentA = content; return fse.writeFile(filePathA, fileContent); }) - .then(function() { + .then(() => { return fse.readFile(filePathB, "utf-8"); }) - .then(function(content) { + .then((content) => { oldContentB = content; return fse.writeFile(filePathB, fileContent); }) - .then(function() { - return Stash.save(repo, repo.defaultSignature(), stashMessage, 0); + .then(() => repo.defaultSignature()) + .then((signature) => { + return Stash.save(repo, signature, stashMessage, 0); }) - .then(function() { + .then(() => { return fse.readFile(filePathA, "utf-8"); }) - .then(function(content) { + .then((content) => { assert.equal(oldContentA, content); return fse.readFile(filePathB, "utf-8"); }) - .then(function(content) { + .then((content) => { assert.equal(oldContentB, content); return Stash.pop(repo, 0); }) - .then(function() { + .then(() => { return fse.readFile(filePathA, "utf-8"); }) - .then(function(content) { + .then((content) => { assert.equal(fileContent, content); return fse.readFile(filePathB, "utf-8"); }) - .then(function(content) { + .then((content) => { assert.equal(fileContent, content); }); }); it("can save a stash, change files, and fail to pop stash", function() { - var fileName = "README.md"; - var fileContent = "Cha-cha-cha-chaaaaaangessssss"; - var fileContent2 = "Somewhere over the repo, changes were made."; - var repo = this.repository; - var filePath = path.join(repo.workdir(), fileName); - var oldContent; - var stashMessage = "stash test"; + const fileName = "README.md"; + const fileContent = "Cha-cha-cha-chaaaaaangessssss"; + const fileContent2 = "Somewhere over the repo, changes were made."; + const repo = this.repository; + const filePath = path.join(repo.workdir(), fileName); + let oldContent; + const stashMessage = "stash test"; return fse.readFile(filePath) - .then(function(content) { + .then((content) => { oldContent = content; return fse.writeFile(filePath, fileContent); }) - .then(function() { - return Stash.save(repo, repo.defaultSignature(), stashMessage, 0); + .then(() => repo.defaultSignature()) + .then((signature) => { + return Stash.save(repo, signature, stashMessage, 0); }) - .then(function() { + .then(() => { return fse.writeFile(filePath, fileContent2); }) - .then(function() { + .then(() => { return Stash.pop(repo, 0); }) - .catch(function(reason) { + .catch((reason) => { if (reason.message !== "1 conflict prevents checkout") { throw reason; } else { @@ -172,81 +177,154 @@ describe("Stash", function() { }); it("can save, apply, then drop the stash", function() { - var fileName = "README.md"; - var fileContent = "Cha-cha-cha-chaaaaaangessssss"; - var repo = this.repository; - var filePath = path.join(repo.workdir(), fileName); - var oldContent; - var stashMessage = "stash test"; + const fileName = "README.md"; + const fileContent = "Cha-cha-cha-chaaaaaangessssss"; + const repo = this.repository; + const filePath = path.join(repo.workdir(), fileName); + let oldContent; + const stashMessage = "stash test"; return fse.readFile(filePath) - .then(function(content) { + .then((content) => { oldContent = content; return fse.writeFile(filePath, fileContent); }) - .then(function() { - return Stash.save(repo, repo.defaultSignature(), stashMessage, 0); + .then(() => repo.defaultSignature()) + .then((signature) => { + return Stash.save(repo, signature, stashMessage, 0); }) - .then(function() { + .then(() => { return Stash.apply(repo, 0); }) - .then(function() { + .then(() => { return Stash.drop(repo, 0); - }, function() { + }, () => { throw new Error("Unable to drop stash after apply."); }) - .then(function() { + .then(() => { return Stash.drop(repo, 0); }) - .catch(function(reason) { - if (reason.message !== "Reference 'refs/stash' not found") { - Promise.reject(); + .catch((reason) => { + if (reason.message !== "reference 'refs/stash' not found") { + throw reason; } }); }); it("can save multiple stashes and pop an arbitrary stash", function() { - var fileName = "README.md"; - var fileContentA = "Hi. It's me. I'm the dog. My name is the dog."; - var fileContentB = "Everyone likes me. I'm cute."; - var fileContentC = "I think I will bark at nothing now. Ba. Ba. Baba Baba."; - var repo = this.repository; - var filePath = path.join(repo.workdir(), fileName); - var oldContent; - var stashMessageA = "stash test A"; - var stashMessageB = "stash test B"; - var stashMessageC = "stash test C"; - - function writeAndStash(path, content, message) { + const fileName = "README.md"; + const fileContentA = "Hi. It's me. I'm the dog. My name is the dog."; + const fileContentB = "Everyone likes me. I'm cute."; + const fileContentC = + "I think I will bark at nothing now. Ba. Ba. Baba Baba."; + const repo = this.repository; + const filePath = path.join(repo.workdir(), fileName); + let oldContent; + const stashMessageA = "stash test A"; + const stashMessageB = "stash test B"; + const stashMessageC = "stash test C"; + + const writeAndStash = (path, content, message) => { return fse.writeFile(path, content) - .then(function() { - return Stash.save(repo, repo.defaultSignature(), message, 0); + .then(() => repo.defaultSignature()) + .then((signature) => { + return Stash.save(repo, signature, message, 0); }); - } + }; return fse.readFile(filePath, "utf-8") - .then(function (content) { + .then((content) => { oldContent = content; return writeAndStash(filePath, fileContentA, stashMessageA); }) - .then(function() { + .then(() => { return writeAndStash(filePath, fileContentB, stashMessageB); }) - .then(function() { + .then(() => { return writeAndStash(filePath, fileContentC, stashMessageC); }) - .then(function() { + .then(() => { return fse.readFile(filePath, "utf-8"); }) - .then(function(content) { + .then((content) => { assert.equal(oldContent, content); return Stash.pop(repo, 1); }) - .then(function() { + .then(() => { return fse.readFile(filePath, "utf-8"); }) - .then(function(content) { + .then((content) => { + assert.equal(fileContentB, content); + }); + }); + + it("can partial stash the workdir and pop it", function() { + const repo = this.repository; + + const fileName1 = "README.md"; + const fileName2 = "install.js"; + const fileName3 = "LICENSE"; + + const fileContentA = "Hi. It's me. I'm the dog. My name is the dog."; + const fileContentB = "Everyone likes me. I'm cute."; + + let oldContentA; + let oldContentB; + let oldContentC; + + const filePath1 = path.join(repo.workdir(), fileName1); + const filePath2 = path.join(repo.workdir(), fileName2); + const filePath3 = path.join(repo.workdir(), fileName3); + + const options = { + flags: 0, + message: "stast test", + paths: [fileName1, fileName2] + }; + + return fse.readFile(filePath1, "utf-8") + .then((content) => { + oldContentA = content; + return fse.readFile(filePath2, "utf-8"); + }) + .then((content) => { + oldContentB = content; + return fse.readFile(filePath3, "utf-8"); + }) + .then((content) => { + oldContentC = content; + return fse.writeFile(filePath1, fileContentA); + }) + .then(() => fse.writeFile(filePath2, fileContentB)) + .then(() => repo.defaultSignature()) + .then((signature) => { + options.stasher = signature; + return Stash.saveWithOpts(repo, options); + }) + .then(() => fse.readFile(filePath1, "utf-8")) + .then((content) => { + assert.equal(oldContentA, content); + return fse.readFile(filePath2, "utf-8"); + }) + .then((content) => { + assert.equal(oldContentB, content); + return fse.readFile(filePath3, "utf-8"); + }) + .then((content) => { + assert.equal(oldContentC, content); + return Stash.pop(repo, 0); + }) + .then(() => fse.readFile(filePath1, "utf-8")) + .then((content) => { + assert.equal(fileContentA, content); + return fse.readFile(filePath2, "utf-8"); + }) + .then((content) => { assert.equal(fileContentB, content); + return fse.readFile(filePath3, "utf-8"); + }) + .then((content) => { + assert.equal(oldContentC, content); }); }); }); diff --git a/test/tests/status.js b/test/tests/status.js index d74c7bee7f..f3caeb7bf4 100644 --- a/test/tests/status.js +++ b/test/tests/status.js @@ -1,7 +1,6 @@ var assert = require("assert"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var local = path.join.bind(path, __dirname); var exec = require("../../utils/execPromise"); @@ -102,7 +101,27 @@ describe("Status", function() { .then(function() { return Promise.reject(e); }); + }); + }); + it("gets status on non-existent file results in error", function() { + var fileName = "non-existent-Status.file-test.txt"; + var repo = this.repository; + var filePath = path.join(repo.workdir(), fileName); + return exec("git clean -xdf", {cwd: reposPath}) + .then(function() { + assert.equal(false, fse.existsSync(filePath)); + return Status.file(repo, filePath) + .then(function() { + assert.fail("Non-existent file should throw error on Status.file"); + }, function(err) { + assert.equal(NodeGit.Error.CODE.ENOTFOUND, err.errno); + assert.equal("Status.file", err.errorFunction); + assert.equal( + "attempt to get status of nonexistent file '" + filePath + "'", + err.message + ); + }); }); }); }); diff --git a/test/tests/status_list.js b/test/tests/status_list.js index be96952a27..68a08910ec 100644 --- a/test/tests/status_list.js +++ b/test/tests/status_list.js @@ -1,7 +1,6 @@ var assert = require("assert"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var local = path.join.bind(path, __dirname); var exec = require("../../utils/execPromise"); diff --git a/test/tests/submodule.js b/test/tests/submodule.js index f42758b124..2323fa56ca 100644 --- a/test/tests/submodule.js +++ b/test/tests/submodule.js @@ -157,4 +157,38 @@ describe("Submodule", function() { assert.equal(entries[1].path, submodulePath); }); }); + + it("can run sync callback without deadlocking", function() { + var repo = this.workdirRepository; + var submodules = []; + var submoduleCallback = function(submodule, name, payload) { + var submoduleName = submodule.name(); + assert.equal(submoduleName, name); + submodules.push(name); + }; + + return Submodule.foreach(repo, submoduleCallback).then(function() { + assert.equal(submodules.length, 1); + }); + }); + + // 'Submodule.foreach' and 'Submodule.lookup' do work with the repo locked. + // They should work together without deadlocking. + it("can run async callback without deadlocking", function() { + var repo = this.workdirRepository; + var submodules = []; + var submoduleCallback = function(submodule, name, payload) { + var owner = submodule.owner(); + + return Submodule.lookup(owner, name) + .then(function(submodule) { + assert.equal(submodule.name(), name); + submodules.push(name); + }); + }; + + return Submodule.foreach(repo, submoduleCallback).then(function() { + assert.equal(submodules.length, 1); + }); + }); }); diff --git a/test/tests/tag.js b/test/tests/tag.js index 11b4f566fe..21acdcc1bc 100644 --- a/test/tests/tag.js +++ b/test/tests/tag.js @@ -13,6 +13,7 @@ describe("Tag", function() { var reposPath = local("../repos/workdir"); var tagName = "annotated-tag"; + var tagPattern = "annotated*"; var tagFullName = "refs/tags/" + tagName; var tagOid = "dc800017566123ff3c746b37284a24a66546667e"; var commitPointedTo = "32789a79e71fbc9e04d3eff7425e1771eb595150"; @@ -24,10 +25,11 @@ describe("Tag", function() { assert.equal(tag.targetType(), Obj.TYPE.COMMIT); assert.equal(tag.message(), tagMessage); - var target = tag.target(); - - assert.ok(target.isCommit()); - assert.equal(target.id().toString(), commitPointedTo); + return tag.target() + .then(function(target) { + assert.ok(target.isCommit()); + assert.equal(target.id().toString(), commitPointedTo); + }); } beforeEach(function() { @@ -42,21 +44,21 @@ describe("Tag", function() { it("can get a tag from a repo via the tag name", function() { return this.repository.getTagByName(tagName) .then(function(tag) { - testTag(tag); + return testTag(tag); }); }); it("can get a tag from a repo via the long tag name", function() { return this.repository.getTagByName(tagFullName) .then(function(tag) { - testTag(tag); + return testTag(tag); }); }); it("can get a tag from a repo via the tag's OID as a string", function() { return this.repository.getTag(tagOid) .then(function(tag) { - testTag(tag); + return testTag(tag); }); }); @@ -65,7 +67,7 @@ describe("Tag", function() { return this.repository.getTag(oid) .then(function(tag) { - testTag(tag); + return testTag(tag); }); }); @@ -80,6 +82,13 @@ describe("Tag", function() { }); }); + it("can list tags of a pattern in a repo", function() { + return Tag.listMatch(tagPattern, this.repository) + .then(function(tagNames) { + assert.equal(tagNames.length, 1); + }); + }); + it("can create a new annotated tag in a repo and delete it", function() { var oid = Oid.fromString(commitPointedTo); var name = "created-annotated-tag"; @@ -87,7 +96,7 @@ describe("Tag", function() { return repository.createTag(oid, name, tagMessage) .then(function(tag) { - testTag(tag, name); + return testTag(tag, name); }) .then(function() { return repository.createTag(oid, name, tagMessage); @@ -150,11 +159,15 @@ describe("Tag", function() { it("can create a new signed tag with Tag.create and delete it", function() { var name = "created-signed-tag-create"; var repository = this.repository; - var signature = Signature.default(repository); + var signature = null; var commit = null; var commit2 = null; - return repository.getCommit(commitPointedTo) + return Signature.default(repository) + .then(function(signatureResult) { + signature = signatureResult; + return repository.getCommit(commitPointedTo); + }) .then(function(theCommit) { commit = theCommit; return repository.getCommit(commitPointedTo2); @@ -167,8 +180,8 @@ describe("Tag", function() { return repository.getTag(oid); }) .then(function(tag) { - testTag(tag, name); assert(tag.tagger(), signature); + return testTag(tag, name); }) .then(function() { // overwriting is okay @@ -198,20 +211,443 @@ describe("Tag", function() { }); }); + it("can create a Tag buffer", function() { + const targetOid = Oid.fromString(commitPointedTo); + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const message = "I'm a teapot"; + + return Tag.createBuffer(repository, name, targetOid, signature, message) + .then((tagBuffer) => { + const lines = tagBuffer.split("\n"); + assert.equal(7, lines.length); + assert.equal(lines[0], `object ${commitPointedTo}`); + assert.equal(lines[1], "type commit"); + assert.equal(lines[2], `tag ${name}`); + assert.equal( + lines[3], + "tagger Shaggy Rogers 987654321 +0130" + ); + assert.equal(lines[4], ""); + assert.equal(lines[5], message); + assert.equal(lines[6], ""); + }); + }); + + it("can create a Tag from a Tag buffer", function() { + const targetOid = Oid.fromString(commitPointedTo); + const otherTargetOid = Oid.fromString(commitPointedTo2); + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const message = "I'm a teapot"; + + let odb; + let buffer; + let otherBuffer; + + return repository.odb() + .then((odbResult) => { + odb = odbResult; + return Tag.createBuffer( + repository, + name, + targetOid, + signature, + message + ); + }) + .then((bufferResult) => { + buffer = bufferResult; + return Tag.createBuffer( + repository, + name, + otherTargetOid, + signature, + message + ); + }) + .then((bufferResult) => { + otherBuffer = bufferResult; + return Tag.createFromBuffer(repository, buffer, 1); + }) + .then((oid) => { + return odb.read(oid); + }) + .then((object) => { + const lines = object.toString().split("\n"); + assert(object.type(), Obj.TYPE.TAG); + assert.equal(7, lines.length); + assert.equal(lines[0], `object ${commitPointedTo}`); + assert.equal(lines[1], "type commit"); + assert.equal(lines[2], `tag ${name}`); + assert.equal( + lines[3], + "tagger Shaggy Rogers 987654321 +0130" + ); + assert.equal(lines[4], ""); + assert.equal(lines[5], message); + assert.equal(lines[6], ""); + }) + .then(() => { + // overwriting is okay + return Tag.createFromBuffer(repository, otherBuffer, 1); + }) + .then(() => { + // overwriting is not okay + return Tag.createFromBuffer(repository, buffer, 0); + }) + .then(() => { + return Promise.reject( + new Error("should not be able to create the '" + name + "' tag twice") + ); + }, + () => { + return Promise.resolve(); + }); + }); + + describe("createWithSignature and extractSignature", function() { + it( + "can create a tag with a signature and extract the signature", + function() { + var targetCommit; + var otherTargetCommit; + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const signatureLines = [ + "-----BEGIN PGP SIGNATURE-----", + "iQIzBAABCAAdFiEEKdxGpJ93wnkLaBKfURjJKedOfEMFAlxR4JUACgkQURjJKedO", + "fEN+8A//cXmkRmhzQMdTEdrxty7tVKQ7lVhL7r7e+cB84hO7WrDn8549c7/Puflu", + "idanWfyoAEMSNWDgY84lx/t3I3YYKXsLDPT93HiMhCXmPVZcfLxlARRL1rrNZV4q", + "L9hhqb9bFrRNBn6YebhygeLXLHlDKEZzx8W9jnDLU8Px8UTkwdQIDnPDfT7UOPPU", + "MYDgP3OwWwoG8dUlZXaHjtFz29wPlJo177MwdLYwn4zpEIysoY1ev5IKWD+LPW4g", + "vdQnaK1x3dozmG8YLUZw5iW7ap9DpahbAGQgdy1z1ypiNUjNuhaP8zkG1ci6X88N", + "6MIoQ+YqfowRJJTIr1lzssxsRI1syjfS6smnI4ZNE6S+6mIKN96ES2OZF+rn4xnD", + "PofR9Qh2gPq++ULriPE/cX7ZkZ0/ZDZGDfIGvricB8JEJhISZn/VMX/KScJs+rFq", + "KWN5Au6Uc2pEqeq5OP4y2k0QUmKQT9sh9OepnPmfqF8hG6wI8nM67jT/FEOcpr0v", + "qoN2NRXrcq3iZAp07AGq9IdpYhBcEW7MFmOcNt+Zb8SbTMp6DawnREg9xzz1SIkZ", + "Cdp1XoJ6mkVvzBB4T/Esp7j1VztinTX2PpX7C1CE5LC76UfCiEjEWOmWrVuPuA5a", + "oRrJvgPJg8gpVj04r2m8nvUK1gwhxg9ZB+SK+nd3OAd0dnbJwTE=", + "=dW3g", + "-----END PGP SIGNATURE-----" + ]; + const message = "I'm a teapot"; + const signingCallback = (message) => ({ + code: NodeGit.Error.CODE.OK, + signedData: signatureLines.join("\n") + }); + + let odb; + let oid; + let object; + + return repository.getCommit(commitPointedTo).then((commit) => { + targetCommit = commit; + return repository.getCommit(commitPointedTo2); + }).then((commit) => { + otherTargetCommit = commit; + return repository.odb(); + }).then((odbResult) => { + odb = odbResult; + + return Tag.createWithSignature( + repository, + name, + targetCommit, + signature, + message, + 1, + signingCallback + ); + }) + .then((oidResult) => { + oid = oidResult; + return odb.read(oid); + }) + .then((objectResult) => { + object = objectResult; + const lines = object.toString().split("\n"); + assert(object.type(), Obj.TYPE.TAG); + assert.equal(signatureLines.length + 7, lines.length); + assert.equal(lines[0], `object ${commitPointedTo}`); + assert.equal(lines[1], "type commit"); + assert.equal(lines[2], `tag ${name}`); + assert.equal( + lines[3], + "tagger Shaggy Rogers 987654321 +0130" + ); + assert.equal(lines[4], ""); + assert.equal(lines[5], message); + for (let i = 6; i < 6 + signatureLines.length; i++) { + assert.equal(lines[i], signatureLines[i - 6]); + } + assert.equal(lines[6 + signatureLines.length], ""); + + return Tag.lookup(repository, oid); + }) + .then((tag) => { + return tag.extractSignature(); + }) + .then((tagSignature) => { + assert.equal(tagSignature, signatureLines.join("\n")); + }) + .then(() => { + // overwriting is okay + return Tag.createWithSignature( + repository, + name, + targetCommit, + signature, + message, + 1, + signingCallback + ); + }) + .then(() => { + // overwriting is not okay + return Tag.createWithSignature( + repository, + name, + otherTargetCommit, + signature, + message, + 0, + signingCallback + ); + }) + .then(() => { + return Promise.reject( + new Error( + "should not be able to create the '" + name + "' tag twice" + ) + ); + }, + () => { + return Promise.resolve(); + }); + } + ); + + it("can optionally skip the signing process", function() { + var targetCommit; + var otherTargetCommit; + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const message = "I'm a teapot"; + const signingCallback = () => ({ + code: NodeGit.Error.CODE.PASSTHROUGH + }); + + let odb; + let oid; + let object; + + return repository.getCommit(commitPointedTo).then((commit) => { + targetCommit = commit; + return repository.getCommit(commitPointedTo2); + }).then((commit) => { + otherTargetCommit = commit; + return repository.odb(); + }).then((odbResult) => { + odb = odbResult; + + return Tag.createWithSignature( + repository, + name, + targetCommit, + signature, + message, + 1, + signingCallback + ); + }) + .then((oidResult) => { + oid = oidResult; + return odb.read(oid); + }) + .then((objectResult) => { + object = objectResult; + const lines = object.toString().split("\n"); + assert(object.type(), Obj.TYPE.TAG); + assert.equal(7, lines.length); + assert.equal(lines[0], `object ${commitPointedTo}`); + assert.equal(lines[1], "type commit"); + assert.equal(lines[2], `tag ${name}`); + assert.equal( + lines[3], + "tagger Shaggy Rogers 987654321 +0130" + ); + assert.equal(lines[4], ""); + assert.equal(lines[5], message); + assert.equal(lines[6], ""); + + return Tag.lookup(repository, oid); + }) + .then((tag) => { + return tag.extractSignature(); + }) + .then(function() { + assert.fail("Tag should not have been signed."); + }, function(error) { + if (error && error.message === "this tag is not signed") { + return; + } + + throw error; + }) + .then(() => { + // overwriting is okay + return Tag.createWithSignature( + repository, + name, + targetCommit, + signature, + message, + 1, + signingCallback + ); + }) + .then(() => { + // overwriting is not okay + return Tag.createWithSignature( + repository, + name, + otherTargetCommit, + signature, + message, + 0, + signingCallback + ); + }) + .then(() => { + return Promise.reject( + new Error("should not be able to create the '" + name + "' tag twice") + ); + }, + () => { + return Promise.resolve(); + }); + }); + + it("will throw if signing callback returns an error code", function() { + var targetCommit; + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const message = "I'm a teapot"; + const signingCallback = () => ({ + code: NodeGit.Error.CODE.ERROR + }); + + + return repository.getCommit(commitPointedTo).then((commit) => { + targetCommit = commit; + return Tag.createWithSignature( + repository, + name, + targetCommit, + signature, + message, + 1, + signingCallback + ); + }).then(function() { + assert.fail("Should not have been able to create tag"); + }, function(error) { + if (error && error.errno === NodeGit.Error.CODE.ERROR) { + return; + } + throw error; + }); + }); + }); + + it("will show a deprecation warning if createWithSignature use oid instead object", function() { + var targetCommit; + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const message = "I'm a teapot"; + const signingCallback = () => ({ + code: NodeGit.Error.CODE.ERROR + }); + + + return repository.getCommit(commitPointedTo).then((commit) => { + targetCommit = commit; + return Tag.createWithSignature( + repository, + name, + targetCommit.id(), + signature, + message, + 1, + signingCallback + ); + }).then(function() { + assert.fail("Should not have been able to create tag"); + }, function(error) { + if (error && error.errno === NodeGit.Error.CODE.ERROR) { + return; + } + throw error; + }); + }); + it("can create a new signed tag with Tag.annotationCreate", function() { - var oid = Oid.fromString(commitPointedTo); + var targetCommit; var name = "created-signed-tag-annotationCreate"; var repository = this.repository; - var signature = Signature.default(repository); + var signature = null; var odb = null; - return repository.odb() + return repository.getCommit(commitPointedTo).then((commit) => { + targetCommit = commit; + return Signature.default(repository); + }).then(function(signatureResult) { + signature = signatureResult; + return repository.odb(); + }) .then(function(theOdb) { odb = theOdb; }) .then(function() { return Tag.annotationCreate( - repository, name, oid, signature, tagMessage); + repository, name, targetCommit, signature, tagMessage); }) .then(function(oid) { return odb.read(oid); @@ -220,4 +656,31 @@ describe("Tag", function() { assert(object.type(), Obj.TYPE.TAG); }); }); + + it("can peel a tag", function() { + return this.repository.getTagByName(tagName) + .then(function(tag) { + return tag.peel(); + }) + .then(function(object) { + assert.equal(object.isCommit(), true); + }); + }); + + it("can get tag's target id", function() { + return this.repository.getTagByName(tagName) + .then(function(tag) { + assert.equal(commitPointedTo, tag.targetId()); + }); + }); + + it("can get tag's owner", function() { + var repository = this.repository; + return this.repository.getTagByName(tagName) + .then(function(tag) { + var owner = tag.owner(); + assert.ok(owner instanceof Repository); + assert.equal(repository.path(), owner.path()); + }); + }); }); diff --git a/test/tests/thread_safety.js b/test/tests/thread_safety.js deleted file mode 100644 index 257c2d51ea..0000000000 --- a/test/tests/thread_safety.js +++ /dev/null @@ -1,65 +0,0 @@ -var assert = require("assert"); -var path = require("path"); -var local = path.join.bind(path, __dirname); - -describe("ThreadSafety", function() { - var NodeGit = require("../../"); - var Repository = NodeGit.Repository; - - var reposPath = local("../repos/workdir"); - - beforeEach(function() { - var test = this; - - return Repository.open(reposPath) - .then(function(repo) { - test.repository = repo; - return repo.refreshIndex(); - }) - .then(function(index) { - test.index = index; - }); - }); - - it("can enable and disable thread safety", function() { - var originalValue = NodeGit.getThreadSafetyStatus(); - - NodeGit.enableThreadSafety(); - assert.equal(NodeGit.THREAD_SAFETY.ENABLED, - NodeGit.getThreadSafetyStatus()); - - NodeGit.setThreadSafetyStatus(NodeGit.THREAD_SAFETY.ENABLED_FOR_ASYNC_ONLY); - assert.equal(NodeGit.THREAD_SAFETY.ENABLED_FOR_ASYNC_ONLY, - NodeGit.getThreadSafetyStatus()); - - NodeGit.setThreadSafetyStatus(NodeGit.THREAD_SAFETY.DISABLED); - assert.equal(NodeGit.THREAD_SAFETY.DISABLED, - NodeGit.getThreadSafetyStatus()); - - NodeGit.setThreadSafetyStatus(originalValue); - }); - - it("can lock something and cleanup mutex", function() { - var diagnostics = NodeGit.getThreadSafetyDiagnostics(); - var originalCount = diagnostics.storedMutexesCount; - // call a sync method to guarantee that it stores a mutex, - // and that it will clean up the mutex in a garbage collection cycle - this.repository.headDetached(); - - diagnostics = NodeGit.getThreadSafetyDiagnostics(); - switch(NodeGit.getThreadSafetyStatus()) { - case NodeGit.THREAD_SAFETY.ENABLED: - // this is a fairly vague test - it just tests that something - // had a mutex created for it at some point (i.e., the thread safety - // code is not completely dead) - assert.ok(diagnostics.storedMutexesCount > 0); - break; - case NodeGit.THREAD_SAFETY.ENABLED_FOR_ASYNC_ONLY: - assert.equal(originalCount, diagnostics.storedMutexesCount); - break; - - case NodeGit.THREAD_SAFETY.DISABLED: - assert.equal(0, diagnostics.storedMutexesCount); - } - }); -}); diff --git a/test/tests/tree.js b/test/tests/tree.js index aa98d4f3d8..052459a80b 100644 --- a/test/tests/tree.js +++ b/test/tests/tree.js @@ -1,8 +1,7 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); describe("Tree", function() { var NodeGit = require("../../"); @@ -32,11 +31,29 @@ describe("Tree", function() { }); it("gets an entry by name", - function(done) { - this.commit.getTree().then(function(tree) { + function() { + return this.commit.getTree().then(function(tree) { var entry = tree.entryByName("README.md"); assert(entry); - }).done(done); + }); + }); + + it("updates a tree", function () { + var repo = this.existingRepo; + var update = new NodeGit.TreeUpdate(); + update.action = NodeGit.Tree.UPDATE.REMOVE; + update.path = "README.md"; + return this.commit.getTree().then(function(tree) { + return tree.createUpdated(repo, 1, [update]); + }) + .then(function(treeOid) { + return repo.getTree(treeOid); + }) + .then(function(updatedTree) { + assert.throws(function () { + updatedTree.entryByName("README.md"); + }); + }); }); it("walks its entries and returns the same entries on both progress and end", @@ -44,8 +61,7 @@ describe("Tree", function() { var repo = this.repository; var file1 = "test.txt"; var file2 = "foo/bar.txt"; - // index.addByPath doesn't like \s so normalize only for the expected paths - var expectedPaths = [file1, path.normalize(file2)]; + var expectedPaths = [file1, file2]; var progressEntries = []; var endEntries; @@ -96,4 +112,13 @@ describe("Tree", function() { ); }); }); + + it("get all paths from a tree", async function () { + const tree = await this.commit.getTree(); + const paths = await tree.getAllFilepaths(); + assert.equal(paths.length, 512); + assert.equal(paths[0], ".gitignore"); + assert.equal(paths[511], "wscript"); + }); + }); diff --git a/test/tests/tree_entry.js b/test/tests/tree_entry.js index 13093fdaad..f62f374f04 100644 --- a/test/tests/tree_entry.js +++ b/test/tests/tree_entry.js @@ -57,16 +57,16 @@ describe("TreeEntry", function() { it("provides the full path", function() { return this.commit.getEntry("test/raw-commit.js") .then(function(entry) { - assert.equal(entry.path(), path.normalize("test/raw-commit.js")); + assert.equal(entry.path(), "test/raw-commit.js"); }); }); - it("provides the full path when the entry came from a tree", function(done) { + it("provides the full path when the entry came from a tree", function() { var testTree = function(tree, _dir) { var dir = _dir || "", testPromises = []; tree.entries().forEach(function(entry) { - var currentPath = path.join(dir, entry.name()); + var currentPath = path.posix.join(dir, entry.name()); if (entry.isTree()) { testPromises.push( entry.getTree().then(function (subtree) { @@ -82,10 +82,7 @@ describe("TreeEntry", function() { }; return this.commit.getTree() - .then(testTree) - .done(function() { - done(); - }); + .then(testTree); }); it("provides the blob representation of the entry", function() { diff --git a/test/tests/treebuilder.js b/test/tests/treebuilder.js index c7ef01f43e..6462fd9346 100644 --- a/test/tests/treebuilder.js +++ b/test/tests/treebuilder.js @@ -1,8 +1,6 @@ var assert = require("assert"); var path = require("path"); -var fs = require("fs"); -var promisify = require("promisify-node"); -var readDir = promisify(fs.readdir); +var fse = require("fs-extra"); var local = path.join.bind(path, __dirname); var leakTest = require("../utils/leak_test"); @@ -43,7 +41,7 @@ describe("TreeBuilder", function(){ .then(function(treeBuilder){ //check //count how many entries we should have - return readDir(reposPath) + return fse.readdir(reposPath) //treebuilder should have all entries in the clean working dir //(minus .git folder) .then(function(dirEntries) { @@ -65,11 +63,13 @@ describe("TreeBuilder", function(){ .then(function(rootTreeBuilder){ //new dir builder return Git.Treebuilder.create(test.repo, null) - .then(function(newTreeBuilder){ - //insert new dir + .then(function(newTreeBuilder) { + return newTreeBuilder.write(); + }) + .then(function(oid) { return rootTreeBuilder.insert( "mynewfolder", - newTreeBuilder.write(), + oid, Git.TreeEntry.FILEMODE.TREE ); }); diff --git a/test/tests/worker.js b/test/tests/worker.js new file mode 100644 index 0000000000..f39e19e6da --- /dev/null +++ b/test/tests/worker.js @@ -0,0 +1,216 @@ +const path = require("path"); +const assert = require("assert"); +const fse = require("fs-extra"); +const local = path.join.bind(path, __dirname); +const NodeGit = require("../../"); + +let filterName = "psuedo_filter"; +let Worker; + +try { + Worker = require("worker_threads").Worker; +} catch (e) {} + +if (Worker) { + describe("Worker", function() { + const clonePath = local("../repos/clone"); + + // Set a reasonable timeout here now that our repository has grown. + this.timeout(30000); + + beforeEach(function() { + return fse.remove(clonePath).catch(function(err) { + console.log(err); + + throw err; + }); + }); + + afterEach(function() { + return NodeGit.FilterRegistry.unregister(filterName) + .catch(function(error) { + if (error === NodeGit.Error.CODE.ERROR) { + throw new Error("Cannot unregister filter"); + } + }); + }); + + it("can perform basic functionality via worker thread", function(done) { + const workerPath = local("../utils/worker.js"); + const worker = new Worker(workerPath, { + workerData: { + clonePath, + url: "https://github.com/nodegit/test.git" + } + }); + worker.on("message", (message) => { + switch (message) { + case "init": + break; + case "success": + done(); + break; + case "failure": + assert.fail(); + break; + } + }); + worker.on("error", () => assert.fail()); + worker.on("exit", (code) => { + if (code !== 0) { + assert.fail(); + } + }); + }); + + for (let i = 0; i < 5; ++i) { + // disabled until we can address flakiness + it.skip(`can kill worker thread while in use #${i}`, function(done) { // jshint ignore:line + const workerPath = local("../utils/worker.js"); + const worker = new Worker(workerPath, { + workerData: { + clonePath, + url: "https://github.com/nodegit/test.git" + } + }); + worker.on("message", (message) => { + switch (message) { + case "init": + setTimeout(() => { worker.terminate(); }, 500); + break; + case "success": + assert.fail(); + break; + case "failure": + assert.fail(); + break; + } + }); + worker.on("error", () => assert.fail()); + worker.on("exit", (code) => { + if (code === 1) { + done(); + } else { + assert.fail(); + } + }); + }); + } + + // NOTE: first try was to build a test measuring memory used, checking + // that memory allocated by objects was being freed, but it was problematic + // to obtain the memory freed by a different context (a worker) after the + // context was gone, and the data in the tests wasn't consistent. + // So instead this test checks that the count of objects created/destroyed + // during the test match the count of objects being tracked by the + // nodegit::Context, which will be destroyed on context shutdown. To check + // that they are actually being freed can be done with a debugger/profiler. + it("can track objects to free on context shutdown", function(done) { + let testOk; + const workerPath = local("../utils/worker_context_aware.js"); + const worker = new Worker(workerPath, { + workerData: { + clonePath, + url: "https://github.com/nodegit/test.git" + } + }); + worker.on("message", (message) => { + switch (message) { + case "numbersMatch": + testOk = true; + worker.terminate(); + break; + case "numbersDoNotMatch": + testOk = false; + worker.terminate(); + break; + case "failure": + assert.fail(); + break; + } + }); + worker.on("error", () => assert.fail()); + worker.on("exit", (code) => { + if (code === 1 && testOk === true) { + done(); + } + else { + assert.fail(); + } + }); + }); + + // This tests that while calling filter's apply callbacks and the worker + // is terminated, node exits gracefully. To make sure we terminate the + // worker during a checkout, continuous checkouts will be running in a loop. + it("can kill worker thread while doing a checkout and exit gracefully", function(done) { // jshint ignore:line + const workerPath = local("../utils/worker_checkout.js"); + const worker = new Worker(workerPath, { + workerData: { + clonePath, + url: "https://github.com/nodegit/test.git" + } + }); + worker.on("message", (message) => { + switch (message) { + case "init": + // give enough time for the worker to start applying the filter + // during continuous checkouts + setTimeout(() => { worker.terminate(); }, 10000); + break; + case "success": + assert.fail(); + break; + case "failure": + assert.fail(); + break; + } + }); + worker.on("error", () => assert.fail()); + worker.on("exit", (code) => { + if (code == 1) { + done(); + } else { + assert.fail(); + } + }); + }); + + // This tests that after calling filter's apply callbacks and the worker + // is terminated, there will be no memory leaks. + it("can track objects to free on context shutdown after multiple checkouts", function(done) { // jshint ignore:line + let testOk; + const workerPath = local("../utils/worker_context_aware_checkout.js"); + const worker = new Worker(workerPath, { + workerData: { + clonePath, + url: "https://github.com/nodegit/test.git" + } + }); + worker.on("message", (message) => { + switch (message) { + case "numbersMatch": + testOk = true; + worker.terminate(); + break; + case "numbersDoNotMatch": + testOk = false; + worker.terminate(); + break; + case "failure": + assert.fail(); + break; + } + }); + worker.on("error", () => assert.fail()); + worker.on("exit", (code) => { + if (code === 1 && testOk === true) { + done(); + } + else { + assert.fail(); + } + }); + }); + }); +} diff --git a/test/utils/index_setup.js b/test/utils/index_setup.js index eafcd5b52a..ab5a75336e 100644 --- a/test/utils/index_setup.js +++ b/test/utils/index_setup.js @@ -1,7 +1,6 @@ var NodeGit = require("../../"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var RepoUtils = require("../utils/repository_setup"); var IndexSetup = { diff --git a/test/utils/loop_checkout.js b/test/utils/loop_checkout.js new file mode 100644 index 0000000000..f6e6c07360 --- /dev/null +++ b/test/utils/loop_checkout.js @@ -0,0 +1,91 @@ +const fse = require("fs-extra"); +const path = require("path"); +const NodeGit = require("../../"); + +const getDirExtFiles = function(dir, ext, done) { + let results = []; + fse.readdir(dir, function(err, list) { + if (err) { + return done(err); + } + let i = 0; + (function next() { + let file = list[i++]; + if (!file) { + return done(null, results); + } + file = path.resolve(dir, file); + fse.stat(file, function(err, stat) { + if (stat && stat.isDirectory()) { + getDirExtFiles(file, ext, function(err, res) { + results = results.concat(res); + next(); + }); + } else { + if (path.extname(file) == ".".concat(ext)) { + results.push(file); + } + next(); + } + }); + })(); + }); +}; + +const getDirFilesToChange = function(dir, ext) { + return new Promise(function(resolve, reject) { + getDirExtFiles(dir, ext, function(err, results) { + if (err) { + reject(err); + } + resolve(results); + }); + }); +}; + +// Changes the content of files with extension 'ext' +// in directory 'dir' recursively. +// Returns relative file paths +const changeDirExtFiles = function (dir, ext, newText) { + let filesChanged = []; + return getDirFilesToChange(dir, ext) + .then(function(filesWithExt) { + filesWithExt.forEach(function(file) { + fse.writeFile( + file, + newText, + { encoding: "utf-8" } + ); + filesChanged.push(path.relative(dir, file)); + }); + return filesChanged; + }) + .catch(function(err) { + throw new Error("Error getting files with extension .".concat(ext)); + }); +}; + +// 'times' to limit the number of iterations in the loop. +// 0 means no limit. +const loopingCheckoutHead = async function(repoPath, repo, times) { + const text0 = "Text0: changing content to trigger checkout"; + const text1 = "Text1: changing content to trigger checkout"; + + let iteration = 0; + for (let i = 0; true; i = ++i%2) { + const newText = (i == 0) ? text0 : text1; + const jsRelativeFilePahts = await changeDirExtFiles(repoPath, "js", newText); // jshint ignore:line + let checkoutOpts = { + checkoutStrategy: NodeGit.Checkout.STRATEGY.FORCE, + paths: jsRelativeFilePahts + }; + await NodeGit.Checkout.head(repo, checkoutOpts); + + if (++iteration == times) { + break; + } + } + return; +}; + +module.exports = loopingCheckoutHead; \ No newline at end of file diff --git a/test/utils/repository_setup.js b/test/utils/repository_setup.js index c5d6ab3e24..5a36bf7460 100644 --- a/test/utils/repository_setup.js +++ b/test/utils/repository_setup.js @@ -1,8 +1,7 @@ var assert = require("assert"); var NodeGit = require("../../"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var RepositorySetup = { addFileToIndex: @@ -49,14 +48,15 @@ var RepositorySetup = { }, createRepository: - function createRepository(repoPath){ + function createRepository(repoPath, isBare){ // Create a new repository in a clean directory return fse.remove(repoPath) .then(function() { return fse.ensureDir(repoPath); }) .then(function() { - return NodeGit.Repository.init(repoPath, 0); + var bare = typeof isBare !== "undefined" ? isBare : 0; + return NodeGit.Repository.init(repoPath, bare); }); }, diff --git a/test/utils/worker.js b/test/utils/worker.js new file mode 100644 index 0000000000..6f2d218408 --- /dev/null +++ b/test/utils/worker.js @@ -0,0 +1,38 @@ +const { + isMainThread, + parentPort, + workerData +} = require("worker_threads"); +const assert = require("assert"); +const NodeGit = require("../../"); + +if (isMainThread) { + throw new Error("Must be run via worker thread"); +} + +parentPort.postMessage("init"); + +const { clonePath, url } = workerData; +const opts = { + fetchOpts: { + callbacks: { + certificateCheck: () => 0 + } + } +}; + +let repository; +return NodeGit.Clone(url, clonePath, opts).then((_repository) => { + repository = _repository; + assert.ok(repository instanceof NodeGit.Repository); + return repository.index(); +}).then((index) => { + assert.ok(index instanceof NodeGit.Index); + return repository.getRemoteNames(); +}).then((remotes) => { + assert.ok(Array.isArray(remotes)); + return repository.getCurrentBranch(); +}).then((branch) => { + assert.ok(branch instanceof NodeGit.Reference); + parentPort.postMessage("success"); +}).catch(() => parentPort.postMessage("failure")); diff --git a/test/utils/worker_checkout.js b/test/utils/worker_checkout.js new file mode 100644 index 0000000000..adfb7aa7c7 --- /dev/null +++ b/test/utils/worker_checkout.js @@ -0,0 +1,51 @@ +const { + isMainThread, + parentPort, + workerData +} = require("worker_threads"); +const assert = require("assert"); +const NodeGit = require("../../"); +const loopingCheckoutHead = require("./loop_checkout.js"); + +if (isMainThread) { + throw new Error("Must be run via worker thread"); +} + +parentPort.postMessage("init"); + +const { clonePath, url } = workerData; +const cloneOpts = { + fetchOpts: { + callbacks: { + certificateCheck: () => 0 + } + } +}; + +let repository; +let filterName = "psuedo_filter"; +let applyCallbackResult = 1; + +return NodeGit.Clone(url, clonePath, cloneOpts) +.then(function(_repository) { + repository = _repository; + assert.ok(repository instanceof NodeGit.Repository); + return NodeGit.FilterRegistry.register(filterName, { + apply: function() { + applyCallbackResult = 0; + }, + check: function() { + return NodeGit.Error.CODE.OK; + } + }, 0); +}) +.then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + return loopingCheckoutHead(clonePath, repository, 0); +}).then(function() { + assert.strictEqual(applyCallbackResult, 0); + parentPort.postMessage("success"); +}) +.catch((err) => { + parentPort.postMessage("failure"); +}); \ No newline at end of file diff --git a/test/utils/worker_context_aware.js b/test/utils/worker_context_aware.js new file mode 100644 index 0000000000..b7784fdaef --- /dev/null +++ b/test/utils/worker_context_aware.js @@ -0,0 +1,74 @@ +const { + isMainThread, + parentPort, + workerData +} = require("worker_threads"); +const garbageCollect = require("./garbage_collect.js"); +const assert = require("assert"); +const NodeGit = require("../../"); +const { promisify } = require("util"); + +if (isMainThread) { + throw new Error("Must be run via worker thread"); +} + +const { clonePath, url } = workerData; +const opts = { + fetchOpts: { + callbacks: { + certificateCheck: () => 0 + } + } +}; + +let repository; +const oid = "fce88902e66c72b5b93e75bdb5ae717038b221f6"; + +return NodeGit.Clone(url, clonePath, opts) +.then((_repository) => { + repository = _repository; + assert.ok(repository instanceof NodeGit.Repository); + return repository.getCommit(oid); +}).then((commit) => { + assert.ok(commit instanceof NodeGit.Commit); + var historyCount = 0; + var history = commit.history(); + + history.on("commit", function(commit) { + // Number of commits is known to be higher than 200 + if (++historyCount == 200) { + // Tracked objects must work too when the Garbage Collector is triggered + garbageCollect(); + + // Count total of objects left after being created/destroyed + const freeingCount = + NodeGit.Cert.getNonSelfFreeingConstructedCount() + + NodeGit.Repository.getSelfFreeingInstanceCount() + + NodeGit.Commit.getSelfFreeingInstanceCount() + + NodeGit.Oid.getSelfFreeingInstanceCount() + + NodeGit.Revwalk.getSelfFreeingInstanceCount(); + + const numberOfTrackedObjects = NodeGit.getNumberOfTrackedObjects(); + + if (freeingCount === numberOfTrackedObjects) { + parentPort.postMessage("numbersMatch"); + } + else { + parentPort.postMessage("numbersDoNotMatch"); + } + } + }); + + history.on("end", function(commits) { + // Test should not get this far + parentPort.postMessage("failure"); + }); + + history.on("error", function(err) { + assert.ok(false); + }); + + history.start(); + + return promisify(setTimeout)(50000); +}).catch(() => parentPort.postMessage("failure")); \ No newline at end of file diff --git a/test/utils/worker_context_aware_checkout.js b/test/utils/worker_context_aware_checkout.js new file mode 100644 index 0000000000..6562915a49 --- /dev/null +++ b/test/utils/worker_context_aware_checkout.js @@ -0,0 +1,66 @@ +const { + isMainThread, + parentPort, + workerData +} = require("worker_threads"); +const garbageCollect = require("./garbage_collect.js"); +const assert = require("assert"); +const NodeGit = require("../../"); +const loopingCheckoutHead = require("./loop_checkout.js"); +const { promisify } = require("util"); + +if (isMainThread) { + throw new Error("Must be run via worker thread"); +} + +const { clonePath, url } = workerData; +const cloneOpts = { + fetchOpts: { + callbacks: { + certificateCheck: () => 0 + } + } +}; + +let repository; +let filterName = "psuedo_filter"; +let applyCallbackResult = 1; + +return NodeGit.Clone(url, clonePath, cloneOpts) +.then(function(_repository) { + repository = _repository; + assert.ok(repository instanceof NodeGit.Repository); + return NodeGit.FilterRegistry.register(filterName, { + apply: function() { + applyCallbackResult = 0; + }, + check: function() { + return NodeGit.Error.CODE.OK; + } + }, 0); +}) +.then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + return loopingCheckoutHead(clonePath, repository, 10); +}).then(function() { + assert.strictEqual(applyCallbackResult, 0); + // Tracked objects must work too when the Garbage Collector is triggered + garbageCollect(); + + // Count total of objects left after being created/destroyed + const freeingCount = + NodeGit.Cert.getNonSelfFreeingConstructedCount() + + NodeGit.FilterSource.getNonSelfFreeingConstructedCount() + + NodeGit.Buf.getNonSelfFreeingConstructedCount() + + NodeGit.Repository.getSelfFreeingInstanceCount(); + + const numberOfTrackedObjects = NodeGit.getNumberOfTrackedObjects(); + + if (freeingCount === numberOfTrackedObjects) { + parentPort.postMessage("numbersMatch"); + } + else { + parentPort.postMessage("numbersDoNotMatch"); + } + return promisify(setTimeout)(50000); +}).catch((err) => parentPort.postMessage("failure")); \ No newline at end of file diff --git a/utils/README.md b/utils/README.md new file mode 100644 index 0000000000..cf046f05b8 --- /dev/null +++ b/utils/README.md @@ -0,0 +1,9 @@ +## /utils + + Contains utilities for NodeGit + + #### buildFlags + Determines how NodeGit should build. Use `BUILD_ONLY` environment variable to build from source. + + ## acquireOpenSSL + Download and compile OpenSSL. diff --git a/utils/acquireOpenSSL.mjs b/utils/acquireOpenSSL.mjs new file mode 100644 index 0000000000..930b5ab33c --- /dev/null +++ b/utils/acquireOpenSSL.mjs @@ -0,0 +1,488 @@ +import crypto from "crypto"; +import { spawn } from "child_process"; +import execPromise from "./execPromise.js"; +import got from "got"; +import path from "path"; +import stream from "stream"; +import tar from "tar-fs"; +import zlib from "zlib"; +import { createWriteStream, promises as fs } from "fs"; +import { performance } from "perf_hooks"; +import { promisify } from "util"; + +import { hostArch, targetArch } from "./buildFlags.js"; + +const pipeline = promisify(stream.pipeline); + +import packageJson from '../package.json' with { type: "json" }; + +const OPENSSL_VERSION = "3.0.18"; +const win32BatPath = path.join(import.meta.dirname, "build-openssl.bat"); +const vendorPath = path.resolve(import.meta.dirname, "..", "vendor"); +const opensslPatchPath = path.join(vendorPath, "patches", "openssl"); +const extractPath = path.join(vendorPath, "openssl"); + +const exists = (filePath) => fs.stat(filePath).then(() => true).catch(() => false); + +const pathsToIncludeForPackage = [ + "include", "lib" +]; + +const getOpenSSLSourceUrl = (version) => `https://www.openssl.org/source/openssl-${version}.tar.gz`; +const getOpenSSLSourceSha256Url = (version) => `${getOpenSSLSourceUrl(version)}.sha256`; + +class HashVerify extends stream.Transform { + constructor(algorithm, onFinal) { + super(); + this.onFinal = onFinal; + this.hash = crypto.createHash(algorithm); + } + + _transform(chunk, encoding, callback) { + this.hash.update(chunk, encoding); + callback(null, chunk); + } + + _final(callback) { + const digest = this.hash.digest("hex"); + const onFinalResult = this.onFinal(digest); + callback(onFinalResult); + } +} + +const makeHashVerifyOnFinal = (expected) => (digest) => { + const digestOk = digest === expected; + return digestOk + ? null + : new Error(`Digest not OK: ${digest} !== ${this.expected}`); +}; + +// currently this only needs to be done on linux +const applyOpenSSLPatches = async (buildCwd, operatingSystem) => { + try { + await fs.access(opensslPatchPath); + + for (const patchFilename of await fs.readdir(opensslPatchPath)) { + const patchTarget = patchFilename.split("-")[1]; + if (patchFilename.split(".").pop() === "patch" && (patchTarget === operatingSystem || patchTarget === "all")) { + console.log(`applying ${patchFilename}`); + await execPromise(`patch -up0 -i ${path.join(opensslPatchPath, patchFilename)}`, { + cwd: buildCwd + }, { pipeOutput: true }); + } + } + } catch(e) { + if (e.code === "ENOENT") { + // no patches to apply + return; + } + + console.log("Patch application failed: ", e); + throw e; + } +} + +const buildDarwin = async (buildCwd, macOsDeploymentTarget) => { + if (!macOsDeploymentTarget) { + throw new Error("Expected macOsDeploymentTarget to be specified"); + } + + const buildConfig = targetArch === "x64" ? "darwin64-x86_64-cc" : "darwin64-arm64-cc"; + + const configureArgs = [ + buildConfig, + // speed up ecdh on little-endian platforms with 128bit int support + "enable-ec_nistp_64_gcc_128", + // compile static libraries + "no-shared", + // disable ssl2, ssl3, and compression + "no-ssl2", + "no-ssl3", + "no-comp", + // disable tty ui since it fails a bunch of tests on GHA runners and we're just gonna link anyways + "no-ui-console", + // set install directory + `--prefix="${extractPath}"`, + `--openssldir="${extractPath}"`, + // set macos version requirement + `-mmacosx-version-min=${macOsDeploymentTarget}` + ]; + + await execPromise(`./Configure ${configureArgs.join(" ")}`, { + cwd: buildCwd + }, { pipeOutput: true }); + + await applyOpenSSLPatches(buildCwd, "darwin"); + + // only build the libraries, not the fuzzer or apps + await execPromise("make build_libs", { + cwd: buildCwd + }, { pipeOutput: true }); + + await execPromise("make test", { + cwd: buildCwd + }, { pipeOutput: true }); + + await execPromise("make install_sw", { + cwd: buildCwd, + maxBuffer: 10 * 1024 * 1024 // we should really just use spawn + }, { pipeOutput: true }); +}; + +const buildLinux = async (buildCwd) => { + const buildConfig = targetArch === "x64" ? "linux-x86_64" : "linux-aarch64"; + + const configureArgs = [ + buildConfig, + // disable ssl3, and compression + "no-ssl3", + "no-comp", + // set install directory + `--prefix="${extractPath}"`, + `--openssldir="${extractPath}"`, + "--libdir=lib", + ]; + await execPromise(`./Configure ${configureArgs.join(" ")}`, { + cwd: buildCwd + }, { pipeOutput: true }); + + await applyOpenSSLPatches(buildCwd, "linux"); + + // only build the libraries, not the fuzzer or apps + await execPromise("make build_libs", { + cwd: buildCwd, + maxBuffer: 10 * 1024 * 1024 + }, { pipeOutput: true }); + + if (hostArch === targetArch) { + await execPromise("make test", { + cwd: buildCwd, + maxBuffer: 10 * 1024 * 1024 + }, { pipeOutput: true }); + } + + // only install software, not the docs + await execPromise("make install_sw", { + cwd: buildCwd, + maxBuffer: 10 * 1024 * 1024 // we should really just use spawn + }, { pipeOutput: true }); +}; + +const buildWin32 = async (buildCwd) => { + let vcvarsallPath = undefined; + + if (process.env.npm_config_vcvarsall_path && await exists(process.env.npm_config_vcvarsall_path)) { + vcvarsallPath = process.env.npm_config_vcvarsall_path; + } else { + const potentialMsvsPaths = []; + + // GYP_MSVS_OVERRIDE_PATH is set by node-gyp so this should cover most cases + if (process.env.GYP_MSVS_OVERRIDE_PATH) { + potentialMsvsPaths.push(process.env.GYP_MSVS_OVERRIDE_PATH); + } + + const packageTypes = ["BuildTools", "Community", "Professional", "Enterprise"]; + const versions = ["2022", "2019"] + + const computePossiblePaths = (parentPath) => { + let possiblePaths = [] + for (const packageType of packageTypes) { + for (const version of versions) { + possiblePaths.push(path.join(parentPath, version, packageType)); + } + } + + return possiblePaths; + } + + if (process.env["ProgramFiles(x86)"]) { + const parentPath = path.join(process.env["ProgramFiles(x86)"], 'Microsoft Visual Studio'); + potentialMsvsPaths.push(...computePossiblePaths(parentPath)); + } + + if (process.env.ProgramFiles) { + const parentPath = path.join(process.env.ProgramFiles, 'Microsoft Visual Studio'); + potentialMsvsPaths.push(...computePossiblePaths(parentPath)); + } + + for (const potentialPath of potentialMsvsPaths) { + const wholePath = path.join(potentialPath, 'VC', 'Auxiliary', 'Build', 'vcvarsall.bat'); + console.log("checking", wholePath); + if (await exists(wholePath)) { + vcvarsallPath = wholePath; + break; + } + } + + if (!vcvarsallPath) { + throw new Error(`vcvarsall.bat not found`); + } + } + + let vcTarget; + switch (targetArch) { + case "x64": + vcTarget = "VC-WIN64A"; + break; + + case "x86": + vcTarget = "VC-WIN32"; + break; + + case "arm64": + vcTarget = "VC-WIN64-ARM"; + break; + } + + let vsBuildArch = hostArch === targetArch + ? hostArch + : `${hostArch}_${targetArch}`; + + console.log("Using vcvarsall.bat at: ", vcvarsallPath); + console.log("Using vsBuildArch: ", vsBuildArch); + console.log("Using vcTarget: ", vcTarget); + + await new Promise((resolve, reject) => { + const buildProcess = spawn(`"${win32BatPath}" "${vcvarsallPath}" ${vsBuildArch} ${vcTarget}`, { + cwd: buildCwd, + shell: process.platform === "win32", + env: { + ...process.env, + NODEGIT_SKIP_TESTS: targetArch !== hostArch ? "1" : undefined + } + }); + + buildProcess.stdout.on("data", function(data) { + console.info(data.toString().trim()); + }); + + buildProcess.stderr.on("data", function(data) { + console.error(data.toString().trim()); + }); + + buildProcess.on("close", function(code) { + if (!code) { + resolve(); + } else { + reject(code); + } + }); + }); + + +}; + +const removeOpenSSLIfOudated = async (openSSLVersion) => { + try { + let openSSLResult; + try { + const openSSLPath = path.join(extractPath, "bin", "openssl"); + openSSLResult = await execPromise(`${openSSLPath} version`); + } catch { + /* if we fail to get the version, assume removal not required */ + } + + if (!openSSLResult) { + return; + } + + const versionMatch = openSSLResult.match(/^OpenSSL (\d\.\d\.\d[a-z]*)/); + const installedVersion = versionMatch && versionMatch[1]; + if (!installedVersion || installedVersion === openSSLVersion) { + return; + } + + console.log("Removing outdated OpenSSL at: ", extractPath); + await fs.rm(extractPath, { recursive: true, force: true }); + console.log("Outdated OpenSSL removed."); + } catch (err) { + console.log("Remove outdated OpenSSL failed: ", err); + } +}; + +const makeOnStreamDownloadProgress = () => { + let lastReport = performance.now(); + return ({ percent, transferred, total }) => { + const currentTime = performance.now(); + if (currentTime - lastReport > 1 * 1000) { + lastReport = currentTime; + console.log(`progress: ${transferred}/${total} (${(percent * 100).toFixed(2)}%)`) + } + }; +}; + +const buildOpenSSLIfNecessary = async ({ + macOsDeploymentTarget, + openSSLVersion +}) => { + if (process.platform !== "darwin" && process.platform !== "win32" && process.platform !== "linux") { + console.log(`Skipping OpenSSL build, not required on ${process.platform}`); + return; + } + + await removeOpenSSLIfOudated(openSSLVersion); + + try { + await fs.stat(extractPath); + console.log("Skipping OpenSSL build, dir exists"); + return; + } catch {} + + const openSSLUrl = getOpenSSLSourceUrl(openSSLVersion); + const openSSLSha256Url = getOpenSSLSourceSha256Url(openSSLVersion); + + const openSSLSha256 = (await got(openSSLSha256Url)).body.trim().split(' ')[0]; + + const downloadStream = got.stream(openSSLUrl); + downloadStream.on("downloadProgress", makeOnStreamDownloadProgress()); + + await pipeline( + downloadStream, + new HashVerify("sha256", makeHashVerifyOnFinal(openSSLSha256)), + zlib.createGunzip(), + tar.extract(extractPath) + ); + + console.log(`OpenSSL ${openSSLVersion} download + extract complete: SHA256 OK.`); + + const buildCwd = path.join(extractPath, `openssl-${openSSLVersion}`); + + if (process.platform === "darwin") { + await buildDarwin(buildCwd, macOsDeploymentTarget); + } else if (process.platform === "linux") { + await buildLinux(buildCwd); + } else if (process.platform === "win32") { + await buildWin32(buildCwd); + } else { + throw new Error(`Unknown platform: ${process.platform}`); + } + + console.log("Build finished."); +} + +const downloadOpenSSLIfNecessary = async ({ + downloadBinUrl, + maybeDownloadSha256, + maybeDownloadSha256Url +}) => { + if (process.platform !== "darwin" && process.platform !== "win32" && process.platform !== "linux") { + console.log(`Skipping OpenSSL download, not required on ${process.platform}`); + return; + } + + try { + await fs.stat(extractPath); + console.log("Skipping OpenSSL download, dir exists"); + return; + } catch {} + + if (maybeDownloadSha256Url) { + maybeDownloadSha256 = (await got(maybeDownloadSha256Url)).body.trim(); + } + + const downloadStream = got.stream(downloadBinUrl); + downloadStream.on("downloadProgress", makeOnStreamDownloadProgress()); + + const pipelineSteps = [ + downloadStream, + maybeDownloadSha256 + ? new HashVerify("sha256", makeHashVerifyOnFinal(maybeDownloadSha256)) + : null, + zlib.createGunzip(), + tar.extract(extractPath) + ].filter(step => step !== null); + await pipeline( + ...pipelineSteps + ); + + console.log(`OpenSSL download + extract complete${maybeDownloadSha256 ? ": SHA256 OK." : "."}`); + console.log("Download finished."); +} + +export const getOpenSSLPackageName = () => { + return `openssl-${OPENSSL_VERSION}-${process.platform}-${targetArch}.tar.gz`; +} + +export const getOpenSSLPackagePath = () => path.join(import.meta.dirname, getOpenSSLPackageName()); + +const getOpenSSLPackageUrl = () => { + const hostUrl = new URL(packageJson.binary.host); + hostUrl.pathname = getOpenSSLPackageName(); + return hostUrl.toString(); +}; + +const buildPackage = async () => { + let resolve, reject; + const promise = new Promise((_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }); + await pipeline( + tar.pack(extractPath, { + entries: pathsToIncludeForPackage, + ignore: (name) => { + // Ignore pkgconfig files + return path.extname(name) === ".pc" + || path.basename(name) === "pkgconfig"; + }, + dmode: 0o0755, + fmode: 0o0644 + }), + zlib.createGzip(), + new HashVerify("sha256", (digest) => { + resolve(digest); + }), + createWriteStream(getOpenSSLPackagePath()) + ); + const digest = await promise; + await fs.writeFile(`${getOpenSSLPackagePath()}.sha256`, digest); +}; + +const acquireOpenSSL = async () => { + try { + const downloadBinUrl = process.env.npm_config_openssl_bin_url + || (['win32', 'darwin'].includes(process.platform) ? getOpenSSLPackageUrl() : undefined); + if (downloadBinUrl && downloadBinUrl !== 'skip' && !process.env.NODEGIT_OPENSSL_BUILD_PACKAGE) { + const downloadOptions = { downloadBinUrl }; + if (process.env.npm_config_openssl_bin_sha256 !== 'skip') { + if (process.env.npm_config_openssl_bin_sha256) { + downloadOptions.maybeDownloadSha256 = process.env.npm_config_openssl_bin_sha256; + } else { + downloadOptions.maybeDownloadSha256Url = `${getOpenSSLPackageUrl()}.sha256`; + } + } + + await downloadOpenSSLIfNecessary(downloadOptions); + return; + } + + let macOsDeploymentTarget; + if (process.platform === "darwin") { + macOsDeploymentTarget = process.argv[2] ?? process.env.OPENSSL_MACOS_DEPLOYMENT_TARGET + if (!macOsDeploymentTarget || !macOsDeploymentTarget.match(/\d+\.\d+/)) { + throw new Error(`Invalid macOsDeploymentTarget: ${macOsDeploymentTarget}`); + } + } + + await buildOpenSSLIfNecessary({ + openSSLVersion: OPENSSL_VERSION, + macOsDeploymentTarget + }); + if (process.env.NODEGIT_OPENSSL_BUILD_PACKAGE) { + await buildPackage(); + } + } catch (err) { + console.error("Acquire failed: ", err); + process.exit(1); + } +}; + +if (process.argv[1] === import.meta.filename) { + try { + await acquireOpenSSL(); + } + catch(error) { + console.error("Acquire OpenSSL failed: ", error); + process.exit(1); + } +} diff --git a/utils/build-openssl.bat b/utils/build-openssl.bat new file mode 100644 index 0000000000..af8063d7c4 --- /dev/null +++ b/utils/build-openssl.bat @@ -0,0 +1,22 @@ +rem Build OpenSSL for Windows +rem %1 - path to vcvarsall.bat +rem %2 - architecture argument for vcvarsall.bat +rem %3 - OpenSSL Configure target + +@call %1 %2 + +perl .\Configure %3 no-shared no-ssl2 no-ssl3 no-comp --prefix="%cd%\.." --openssldir="%cd%\.." || goto :error + +nmake || goto :error + +if "%NODEGIT_SKIP_TESTS%" NEQ "1" ( + nmake test || goto :error +) + +nmake install || goto :error + +goto :EOF + +:error +echo Failed with error #%errorlevel%. +exit /b %errorlevel% \ No newline at end of file diff --git a/utils/buildFlags.js b/utils/buildFlags.js index 3c3d9d9b21..7ea87428ba 100644 --- a/utils/buildFlags.js +++ b/utils/buildFlags.js @@ -10,7 +10,29 @@ try { isGitRepo = false; } +const convertArch = (archStr) => { + const convertedArch = { + 'ia32': 'x86', + 'x86': 'x86', + 'x64': 'x64', + 'arm64': 'arm64' + }[archStr]; + + if (!convertedArch) { + throw new Error('unsupported architecture'); + } + + return convertedArch; +} + +const hostArch = convertArch(process.arch); +const targetArch = process.env.npm_config_arch + ? convertArch(process.env.npm_config_arch) + : hostArch; + module.exports = { + hostArch, + targetArch, debugBuild: !!process.env.BUILD_DEBUG, isElectron: process.env.npm_config_runtime === "electron", isGitRepo: isGitRepo, diff --git a/utils/configureLibssh2.js b/utils/configureLibssh2.js new file mode 100644 index 0000000000..95fd5d3649 --- /dev/null +++ b/utils/configureLibssh2.js @@ -0,0 +1,57 @@ +var cp = require("child_process"); +var fse = require("fs-extra"); +var path = require("path"); + +const { hostArch, targetArch } = require("./buildFlags"); + +const opensslVendorDirectory = path.resolve(__dirname, "..", "vendor", "openssl"); +const libssh2VendorDirectory = path.resolve(__dirname, "..", "vendor", "libssh2"); +const libssh2ConfigureScript = path.join(libssh2VendorDirectory, "configure"); +const libssh2StaticConfigDirectory = path.resolve(__dirname, "..", "vendor", "static_config", "libssh2"); + +module.exports = function retrieveExternalDependencies() { + console.info("[nodegit] Configuring libssh2."); + + // Copy Windows / Mac preconfigured files + if (process.platform === "win32" || process.platform === "darwin") { + return fse.copy( + path.join(libssh2StaticConfigDirectory, process.platform), + path.join(libssh2VendorDirectory, "src") + ); + } + + // Run the `configure` script on Linux + let cpArgs = ` --with-libssl-prefix=${opensslVendorDirectory}`; + + const archConfigMap = { + 'x64': 'x86_64-linux-gnu', + 'arm64': 'aarch64-linux-gnu' + }; + + cpArgs += ` --build=${archConfigMap[hostArch]}`; + cpArgs += ` --host=${archConfigMap[targetArch]}`; + + return new Promise(function(resolve, reject) { + cp.exec( + `${libssh2ConfigureScript}${cpArgs}`, + { + cwd: libssh2VendorDirectory + }, + function(err, stdout, stderr) { + if (err) { + console.error(err); + console.error(stderr); + reject(err, stderr); + } + else { + resolve(stdout); + } + } + ); + }); +}; + +// Called on the command line +if (require.main === module) { + module.exports(); +} diff --git a/utils/defaultCxxStandard.js b/utils/defaultCxxStandard.js new file mode 100644 index 0000000000..5a7d7beb5a --- /dev/null +++ b/utils/defaultCxxStandard.js @@ -0,0 +1,24 @@ +const targetSpecified = process.argv[2] !== 'none'; + +let cxxStandard = '14'; + +if (targetSpecified) { + // Assume electron if target is specified. + // If building node 18 / 19 via target, will need to specify C++ standard manually + const majorVersion = process.argv[2].split('.')[0]; + if (Number.parseInt(majorVersion) >= 32) { + cxxStandard = '20'; + } else if (Number.parseInt(majorVersion) >= 21) { + cxxStandard = '17'; + } +} else { + const abiVersion = Number.parseInt(process.versions.modules) ?? 0; + // Node 18 === 108 + if (abiVersion >= 131) { + cxxStandard = '20'; + } else if (abiVersion >= 108) { + cxxStandard = '17'; + } +} + +process.stdout.write(cxxStandard); diff --git a/utils/execPromise.js b/utils/execPromise.js index c186a12bcc..acdc785ec6 100644 --- a/utils/execPromise.js +++ b/utils/execPromise.js @@ -3,9 +3,9 @@ var cp = require('child_process'); // We have to manually promisify this because at this is required in lifecycle // methods and we are not guaranteed that any 3rd party packages are installed // at this point -module.exports = function(command, opts) { +module.exports = function(command, opts, extraOpts = {}) { return new Promise(function(resolve, reject) { - return cp.exec(command, opts, function(err, result) { + const childProcess = cp.exec(command, opts, function(err, result) { if (err) { reject(err); } @@ -13,5 +13,12 @@ module.exports = function(command, opts) { resolve(result); } }); + + if (extraOpts.pipeOutput) { + childProcess.stdout.pipe(process.stdout); + childProcess.stderr.pipe(process.stderr); + } + + return childProcess; }); }; diff --git a/utils/getElectronOpenSSLRoot.js b/utils/getElectronOpenSSLRoot.js new file mode 100644 index 0000000000..a8ccc09b7b --- /dev/null +++ b/utils/getElectronOpenSSLRoot.js @@ -0,0 +1,10 @@ +const path = require("path"); + +if (process.argv.length < 3) { + process.exit(1); +} + +const [, , moduleRootDir] = process.argv; + +const openSSLRoot = process.env.npm_config_openssl_dir || path.join(moduleRootDir, 'vendor', 'openssl'); +process.stdout.write(openSSLRoot); diff --git a/utils/isBuildingForElectron.js b/utils/isBuildingForElectron.js new file mode 100644 index 0000000000..295f6ab1fb --- /dev/null +++ b/utils/isBuildingForElectron.js @@ -0,0 +1,30 @@ +const fs = require("fs") +const JSON5 = require("json5"); +const path = require("path"); + +if (process.argv.length < 3) { + process.exit(1); +} + +const last = arr => arr[arr.length - 1]; +const [, , nodeRootDir] = process.argv; + +let isElectron = last(nodeRootDir.split(path.sep)).startsWith("iojs"); + +if (!isElectron) { + try { + // Not ideal, would love it if there were a full featured gyp package to do this operation instead. + const { variables: { built_with_electron } } = JSON5.parse( + fs.readFileSync( + path.resolve(nodeRootDir, "include", "node", "config.gypi"), + "utf8" + ) + ); + + if (built_with_electron) { + isElectron = true; + } + } catch (e) {} +} + +process.stdout.write(isElectron ? "1" : "0"); diff --git a/utils/retry.js b/utils/retry.js new file mode 100644 index 0000000000..c7a57fb065 --- /dev/null +++ b/utils/retry.js @@ -0,0 +1,51 @@ +const { spawn } = require('child_process'); + +const [, , cmd, ...args] = process.argv; +if (!cmd) { + process.exit(-1); +} + +const once = (fn) => { + let runOnce = false; + return (...args) => { + if (runOnce) { + return; + } + + runOnce = true; + fn(...args); + } +}; + +const retry = (numRetries = 3) => { + const child = spawn(cmd, args, { + shell: process.platform === 'win32', + stdio: [0, 'pipe', 'pipe'] + }); + + child.setMaxListeners(0); + + child.stdout.setEncoding('utf8'); + child.stderr.setEncoding('utf8'); + + child.stdout.pipe(process.stdout); + child.stderr.pipe(process.stderr); + + const cleanupAndExit = once((error, status) => { + child.kill(); + if (numRetries > 0 && (error || status !== 0)) { + retry(numRetries - 1); + } else if (error) { + console.log(error); + process.exit(-1); + } else { + process.exit(status); + } + }); + const onClose = status => cleanupAndExit(null, status); + + child.on('close', onClose); + child.on('error', cleanupAndExit); +}; + +retry(); diff --git a/utils/uploadOpenSSL.mjs b/utils/uploadOpenSSL.mjs new file mode 100644 index 0000000000..5de760462e --- /dev/null +++ b/utils/uploadOpenSSL.mjs @@ -0,0 +1,32 @@ +import aws from 'aws-sdk'; +import fs from "fs"; +import path from "path"; + +import pkgJson from '../package.json' with { type: "json" }; +import { getOpenSSLPackagePath, getOpenSSLPackageName } from './acquireOpenSSL.mjs'; + +const s3 = new aws.S3(); + +const uploadBinaryToS3 = (fileName, bucketName, pathToFile) => + s3.upload({ + Body: fs.createReadStream(pathToFile), + Bucket: bucketName, + Key: fileName, + ACL: "public-read" + }).promise(); + +export const uploadOpenSSL = async () => { + const packageName = path.basename(getOpenSSLPackageName()); + const packagePath = getOpenSSLPackagePath(); + console.log(`Uploading ${packagePath} to s3://${pkgJson.binary.bucket_name}/${packageName}`); + await uploadBinaryToS3(packageName, pkgJson.binary.bucket_name, packagePath); + const sha256PackageName = `${packageName}.sha256`; + await uploadBinaryToS3(sha256PackageName, pkgJson.binary.bucket_name, `${packagePath}.sha256`); +}; + +if (process.argv[1] === import.meta.filename) { + uploadOpenSSL().catch((error) => { + console.error('Push to S3 failed: ', error); + process.exit(1); + }); +} diff --git a/vendor/http_parser b/vendor/http_parser new file mode 160000 index 0000000000..39c2c1e573 --- /dev/null +++ b/vendor/http_parser @@ -0,0 +1 @@ +Subproject commit 39c2c1e5733eb2cb7397a370cf50508ea1214bf7 diff --git a/vendor/http_parser/.gitignore b/vendor/http_parser/.gitignore deleted file mode 100644 index 32cb51b2d3..0000000000 --- a/vendor/http_parser/.gitignore +++ /dev/null @@ -1,28 +0,0 @@ -/out/ -core -tags -*.o -test -test_g -test_fast -bench -url_parser -parsertrace -parsertrace_g -*.mk -*.Makefile -*.so.* -*.a - - -# Visual Studio uglies -*.suo -*.sln -*.vcxproj -*.vcxproj.filters -*.vcxproj.user -*.opensdf -*.ncrunchsolution* -*.sdf -*.vsp -*.psess diff --git a/vendor/http_parser/.mailmap b/vendor/http_parser/.mailmap deleted file mode 100644 index 278d141263..0000000000 --- a/vendor/http_parser/.mailmap +++ /dev/null @@ -1,8 +0,0 @@ -# update AUTHORS with: -# git log --all --reverse --format='%aN <%aE>' | perl -ne 'BEGIN{print "# Authors ordered by first contribution.\n"} print unless $h{$_}; $h{$_} = 1' > AUTHORS -Ryan Dahl -Salman Haq -Simon Zimmermann -Thomas LE ROUX LE ROUX Thomas -Thomas LE ROUX Thomas LE ROUX -Fedor Indutny diff --git a/vendor/http_parser/.travis.yml b/vendor/http_parser/.travis.yml deleted file mode 100644 index 4b038e6e62..0000000000 --- a/vendor/http_parser/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: c - -compiler: - - clang - - gcc - -script: - - "make" - -notifications: - email: false - irc: - - "irc.freenode.net#node-ci" diff --git a/vendor/http_parser/AUTHORS b/vendor/http_parser/AUTHORS deleted file mode 100644 index 8e2df1d06e..0000000000 --- a/vendor/http_parser/AUTHORS +++ /dev/null @@ -1,67 +0,0 @@ -# Authors ordered by first contribution. -Ryan Dahl -Jeremy Hinegardner -Sergey Shepelev -Joe Damato -tomika -Phoenix Sol -Cliff Frey -Ewen Cheslack-Postava -Santiago Gala -Tim Becker -Jeff Terrace -Ben Noordhuis -Nathan Rajlich -Mark Nottingham -Aman Gupta -Tim Becker -Sean Cunningham -Peter Griess -Salman Haq -Cliff Frey -Jon Kolb -Fouad Mardini -Paul Querna -Felix Geisendörfer -koichik -Andre Caron -Ivo Raisr -James McLaughlin -David Gwynne -Thomas LE ROUX -Randy Rizun -Andre Louis Caron -Simon Zimmermann -Erik Dubbelboer -Martell Malone -Bertrand Paquet -BogDan Vatra -Peter Faiman -Corey Richardson -Tóth Tamás -Cam Swords -Chris Dickinson -Uli Köhler -Charlie Somerville -Patrik Stutz -Fedor Indutny -runner -Alexis Campailla -David Wragg -Vinnie Falco -Alex Butum -Rex Feng -Alex Kocharin -Mark Koopman -Helge Heß -Alexis La Goutte -George Miroshnykov -Maciej Małecki -Marc O'Morain -Jeff Pinner -Timothy J Fontaine -Akagi201 -Romain Giraud -Jay Satiro -Arne Steen -Kjell Schubert diff --git a/vendor/http_parser/LICENSE-MIT b/vendor/http_parser/LICENSE-MIT deleted file mode 100644 index 58010b3889..0000000000 --- a/vendor/http_parser/LICENSE-MIT +++ /dev/null @@ -1,23 +0,0 @@ -http_parser.c is based on src/http/ngx_http_parse.c from NGINX copyright -Igor Sysoev. - -Additional changes are licensed under the same terms as NGINX and -copyright Joyent, Inc. and other Node contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/vendor/http_parser/Makefile b/vendor/http_parser/Makefile deleted file mode 100644 index 373709c667..0000000000 --- a/vendor/http_parser/Makefile +++ /dev/null @@ -1,136 +0,0 @@ -# Copyright Joyent, Inc. and other Node contributors. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. - -PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"') -SONAME ?= libhttp_parser.so.2.5.0 - -CC?=gcc -AR?=ar - -CPPFLAGS ?= -LDFLAGS ?= - -CPPFLAGS += -I. -CPPFLAGS_DEBUG = $(CPPFLAGS) -DHTTP_PARSER_STRICT=1 -CPPFLAGS_DEBUG += $(CPPFLAGS_DEBUG_EXTRA) -CPPFLAGS_FAST = $(CPPFLAGS) -DHTTP_PARSER_STRICT=0 -CPPFLAGS_FAST += $(CPPFLAGS_FAST_EXTRA) -CPPFLAGS_BENCH = $(CPPFLAGS_FAST) - -CFLAGS += -Wall -Wextra -Werror -CFLAGS_DEBUG = $(CFLAGS) -O0 -g $(CFLAGS_DEBUG_EXTRA) -CFLAGS_FAST = $(CFLAGS) -O3 $(CFLAGS_FAST_EXTRA) -CFLAGS_BENCH = $(CFLAGS_FAST) -Wno-unused-parameter -CFLAGS_LIB = $(CFLAGS_FAST) -fPIC - -LDFLAGS_LIB = $(LDFLAGS) -shared - -INSTALL ?= install -PREFIX ?= $(DESTDIR)/usr/local -LIBDIR = $(PREFIX)/lib -INCLUDEDIR = $(PREFIX)/include - -ifneq (darwin,$(PLATFORM)) -# TODO(bnoordhuis) The native SunOS linker expects -h rather than -soname... -LDFLAGS_LIB += -Wl,-soname=$(SONAME) -endif - -test: test_g test_fast - ./test_g - ./test_fast - -test_g: http_parser_g.o test_g.o - $(CC) $(CFLAGS_DEBUG) $(LDFLAGS) http_parser_g.o test_g.o -o $@ - -test_g.o: test.c http_parser.h Makefile - $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) -c test.c -o $@ - -http_parser_g.o: http_parser.c http_parser.h Makefile - $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) -c http_parser.c -o $@ - -test_fast: http_parser.o test.o http_parser.h - $(CC) $(CFLAGS_FAST) $(LDFLAGS) http_parser.o test.o -o $@ - -test.o: test.c http_parser.h Makefile - $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c test.c -o $@ - -bench: http_parser.o bench.o - $(CC) $(CFLAGS_BENCH) $(LDFLAGS) http_parser.o bench.o -o $@ - -bench.o: bench.c http_parser.h Makefile - $(CC) $(CPPFLAGS_BENCH) $(CFLAGS_BENCH) -c bench.c -o $@ - -http_parser.o: http_parser.c http_parser.h Makefile - $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c http_parser.c - -test-run-timed: test_fast - while(true) do time ./test_fast > /dev/null; done - -test-valgrind: test_g - valgrind ./test_g - -libhttp_parser.o: http_parser.c http_parser.h Makefile - $(CC) $(CPPFLAGS_FAST) $(CFLAGS_LIB) -c http_parser.c -o libhttp_parser.o - -library: libhttp_parser.o - $(CC) $(LDFLAGS_LIB) -o $(SONAME) $< - -package: http_parser.o - $(AR) rcs libhttp_parser.a http_parser.o - -url_parser: http_parser.o contrib/url_parser.c - $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o $@ - -url_parser_g: http_parser_g.o contrib/url_parser.c - $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o $@ - -parsertrace: http_parser.o contrib/parsertrace.c - $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o parsertrace - -parsertrace_g: http_parser_g.o contrib/parsertrace.c - $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o parsertrace_g - -tags: http_parser.c http_parser.h test.c - ctags $^ - -install: library - $(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h - $(INSTALL) -D $(SONAME) $(LIBDIR)/$(SONAME) - ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.so - -install-strip: library - $(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h - $(INSTALL) -D -s $(SONAME) $(LIBDIR)/$(SONAME) - ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.so - -uninstall: - rm $(INCLUDEDIR)/http_parser.h - rm $(LIBDIR)/$(SONAME) - rm $(LIBDIR)/libhttp_parser.so - -clean: - rm -f *.o *.a tags test test_fast test_g \ - http_parser.tar libhttp_parser.so.* \ - url_parser url_parser_g parsertrace parsertrace_g - -contrib/url_parser.c: http_parser.h -contrib/parsertrace.c: http_parser.h - -.PHONY: clean package test-run test-run-timed test-valgrind install install-strip uninstall diff --git a/vendor/http_parser/README.md b/vendor/http_parser/README.md deleted file mode 100644 index 7c54dd42d0..0000000000 --- a/vendor/http_parser/README.md +++ /dev/null @@ -1,183 +0,0 @@ -HTTP Parser -=========== - -[![Build Status](https://travis-ci.org/joyent/http-parser.png?branch=master)](https://travis-ci.org/joyent/http-parser) - -This is a parser for HTTP messages written in C. It parses both requests and -responses. The parser is designed to be used in performance HTTP -applications. It does not make any syscalls nor allocations, it does not -buffer data, it can be interrupted at anytime. Depending on your -architecture, it only requires about 40 bytes of data per message -stream (in a web server that is per connection). - -Features: - - * No dependencies - * Handles persistent streams (keep-alive). - * Decodes chunked encoding. - * Upgrade support - * Defends against buffer overflow attacks. - -The parser extracts the following information from HTTP messages: - - * Header fields and values - * Content-Length - * Request method - * Response status code - * Transfer-Encoding - * HTTP version - * Request URL - * Message body - - -Usage ------ - -One `http_parser` object is used per TCP connection. Initialize the struct -using `http_parser_init()` and set the callbacks. That might look something -like this for a request parser: -```c -http_parser_settings settings; -settings.on_url = my_url_callback; -settings.on_header_field = my_header_field_callback; -/* ... */ - -http_parser *parser = malloc(sizeof(http_parser)); -http_parser_init(parser, HTTP_REQUEST); -parser->data = my_socket; -``` - -When data is received on the socket execute the parser and check for errors. - -```c -size_t len = 80*1024, nparsed; -char buf[len]; -ssize_t recved; - -recved = recv(fd, buf, len, 0); - -if (recved < 0) { - /* Handle error. */ -} - -/* Start up / continue the parser. - * Note we pass recved==0 to signal that EOF has been received. - */ -nparsed = http_parser_execute(parser, &settings, buf, recved); - -if (parser->upgrade) { - /* handle new protocol */ -} else if (nparsed != recved) { - /* Handle error. Usually just close the connection. */ -} -``` - -HTTP needs to know where the end of the stream is. For example, sometimes -servers send responses without Content-Length and expect the client to -consume input (for the body) until EOF. To tell http_parser about EOF, give -`0` as the fourth parameter to `http_parser_execute()`. Callbacks and errors -can still be encountered during an EOF, so one must still be prepared -to receive them. - -Scalar valued message information such as `status_code`, `method`, and the -HTTP version are stored in the parser structure. This data is only -temporally stored in `http_parser` and gets reset on each new message. If -this information is needed later, copy it out of the structure during the -`headers_complete` callback. - -The parser decodes the transfer-encoding for both requests and responses -transparently. That is, a chunked encoding is decoded before being sent to -the on_body callback. - - -The Special Problem of Upgrade ------------------------------- - -HTTP supports upgrading the connection to a different protocol. An -increasingly common example of this is the Web Socket protocol which sends -a request like - - GET /demo HTTP/1.1 - Upgrade: WebSocket - Connection: Upgrade - Host: example.com - Origin: http://example.com - WebSocket-Protocol: sample - -followed by non-HTTP data. - -(See http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75 for more -information the Web Socket protocol.) - -To support this, the parser will treat this as a normal HTTP message without a -body, issuing both on_headers_complete and on_message_complete callbacks. However -http_parser_execute() will stop parsing at the end of the headers and return. - -The user is expected to check if `parser->upgrade` has been set to 1 after -`http_parser_execute()` returns. Non-HTTP data begins at the buffer supplied -offset by the return value of `http_parser_execute()`. - - -Callbacks ---------- - -During the `http_parser_execute()` call, the callbacks set in -`http_parser_settings` will be executed. The parser maintains state and -never looks behind, so buffering the data is not necessary. If you need to -save certain data for later usage, you can do that from the callbacks. - -There are two types of callbacks: - -* notification `typedef int (*http_cb) (http_parser*);` - Callbacks: on_message_begin, on_headers_complete, on_message_complete. -* data `typedef int (*http_data_cb) (http_parser*, const char *at, size_t length);` - Callbacks: (requests only) on_url, - (common) on_header_field, on_header_value, on_body; - -Callbacks must return 0 on success. Returning a non-zero value indicates -error to the parser, making it exit immediately. - -In case you parse HTTP message in chunks (i.e. `read()` request line -from socket, parse, read half headers, parse, etc) your data callbacks -may be called more than once. Http-parser guarantees that data pointer is only -valid for the lifetime of callback. You can also `read()` into a heap allocated -buffer to avoid copying memory around if this fits your application. - -Reading headers may be a tricky task if you read/parse headers partially. -Basically, you need to remember whether last header callback was field or value -and apply the following logic: - - (on_header_field and on_header_value shortened to on_h_*) - ------------------------ ------------ -------------------------------------------- - | State (prev. callback) | Callback | Description/action | - ------------------------ ------------ -------------------------------------------- - | nothing (first call) | on_h_field | Allocate new buffer and copy callback data | - | | | into it | - ------------------------ ------------ -------------------------------------------- - | value | on_h_field | New header started. | - | | | Copy current name,value buffers to headers | - | | | list and allocate new buffer for new name | - ------------------------ ------------ -------------------------------------------- - | field | on_h_field | Previous name continues. Reallocate name | - | | | buffer and append callback data to it | - ------------------------ ------------ -------------------------------------------- - | field | on_h_value | Value for current header started. Allocate | - | | | new buffer and copy callback data to it | - ------------------------ ------------ -------------------------------------------- - | value | on_h_value | Value continues. Reallocate value buffer | - | | | and append callback data to it | - ------------------------ ------------ -------------------------------------------- - - -Parsing URLs ------------- - -A simplistic zero-copy URL parser is provided as `http_parser_parse_url()`. -Users of this library may wish to use it to parse URLs constructed from -consecutive `on_url` callbacks. - -See examples of reading in headers: - -* [partial example](http://gist.github.com/155877) in C -* [from http-parser tests](http://github.com/joyent/http-parser/blob/37a0ff8/test.c#L403) in C -* [from Node library](http://github.com/joyent/node/blob/842eaf4/src/http.js#L284) in Javascript diff --git a/vendor/http_parser/bench.c b/vendor/http_parser/bench.c deleted file mode 100644 index 5b452fa1cd..0000000000 --- a/vendor/http_parser/bench.c +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright Fedor Indutny. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ -#include "http_parser.h" -#include -#include -#include -#include - -static const char data[] = - "POST /joyent/http-parser HTTP/1.1\r\n" - "Host: github.com\r\n" - "DNT: 1\r\n" - "Accept-Encoding: gzip, deflate, sdch\r\n" - "Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4\r\n" - "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) " - "AppleWebKit/537.36 (KHTML, like Gecko) " - "Chrome/39.0.2171.65 Safari/537.36\r\n" - "Accept: text/html,application/xhtml+xml,application/xml;q=0.9," - "image/webp,*/*;q=0.8\r\n" - "Referer: https://github.com/joyent/http-parser\r\n" - "Connection: keep-alive\r\n" - "Transfer-Encoding: chunked\r\n" - "Cache-Control: max-age=0\r\n\r\nb\r\nhello world\r\n0\r\n\r\n"; -static const size_t data_len = sizeof(data) - 1; - -static int on_info(http_parser* p) { - return 0; -} - - -static int on_data(http_parser* p, const char *at, size_t length) { - return 0; -} - -static http_parser_settings settings = { - .on_message_begin = on_info, - .on_headers_complete = on_info, - .on_message_complete = on_info, - .on_header_field = on_data, - .on_header_value = on_data, - .on_url = on_data, - .on_status = on_data, - .on_body = on_data -}; - -int bench(int iter_count, int silent) { - struct http_parser parser; - int i; - int err; - struct timeval start; - struct timeval end; - float rps; - - if (!silent) { - err = gettimeofday(&start, NULL); - assert(err == 0); - } - - for (i = 0; i < iter_count; i++) { - size_t parsed; - http_parser_init(&parser, HTTP_REQUEST); - - parsed = http_parser_execute(&parser, &settings, data, data_len); - assert(parsed == data_len); - } - - if (!silent) { - err = gettimeofday(&end, NULL); - assert(err == 0); - - fprintf(stdout, "Benchmark result:\n"); - - rps = (float) (end.tv_sec - start.tv_sec) + - (end.tv_usec - start.tv_usec) * 1e-6f; - fprintf(stdout, "Took %f seconds to run\n", rps); - - rps = (float) iter_count / rps; - fprintf(stdout, "%f req/sec\n", rps); - fflush(stdout); - } - - return 0; -} - -int main(int argc, char** argv) { - if (argc == 2 && strcmp(argv[1], "infinite") == 0) { - for (;;) - bench(5000000, 1); - return 0; - } else { - return bench(5000000, 0); - } -} diff --git a/vendor/http_parser/contrib/parsertrace.c b/vendor/http_parser/contrib/parsertrace.c deleted file mode 100644 index e7153680f4..0000000000 --- a/vendor/http_parser/contrib/parsertrace.c +++ /dev/null @@ -1,160 +0,0 @@ -/* Based on src/http/ngx_http_parse.c from NGINX copyright Igor Sysoev - * - * Additional changes are licensed under the same terms as NGINX and - * copyright Joyent, Inc. and other Node contributors. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -/* Dump what the parser finds to stdout as it happen */ - -#include "http_parser.h" -#include -#include -#include - -int on_message_begin(http_parser* _) { - (void)_; - printf("\n***MESSAGE BEGIN***\n\n"); - return 0; -} - -int on_headers_complete(http_parser* _) { - (void)_; - printf("\n***HEADERS COMPLETE***\n\n"); - return 0; -} - -int on_message_complete(http_parser* _) { - (void)_; - printf("\n***MESSAGE COMPLETE***\n\n"); - return 0; -} - -int on_url(http_parser* _, const char* at, size_t length) { - (void)_; - printf("Url: %.*s\n", (int)length, at); - return 0; -} - -int on_header_field(http_parser* _, const char* at, size_t length) { - (void)_; - printf("Header field: %.*s\n", (int)length, at); - return 0; -} - -int on_header_value(http_parser* _, const char* at, size_t length) { - (void)_; - printf("Header value: %.*s\n", (int)length, at); - return 0; -} - -int on_body(http_parser* _, const char* at, size_t length) { - (void)_; - printf("Body: %.*s\n", (int)length, at); - return 0; -} - -void usage(const char* name) { - fprintf(stderr, - "Usage: %s $type $filename\n" - " type: -x, where x is one of {r,b,q}\n" - " parses file as a Response, reQuest, or Both\n", - name); - exit(EXIT_FAILURE); -} - -int main(int argc, char* argv[]) { - enum http_parser_type file_type; - - if (argc != 3) { - usage(argv[0]); - } - - char* type = argv[1]; - if (type[0] != '-') { - usage(argv[0]); - } - - switch (type[1]) { - /* in the case of "-", type[1] will be NUL */ - case 'r': - file_type = HTTP_RESPONSE; - break; - case 'q': - file_type = HTTP_REQUEST; - break; - case 'b': - file_type = HTTP_BOTH; - break; - default: - usage(argv[0]); - } - - char* filename = argv[2]; - FILE* file = fopen(filename, "r"); - if (file == NULL) { - perror("fopen"); - goto fail; - } - - fseek(file, 0, SEEK_END); - long file_length = ftell(file); - if (file_length == -1) { - perror("ftell"); - goto fail; - } - fseek(file, 0, SEEK_SET); - - char* data = malloc(file_length); - if (fread(data, 1, file_length, file) != (size_t)file_length) { - fprintf(stderr, "couldn't read entire file\n"); - free(data); - goto fail; - } - - http_parser_settings settings; - memset(&settings, 0, sizeof(settings)); - settings.on_message_begin = on_message_begin; - settings.on_url = on_url; - settings.on_header_field = on_header_field; - settings.on_header_value = on_header_value; - settings.on_headers_complete = on_headers_complete; - settings.on_body = on_body; - settings.on_message_complete = on_message_complete; - - http_parser parser; - http_parser_init(&parser, file_type); - size_t nparsed = http_parser_execute(&parser, &settings, data, file_length); - free(data); - - if (nparsed != (size_t)file_length) { - fprintf(stderr, - "Error: %s (%s)\n", - http_errno_description(HTTP_PARSER_ERRNO(&parser)), - http_errno_name(HTTP_PARSER_ERRNO(&parser))); - goto fail; - } - - return EXIT_SUCCESS; - -fail: - fclose(file); - return EXIT_FAILURE; -} diff --git a/vendor/http_parser/contrib/url_parser.c b/vendor/http_parser/contrib/url_parser.c deleted file mode 100644 index 6650b414af..0000000000 --- a/vendor/http_parser/contrib/url_parser.c +++ /dev/null @@ -1,46 +0,0 @@ -#include "http_parser.h" -#include -#include - -void -dump_url (const char *url, const struct http_parser_url *u) -{ - unsigned int i; - - printf("\tfield_set: 0x%x, port: %u\n", u->field_set, u->port); - for (i = 0; i < UF_MAX; i++) { - if ((u->field_set & (1 << i)) == 0) { - printf("\tfield_data[%u]: unset\n", i); - continue; - } - - printf("\tfield_data[%u]: off: %u, len: %u, part: %.*s\n", - i, - u->field_data[i].off, - u->field_data[i].len, - u->field_data[i].len, - url + u->field_data[i].off); - } -} - -int main(int argc, char ** argv) { - struct http_parser_url u; - int len, connect, result; - - if (argc != 3) { - printf("Syntax : %s connect|get url\n", argv[0]); - return 1; - } - len = strlen(argv[2]); - connect = strcmp("connect", argv[1]) == 0 ? 1 : 0; - printf("Parsing %s, connect %d\n", argv[2], connect); - - result = http_parser_parse_url(argv[2], len, connect, &u); - if (result != 0) { - printf("Parse error : %d\n", result); - return result; - } - printf("Parse ok, result : \n"); - dump_url(argv[2], &u); - return 0; -} \ No newline at end of file diff --git a/vendor/http_parser/http_parser.c b/vendor/http_parser/http_parser.c deleted file mode 100644 index 0fa1c36272..0000000000 --- a/vendor/http_parser/http_parser.c +++ /dev/null @@ -1,2429 +0,0 @@ -/* Based on src/http/ngx_http_parse.c from NGINX copyright Igor Sysoev - * - * Additional changes are licensed under the same terms as NGINX and - * copyright Joyent, Inc. and other Node contributors. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ -#include "http_parser.h" -#include -#include -#include -#include -#include -#include - -#ifndef ULLONG_MAX -# define ULLONG_MAX ((uint64_t) -1) /* 2^64-1 */ -#endif - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef ARRAY_SIZE -# define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) -#endif - -#ifndef BIT_AT -# define BIT_AT(a, i) \ - (!!((unsigned int) (a)[(unsigned int) (i) >> 3] & \ - (1 << ((unsigned int) (i) & 7)))) -#endif - -#ifndef ELEM_AT -# define ELEM_AT(a, i, v) ((unsigned int) (i) < ARRAY_SIZE(a) ? (a)[(i)] : (v)) -#endif - -#define SET_ERRNO(e) \ -do { \ - parser->http_errno = (e); \ -} while(0) - -#define CURRENT_STATE() p_state -#define UPDATE_STATE(V) p_state = (enum state) (V); -#define RETURN(V) \ -do { \ - parser->state = CURRENT_STATE(); \ - return (V); \ -} while (0); -#define REEXECUTE() \ - goto reexecute; \ - - -#ifdef __GNUC__ -# define LIKELY(X) __builtin_expect(!!(X), 1) -# define UNLIKELY(X) __builtin_expect(!!(X), 0) -#else -# define LIKELY(X) (X) -# define UNLIKELY(X) (X) -#endif - - -/* Run the notify callback FOR, returning ER if it fails */ -#define CALLBACK_NOTIFY_(FOR, ER) \ -do { \ - assert(HTTP_PARSER_ERRNO(parser) == HPE_OK); \ - \ - if (LIKELY(settings->on_##FOR)) { \ - parser->state = CURRENT_STATE(); \ - if (UNLIKELY(0 != settings->on_##FOR(parser))) { \ - SET_ERRNO(HPE_CB_##FOR); \ - } \ - UPDATE_STATE(parser->state); \ - \ - /* We either errored above or got paused; get out */ \ - if (UNLIKELY(HTTP_PARSER_ERRNO(parser) != HPE_OK)) { \ - return (ER); \ - } \ - } \ -} while (0) - -/* Run the notify callback FOR and consume the current byte */ -#define CALLBACK_NOTIFY(FOR) CALLBACK_NOTIFY_(FOR, p - data + 1) - -/* Run the notify callback FOR and don't consume the current byte */ -#define CALLBACK_NOTIFY_NOADVANCE(FOR) CALLBACK_NOTIFY_(FOR, p - data) - -/* Run data callback FOR with LEN bytes, returning ER if it fails */ -#define CALLBACK_DATA_(FOR, LEN, ER) \ -do { \ - assert(HTTP_PARSER_ERRNO(parser) == HPE_OK); \ - \ - if (FOR##_mark) { \ - if (LIKELY(settings->on_##FOR)) { \ - parser->state = CURRENT_STATE(); \ - if (UNLIKELY(0 != \ - settings->on_##FOR(parser, FOR##_mark, (LEN)))) { \ - SET_ERRNO(HPE_CB_##FOR); \ - } \ - UPDATE_STATE(parser->state); \ - \ - /* We either errored above or got paused; get out */ \ - if (UNLIKELY(HTTP_PARSER_ERRNO(parser) != HPE_OK)) { \ - return (ER); \ - } \ - } \ - FOR##_mark = NULL; \ - } \ -} while (0) - -/* Run the data callback FOR and consume the current byte */ -#define CALLBACK_DATA(FOR) \ - CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1) - -/* Run the data callback FOR and don't consume the current byte */ -#define CALLBACK_DATA_NOADVANCE(FOR) \ - CALLBACK_DATA_(FOR, p - FOR##_mark, p - data) - -/* Set the mark FOR; non-destructive if mark is already set */ -#define MARK(FOR) \ -do { \ - if (!FOR##_mark) { \ - FOR##_mark = p; \ - } \ -} while (0) - -/* Don't allow the total size of the HTTP headers (including the status - * line) to exceed HTTP_MAX_HEADER_SIZE. This check is here to protect - * embedders against denial-of-service attacks where the attacker feeds - * us a never-ending header that the embedder keeps buffering. - * - * This check is arguably the responsibility of embedders but we're doing - * it on the embedder's behalf because most won't bother and this way we - * make the web a little safer. HTTP_MAX_HEADER_SIZE is still far bigger - * than any reasonable request or response so this should never affect - * day-to-day operation. - */ -#define COUNT_HEADER_SIZE(V) \ -do { \ - parser->nread += (V); \ - if (UNLIKELY(parser->nread > (HTTP_MAX_HEADER_SIZE))) { \ - SET_ERRNO(HPE_HEADER_OVERFLOW); \ - goto error; \ - } \ -} while (0) - - -#define PROXY_CONNECTION "proxy-connection" -#define CONNECTION "connection" -#define CONTENT_LENGTH "content-length" -#define TRANSFER_ENCODING "transfer-encoding" -#define UPGRADE "upgrade" -#define CHUNKED "chunked" -#define KEEP_ALIVE "keep-alive" -#define CLOSE "close" - - -static const char *method_strings[] = - { -#define XX(num, name, string) #string, - HTTP_METHOD_MAP(XX) -#undef XX - }; - - -/* Tokens as defined by rfc 2616. Also lowercases them. - * token = 1* - * separators = "(" | ")" | "<" | ">" | "@" - * | "," | ";" | ":" | "\" | <"> - * | "/" | "[" | "]" | "?" | "=" - * | "{" | "}" | SP | HT - */ -static const char tokens[256] = { -/* 0 nul 1 soh 2 stx 3 etx 4 eot 5 enq 6 ack 7 bel */ - 0, 0, 0, 0, 0, 0, 0, 0, -/* 8 bs 9 ht 10 nl 11 vt 12 np 13 cr 14 so 15 si */ - 0, 0, 0, 0, 0, 0, 0, 0, -/* 16 dle 17 dc1 18 dc2 19 dc3 20 dc4 21 nak 22 syn 23 etb */ - 0, 0, 0, 0, 0, 0, 0, 0, -/* 24 can 25 em 26 sub 27 esc 28 fs 29 gs 30 rs 31 us */ - 0, 0, 0, 0, 0, 0, 0, 0, -/* 32 sp 33 ! 34 " 35 # 36 $ 37 % 38 & 39 ' */ - 0, '!', 0, '#', '$', '%', '&', '\'', -/* 40 ( 41 ) 42 * 43 + 44 , 45 - 46 . 47 / */ - 0, 0, '*', '+', 0, '-', '.', 0, -/* 48 0 49 1 50 2 51 3 52 4 53 5 54 6 55 7 */ - '0', '1', '2', '3', '4', '5', '6', '7', -/* 56 8 57 9 58 : 59 ; 60 < 61 = 62 > 63 ? */ - '8', '9', 0, 0, 0, 0, 0, 0, -/* 64 @ 65 A 66 B 67 C 68 D 69 E 70 F 71 G */ - 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', -/* 72 H 73 I 74 J 75 K 76 L 77 M 78 N 79 O */ - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', -/* 80 P 81 Q 82 R 83 S 84 T 85 U 86 V 87 W */ - 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', -/* 88 X 89 Y 90 Z 91 [ 92 \ 93 ] 94 ^ 95 _ */ - 'x', 'y', 'z', 0, 0, 0, '^', '_', -/* 96 ` 97 a 98 b 99 c 100 d 101 e 102 f 103 g */ - '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', -/* 104 h 105 i 106 j 107 k 108 l 109 m 110 n 111 o */ - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', -/* 112 p 113 q 114 r 115 s 116 t 117 u 118 v 119 w */ - 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', -/* 120 x 121 y 122 z 123 { 124 | 125 } 126 ~ 127 del */ - 'x', 'y', 'z', 0, '|', 0, '~', 0 }; - - -static const int8_t unhex[256] = - {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 - ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 - ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 - , 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1 - ,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1 - ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 - ,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1 - ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 - }; - - -#if HTTP_PARSER_STRICT -# define T(v) 0 -#else -# define T(v) v -#endif - - -static const uint8_t normal_url_char[32] = { -/* 0 nul 1 soh 2 stx 3 etx 4 eot 5 enq 6 ack 7 bel */ - 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0, -/* 8 bs 9 ht 10 nl 11 vt 12 np 13 cr 14 so 15 si */ - 0 | T(2) | 0 | 0 | T(16) | 0 | 0 | 0, -/* 16 dle 17 dc1 18 dc2 19 dc3 20 dc4 21 nak 22 syn 23 etb */ - 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0, -/* 24 can 25 em 26 sub 27 esc 28 fs 29 gs 30 rs 31 us */ - 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0, -/* 32 sp 33 ! 34 " 35 # 36 $ 37 % 38 & 39 ' */ - 0 | 2 | 4 | 0 | 16 | 32 | 64 | 128, -/* 40 ( 41 ) 42 * 43 + 44 , 45 - 46 . 47 / */ - 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128, -/* 48 0 49 1 50 2 51 3 52 4 53 5 54 6 55 7 */ - 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128, -/* 56 8 57 9 58 : 59 ; 60 < 61 = 62 > 63 ? */ - 1 | 2 | 4 | 8 | 16 | 32 | 64 | 0, -/* 64 @ 65 A 66 B 67 C 68 D 69 E 70 F 71 G */ - 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128, -/* 72 H 73 I 74 J 75 K 76 L 77 M 78 N 79 O */ - 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128, -/* 80 P 81 Q 82 R 83 S 84 T 85 U 86 V 87 W */ - 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128, -/* 88 X 89 Y 90 Z 91 [ 92 \ 93 ] 94 ^ 95 _ */ - 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128, -/* 96 ` 97 a 98 b 99 c 100 d 101 e 102 f 103 g */ - 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128, -/* 104 h 105 i 106 j 107 k 108 l 109 m 110 n 111 o */ - 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128, -/* 112 p 113 q 114 r 115 s 116 t 117 u 118 v 119 w */ - 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128, -/* 120 x 121 y 122 z 123 { 124 | 125 } 126 ~ 127 del */ - 1 | 2 | 4 | 8 | 16 | 32 | 64 | 0, }; - -#undef T - -enum state - { s_dead = 1 /* important that this is > 0 */ - - , s_start_req_or_res - , s_res_or_resp_H - , s_start_res - , s_res_H - , s_res_HT - , s_res_HTT - , s_res_HTTP - , s_res_first_http_major - , s_res_http_major - , s_res_first_http_minor - , s_res_http_minor - , s_res_first_status_code - , s_res_status_code - , s_res_status_start - , s_res_status - , s_res_line_almost_done - - , s_start_req - - , s_req_method - , s_req_spaces_before_url - , s_req_schema - , s_req_schema_slash - , s_req_schema_slash_slash - , s_req_server_start - , s_req_server - , s_req_server_with_at - , s_req_path - , s_req_query_string_start - , s_req_query_string - , s_req_fragment_start - , s_req_fragment - , s_req_http_start - , s_req_http_H - , s_req_http_HT - , s_req_http_HTT - , s_req_http_HTTP - , s_req_first_http_major - , s_req_http_major - , s_req_first_http_minor - , s_req_http_minor - , s_req_line_almost_done - - , s_header_field_start - , s_header_field - , s_header_value_discard_ws - , s_header_value_discard_ws_almost_done - , s_header_value_discard_lws - , s_header_value_start - , s_header_value - , s_header_value_lws - - , s_header_almost_done - - , s_chunk_size_start - , s_chunk_size - , s_chunk_parameters - , s_chunk_size_almost_done - - , s_headers_almost_done - , s_headers_done - - /* Important: 's_headers_done' must be the last 'header' state. All - * states beyond this must be 'body' states. It is used for overflow - * checking. See the PARSING_HEADER() macro. - */ - - , s_chunk_data - , s_chunk_data_almost_done - , s_chunk_data_done - - , s_body_identity - , s_body_identity_eof - - , s_message_done - }; - - -#define PARSING_HEADER(state) (state <= s_headers_done) - - -enum header_states - { h_general = 0 - , h_C - , h_CO - , h_CON - - , h_matching_connection - , h_matching_proxy_connection - , h_matching_content_length - , h_matching_transfer_encoding - , h_matching_upgrade - - , h_connection - , h_content_length - , h_transfer_encoding - , h_upgrade - - , h_matching_transfer_encoding_chunked - , h_matching_connection_token_start - , h_matching_connection_keep_alive - , h_matching_connection_close - , h_matching_connection_upgrade - , h_matching_connection_token - - , h_transfer_encoding_chunked - , h_connection_keep_alive - , h_connection_close - , h_connection_upgrade - }; - -enum http_host_state - { - s_http_host_dead = 1 - , s_http_userinfo_start - , s_http_userinfo - , s_http_host_start - , s_http_host_v6_start - , s_http_host - , s_http_host_v6 - , s_http_host_v6_end - , s_http_host_port_start - , s_http_host_port -}; - -/* Macros for character classes; depends on strict-mode */ -#define CR '\r' -#define LF '\n' -#define LOWER(c) (unsigned char)(c | 0x20) -#define IS_ALPHA(c) (LOWER(c) >= 'a' && LOWER(c) <= 'z') -#define IS_NUM(c) ((c) >= '0' && (c) <= '9') -#define IS_ALPHANUM(c) (IS_ALPHA(c) || IS_NUM(c)) -#define IS_HEX(c) (IS_NUM(c) || (LOWER(c) >= 'a' && LOWER(c) <= 'f')) -#define IS_MARK(c) ((c) == '-' || (c) == '_' || (c) == '.' || \ - (c) == '!' || (c) == '~' || (c) == '*' || (c) == '\'' || (c) == '(' || \ - (c) == ')') -#define IS_USERINFO_CHAR(c) (IS_ALPHANUM(c) || IS_MARK(c) || (c) == '%' || \ - (c) == ';' || (c) == ':' || (c) == '&' || (c) == '=' || (c) == '+' || \ - (c) == '$' || (c) == ',') - -#define STRICT_TOKEN(c) (tokens[(unsigned char)c]) - -#if HTTP_PARSER_STRICT -#define TOKEN(c) (tokens[(unsigned char)c]) -#define IS_URL_CHAR(c) (BIT_AT(normal_url_char, (unsigned char)c)) -#define IS_HOST_CHAR(c) (IS_ALPHANUM(c) || (c) == '.' || (c) == '-') -#else -#define TOKEN(c) ((c == ' ') ? ' ' : tokens[(unsigned char)c]) -#define IS_URL_CHAR(c) \ - (BIT_AT(normal_url_char, (unsigned char)c) || ((c) & 0x80)) -#define IS_HOST_CHAR(c) \ - (IS_ALPHANUM(c) || (c) == '.' || (c) == '-' || (c) == '_') -#endif - - -#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res) - - -#if HTTP_PARSER_STRICT -# define STRICT_CHECK(cond) \ -do { \ - if (cond) { \ - SET_ERRNO(HPE_STRICT); \ - goto error; \ - } \ -} while (0) -# define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead) -#else -# define STRICT_CHECK(cond) -# define NEW_MESSAGE() start_state -#endif - - -/* Map errno values to strings for human-readable output */ -#define HTTP_STRERROR_GEN(n, s) { "HPE_" #n, s }, -static struct { - const char *name; - const char *description; -} http_strerror_tab[] = { - HTTP_ERRNO_MAP(HTTP_STRERROR_GEN) -}; -#undef HTTP_STRERROR_GEN - -int http_message_needs_eof(const http_parser *parser); - -/* Our URL parser. - * - * This is designed to be shared by http_parser_execute() for URL validation, - * hence it has a state transition + byte-for-byte interface. In addition, it - * is meant to be embedded in http_parser_parse_url(), which does the dirty - * work of turning state transitions URL components for its API. - * - * This function should only be invoked with non-space characters. It is - * assumed that the caller cares about (and can detect) the transition between - * URL and non-URL states by looking for these. - */ -static enum state -parse_url_char(enum state s, const char ch) -{ - if (ch == ' ' || ch == '\r' || ch == '\n') { - return s_dead; - } - -#if HTTP_PARSER_STRICT - if (ch == '\t' || ch == '\f') { - return s_dead; - } -#endif - - switch (s) { - case s_req_spaces_before_url: - /* Proxied requests are followed by scheme of an absolute URI (alpha). - * All methods except CONNECT are followed by '/' or '*'. - */ - - if (ch == '/' || ch == '*') { - return s_req_path; - } - - if (IS_ALPHA(ch)) { - return s_req_schema; - } - - break; - - case s_req_schema: - if (IS_ALPHA(ch)) { - return s; - } - - if (ch == ':') { - return s_req_schema_slash; - } - - break; - - case s_req_schema_slash: - if (ch == '/') { - return s_req_schema_slash_slash; - } - - break; - - case s_req_schema_slash_slash: - if (ch == '/') { - return s_req_server_start; - } - - break; - - case s_req_server_with_at: - if (ch == '@') { - return s_dead; - } - - /* FALLTHROUGH */ - case s_req_server_start: - case s_req_server: - if (ch == '/') { - return s_req_path; - } - - if (ch == '?') { - return s_req_query_string_start; - } - - if (ch == '@') { - return s_req_server_with_at; - } - - if (IS_USERINFO_CHAR(ch) || ch == '[' || ch == ']') { - return s_req_server; - } - - break; - - case s_req_path: - if (IS_URL_CHAR(ch)) { - return s; - } - - switch (ch) { - case '?': - return s_req_query_string_start; - - case '#': - return s_req_fragment_start; - } - - break; - - case s_req_query_string_start: - case s_req_query_string: - if (IS_URL_CHAR(ch)) { - return s_req_query_string; - } - - switch (ch) { - case '?': - /* allow extra '?' in query string */ - return s_req_query_string; - - case '#': - return s_req_fragment_start; - } - - break; - - case s_req_fragment_start: - if (IS_URL_CHAR(ch)) { - return s_req_fragment; - } - - switch (ch) { - case '?': - return s_req_fragment; - - case '#': - return s; - } - - break; - - case s_req_fragment: - if (IS_URL_CHAR(ch)) { - return s; - } - - switch (ch) { - case '?': - case '#': - return s; - } - - break; - - default: - break; - } - - /* We should never fall out of the switch above unless there's an error */ - return s_dead; -} - -size_t http_parser_execute (http_parser *parser, - const http_parser_settings *settings, - const char *data, - size_t len) -{ - char c, ch; - int8_t unhex_val; - const char *p = data; - const char *header_field_mark = 0; - const char *header_value_mark = 0; - const char *url_mark = 0; - const char *body_mark = 0; - const char *status_mark = 0; - enum state p_state = (enum state) parser->state; - - /* We're in an error state. Don't bother doing anything. */ - if (HTTP_PARSER_ERRNO(parser) != HPE_OK) { - return 0; - } - - if (len == 0) { - switch (CURRENT_STATE()) { - case s_body_identity_eof: - /* Use of CALLBACK_NOTIFY() here would erroneously return 1 byte read if - * we got paused. - */ - CALLBACK_NOTIFY_NOADVANCE(message_complete); - return 0; - - case s_dead: - case s_start_req_or_res: - case s_start_res: - case s_start_req: - return 0; - - default: - SET_ERRNO(HPE_INVALID_EOF_STATE); - return 1; - } - } - - - if (CURRENT_STATE() == s_header_field) - header_field_mark = data; - if (CURRENT_STATE() == s_header_value) - header_value_mark = data; - switch (CURRENT_STATE()) { - case s_req_path: - case s_req_schema: - case s_req_schema_slash: - case s_req_schema_slash_slash: - case s_req_server_start: - case s_req_server: - case s_req_server_with_at: - case s_req_query_string_start: - case s_req_query_string: - case s_req_fragment_start: - case s_req_fragment: - url_mark = data; - break; - case s_res_status: - status_mark = data; - break; - default: - break; - } - - for (p=data; p != data + len; p++) { - ch = *p; - - if (PARSING_HEADER(CURRENT_STATE())) - COUNT_HEADER_SIZE(1); - -reexecute: - switch (CURRENT_STATE()) { - - case s_dead: - /* this state is used after a 'Connection: close' message - * the parser will error out if it reads another message - */ - if (LIKELY(ch == CR || ch == LF)) - break; - - SET_ERRNO(HPE_CLOSED_CONNECTION); - goto error; - - case s_start_req_or_res: - { - if (ch == CR || ch == LF) - break; - parser->flags = 0; - parser->content_length = ULLONG_MAX; - - if (ch == 'H') { - UPDATE_STATE(s_res_or_resp_H); - - CALLBACK_NOTIFY(message_begin); - } else { - parser->type = HTTP_REQUEST; - UPDATE_STATE(s_start_req); - REEXECUTE(); - } - - break; - } - - case s_res_or_resp_H: - if (ch == 'T') { - parser->type = HTTP_RESPONSE; - UPDATE_STATE(s_res_HT); - } else { - if (UNLIKELY(ch != 'E')) { - SET_ERRNO(HPE_INVALID_CONSTANT); - goto error; - } - - parser->type = HTTP_REQUEST; - parser->method = HTTP_HEAD; - parser->index = 2; - UPDATE_STATE(s_req_method); - } - break; - - case s_start_res: - { - parser->flags = 0; - parser->content_length = ULLONG_MAX; - - switch (ch) { - case 'H': - UPDATE_STATE(s_res_H); - break; - - case CR: - case LF: - break; - - default: - SET_ERRNO(HPE_INVALID_CONSTANT); - goto error; - } - - CALLBACK_NOTIFY(message_begin); - break; - } - - case s_res_H: - STRICT_CHECK(ch != 'T'); - UPDATE_STATE(s_res_HT); - break; - - case s_res_HT: - STRICT_CHECK(ch != 'T'); - UPDATE_STATE(s_res_HTT); - break; - - case s_res_HTT: - STRICT_CHECK(ch != 'P'); - UPDATE_STATE(s_res_HTTP); - break; - - case s_res_HTTP: - STRICT_CHECK(ch != '/'); - UPDATE_STATE(s_res_first_http_major); - break; - - case s_res_first_http_major: - if (UNLIKELY(ch < '0' || ch > '9')) { - SET_ERRNO(HPE_INVALID_VERSION); - goto error; - } - - parser->http_major = ch - '0'; - UPDATE_STATE(s_res_http_major); - break; - - /* major HTTP version or dot */ - case s_res_http_major: - { - if (ch == '.') { - UPDATE_STATE(s_res_first_http_minor); - break; - } - - if (!IS_NUM(ch)) { - SET_ERRNO(HPE_INVALID_VERSION); - goto error; - } - - parser->http_major *= 10; - parser->http_major += ch - '0'; - - if (UNLIKELY(parser->http_major > 999)) { - SET_ERRNO(HPE_INVALID_VERSION); - goto error; - } - - break; - } - - /* first digit of minor HTTP version */ - case s_res_first_http_minor: - if (UNLIKELY(!IS_NUM(ch))) { - SET_ERRNO(HPE_INVALID_VERSION); - goto error; - } - - parser->http_minor = ch - '0'; - UPDATE_STATE(s_res_http_minor); - break; - - /* minor HTTP version or end of request line */ - case s_res_http_minor: - { - if (ch == ' ') { - UPDATE_STATE(s_res_first_status_code); - break; - } - - if (UNLIKELY(!IS_NUM(ch))) { - SET_ERRNO(HPE_INVALID_VERSION); - goto error; - } - - parser->http_minor *= 10; - parser->http_minor += ch - '0'; - - if (UNLIKELY(parser->http_minor > 999)) { - SET_ERRNO(HPE_INVALID_VERSION); - goto error; - } - - break; - } - - case s_res_first_status_code: - { - if (!IS_NUM(ch)) { - if (ch == ' ') { - break; - } - - SET_ERRNO(HPE_INVALID_STATUS); - goto error; - } - parser->status_code = ch - '0'; - UPDATE_STATE(s_res_status_code); - break; - } - - case s_res_status_code: - { - if (!IS_NUM(ch)) { - switch (ch) { - case ' ': - UPDATE_STATE(s_res_status_start); - break; - case CR: - UPDATE_STATE(s_res_line_almost_done); - break; - case LF: - UPDATE_STATE(s_header_field_start); - break; - default: - SET_ERRNO(HPE_INVALID_STATUS); - goto error; - } - break; - } - - parser->status_code *= 10; - parser->status_code += ch - '0'; - - if (UNLIKELY(parser->status_code > 999)) { - SET_ERRNO(HPE_INVALID_STATUS); - goto error; - } - - break; - } - - case s_res_status_start: - { - if (ch == CR) { - UPDATE_STATE(s_res_line_almost_done); - break; - } - - if (ch == LF) { - UPDATE_STATE(s_header_field_start); - break; - } - - MARK(status); - UPDATE_STATE(s_res_status); - parser->index = 0; - break; - } - - case s_res_status: - if (ch == CR) { - UPDATE_STATE(s_res_line_almost_done); - CALLBACK_DATA(status); - break; - } - - if (ch == LF) { - UPDATE_STATE(s_header_field_start); - CALLBACK_DATA(status); - break; - } - - break; - - case s_res_line_almost_done: - STRICT_CHECK(ch != LF); - UPDATE_STATE(s_header_field_start); - break; - - case s_start_req: - { - if (ch == CR || ch == LF) - break; - parser->flags = 0; - parser->content_length = ULLONG_MAX; - - if (UNLIKELY(!IS_ALPHA(ch))) { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - - parser->method = (enum http_method) 0; - parser->index = 1; - switch (ch) { - case 'C': parser->method = HTTP_CONNECT; /* or COPY, CHECKOUT */ break; - case 'D': parser->method = HTTP_DELETE; break; - case 'G': parser->method = HTTP_GET; break; - case 'H': parser->method = HTTP_HEAD; break; - case 'L': parser->method = HTTP_LOCK; break; - case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH, MKCALENDAR */ break; - case 'N': parser->method = HTTP_NOTIFY; break; - case 'O': parser->method = HTTP_OPTIONS; break; - case 'P': parser->method = HTTP_POST; - /* or PROPFIND|PROPPATCH|PUT|PATCH|PURGE */ - break; - case 'R': parser->method = HTTP_REPORT; break; - case 'S': parser->method = HTTP_SUBSCRIBE; /* or SEARCH */ break; - case 'T': parser->method = HTTP_TRACE; break; - case 'U': parser->method = HTTP_UNLOCK; /* or UNSUBSCRIBE */ break; - default: - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - UPDATE_STATE(s_req_method); - - CALLBACK_NOTIFY(message_begin); - - break; - } - - case s_req_method: - { - const char *matcher; - if (UNLIKELY(ch == '\0')) { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - - matcher = method_strings[parser->method]; - if (ch == ' ' && matcher[parser->index] == '\0') { - UPDATE_STATE(s_req_spaces_before_url); - } else if (ch == matcher[parser->index]) { - ; /* nada */ - } else if (parser->method == HTTP_CONNECT) { - if (parser->index == 1 && ch == 'H') { - parser->method = HTTP_CHECKOUT; - } else if (parser->index == 2 && ch == 'P') { - parser->method = HTTP_COPY; - } else { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - } else if (parser->method == HTTP_MKCOL) { - if (parser->index == 1 && ch == 'O') { - parser->method = HTTP_MOVE; - } else if (parser->index == 1 && ch == 'E') { - parser->method = HTTP_MERGE; - } else if (parser->index == 1 && ch == '-') { - parser->method = HTTP_MSEARCH; - } else if (parser->index == 2 && ch == 'A') { - parser->method = HTTP_MKACTIVITY; - } else if (parser->index == 3 && ch == 'A') { - parser->method = HTTP_MKCALENDAR; - } else { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - } else if (parser->method == HTTP_SUBSCRIBE) { - if (parser->index == 1 && ch == 'E') { - parser->method = HTTP_SEARCH; - } else { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - } else if (parser->index == 1 && parser->method == HTTP_POST) { - if (ch == 'R') { - parser->method = HTTP_PROPFIND; /* or HTTP_PROPPATCH */ - } else if (ch == 'U') { - parser->method = HTTP_PUT; /* or HTTP_PURGE */ - } else if (ch == 'A') { - parser->method = HTTP_PATCH; - } else { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - } else if (parser->index == 2) { - if (parser->method == HTTP_PUT) { - if (ch == 'R') { - parser->method = HTTP_PURGE; - } else { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - } else if (parser->method == HTTP_UNLOCK) { - if (ch == 'S') { - parser->method = HTTP_UNSUBSCRIBE; - } else { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - } else { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - } else if (parser->index == 4 && parser->method == HTTP_PROPFIND && ch == 'P') { - parser->method = HTTP_PROPPATCH; - } else { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - - ++parser->index; - break; - } - - case s_req_spaces_before_url: - { - if (ch == ' ') break; - - MARK(url); - if (parser->method == HTTP_CONNECT) { - UPDATE_STATE(s_req_server_start); - } - - UPDATE_STATE(parse_url_char(CURRENT_STATE(), ch)); - if (UNLIKELY(CURRENT_STATE() == s_dead)) { - SET_ERRNO(HPE_INVALID_URL); - goto error; - } - - break; - } - - case s_req_schema: - case s_req_schema_slash: - case s_req_schema_slash_slash: - case s_req_server_start: - { - switch (ch) { - /* No whitespace allowed here */ - case ' ': - case CR: - case LF: - SET_ERRNO(HPE_INVALID_URL); - goto error; - default: - UPDATE_STATE(parse_url_char(CURRENT_STATE(), ch)); - if (UNLIKELY(CURRENT_STATE() == s_dead)) { - SET_ERRNO(HPE_INVALID_URL); - goto error; - } - } - - break; - } - - case s_req_server: - case s_req_server_with_at: - case s_req_path: - case s_req_query_string_start: - case s_req_query_string: - case s_req_fragment_start: - case s_req_fragment: - { - switch (ch) { - case ' ': - UPDATE_STATE(s_req_http_start); - CALLBACK_DATA(url); - break; - case CR: - case LF: - parser->http_major = 0; - parser->http_minor = 9; - UPDATE_STATE((ch == CR) ? - s_req_line_almost_done : - s_header_field_start); - CALLBACK_DATA(url); - break; - default: - UPDATE_STATE(parse_url_char(CURRENT_STATE(), ch)); - if (UNLIKELY(CURRENT_STATE() == s_dead)) { - SET_ERRNO(HPE_INVALID_URL); - goto error; - } - } - break; - } - - case s_req_http_start: - switch (ch) { - case 'H': - UPDATE_STATE(s_req_http_H); - break; - case ' ': - break; - default: - SET_ERRNO(HPE_INVALID_CONSTANT); - goto error; - } - break; - - case s_req_http_H: - STRICT_CHECK(ch != 'T'); - UPDATE_STATE(s_req_http_HT); - break; - - case s_req_http_HT: - STRICT_CHECK(ch != 'T'); - UPDATE_STATE(s_req_http_HTT); - break; - - case s_req_http_HTT: - STRICT_CHECK(ch != 'P'); - UPDATE_STATE(s_req_http_HTTP); - break; - - case s_req_http_HTTP: - STRICT_CHECK(ch != '/'); - UPDATE_STATE(s_req_first_http_major); - break; - - /* first digit of major HTTP version */ - case s_req_first_http_major: - if (UNLIKELY(ch < '1' || ch > '9')) { - SET_ERRNO(HPE_INVALID_VERSION); - goto error; - } - - parser->http_major = ch - '0'; - UPDATE_STATE(s_req_http_major); - break; - - /* major HTTP version or dot */ - case s_req_http_major: - { - if (ch == '.') { - UPDATE_STATE(s_req_first_http_minor); - break; - } - - if (UNLIKELY(!IS_NUM(ch))) { - SET_ERRNO(HPE_INVALID_VERSION); - goto error; - } - - parser->http_major *= 10; - parser->http_major += ch - '0'; - - if (UNLIKELY(parser->http_major > 999)) { - SET_ERRNO(HPE_INVALID_VERSION); - goto error; - } - - break; - } - - /* first digit of minor HTTP version */ - case s_req_first_http_minor: - if (UNLIKELY(!IS_NUM(ch))) { - SET_ERRNO(HPE_INVALID_VERSION); - goto error; - } - - parser->http_minor = ch - '0'; - UPDATE_STATE(s_req_http_minor); - break; - - /* minor HTTP version or end of request line */ - case s_req_http_minor: - { - if (ch == CR) { - UPDATE_STATE(s_req_line_almost_done); - break; - } - - if (ch == LF) { - UPDATE_STATE(s_header_field_start); - break; - } - - /* XXX allow spaces after digit? */ - - if (UNLIKELY(!IS_NUM(ch))) { - SET_ERRNO(HPE_INVALID_VERSION); - goto error; - } - - parser->http_minor *= 10; - parser->http_minor += ch - '0'; - - if (UNLIKELY(parser->http_minor > 999)) { - SET_ERRNO(HPE_INVALID_VERSION); - goto error; - } - - break; - } - - /* end of request line */ - case s_req_line_almost_done: - { - if (UNLIKELY(ch != LF)) { - SET_ERRNO(HPE_LF_EXPECTED); - goto error; - } - - UPDATE_STATE(s_header_field_start); - break; - } - - case s_header_field_start: - { - if (ch == CR) { - UPDATE_STATE(s_headers_almost_done); - break; - } - - if (ch == LF) { - /* they might be just sending \n instead of \r\n so this would be - * the second \n to denote the end of headers*/ - UPDATE_STATE(s_headers_almost_done); - REEXECUTE(); - } - - c = TOKEN(ch); - - if (UNLIKELY(!c)) { - SET_ERRNO(HPE_INVALID_HEADER_TOKEN); - goto error; - } - - MARK(header_field); - - parser->index = 0; - UPDATE_STATE(s_header_field); - - switch (c) { - case 'c': - parser->header_state = h_C; - break; - - case 'p': - parser->header_state = h_matching_proxy_connection; - break; - - case 't': - parser->header_state = h_matching_transfer_encoding; - break; - - case 'u': - parser->header_state = h_matching_upgrade; - break; - - default: - parser->header_state = h_general; - break; - } - break; - } - - case s_header_field: - { - const char* start = p; - for (; p != data + len; p++) { - ch = *p; - c = TOKEN(ch); - - if (!c) - break; - - switch (parser->header_state) { - case h_general: - break; - - case h_C: - parser->index++; - parser->header_state = (c == 'o' ? h_CO : h_general); - break; - - case h_CO: - parser->index++; - parser->header_state = (c == 'n' ? h_CON : h_general); - break; - - case h_CON: - parser->index++; - switch (c) { - case 'n': - parser->header_state = h_matching_connection; - break; - case 't': - parser->header_state = h_matching_content_length; - break; - default: - parser->header_state = h_general; - break; - } - break; - - /* connection */ - - case h_matching_connection: - parser->index++; - if (parser->index > sizeof(CONNECTION)-1 - || c != CONNECTION[parser->index]) { - parser->header_state = h_general; - } else if (parser->index == sizeof(CONNECTION)-2) { - parser->header_state = h_connection; - } - break; - - /* proxy-connection */ - - case h_matching_proxy_connection: - parser->index++; - if (parser->index > sizeof(PROXY_CONNECTION)-1 - || c != PROXY_CONNECTION[parser->index]) { - parser->header_state = h_general; - } else if (parser->index == sizeof(PROXY_CONNECTION)-2) { - parser->header_state = h_connection; - } - break; - - /* content-length */ - - case h_matching_content_length: - parser->index++; - if (parser->index > sizeof(CONTENT_LENGTH)-1 - || c != CONTENT_LENGTH[parser->index]) { - parser->header_state = h_general; - } else if (parser->index == sizeof(CONTENT_LENGTH)-2) { - parser->header_state = h_content_length; - } - break; - - /* transfer-encoding */ - - case h_matching_transfer_encoding: - parser->index++; - if (parser->index > sizeof(TRANSFER_ENCODING)-1 - || c != TRANSFER_ENCODING[parser->index]) { - parser->header_state = h_general; - } else if (parser->index == sizeof(TRANSFER_ENCODING)-2) { - parser->header_state = h_transfer_encoding; - } - break; - - /* upgrade */ - - case h_matching_upgrade: - parser->index++; - if (parser->index > sizeof(UPGRADE)-1 - || c != UPGRADE[parser->index]) { - parser->header_state = h_general; - } else if (parser->index == sizeof(UPGRADE)-2) { - parser->header_state = h_upgrade; - } - break; - - case h_connection: - case h_content_length: - case h_transfer_encoding: - case h_upgrade: - if (ch != ' ') parser->header_state = h_general; - break; - - default: - assert(0 && "Unknown header_state"); - break; - } - } - - COUNT_HEADER_SIZE(p - start); - - if (p == data + len) { - --p; - break; - } - - if (ch == ':') { - UPDATE_STATE(s_header_value_discard_ws); - CALLBACK_DATA(header_field); - break; - } - - SET_ERRNO(HPE_INVALID_HEADER_TOKEN); - goto error; - } - - case s_header_value_discard_ws: - if (ch == ' ' || ch == '\t') break; - - if (ch == CR) { - UPDATE_STATE(s_header_value_discard_ws_almost_done); - break; - } - - if (ch == LF) { - UPDATE_STATE(s_header_value_discard_lws); - break; - } - - /* FALLTHROUGH */ - - case s_header_value_start: - { - MARK(header_value); - - UPDATE_STATE(s_header_value); - parser->index = 0; - - c = LOWER(ch); - - switch (parser->header_state) { - case h_upgrade: - parser->flags |= F_UPGRADE; - parser->header_state = h_general; - break; - - case h_transfer_encoding: - /* looking for 'Transfer-Encoding: chunked' */ - if ('c' == c) { - parser->header_state = h_matching_transfer_encoding_chunked; - } else { - parser->header_state = h_general; - } - break; - - case h_content_length: - if (UNLIKELY(!IS_NUM(ch))) { - SET_ERRNO(HPE_INVALID_CONTENT_LENGTH); - goto error; - } - - parser->content_length = ch - '0'; - break; - - case h_connection: - /* looking for 'Connection: keep-alive' */ - if (c == 'k') { - parser->header_state = h_matching_connection_keep_alive; - /* looking for 'Connection: close' */ - } else if (c == 'c') { - parser->header_state = h_matching_connection_close; - } else if (c == 'u') { - parser->header_state = h_matching_connection_upgrade; - } else { - parser->header_state = h_matching_connection_token; - } - break; - - /* Multi-value `Connection` header */ - case h_matching_connection_token_start: - break; - - default: - parser->header_state = h_general; - break; - } - break; - } - - case s_header_value: - { - const char* start = p; - enum header_states h_state = (enum header_states) parser->header_state; - for (; p != data + len; p++) { - ch = *p; - if (ch == CR) { - UPDATE_STATE(s_header_almost_done); - parser->header_state = h_state; - CALLBACK_DATA(header_value); - break; - } - - if (ch == LF) { - UPDATE_STATE(s_header_almost_done); - COUNT_HEADER_SIZE(p - start); - parser->header_state = h_state; - CALLBACK_DATA_NOADVANCE(header_value); - REEXECUTE(); - } - - c = LOWER(ch); - - switch (h_state) { - case h_general: - { - const char* p_cr; - const char* p_lf; - size_t limit = data + len - p; - - limit = MIN(limit, HTTP_MAX_HEADER_SIZE); - - p_cr = (const char*) memchr(p, CR, limit); - p_lf = (const char*) memchr(p, LF, limit); - if (p_cr != NULL) { - if (p_lf != NULL && p_cr >= p_lf) - p = p_lf; - else - p = p_cr; - } else if (UNLIKELY(p_lf != NULL)) { - p = p_lf; - } else { - p = data + len; - } - --p; - - break; - } - - case h_connection: - case h_transfer_encoding: - assert(0 && "Shouldn't get here."); - break; - - case h_content_length: - { - uint64_t t; - - if (ch == ' ') break; - - if (UNLIKELY(!IS_NUM(ch))) { - SET_ERRNO(HPE_INVALID_CONTENT_LENGTH); - parser->header_state = h_state; - goto error; - } - - t = parser->content_length; - t *= 10; - t += ch - '0'; - - /* Overflow? Test against a conservative limit for simplicity. */ - if (UNLIKELY((ULLONG_MAX - 10) / 10 < parser->content_length)) { - SET_ERRNO(HPE_INVALID_CONTENT_LENGTH); - parser->header_state = h_state; - goto error; - } - - parser->content_length = t; - break; - } - - /* Transfer-Encoding: chunked */ - case h_matching_transfer_encoding_chunked: - parser->index++; - if (parser->index > sizeof(CHUNKED)-1 - || c != CHUNKED[parser->index]) { - h_state = h_general; - } else if (parser->index == sizeof(CHUNKED)-2) { - h_state = h_transfer_encoding_chunked; - } - break; - - case h_matching_connection_token_start: - /* looking for 'Connection: keep-alive' */ - if (c == 'k') { - h_state = h_matching_connection_keep_alive; - /* looking for 'Connection: close' */ - } else if (c == 'c') { - h_state = h_matching_connection_close; - } else if (c == 'u') { - h_state = h_matching_connection_upgrade; - } else if (STRICT_TOKEN(c)) { - h_state = h_matching_connection_token; - } else if (c == ' ' || c == '\t') { - /* Skip lws */ - } else { - h_state = h_general; - } - break; - - /* looking for 'Connection: keep-alive' */ - case h_matching_connection_keep_alive: - parser->index++; - if (parser->index > sizeof(KEEP_ALIVE)-1 - || c != KEEP_ALIVE[parser->index]) { - h_state = h_matching_connection_token; - } else if (parser->index == sizeof(KEEP_ALIVE)-2) { - h_state = h_connection_keep_alive; - } - break; - - /* looking for 'Connection: close' */ - case h_matching_connection_close: - parser->index++; - if (parser->index > sizeof(CLOSE)-1 || c != CLOSE[parser->index]) { - h_state = h_matching_connection_token; - } else if (parser->index == sizeof(CLOSE)-2) { - h_state = h_connection_close; - } - break; - - /* looking for 'Connection: upgrade' */ - case h_matching_connection_upgrade: - parser->index++; - if (parser->index > sizeof(UPGRADE) - 1 || - c != UPGRADE[parser->index]) { - h_state = h_matching_connection_token; - } else if (parser->index == sizeof(UPGRADE)-2) { - h_state = h_connection_upgrade; - } - break; - - case h_matching_connection_token: - if (ch == ',') { - h_state = h_matching_connection_token_start; - parser->index = 0; - } - break; - - case h_transfer_encoding_chunked: - if (ch != ' ') h_state = h_general; - break; - - case h_connection_keep_alive: - case h_connection_close: - case h_connection_upgrade: - if (ch == ',') { - if (h_state == h_connection_keep_alive) { - parser->flags |= F_CONNECTION_KEEP_ALIVE; - } else if (h_state == h_connection_close) { - parser->flags |= F_CONNECTION_CLOSE; - } else if (h_state == h_connection_upgrade) { - parser->flags |= F_CONNECTION_UPGRADE; - } - h_state = h_matching_connection_token_start; - parser->index = 0; - } else if (ch != ' ') { - h_state = h_matching_connection_token; - } - break; - - default: - UPDATE_STATE(s_header_value); - h_state = h_general; - break; - } - } - parser->header_state = h_state; - - COUNT_HEADER_SIZE(p - start); - - if (p == data + len) - --p; - break; - } - - case s_header_almost_done: - { - STRICT_CHECK(ch != LF); - - UPDATE_STATE(s_header_value_lws); - break; - } - - case s_header_value_lws: - { - if (ch == ' ' || ch == '\t') { - UPDATE_STATE(s_header_value_start); - REEXECUTE(); - } - - /* finished the header */ - switch (parser->header_state) { - case h_connection_keep_alive: - parser->flags |= F_CONNECTION_KEEP_ALIVE; - break; - case h_connection_close: - parser->flags |= F_CONNECTION_CLOSE; - break; - case h_transfer_encoding_chunked: - parser->flags |= F_CHUNKED; - break; - case h_connection_upgrade: - parser->flags |= F_CONNECTION_UPGRADE; - break; - default: - break; - } - - UPDATE_STATE(s_header_field_start); - REEXECUTE(); - } - - case s_header_value_discard_ws_almost_done: - { - STRICT_CHECK(ch != LF); - UPDATE_STATE(s_header_value_discard_lws); - break; - } - - case s_header_value_discard_lws: - { - if (ch == ' ' || ch == '\t') { - UPDATE_STATE(s_header_value_discard_ws); - break; - } else { - switch (parser->header_state) { - case h_connection_keep_alive: - parser->flags |= F_CONNECTION_KEEP_ALIVE; - break; - case h_connection_close: - parser->flags |= F_CONNECTION_CLOSE; - break; - case h_connection_upgrade: - parser->flags |= F_CONNECTION_UPGRADE; - break; - case h_transfer_encoding_chunked: - parser->flags |= F_CHUNKED; - break; - default: - break; - } - - /* header value was empty */ - MARK(header_value); - UPDATE_STATE(s_header_field_start); - CALLBACK_DATA_NOADVANCE(header_value); - REEXECUTE(); - } - } - - case s_headers_almost_done: - { - STRICT_CHECK(ch != LF); - - if (parser->flags & F_TRAILING) { - /* End of a chunked request */ - UPDATE_STATE(s_message_done); - CALLBACK_NOTIFY_NOADVANCE(chunk_complete); - REEXECUTE(); - } - - UPDATE_STATE(s_headers_done); - - /* Set this here so that on_headers_complete() callbacks can see it */ - parser->upgrade = - ((parser->flags & (F_UPGRADE | F_CONNECTION_UPGRADE)) == - (F_UPGRADE | F_CONNECTION_UPGRADE) || - parser->method == HTTP_CONNECT); - - /* Here we call the headers_complete callback. This is somewhat - * different than other callbacks because if the user returns 1, we - * will interpret that as saying that this message has no body. This - * is needed for the annoying case of recieving a response to a HEAD - * request. - * - * We'd like to use CALLBACK_NOTIFY_NOADVANCE() here but we cannot, so - * we have to simulate it by handling a change in errno below. - */ - if (settings->on_headers_complete) { - switch (settings->on_headers_complete(parser)) { - case 0: - break; - - case 1: - parser->flags |= F_SKIPBODY; - break; - - default: - SET_ERRNO(HPE_CB_headers_complete); - RETURN(p - data); /* Error */ - } - } - - if (HTTP_PARSER_ERRNO(parser) != HPE_OK) { - RETURN(p - data); - } - - REEXECUTE(); - } - - case s_headers_done: - { - STRICT_CHECK(ch != LF); - - parser->nread = 0; - - int hasBody = parser->flags & F_CHUNKED || - (parser->content_length > 0 && parser->content_length != ULLONG_MAX); - if (parser->upgrade && (parser->method == HTTP_CONNECT || - (parser->flags & F_SKIPBODY) || !hasBody)) { - /* Exit, the rest of the message is in a different protocol. */ - UPDATE_STATE(NEW_MESSAGE()); - CALLBACK_NOTIFY(message_complete); - RETURN((p - data) + 1); - } - - if (parser->flags & F_SKIPBODY) { - UPDATE_STATE(NEW_MESSAGE()); - CALLBACK_NOTIFY(message_complete); - } else if (parser->flags & F_CHUNKED) { - /* chunked encoding - ignore Content-Length header */ - UPDATE_STATE(s_chunk_size_start); - } else { - if (parser->content_length == 0) { - /* Content-Length header given but zero: Content-Length: 0\r\n */ - UPDATE_STATE(NEW_MESSAGE()); - CALLBACK_NOTIFY(message_complete); - } else if (parser->content_length != ULLONG_MAX) { - /* Content-Length header given and non-zero */ - UPDATE_STATE(s_body_identity); - } else { - if (parser->type == HTTP_REQUEST || - !http_message_needs_eof(parser)) { - /* Assume content-length 0 - read the next */ - UPDATE_STATE(NEW_MESSAGE()); - CALLBACK_NOTIFY(message_complete); - } else { - /* Read body until EOF */ - UPDATE_STATE(s_body_identity_eof); - } - } - } - - break; - } - - case s_body_identity: - { - uint64_t to_read = MIN(parser->content_length, - (uint64_t) ((data + len) - p)); - - assert(parser->content_length != 0 - && parser->content_length != ULLONG_MAX); - - /* The difference between advancing content_length and p is because - * the latter will automaticaly advance on the next loop iteration. - * Further, if content_length ends up at 0, we want to see the last - * byte again for our message complete callback. - */ - MARK(body); - parser->content_length -= to_read; - p += to_read - 1; - - if (parser->content_length == 0) { - UPDATE_STATE(s_message_done); - - /* Mimic CALLBACK_DATA_NOADVANCE() but with one extra byte. - * - * The alternative to doing this is to wait for the next byte to - * trigger the data callback, just as in every other case. The - * problem with this is that this makes it difficult for the test - * harness to distinguish between complete-on-EOF and - * complete-on-length. It's not clear that this distinction is - * important for applications, but let's keep it for now. - */ - CALLBACK_DATA_(body, p - body_mark + 1, p - data); - REEXECUTE(); - } - - break; - } - - /* read until EOF */ - case s_body_identity_eof: - MARK(body); - p = data + len - 1; - - break; - - case s_message_done: - UPDATE_STATE(NEW_MESSAGE()); - CALLBACK_NOTIFY(message_complete); - if (parser->upgrade) { - /* Exit, the rest of the message is in a different protocol. */ - RETURN((p - data) + 1); - } - break; - - case s_chunk_size_start: - { - assert(parser->nread == 1); - assert(parser->flags & F_CHUNKED); - - unhex_val = unhex[(unsigned char)ch]; - if (UNLIKELY(unhex_val == -1)) { - SET_ERRNO(HPE_INVALID_CHUNK_SIZE); - goto error; - } - - parser->content_length = unhex_val; - UPDATE_STATE(s_chunk_size); - break; - } - - case s_chunk_size: - { - uint64_t t; - - assert(parser->flags & F_CHUNKED); - - if (ch == CR) { - UPDATE_STATE(s_chunk_size_almost_done); - break; - } - - unhex_val = unhex[(unsigned char)ch]; - - if (unhex_val == -1) { - if (ch == ';' || ch == ' ') { - UPDATE_STATE(s_chunk_parameters); - break; - } - - SET_ERRNO(HPE_INVALID_CHUNK_SIZE); - goto error; - } - - t = parser->content_length; - t *= 16; - t += unhex_val; - - /* Overflow? Test against a conservative limit for simplicity. */ - if (UNLIKELY((ULLONG_MAX - 16) / 16 < parser->content_length)) { - SET_ERRNO(HPE_INVALID_CONTENT_LENGTH); - goto error; - } - - parser->content_length = t; - break; - } - - case s_chunk_parameters: - { - assert(parser->flags & F_CHUNKED); - /* just ignore this shit. TODO check for overflow */ - if (ch == CR) { - UPDATE_STATE(s_chunk_size_almost_done); - break; - } - break; - } - - case s_chunk_size_almost_done: - { - assert(parser->flags & F_CHUNKED); - STRICT_CHECK(ch != LF); - - parser->nread = 0; - - if (parser->content_length == 0) { - parser->flags |= F_TRAILING; - UPDATE_STATE(s_header_field_start); - } else { - UPDATE_STATE(s_chunk_data); - } - CALLBACK_NOTIFY(chunk_header); - break; - } - - case s_chunk_data: - { - uint64_t to_read = MIN(parser->content_length, - (uint64_t) ((data + len) - p)); - - assert(parser->flags & F_CHUNKED); - assert(parser->content_length != 0 - && parser->content_length != ULLONG_MAX); - - /* See the explanation in s_body_identity for why the content - * length and data pointers are managed this way. - */ - MARK(body); - parser->content_length -= to_read; - p += to_read - 1; - - if (parser->content_length == 0) { - UPDATE_STATE(s_chunk_data_almost_done); - } - - break; - } - - case s_chunk_data_almost_done: - assert(parser->flags & F_CHUNKED); - assert(parser->content_length == 0); - STRICT_CHECK(ch != CR); - UPDATE_STATE(s_chunk_data_done); - CALLBACK_DATA(body); - break; - - case s_chunk_data_done: - assert(parser->flags & F_CHUNKED); - STRICT_CHECK(ch != LF); - parser->nread = 0; - UPDATE_STATE(s_chunk_size_start); - CALLBACK_NOTIFY(chunk_complete); - break; - - default: - assert(0 && "unhandled state"); - SET_ERRNO(HPE_INVALID_INTERNAL_STATE); - goto error; - } - } - - /* Run callbacks for any marks that we have leftover after we ran our of - * bytes. There should be at most one of these set, so it's OK to invoke - * them in series (unset marks will not result in callbacks). - * - * We use the NOADVANCE() variety of callbacks here because 'p' has already - * overflowed 'data' and this allows us to correct for the off-by-one that - * we'd otherwise have (since CALLBACK_DATA() is meant to be run with a 'p' - * value that's in-bounds). - */ - - assert(((header_field_mark ? 1 : 0) + - (header_value_mark ? 1 : 0) + - (url_mark ? 1 : 0) + - (body_mark ? 1 : 0) + - (status_mark ? 1 : 0)) <= 1); - - CALLBACK_DATA_NOADVANCE(header_field); - CALLBACK_DATA_NOADVANCE(header_value); - CALLBACK_DATA_NOADVANCE(url); - CALLBACK_DATA_NOADVANCE(body); - CALLBACK_DATA_NOADVANCE(status); - - RETURN(len); - -error: - if (HTTP_PARSER_ERRNO(parser) == HPE_OK) { - SET_ERRNO(HPE_UNKNOWN); - } - - RETURN(p - data); -} - - -/* Does the parser need to see an EOF to find the end of the message? */ -int -http_message_needs_eof (const http_parser *parser) -{ - if (parser->type == HTTP_REQUEST) { - return 0; - } - - /* See RFC 2616 section 4.4 */ - if (parser->status_code / 100 == 1 || /* 1xx e.g. Continue */ - parser->status_code == 204 || /* No Content */ - parser->status_code == 304 || /* Not Modified */ - parser->flags & F_SKIPBODY) { /* response to a HEAD request */ - return 0; - } - - if ((parser->flags & F_CHUNKED) || parser->content_length != ULLONG_MAX) { - return 0; - } - - return 1; -} - - -int -http_should_keep_alive (const http_parser *parser) -{ - if (parser->http_major > 0 && parser->http_minor > 0) { - /* HTTP/1.1 */ - if (parser->flags & F_CONNECTION_CLOSE) { - return 0; - } - } else { - /* HTTP/1.0 or earlier */ - if (!(parser->flags & F_CONNECTION_KEEP_ALIVE)) { - return 0; - } - } - - return !http_message_needs_eof(parser); -} - - -const char * -http_method_str (enum http_method m) -{ - return ELEM_AT(method_strings, m, ""); -} - - -void -http_parser_init (http_parser *parser, enum http_parser_type t) -{ - void *data = parser->data; /* preserve application data */ - memset(parser, 0, sizeof(*parser)); - parser->data = data; - parser->type = t; - parser->state = (t == HTTP_REQUEST ? s_start_req : (t == HTTP_RESPONSE ? s_start_res : s_start_req_or_res)); - parser->http_errno = HPE_OK; -} - -void -http_parser_settings_init(http_parser_settings *settings) -{ - memset(settings, 0, sizeof(*settings)); -} - -const char * -http_errno_name(enum http_errno err) { - assert(((size_t) err) < - (sizeof(http_strerror_tab) / sizeof(http_strerror_tab[0]))); - return http_strerror_tab[err].name; -} - -const char * -http_errno_description(enum http_errno err) { - assert(((size_t) err) < - (sizeof(http_strerror_tab) / sizeof(http_strerror_tab[0]))); - return http_strerror_tab[err].description; -} - -static enum http_host_state -http_parse_host_char(enum http_host_state s, const char ch) { - switch(s) { - case s_http_userinfo: - case s_http_userinfo_start: - if (ch == '@') { - return s_http_host_start; - } - - if (IS_USERINFO_CHAR(ch)) { - return s_http_userinfo; - } - break; - - case s_http_host_start: - if (ch == '[') { - return s_http_host_v6_start; - } - - if (IS_HOST_CHAR(ch)) { - return s_http_host; - } - - break; - - case s_http_host: - if (IS_HOST_CHAR(ch)) { - return s_http_host; - } - - /* FALLTHROUGH */ - case s_http_host_v6_end: - if (ch == ':') { - return s_http_host_port_start; - } - - break; - - case s_http_host_v6: - if (ch == ']') { - return s_http_host_v6_end; - } - - /* FALLTHROUGH */ - case s_http_host_v6_start: - if (IS_HEX(ch) || ch == ':' || ch == '.') { - return s_http_host_v6; - } - - break; - - case s_http_host_port: - case s_http_host_port_start: - if (IS_NUM(ch)) { - return s_http_host_port; - } - - break; - - default: - break; - } - return s_http_host_dead; -} - -static int -http_parse_host(const char * buf, struct http_parser_url *u, int found_at) { - enum http_host_state s; - - const char *p; - size_t buflen = u->field_data[UF_HOST].off + u->field_data[UF_HOST].len; - - u->field_data[UF_HOST].len = 0; - - s = found_at ? s_http_userinfo_start : s_http_host_start; - - for (p = buf + u->field_data[UF_HOST].off; p < buf + buflen; p++) { - enum http_host_state new_s = http_parse_host_char(s, *p); - - if (new_s == s_http_host_dead) { - return 1; - } - - switch(new_s) { - case s_http_host: - if (s != s_http_host) { - u->field_data[UF_HOST].off = p - buf; - } - u->field_data[UF_HOST].len++; - break; - - case s_http_host_v6: - if (s != s_http_host_v6) { - u->field_data[UF_HOST].off = p - buf; - } - u->field_data[UF_HOST].len++; - break; - - case s_http_host_port: - if (s != s_http_host_port) { - u->field_data[UF_PORT].off = p - buf; - u->field_data[UF_PORT].len = 0; - u->field_set |= (1 << UF_PORT); - } - u->field_data[UF_PORT].len++; - break; - - case s_http_userinfo: - if (s != s_http_userinfo) { - u->field_data[UF_USERINFO].off = p - buf ; - u->field_data[UF_USERINFO].len = 0; - u->field_set |= (1 << UF_USERINFO); - } - u->field_data[UF_USERINFO].len++; - break; - - default: - break; - } - s = new_s; - } - - /* Make sure we don't end somewhere unexpected */ - switch (s) { - case s_http_host_start: - case s_http_host_v6_start: - case s_http_host_v6: - case s_http_host_port_start: - case s_http_userinfo: - case s_http_userinfo_start: - return 1; - default: - break; - } - - return 0; -} - -int -http_parser_parse_url(const char *buf, size_t buflen, int is_connect, - struct http_parser_url *u) -{ - enum state s; - const char *p; - enum http_parser_url_fields uf, old_uf; - int found_at = 0; - - u->port = u->field_set = 0; - s = is_connect ? s_req_server_start : s_req_spaces_before_url; - old_uf = UF_MAX; - - for (p = buf; p < buf + buflen; p++) { - s = parse_url_char(s, *p); - - /* Figure out the next field that we're operating on */ - switch (s) { - case s_dead: - return 1; - - /* Skip delimeters */ - case s_req_schema_slash: - case s_req_schema_slash_slash: - case s_req_server_start: - case s_req_query_string_start: - case s_req_fragment_start: - continue; - - case s_req_schema: - uf = UF_SCHEMA; - break; - - case s_req_server_with_at: - found_at = 1; - - /* FALLTROUGH */ - case s_req_server: - uf = UF_HOST; - break; - - case s_req_path: - uf = UF_PATH; - break; - - case s_req_query_string: - uf = UF_QUERY; - break; - - case s_req_fragment: - uf = UF_FRAGMENT; - break; - - default: - assert(!"Unexpected state"); - return 1; - } - - /* Nothing's changed; soldier on */ - if (uf == old_uf) { - u->field_data[uf].len++; - continue; - } - - u->field_data[uf].off = p - buf; - u->field_data[uf].len = 1; - - u->field_set |= (1 << uf); - old_uf = uf; - } - - /* host must be present if there is a schema */ - /* parsing http:///toto will fail */ - if ((u->field_set & ((1 << UF_SCHEMA) | (1 << UF_HOST))) != 0) { - if (http_parse_host(buf, u, found_at) != 0) { - return 1; - } - } - - /* CONNECT requests can only contain "hostname:port" */ - if (is_connect && u->field_set != ((1 << UF_HOST)|(1 << UF_PORT))) { - return 1; - } - - if (u->field_set & (1 << UF_PORT)) { - /* Don't bother with endp; we've already validated the string */ - unsigned long v = strtoul(buf + u->field_data[UF_PORT].off, NULL, 10); - - /* Ports have a max value of 2^16 */ - if (v > 0xffff) { - return 1; - } - - u->port = (uint16_t) v; - } - - return 0; -} - -void -http_parser_pause(http_parser *parser, int paused) { - /* Users should only be pausing/unpausing a parser that is not in an error - * state. In non-debug builds, there's not much that we can do about this - * other than ignore it. - */ - if (HTTP_PARSER_ERRNO(parser) == HPE_OK || - HTTP_PARSER_ERRNO(parser) == HPE_PAUSED) { - SET_ERRNO((paused) ? HPE_PAUSED : HPE_OK); - } else { - assert(0 && "Attempting to pause parser in error state"); - } -} - -int -http_body_is_final(const struct http_parser *parser) { - return parser->state == s_message_done; -} - -unsigned long -http_parser_version(void) { - return HTTP_PARSER_VERSION_MAJOR * 0x10000 | - HTTP_PARSER_VERSION_MINOR * 0x00100 | - HTTP_PARSER_VERSION_PATCH * 0x00001; -} diff --git a/vendor/http_parser/http_parser.gyp b/vendor/http_parser/http_parser.gyp deleted file mode 100644 index ef34ecaeae..0000000000 --- a/vendor/http_parser/http_parser.gyp +++ /dev/null @@ -1,111 +0,0 @@ -# This file is used with the GYP meta build system. -# http://code.google.com/p/gyp/ -# To build try this: -# svn co http://gyp.googlecode.com/svn/trunk gyp -# ./gyp/gyp -f make --depth=`pwd` http_parser.gyp -# ./out/Debug/test -{ - 'target_defaults': { - 'default_configuration': 'Debug', - 'configurations': { - # TODO: hoist these out and put them somewhere common, because - # RuntimeLibrary MUST MATCH across the entire project - 'Debug': { - 'defines': [ 'DEBUG', '_DEBUG' ], - 'cflags': [ '-Wall', '-Wextra', '-O0', '-g', '-ftrapv' ], - 'msvs_settings': { - 'VCCLCompilerTool': { - 'RuntimeLibrary': 1, # static debug - }, - }, - }, - 'Release': { - 'defines': [ 'NDEBUG' ], - 'cflags': [ '-Wall', '-Wextra', '-O3' ], - 'msvs_settings': { - 'VCCLCompilerTool': { - 'RuntimeLibrary': 0, # static release - }, - }, - } - }, - 'msvs_settings': { - 'VCCLCompilerTool': { - }, - 'VCLibrarianTool': { - }, - 'VCLinkerTool': { - 'GenerateDebugInformation': 'true', - }, - }, - 'conditions': [ - ['OS == "win"', { - 'defines': [ - 'WIN32' - ], - }] - ], - }, - - 'targets': [ - { - 'target_name': 'http_parser', - 'type': 'static_library', - 'include_dirs': [ '.' ], - 'direct_dependent_settings': { - 'defines': [ 'HTTP_PARSER_STRICT=0' ], - 'include_dirs': [ '.' ], - }, - 'defines': [ 'HTTP_PARSER_STRICT=0' ], - 'sources': [ './http_parser.c', ], - 'conditions': [ - ['OS=="win"', { - 'msvs_settings': { - 'VCCLCompilerTool': { - # Compile as C++. http_parser.c is actually C99, but C++ is - # close enough in this case. - 'CompileAs': 2, - }, - }, - }] - ], - }, - - { - 'target_name': 'http_parser_strict', - 'type': 'static_library', - 'include_dirs': [ '.' ], - 'direct_dependent_settings': { - 'defines': [ 'HTTP_PARSER_STRICT=1' ], - 'include_dirs': [ '.' ], - }, - 'defines': [ 'HTTP_PARSER_STRICT=1' ], - 'sources': [ './http_parser.c', ], - 'conditions': [ - ['OS=="win"', { - 'msvs_settings': { - 'VCCLCompilerTool': { - # Compile as C++. http_parser.c is actually C99, but C++ is - # close enough in this case. - 'CompileAs': 2, - }, - }, - }] - ], - }, - - { - 'target_name': 'test-nonstrict', - 'type': 'executable', - 'dependencies': [ 'http_parser' ], - 'sources': [ 'test.c' ] - }, - - { - 'target_name': 'test-strict', - 'type': 'executable', - 'dependencies': [ 'http_parser_strict' ], - 'sources': [ 'test.c' ] - } - ] -} diff --git a/vendor/http_parser/http_parser.h b/vendor/http_parser/http_parser.h deleted file mode 100644 index eb71bf9921..0000000000 --- a/vendor/http_parser/http_parser.h +++ /dev/null @@ -1,342 +0,0 @@ -/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ -#ifndef http_parser_h -#define http_parser_h -#ifdef __cplusplus -extern "C" { -#endif - -/* Also update SONAME in the Makefile whenever you change these. */ -#define HTTP_PARSER_VERSION_MAJOR 2 -#define HTTP_PARSER_VERSION_MINOR 5 -#define HTTP_PARSER_VERSION_PATCH 0 - -#include -#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600) -#include -#include -typedef __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -#else -#include -#endif - -/* Compile with -DHTTP_PARSER_STRICT=0 to make less checks, but run - * faster - */ -#ifndef HTTP_PARSER_STRICT -# define HTTP_PARSER_STRICT 1 -#endif - -/* Maximium header size allowed. If the macro is not defined - * before including this header then the default is used. To - * change the maximum header size, define the macro in the build - * environment (e.g. -DHTTP_MAX_HEADER_SIZE=). To remove - * the effective limit on the size of the header, define the macro - * to a very large number (e.g. -DHTTP_MAX_HEADER_SIZE=0x7fffffff) - */ -#ifndef HTTP_MAX_HEADER_SIZE -# define HTTP_MAX_HEADER_SIZE (80*1024) -#endif - -typedef struct http_parser http_parser; -typedef struct http_parser_settings http_parser_settings; - - -/* Callbacks should return non-zero to indicate an error. The parser will - * then halt execution. - * - * The one exception is on_headers_complete. In a HTTP_RESPONSE parser - * returning '1' from on_headers_complete will tell the parser that it - * should not expect a body. This is used when receiving a response to a - * HEAD request which may contain 'Content-Length' or 'Transfer-Encoding: - * chunked' headers that indicate the presence of a body. - * - * http_data_cb does not return data chunks. It will be called arbitrarily - * many times for each string. E.G. you might get 10 callbacks for "on_url" - * each providing just a few characters more data. - */ -typedef int (*http_data_cb) (http_parser*, const char *at, size_t length); -typedef int (*http_cb) (http_parser*); - - -/* Request Methods */ -#define HTTP_METHOD_MAP(XX) \ - XX(0, DELETE, DELETE) \ - XX(1, GET, GET) \ - XX(2, HEAD, HEAD) \ - XX(3, POST, POST) \ - XX(4, PUT, PUT) \ - /* pathological */ \ - XX(5, CONNECT, CONNECT) \ - XX(6, OPTIONS, OPTIONS) \ - XX(7, TRACE, TRACE) \ - /* webdav */ \ - XX(8, COPY, COPY) \ - XX(9, LOCK, LOCK) \ - XX(10, MKCOL, MKCOL) \ - XX(11, MOVE, MOVE) \ - XX(12, PROPFIND, PROPFIND) \ - XX(13, PROPPATCH, PROPPATCH) \ - XX(14, SEARCH, SEARCH) \ - XX(15, UNLOCK, UNLOCK) \ - /* subversion */ \ - XX(16, REPORT, REPORT) \ - XX(17, MKACTIVITY, MKACTIVITY) \ - XX(18, CHECKOUT, CHECKOUT) \ - XX(19, MERGE, MERGE) \ - /* upnp */ \ - XX(20, MSEARCH, M-SEARCH) \ - XX(21, NOTIFY, NOTIFY) \ - XX(22, SUBSCRIBE, SUBSCRIBE) \ - XX(23, UNSUBSCRIBE, UNSUBSCRIBE) \ - /* RFC-5789 */ \ - XX(24, PATCH, PATCH) \ - XX(25, PURGE, PURGE) \ - /* CalDAV */ \ - XX(26, MKCALENDAR, MKCALENDAR) \ - -enum http_method - { -#define XX(num, name, string) HTTP_##name = num, - HTTP_METHOD_MAP(XX) -#undef XX - }; - - -enum http_parser_type { HTTP_REQUEST, HTTP_RESPONSE, HTTP_BOTH }; - - -/* Flag values for http_parser.flags field */ -enum flags - { F_CHUNKED = 1 << 0 - , F_CONNECTION_KEEP_ALIVE = 1 << 1 - , F_CONNECTION_CLOSE = 1 << 2 - , F_CONNECTION_UPGRADE = 1 << 3 - , F_TRAILING = 1 << 4 - , F_UPGRADE = 1 << 5 - , F_SKIPBODY = 1 << 6 - }; - - -/* Map for errno-related constants - * - * The provided argument should be a macro that takes 2 arguments. - */ -#define HTTP_ERRNO_MAP(XX) \ - /* No error */ \ - XX(OK, "success") \ - \ - /* Callback-related errors */ \ - XX(CB_message_begin, "the on_message_begin callback failed") \ - XX(CB_url, "the on_url callback failed") \ - XX(CB_header_field, "the on_header_field callback failed") \ - XX(CB_header_value, "the on_header_value callback failed") \ - XX(CB_headers_complete, "the on_headers_complete callback failed") \ - XX(CB_body, "the on_body callback failed") \ - XX(CB_message_complete, "the on_message_complete callback failed") \ - XX(CB_status, "the on_status callback failed") \ - XX(CB_chunk_header, "the on_chunk_header callback failed") \ - XX(CB_chunk_complete, "the on_chunk_complete callback failed") \ - \ - /* Parsing-related errors */ \ - XX(INVALID_EOF_STATE, "stream ended at an unexpected time") \ - XX(HEADER_OVERFLOW, \ - "too many header bytes seen; overflow detected") \ - XX(CLOSED_CONNECTION, \ - "data received after completed connection: close message") \ - XX(INVALID_VERSION, "invalid HTTP version") \ - XX(INVALID_STATUS, "invalid HTTP status code") \ - XX(INVALID_METHOD, "invalid HTTP method") \ - XX(INVALID_URL, "invalid URL") \ - XX(INVALID_HOST, "invalid host") \ - XX(INVALID_PORT, "invalid port") \ - XX(INVALID_PATH, "invalid path") \ - XX(INVALID_QUERY_STRING, "invalid query string") \ - XX(INVALID_FRAGMENT, "invalid fragment") \ - XX(LF_EXPECTED, "LF character expected") \ - XX(INVALID_HEADER_TOKEN, "invalid character in header") \ - XX(INVALID_CONTENT_LENGTH, \ - "invalid character in content-length header") \ - XX(INVALID_CHUNK_SIZE, \ - "invalid character in chunk size header") \ - XX(INVALID_CONSTANT, "invalid constant string") \ - XX(INVALID_INTERNAL_STATE, "encountered unexpected internal state")\ - XX(STRICT, "strict mode assertion failed") \ - XX(PAUSED, "parser is paused") \ - XX(UNKNOWN, "an unknown error occurred") - - -/* Define HPE_* values for each errno value above */ -#define HTTP_ERRNO_GEN(n, s) HPE_##n, -enum http_errno { - HTTP_ERRNO_MAP(HTTP_ERRNO_GEN) -}; -#undef HTTP_ERRNO_GEN - - -/* Get an http_errno value from an http_parser */ -#define HTTP_PARSER_ERRNO(p) ((enum http_errno) (p)->http_errno) - - -struct http_parser { - /** PRIVATE **/ - unsigned int type : 2; /* enum http_parser_type */ - unsigned int flags : 7; /* F_* values from 'flags' enum; semi-public */ - unsigned int state : 7; /* enum state from http_parser.c */ - unsigned int header_state : 8; /* enum header_state from http_parser.c */ - unsigned int index : 8; /* index into current matcher */ - - uint32_t nread; /* # bytes read in various scenarios */ - uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */ - - /** READ-ONLY **/ - unsigned short http_major; - unsigned short http_minor; - unsigned int status_code : 16; /* responses only */ - unsigned int method : 8; /* requests only */ - unsigned int http_errno : 7; - - /* 1 = Upgrade header was present and the parser has exited because of that. - * 0 = No upgrade header present. - * Should be checked when http_parser_execute() returns in addition to - * error checking. - */ - unsigned int upgrade : 1; - - /** PUBLIC **/ - void *data; /* A pointer to get hook to the "connection" or "socket" object */ -}; - - -struct http_parser_settings { - http_cb on_message_begin; - http_data_cb on_url; - http_data_cb on_status; - http_data_cb on_header_field; - http_data_cb on_header_value; - http_cb on_headers_complete; - http_data_cb on_body; - http_cb on_message_complete; - /* When on_chunk_header is called, the current chunk length is stored - * in parser->content_length. - */ - http_cb on_chunk_header; - http_cb on_chunk_complete; -}; - - -enum http_parser_url_fields - { UF_SCHEMA = 0 - , UF_HOST = 1 - , UF_PORT = 2 - , UF_PATH = 3 - , UF_QUERY = 4 - , UF_FRAGMENT = 5 - , UF_USERINFO = 6 - , UF_MAX = 7 - }; - - -/* Result structure for http_parser_parse_url(). - * - * Callers should index into field_data[] with UF_* values iff field_set - * has the relevant (1 << UF_*) bit set. As a courtesy to clients (and - * because we probably have padding left over), we convert any port to - * a uint16_t. - */ -struct http_parser_url { - uint16_t field_set; /* Bitmask of (1 << UF_*) values */ - uint16_t port; /* Converted UF_PORT string */ - - struct { - uint16_t off; /* Offset into buffer in which field starts */ - uint16_t len; /* Length of run in buffer */ - } field_data[UF_MAX]; -}; - - -/* Returns the library version. Bits 16-23 contain the major version number, - * bits 8-15 the minor version number and bits 0-7 the patch level. - * Usage example: - * - * unsigned long version = http_parser_version(); - * unsigned major = (version >> 16) & 255; - * unsigned minor = (version >> 8) & 255; - * unsigned patch = version & 255; - * printf("http_parser v%u.%u.%u\n", major, minor, patch); - */ -unsigned long http_parser_version(void); - -void http_parser_init(http_parser *parser, enum http_parser_type type); - - -/* Initialize http_parser_settings members to 0 - */ -void http_parser_settings_init(http_parser_settings *settings); - - -/* Executes the parser. Returns number of parsed bytes. Sets - * `parser->http_errno` on error. */ -size_t http_parser_execute(http_parser *parser, - const http_parser_settings *settings, - const char *data, - size_t len); - - -/* If http_should_keep_alive() in the on_headers_complete or - * on_message_complete callback returns 0, then this should be - * the last message on the connection. - * If you are the server, respond with the "Connection: close" header. - * If you are the client, close the connection. - */ -int http_should_keep_alive(const http_parser *parser); - -/* Returns a string version of the HTTP method. */ -const char *http_method_str(enum http_method m); - -/* Return a string name of the given error */ -const char *http_errno_name(enum http_errno err); - -/* Return a string description of the given error */ -const char *http_errno_description(enum http_errno err); - -/* Parse a URL; return nonzero on failure */ -int http_parser_parse_url(const char *buf, size_t buflen, - int is_connect, - struct http_parser_url *u); - -/* Pause or un-pause the parser; a nonzero value pauses */ -void http_parser_pause(http_parser *parser, int paused); - -/* Checks if this is the final chunk of the body. */ -int http_body_is_final(const http_parser *parser); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/vendor/http_parser/test.c b/vendor/http_parser/test.c deleted file mode 100644 index 4c00571eba..0000000000 --- a/vendor/http_parser/test.c +++ /dev/null @@ -1,3852 +0,0 @@ -/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ -#include "http_parser.h" -#include -#include -#include -#include /* rand */ -#include -#include - -#if defined(__APPLE__) -# undef strlcat -# undef strlncpy -# undef strlcpy -#endif /* defined(__APPLE__) */ - -#undef TRUE -#define TRUE 1 -#undef FALSE -#define FALSE 0 - -#define MAX_HEADERS 13 -#define MAX_ELEMENT_SIZE 2048 -#define MAX_CHUNKS 16 - -#define MIN(a,b) ((a) < (b) ? (a) : (b)) - -static http_parser *parser; - -struct message { - const char *name; // for debugging purposes - const char *raw; - enum http_parser_type type; - enum http_method method; - int status_code; - char response_status[MAX_ELEMENT_SIZE]; - char request_path[MAX_ELEMENT_SIZE]; - char request_url[MAX_ELEMENT_SIZE]; - char fragment[MAX_ELEMENT_SIZE]; - char query_string[MAX_ELEMENT_SIZE]; - char body[MAX_ELEMENT_SIZE]; - size_t body_size; - const char *host; - const char *userinfo; - uint16_t port; - int num_headers; - enum { NONE=0, FIELD, VALUE } last_header_element; - char headers [MAX_HEADERS][2][MAX_ELEMENT_SIZE]; - int should_keep_alive; - - int num_chunks; - int num_chunks_complete; - int chunk_lengths[MAX_CHUNKS]; - - const char *upgrade; // upgraded body - - unsigned short http_major; - unsigned short http_minor; - - int message_begin_cb_called; - int headers_complete_cb_called; - int message_complete_cb_called; - int message_complete_on_eof; - int body_is_final; -}; - -static int currently_parsing_eof; - -static struct message messages[5]; -static int num_messages; -static http_parser_settings *current_pause_parser; - -/* * R E Q U E S T S * */ -const struct message requests[] = -#define CURL_GET 0 -{ {.name= "curl get" - ,.type= HTTP_REQUEST - ,.raw= "GET /test HTTP/1.1\r\n" - "User-Agent: curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1\r\n" - "Host: 0.0.0.0=5000\r\n" - "Accept: */*\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/test" - ,.request_url= "/test" - ,.num_headers= 3 - ,.headers= - { { "User-Agent", "curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1" } - , { "Host", "0.0.0.0=5000" } - , { "Accept", "*/*" } - } - ,.body= "" - } - -#define FIREFOX_GET 1 -, {.name= "firefox get" - ,.type= HTTP_REQUEST - ,.raw= "GET /favicon.ico HTTP/1.1\r\n" - "Host: 0.0.0.0=5000\r\n" - "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0\r\n" - "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n" - "Accept-Language: en-us,en;q=0.5\r\n" - "Accept-Encoding: gzip,deflate\r\n" - "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n" - "Keep-Alive: 300\r\n" - "Connection: keep-alive\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/favicon.ico" - ,.request_url= "/favicon.ico" - ,.num_headers= 8 - ,.headers= - { { "Host", "0.0.0.0=5000" } - , { "User-Agent", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0" } - , { "Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" } - , { "Accept-Language", "en-us,en;q=0.5" } - , { "Accept-Encoding", "gzip,deflate" } - , { "Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7" } - , { "Keep-Alive", "300" } - , { "Connection", "keep-alive" } - } - ,.body= "" - } - -#define DUMBFUCK 2 -, {.name= "dumbfuck" - ,.type= HTTP_REQUEST - ,.raw= "GET /dumbfuck HTTP/1.1\r\n" - "aaaaaaaaaaaaa:++++++++++\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/dumbfuck" - ,.request_url= "/dumbfuck" - ,.num_headers= 1 - ,.headers= - { { "aaaaaaaaaaaaa", "++++++++++" } - } - ,.body= "" - } - -#define FRAGMENT_IN_URI 3 -, {.name= "fragment in url" - ,.type= HTTP_REQUEST - ,.raw= "GET /forums/1/topics/2375?page=1#posts-17408 HTTP/1.1\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "page=1" - ,.fragment= "posts-17408" - ,.request_path= "/forums/1/topics/2375" - /* XXX request url does include fragment? */ - ,.request_url= "/forums/1/topics/2375?page=1#posts-17408" - ,.num_headers= 0 - ,.body= "" - } - -#define GET_NO_HEADERS_NO_BODY 4 -, {.name= "get no headers no body" - ,.type= HTTP_REQUEST - ,.raw= "GET /get_no_headers_no_body/world HTTP/1.1\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE /* would need Connection: close */ - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/get_no_headers_no_body/world" - ,.request_url= "/get_no_headers_no_body/world" - ,.num_headers= 0 - ,.body= "" - } - -#define GET_ONE_HEADER_NO_BODY 5 -, {.name= "get one header no body" - ,.type= HTTP_REQUEST - ,.raw= "GET /get_one_header_no_body HTTP/1.1\r\n" - "Accept: */*\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE /* would need Connection: close */ - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/get_one_header_no_body" - ,.request_url= "/get_one_header_no_body" - ,.num_headers= 1 - ,.headers= - { { "Accept" , "*/*" } - } - ,.body= "" - } - -#define GET_FUNKY_CONTENT_LENGTH 6 -, {.name= "get funky content length body hello" - ,.type= HTTP_REQUEST - ,.raw= "GET /get_funky_content_length_body_hello HTTP/1.0\r\n" - "conTENT-Length: 5\r\n" - "\r\n" - "HELLO" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 0 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/get_funky_content_length_body_hello" - ,.request_url= "/get_funky_content_length_body_hello" - ,.num_headers= 1 - ,.headers= - { { "conTENT-Length" , "5" } - } - ,.body= "HELLO" - } - -#define POST_IDENTITY_BODY_WORLD 7 -, {.name= "post identity body world" - ,.type= HTTP_REQUEST - ,.raw= "POST /post_identity_body_world?q=search#hey HTTP/1.1\r\n" - "Accept: */*\r\n" - "Transfer-Encoding: identity\r\n" - "Content-Length: 5\r\n" - "\r\n" - "World" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_POST - ,.query_string= "q=search" - ,.fragment= "hey" - ,.request_path= "/post_identity_body_world" - ,.request_url= "/post_identity_body_world?q=search#hey" - ,.num_headers= 3 - ,.headers= - { { "Accept", "*/*" } - , { "Transfer-Encoding", "identity" } - , { "Content-Length", "5" } - } - ,.body= "World" - } - -#define POST_CHUNKED_ALL_YOUR_BASE 8 -, {.name= "post - chunked body: all your base are belong to us" - ,.type= HTTP_REQUEST - ,.raw= "POST /post_chunked_all_your_base HTTP/1.1\r\n" - "Transfer-Encoding: chunked\r\n" - "\r\n" - "1e\r\nall your base are belong to us\r\n" - "0\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_POST - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/post_chunked_all_your_base" - ,.request_url= "/post_chunked_all_your_base" - ,.num_headers= 1 - ,.headers= - { { "Transfer-Encoding" , "chunked" } - } - ,.body= "all your base are belong to us" - ,.num_chunks_complete= 2 - ,.chunk_lengths= { 0x1e } - } - -#define TWO_CHUNKS_MULT_ZERO_END 9 -, {.name= "two chunks ; triple zero ending" - ,.type= HTTP_REQUEST - ,.raw= "POST /two_chunks_mult_zero_end HTTP/1.1\r\n" - "Transfer-Encoding: chunked\r\n" - "\r\n" - "5\r\nhello\r\n" - "6\r\n world\r\n" - "000\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_POST - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/two_chunks_mult_zero_end" - ,.request_url= "/two_chunks_mult_zero_end" - ,.num_headers= 1 - ,.headers= - { { "Transfer-Encoding", "chunked" } - } - ,.body= "hello world" - ,.num_chunks_complete= 3 - ,.chunk_lengths= { 5, 6 } - } - -#define CHUNKED_W_TRAILING_HEADERS 10 -, {.name= "chunked with trailing headers. blech." - ,.type= HTTP_REQUEST - ,.raw= "POST /chunked_w_trailing_headers HTTP/1.1\r\n" - "Transfer-Encoding: chunked\r\n" - "\r\n" - "5\r\nhello\r\n" - "6\r\n world\r\n" - "0\r\n" - "Vary: *\r\n" - "Content-Type: text/plain\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_POST - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/chunked_w_trailing_headers" - ,.request_url= "/chunked_w_trailing_headers" - ,.num_headers= 3 - ,.headers= - { { "Transfer-Encoding", "chunked" } - , { "Vary", "*" } - , { "Content-Type", "text/plain" } - } - ,.body= "hello world" - ,.num_chunks_complete= 3 - ,.chunk_lengths= { 5, 6 } - } - -#define CHUNKED_W_BULLSHIT_AFTER_LENGTH 11 -, {.name= "with bullshit after the length" - ,.type= HTTP_REQUEST - ,.raw= "POST /chunked_w_bullshit_after_length HTTP/1.1\r\n" - "Transfer-Encoding: chunked\r\n" - "\r\n" - "5; ihatew3;whatthefuck=aretheseparametersfor\r\nhello\r\n" - "6; blahblah; blah\r\n world\r\n" - "0\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_POST - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/chunked_w_bullshit_after_length" - ,.request_url= "/chunked_w_bullshit_after_length" - ,.num_headers= 1 - ,.headers= - { { "Transfer-Encoding", "chunked" } - } - ,.body= "hello world" - ,.num_chunks_complete= 3 - ,.chunk_lengths= { 5, 6 } - } - -#define WITH_QUOTES 12 -, {.name= "with quotes" - ,.type= HTTP_REQUEST - ,.raw= "GET /with_\"stupid\"_quotes?foo=\"bar\" HTTP/1.1\r\n\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "foo=\"bar\"" - ,.fragment= "" - ,.request_path= "/with_\"stupid\"_quotes" - ,.request_url= "/with_\"stupid\"_quotes?foo=\"bar\"" - ,.num_headers= 0 - ,.headers= { } - ,.body= "" - } - -#define APACHEBENCH_GET 13 -/* The server receiving this request SHOULD NOT wait for EOF - * to know that content-length == 0. - * How to represent this in a unit test? message_complete_on_eof - * Compare with NO_CONTENT_LENGTH_RESPONSE. - */ -, {.name = "apachebench get" - ,.type= HTTP_REQUEST - ,.raw= "GET /test HTTP/1.0\r\n" - "Host: 0.0.0.0:5000\r\n" - "User-Agent: ApacheBench/2.3\r\n" - "Accept: */*\r\n\r\n" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 0 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/test" - ,.request_url= "/test" - ,.num_headers= 3 - ,.headers= { { "Host", "0.0.0.0:5000" } - , { "User-Agent", "ApacheBench/2.3" } - , { "Accept", "*/*" } - } - ,.body= "" - } - -#define QUERY_URL_WITH_QUESTION_MARK_GET 14 -/* Some clients include '?' characters in query strings. - */ -, {.name = "query url with question mark" - ,.type= HTTP_REQUEST - ,.raw= "GET /test.cgi?foo=bar?baz HTTP/1.1\r\n\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "foo=bar?baz" - ,.fragment= "" - ,.request_path= "/test.cgi" - ,.request_url= "/test.cgi?foo=bar?baz" - ,.num_headers= 0 - ,.headers= {} - ,.body= "" - } - -#define PREFIX_NEWLINE_GET 15 -/* Some clients, especially after a POST in a keep-alive connection, - * will send an extra CRLF before the next request - */ -, {.name = "newline prefix get" - ,.type= HTTP_REQUEST - ,.raw= "\r\nGET /test HTTP/1.1\r\n\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/test" - ,.request_url= "/test" - ,.num_headers= 0 - ,.headers= { } - ,.body= "" - } - -#define UPGRADE_REQUEST 16 -, {.name = "upgrade request" - ,.type= HTTP_REQUEST - ,.raw= "GET /demo HTTP/1.1\r\n" - "Host: example.com\r\n" - "Connection: Upgrade\r\n" - "Sec-WebSocket-Key2: 12998 5 Y3 1 .P00\r\n" - "Sec-WebSocket-Protocol: sample\r\n" - "Upgrade: WebSocket\r\n" - "Sec-WebSocket-Key1: 4 @1 46546xW%0l 1 5\r\n" - "Origin: http://example.com\r\n" - "\r\n" - "Hot diggity dogg" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/demo" - ,.request_url= "/demo" - ,.num_headers= 7 - ,.upgrade="Hot diggity dogg" - ,.headers= { { "Host", "example.com" } - , { "Connection", "Upgrade" } - , { "Sec-WebSocket-Key2", "12998 5 Y3 1 .P00" } - , { "Sec-WebSocket-Protocol", "sample" } - , { "Upgrade", "WebSocket" } - , { "Sec-WebSocket-Key1", "4 @1 46546xW%0l 1 5" } - , { "Origin", "http://example.com" } - } - ,.body= "" - } - -#define CONNECT_REQUEST 17 -, {.name = "connect request" - ,.type= HTTP_REQUEST - ,.raw= "CONNECT 0-home0.netscape.com:443 HTTP/1.0\r\n" - "User-agent: Mozilla/1.1N\r\n" - "Proxy-authorization: basic aGVsbG86d29ybGQ=\r\n" - "\r\n" - "some data\r\n" - "and yet even more data" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 0 - ,.method= HTTP_CONNECT - ,.query_string= "" - ,.fragment= "" - ,.request_path= "" - ,.request_url= "0-home0.netscape.com:443" - ,.num_headers= 2 - ,.upgrade="some data\r\nand yet even more data" - ,.headers= { { "User-agent", "Mozilla/1.1N" } - , { "Proxy-authorization", "basic aGVsbG86d29ybGQ=" } - } - ,.body= "" - } - -#define REPORT_REQ 18 -, {.name= "report request" - ,.type= HTTP_REQUEST - ,.raw= "REPORT /test HTTP/1.1\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_REPORT - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/test" - ,.request_url= "/test" - ,.num_headers= 0 - ,.headers= {} - ,.body= "" - } - -#define NO_HTTP_VERSION 19 -, {.name= "request with no http version" - ,.type= HTTP_REQUEST - ,.raw= "GET /\r\n" - "\r\n" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= FALSE - ,.http_major= 0 - ,.http_minor= 9 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/" - ,.request_url= "/" - ,.num_headers= 0 - ,.headers= {} - ,.body= "" - } - -#define MSEARCH_REQ 20 -, {.name= "m-search request" - ,.type= HTTP_REQUEST - ,.raw= "M-SEARCH * HTTP/1.1\r\n" - "HOST: 239.255.255.250:1900\r\n" - "MAN: \"ssdp:discover\"\r\n" - "ST: \"ssdp:all\"\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_MSEARCH - ,.query_string= "" - ,.fragment= "" - ,.request_path= "*" - ,.request_url= "*" - ,.num_headers= 3 - ,.headers= { { "HOST", "239.255.255.250:1900" } - , { "MAN", "\"ssdp:discover\"" } - , { "ST", "\"ssdp:all\"" } - } - ,.body= "" - } - -#define LINE_FOLDING_IN_HEADER 21 -, {.name= "line folding in header value" - ,.type= HTTP_REQUEST - ,.raw= "GET / HTTP/1.1\r\n" - "Line1: abc\r\n" - "\tdef\r\n" - " ghi\r\n" - "\t\tjkl\r\n" - " mno \r\n" - "\t \tqrs\r\n" - "Line2: \t line2\t\r\n" - "Line3:\r\n" - " line3\r\n" - "Line4: \r\n" - " \r\n" - "Connection:\r\n" - " close\r\n" - "\r\n" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/" - ,.request_url= "/" - ,.num_headers= 5 - ,.headers= { { "Line1", "abc\tdef ghi\t\tjkl mno \t \tqrs" } - , { "Line2", "line2\t" } - , { "Line3", "line3" } - , { "Line4", "" } - , { "Connection", "close" }, - } - ,.body= "" - } - - -#define QUERY_TERMINATED_HOST 22 -, {.name= "host terminated by a query string" - ,.type= HTTP_REQUEST - ,.raw= "GET http://hypnotoad.org?hail=all HTTP/1.1\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "hail=all" - ,.fragment= "" - ,.request_path= "" - ,.request_url= "http://hypnotoad.org?hail=all" - ,.host= "hypnotoad.org" - ,.num_headers= 0 - ,.headers= { } - ,.body= "" - } - -#define QUERY_TERMINATED_HOSTPORT 23 -, {.name= "host:port terminated by a query string" - ,.type= HTTP_REQUEST - ,.raw= "GET http://hypnotoad.org:1234?hail=all HTTP/1.1\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "hail=all" - ,.fragment= "" - ,.request_path= "" - ,.request_url= "http://hypnotoad.org:1234?hail=all" - ,.host= "hypnotoad.org" - ,.port= 1234 - ,.num_headers= 0 - ,.headers= { } - ,.body= "" - } - -#define SPACE_TERMINATED_HOSTPORT 24 -, {.name= "host:port terminated by a space" - ,.type= HTTP_REQUEST - ,.raw= "GET http://hypnotoad.org:1234 HTTP/1.1\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "" - ,.request_url= "http://hypnotoad.org:1234" - ,.host= "hypnotoad.org" - ,.port= 1234 - ,.num_headers= 0 - ,.headers= { } - ,.body= "" - } - -#define PATCH_REQ 25 -, {.name = "PATCH request" - ,.type= HTTP_REQUEST - ,.raw= "PATCH /file.txt HTTP/1.1\r\n" - "Host: www.example.com\r\n" - "Content-Type: application/example\r\n" - "If-Match: \"e0023aa4e\"\r\n" - "Content-Length: 10\r\n" - "\r\n" - "cccccccccc" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_PATCH - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/file.txt" - ,.request_url= "/file.txt" - ,.num_headers= 4 - ,.headers= { { "Host", "www.example.com" } - , { "Content-Type", "application/example" } - , { "If-Match", "\"e0023aa4e\"" } - , { "Content-Length", "10" } - } - ,.body= "cccccccccc" - } - -#define CONNECT_CAPS_REQUEST 26 -, {.name = "connect caps request" - ,.type= HTTP_REQUEST - ,.raw= "CONNECT HOME0.NETSCAPE.COM:443 HTTP/1.0\r\n" - "User-agent: Mozilla/1.1N\r\n" - "Proxy-authorization: basic aGVsbG86d29ybGQ=\r\n" - "\r\n" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 0 - ,.method= HTTP_CONNECT - ,.query_string= "" - ,.fragment= "" - ,.request_path= "" - ,.request_url= "HOME0.NETSCAPE.COM:443" - ,.num_headers= 2 - ,.upgrade="" - ,.headers= { { "User-agent", "Mozilla/1.1N" } - , { "Proxy-authorization", "basic aGVsbG86d29ybGQ=" } - } - ,.body= "" - } - -#if !HTTP_PARSER_STRICT -#define UTF8_PATH_REQ 27 -, {.name= "utf-8 path request" - ,.type= HTTP_REQUEST - ,.raw= "GET /δ¶/δt/pope?q=1#narf HTTP/1.1\r\n" - "Host: github.com\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "q=1" - ,.fragment= "narf" - ,.request_path= "/δ¶/δt/pope" - ,.request_url= "/δ¶/δt/pope?q=1#narf" - ,.num_headers= 1 - ,.headers= { {"Host", "github.com" } - } - ,.body= "" - } - -#define HOSTNAME_UNDERSCORE 28 -, {.name = "hostname underscore" - ,.type= HTTP_REQUEST - ,.raw= "CONNECT home_0.netscape.com:443 HTTP/1.0\r\n" - "User-agent: Mozilla/1.1N\r\n" - "Proxy-authorization: basic aGVsbG86d29ybGQ=\r\n" - "\r\n" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 0 - ,.method= HTTP_CONNECT - ,.query_string= "" - ,.fragment= "" - ,.request_path= "" - ,.request_url= "home_0.netscape.com:443" - ,.num_headers= 2 - ,.upgrade="" - ,.headers= { { "User-agent", "Mozilla/1.1N" } - , { "Proxy-authorization", "basic aGVsbG86d29ybGQ=" } - } - ,.body= "" - } -#endif /* !HTTP_PARSER_STRICT */ - -/* see https://github.com/ry/http-parser/issues/47 */ -#define EAT_TRAILING_CRLF_NO_CONNECTION_CLOSE 29 -, {.name = "eat CRLF between requests, no \"Connection: close\" header" - ,.raw= "POST / HTTP/1.1\r\n" - "Host: www.example.com\r\n" - "Content-Type: application/x-www-form-urlencoded\r\n" - "Content-Length: 4\r\n" - "\r\n" - "q=42\r\n" /* note the trailing CRLF */ - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_POST - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/" - ,.request_url= "/" - ,.num_headers= 3 - ,.upgrade= 0 - ,.headers= { { "Host", "www.example.com" } - , { "Content-Type", "application/x-www-form-urlencoded" } - , { "Content-Length", "4" } - } - ,.body= "q=42" - } - -/* see https://github.com/ry/http-parser/issues/47 */ -#define EAT_TRAILING_CRLF_WITH_CONNECTION_CLOSE 30 -, {.name = "eat CRLF between requests even if \"Connection: close\" is set" - ,.raw= "POST / HTTP/1.1\r\n" - "Host: www.example.com\r\n" - "Content-Type: application/x-www-form-urlencoded\r\n" - "Content-Length: 4\r\n" - "Connection: close\r\n" - "\r\n" - "q=42\r\n" /* note the trailing CRLF */ - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= FALSE /* input buffer isn't empty when on_message_complete is called */ - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_POST - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/" - ,.request_url= "/" - ,.num_headers= 4 - ,.upgrade= 0 - ,.headers= { { "Host", "www.example.com" } - , { "Content-Type", "application/x-www-form-urlencoded" } - , { "Content-Length", "4" } - , { "Connection", "close" } - } - ,.body= "q=42" - } - -#define PURGE_REQ 31 -, {.name = "PURGE request" - ,.type= HTTP_REQUEST - ,.raw= "PURGE /file.txt HTTP/1.1\r\n" - "Host: www.example.com\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_PURGE - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/file.txt" - ,.request_url= "/file.txt" - ,.num_headers= 1 - ,.headers= { { "Host", "www.example.com" } } - ,.body= "" - } - -#define SEARCH_REQ 32 -, {.name = "SEARCH request" - ,.type= HTTP_REQUEST - ,.raw= "SEARCH / HTTP/1.1\r\n" - "Host: www.example.com\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_SEARCH - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/" - ,.request_url= "/" - ,.num_headers= 1 - ,.headers= { { "Host", "www.example.com" } } - ,.body= "" - } - -#define PROXY_WITH_BASIC_AUTH 33 -, {.name= "host:port and basic_auth" - ,.type= HTTP_REQUEST - ,.raw= "GET http://a%12:b!&*$@hypnotoad.org:1234/toto HTTP/1.1\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.fragment= "" - ,.request_path= "/toto" - ,.request_url= "http://a%12:b!&*$@hypnotoad.org:1234/toto" - ,.host= "hypnotoad.org" - ,.userinfo= "a%12:b!&*$" - ,.port= 1234 - ,.num_headers= 0 - ,.headers= { } - ,.body= "" - } - -#define LINE_FOLDING_IN_HEADER_WITH_LF 34 -, {.name= "line folding in header value" - ,.type= HTTP_REQUEST - ,.raw= "GET / HTTP/1.1\n" - "Line1: abc\n" - "\tdef\n" - " ghi\n" - "\t\tjkl\n" - " mno \n" - "\t \tqrs\n" - "Line2: \t line2\t\n" - "Line3:\n" - " line3\n" - "Line4: \n" - " \n" - "Connection:\n" - " close\n" - "\n" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/" - ,.request_url= "/" - ,.num_headers= 5 - ,.headers= { { "Line1", "abc\tdef ghi\t\tjkl mno \t \tqrs" } - , { "Line2", "line2\t" } - , { "Line3", "line3" } - , { "Line4", "" } - , { "Connection", "close" }, - } - ,.body= "" - } - -#define CONNECTION_MULTI 35 -, {.name = "multiple connection header values with folding" - ,.type= HTTP_REQUEST - ,.raw= "GET /demo HTTP/1.1\r\n" - "Host: example.com\r\n" - "Connection: Something,\r\n" - " Upgrade, ,Keep-Alive\r\n" - "Sec-WebSocket-Key2: 12998 5 Y3 1 .P00\r\n" - "Sec-WebSocket-Protocol: sample\r\n" - "Upgrade: WebSocket\r\n" - "Sec-WebSocket-Key1: 4 @1 46546xW%0l 1 5\r\n" - "Origin: http://example.com\r\n" - "\r\n" - "Hot diggity dogg" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/demo" - ,.request_url= "/demo" - ,.num_headers= 7 - ,.upgrade="Hot diggity dogg" - ,.headers= { { "Host", "example.com" } - , { "Connection", "Something, Upgrade, ,Keep-Alive" } - , { "Sec-WebSocket-Key2", "12998 5 Y3 1 .P00" } - , { "Sec-WebSocket-Protocol", "sample" } - , { "Upgrade", "WebSocket" } - , { "Sec-WebSocket-Key1", "4 @1 46546xW%0l 1 5" } - , { "Origin", "http://example.com" } - } - ,.body= "" - } - -#define CONNECTION_MULTI_LWS 36 -, {.name = "multiple connection header values with folding and lws" - ,.type= HTTP_REQUEST - ,.raw= "GET /demo HTTP/1.1\r\n" - "Connection: keep-alive, upgrade\r\n" - "Upgrade: WebSocket\r\n" - "\r\n" - "Hot diggity dogg" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/demo" - ,.request_url= "/demo" - ,.num_headers= 2 - ,.upgrade="Hot diggity dogg" - ,.headers= { { "Connection", "keep-alive, upgrade" } - , { "Upgrade", "WebSocket" } - } - ,.body= "" - } - -#define CONNECTION_MULTI_LWS_CRLF 37 -, {.name = "multiple connection header values with folding and lws" - ,.type= HTTP_REQUEST - ,.raw= "GET /demo HTTP/1.1\r\n" - "Connection: keep-alive, \r\n upgrade\r\n" - "Upgrade: WebSocket\r\n" - "\r\n" - "Hot diggity dogg" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_GET - ,.query_string= "" - ,.fragment= "" - ,.request_path= "/demo" - ,.request_url= "/demo" - ,.num_headers= 2 - ,.upgrade="Hot diggity dogg" - ,.headers= { { "Connection", "keep-alive, upgrade" } - , { "Upgrade", "WebSocket" } - } - ,.body= "" - } - -#define UPGRADE_POST_REQUEST 38 -, {.name = "upgrade post request" - ,.type= HTTP_REQUEST - ,.raw= "POST /demo HTTP/1.1\r\n" - "Host: example.com\r\n" - "Connection: Upgrade\r\n" - "Upgrade: HTTP/2.0\r\n" - "Content-Length: 15\r\n" - "\r\n" - "sweet post body" - "Hot diggity dogg" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.method= HTTP_POST - ,.request_path= "/demo" - ,.request_url= "/demo" - ,.num_headers= 4 - ,.upgrade="Hot diggity dogg" - ,.headers= { { "Host", "example.com" } - , { "Connection", "Upgrade" } - , { "Upgrade", "HTTP/2.0" } - , { "Content-Length", "15" } - } - ,.body= "sweet post body" - } - -#define CONNECT_WITH_BODY_REQUEST 39 -, {.name = "connect with body request" - ,.type= HTTP_REQUEST - ,.raw= "CONNECT foo.bar.com:443 HTTP/1.0\r\n" - "User-agent: Mozilla/1.1N\r\n" - "Proxy-authorization: basic aGVsbG86d29ybGQ=\r\n" - "Content-Length: 10\r\n" - "\r\n" - "blarfcicle" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 0 - ,.method= HTTP_CONNECT - ,.request_url= "foo.bar.com:443" - ,.num_headers= 3 - ,.upgrade="blarfcicle" - ,.headers= { { "User-agent", "Mozilla/1.1N" } - , { "Proxy-authorization", "basic aGVsbG86d29ybGQ=" } - , { "Content-Length", "10" } - } - ,.body= "" - } - -, {.name= NULL } /* sentinel */ -}; - -/* * R E S P O N S E S * */ -const struct message responses[] = -#define GOOGLE_301 0 -{ {.name= "google 301" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 301 Moved Permanently\r\n" - "Location: http://www.google.com/\r\n" - "Content-Type: text/html; charset=UTF-8\r\n" - "Date: Sun, 26 Apr 2009 11:11:49 GMT\r\n" - "Expires: Tue, 26 May 2009 11:11:49 GMT\r\n" - "X-$PrototypeBI-Version: 1.6.0.3\r\n" /* $ char in header field */ - "Cache-Control: public, max-age=2592000\r\n" - "Server: gws\r\n" - "Content-Length: 219 \r\n" - "\r\n" - "\n" - "301 Moved\n" - "

301 Moved

\n" - "The document has moved\n" - "here.\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 301 - ,.response_status= "Moved Permanently" - ,.num_headers= 8 - ,.headers= - { { "Location", "http://www.google.com/" } - , { "Content-Type", "text/html; charset=UTF-8" } - , { "Date", "Sun, 26 Apr 2009 11:11:49 GMT" } - , { "Expires", "Tue, 26 May 2009 11:11:49 GMT" } - , { "X-$PrototypeBI-Version", "1.6.0.3" } - , { "Cache-Control", "public, max-age=2592000" } - , { "Server", "gws" } - , { "Content-Length", "219 " } - } - ,.body= "\n" - "301 Moved\n" - "

301 Moved

\n" - "The document has moved\n" - "here.\r\n" - "\r\n" - } - -#define NO_CONTENT_LENGTH_RESPONSE 1 -/* The client should wait for the server's EOF. That is, when content-length - * is not specified, and "Connection: close", the end of body is specified - * by the EOF. - * Compare with APACHEBENCH_GET - */ -, {.name= "no content-length response" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 200 OK\r\n" - "Date: Tue, 04 Aug 2009 07:59:32 GMT\r\n" - "Server: Apache\r\n" - "X-Powered-By: Servlet/2.5 JSP/2.1\r\n" - "Content-Type: text/xml; charset=utf-8\r\n" - "Connection: close\r\n" - "\r\n" - "\n" - "\n" - " \n" - " \n" - " SOAP-ENV:Client\n" - " Client Error\n" - " \n" - " \n" - "" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= TRUE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 200 - ,.response_status= "OK" - ,.num_headers= 5 - ,.headers= - { { "Date", "Tue, 04 Aug 2009 07:59:32 GMT" } - , { "Server", "Apache" } - , { "X-Powered-By", "Servlet/2.5 JSP/2.1" } - , { "Content-Type", "text/xml; charset=utf-8" } - , { "Connection", "close" } - } - ,.body= "\n" - "\n" - " \n" - " \n" - " SOAP-ENV:Client\n" - " Client Error\n" - " \n" - " \n" - "" - } - -#define NO_HEADERS_NO_BODY_404 2 -, {.name= "404 no headers no body" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 404 Not Found\r\n\r\n" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= TRUE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 404 - ,.response_status= "Not Found" - ,.num_headers= 0 - ,.headers= {} - ,.body_size= 0 - ,.body= "" - } - -#define NO_REASON_PHRASE 3 -, {.name= "301 no response phrase" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 301\r\n\r\n" - ,.should_keep_alive = FALSE - ,.message_complete_on_eof= TRUE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 301 - ,.response_status= "" - ,.num_headers= 0 - ,.headers= {} - ,.body= "" - } - -#define TRAILING_SPACE_ON_CHUNKED_BODY 4 -, {.name="200 trailing space on chunked body" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 200 OK\r\n" - "Content-Type: text/plain\r\n" - "Transfer-Encoding: chunked\r\n" - "\r\n" - "25 \r\n" - "This is the data in the first chunk\r\n" - "\r\n" - "1C\r\n" - "and this is the second one\r\n" - "\r\n" - "0 \r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 200 - ,.response_status= "OK" - ,.num_headers= 2 - ,.headers= - { {"Content-Type", "text/plain" } - , {"Transfer-Encoding", "chunked" } - } - ,.body_size = 37+28 - ,.body = - "This is the data in the first chunk\r\n" - "and this is the second one\r\n" - ,.num_chunks_complete= 3 - ,.chunk_lengths= { 0x25, 0x1c } - } - -#define NO_CARRIAGE_RET 5 -, {.name="no carriage ret" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 200 OK\n" - "Content-Type: text/html; charset=utf-8\n" - "Connection: close\n" - "\n" - "these headers are from http://news.ycombinator.com/" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= TRUE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 200 - ,.response_status= "OK" - ,.num_headers= 2 - ,.headers= - { {"Content-Type", "text/html; charset=utf-8" } - , {"Connection", "close" } - } - ,.body= "these headers are from http://news.ycombinator.com/" - } - -#define PROXY_CONNECTION 6 -, {.name="proxy connection" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 200 OK\r\n" - "Content-Type: text/html; charset=UTF-8\r\n" - "Content-Length: 11\r\n" - "Proxy-Connection: close\r\n" - "Date: Thu, 31 Dec 2009 20:55:48 +0000\r\n" - "\r\n" - "hello world" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 200 - ,.response_status= "OK" - ,.num_headers= 4 - ,.headers= - { {"Content-Type", "text/html; charset=UTF-8" } - , {"Content-Length", "11" } - , {"Proxy-Connection", "close" } - , {"Date", "Thu, 31 Dec 2009 20:55:48 +0000"} - } - ,.body= "hello world" - } - -#define UNDERSTORE_HEADER_KEY 7 - // shown by - // curl -o /dev/null -v "http://ad.doubleclick.net/pfadx/DARTSHELLCONFIGXML;dcmt=text/xml;" -, {.name="underscore header key" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 200 OK\r\n" - "Server: DCLK-AdSvr\r\n" - "Content-Type: text/xml\r\n" - "Content-Length: 0\r\n" - "DCLK_imp: v7;x;114750856;0-0;0;17820020;0/0;21603567/21621457/1;;~okv=;dcmt=text/xml;;~cs=o\r\n\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 200 - ,.response_status= "OK" - ,.num_headers= 4 - ,.headers= - { {"Server", "DCLK-AdSvr" } - , {"Content-Type", "text/xml" } - , {"Content-Length", "0" } - , {"DCLK_imp", "v7;x;114750856;0-0;0;17820020;0/0;21603567/21621457/1;;~okv=;dcmt=text/xml;;~cs=o" } - } - ,.body= "" - } - -#define BONJOUR_MADAME_FR 8 -/* The client should not merge two headers fields when the first one doesn't - * have a value. - */ -, {.name= "bonjourmadame.fr" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.0 301 Moved Permanently\r\n" - "Date: Thu, 03 Jun 2010 09:56:32 GMT\r\n" - "Server: Apache/2.2.3 (Red Hat)\r\n" - "Cache-Control: public\r\n" - "Pragma: \r\n" - "Location: http://www.bonjourmadame.fr/\r\n" - "Vary: Accept-Encoding\r\n" - "Content-Length: 0\r\n" - "Content-Type: text/html; charset=UTF-8\r\n" - "Connection: keep-alive\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 0 - ,.status_code= 301 - ,.response_status= "Moved Permanently" - ,.num_headers= 9 - ,.headers= - { { "Date", "Thu, 03 Jun 2010 09:56:32 GMT" } - , { "Server", "Apache/2.2.3 (Red Hat)" } - , { "Cache-Control", "public" } - , { "Pragma", "" } - , { "Location", "http://www.bonjourmadame.fr/" } - , { "Vary", "Accept-Encoding" } - , { "Content-Length", "0" } - , { "Content-Type", "text/html; charset=UTF-8" } - , { "Connection", "keep-alive" } - } - ,.body= "" - } - -#define RES_FIELD_UNDERSCORE 9 -/* Should handle spaces in header fields */ -, {.name= "field underscore" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 200 OK\r\n" - "Date: Tue, 28 Sep 2010 01:14:13 GMT\r\n" - "Server: Apache\r\n" - "Cache-Control: no-cache, must-revalidate\r\n" - "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n" - ".et-Cookie: PlaxoCS=1274804622353690521; path=/; domain=.plaxo.com\r\n" - "Vary: Accept-Encoding\r\n" - "_eep-Alive: timeout=45\r\n" /* semantic value ignored */ - "_onnection: Keep-Alive\r\n" /* semantic value ignored */ - "Transfer-Encoding: chunked\r\n" - "Content-Type: text/html\r\n" - "Connection: close\r\n" - "\r\n" - "0\r\n\r\n" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 200 - ,.response_status= "OK" - ,.num_headers= 11 - ,.headers= - { { "Date", "Tue, 28 Sep 2010 01:14:13 GMT" } - , { "Server", "Apache" } - , { "Cache-Control", "no-cache, must-revalidate" } - , { "Expires", "Mon, 26 Jul 1997 05:00:00 GMT" } - , { ".et-Cookie", "PlaxoCS=1274804622353690521; path=/; domain=.plaxo.com" } - , { "Vary", "Accept-Encoding" } - , { "_eep-Alive", "timeout=45" } - , { "_onnection", "Keep-Alive" } - , { "Transfer-Encoding", "chunked" } - , { "Content-Type", "text/html" } - , { "Connection", "close" } - } - ,.body= "" - ,.num_chunks_complete= 1 - ,.chunk_lengths= {} - } - -#define NON_ASCII_IN_STATUS_LINE 10 -/* Should handle non-ASCII in status line */ -, {.name= "non-ASCII in status line" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 500 Oriëntatieprobleem\r\n" - "Date: Fri, 5 Nov 2010 23:07:12 GMT+2\r\n" - "Content-Length: 0\r\n" - "Connection: close\r\n" - "\r\n" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 500 - ,.response_status= "Oriëntatieprobleem" - ,.num_headers= 3 - ,.headers= - { { "Date", "Fri, 5 Nov 2010 23:07:12 GMT+2" } - , { "Content-Length", "0" } - , { "Connection", "close" } - } - ,.body= "" - } - -#define HTTP_VERSION_0_9 11 -/* Should handle HTTP/0.9 */ -, {.name= "http version 0.9" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/0.9 200 OK\r\n" - "\r\n" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= TRUE - ,.http_major= 0 - ,.http_minor= 9 - ,.status_code= 200 - ,.response_status= "OK" - ,.num_headers= 0 - ,.headers= - {} - ,.body= "" - } - -#define NO_CONTENT_LENGTH_NO_TRANSFER_ENCODING_RESPONSE 12 -/* The client should wait for the server's EOF. That is, when neither - * content-length nor transfer-encoding is specified, the end of body - * is specified by the EOF. - */ -, {.name= "neither content-length nor transfer-encoding response" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 200 OK\r\n" - "Content-Type: text/plain\r\n" - "\r\n" - "hello world" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= TRUE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 200 - ,.response_status= "OK" - ,.num_headers= 1 - ,.headers= - { { "Content-Type", "text/plain" } - } - ,.body= "hello world" - } - -#define NO_BODY_HTTP10_KA_200 13 -, {.name= "HTTP/1.0 with keep-alive and EOF-terminated 200 status" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.0 200 OK\r\n" - "Connection: keep-alive\r\n" - "\r\n" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= TRUE - ,.http_major= 1 - ,.http_minor= 0 - ,.status_code= 200 - ,.response_status= "OK" - ,.num_headers= 1 - ,.headers= - { { "Connection", "keep-alive" } - } - ,.body_size= 0 - ,.body= "" - } - -#define NO_BODY_HTTP10_KA_204 14 -, {.name= "HTTP/1.0 with keep-alive and a 204 status" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.0 204 No content\r\n" - "Connection: keep-alive\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 0 - ,.status_code= 204 - ,.response_status= "No content" - ,.num_headers= 1 - ,.headers= - { { "Connection", "keep-alive" } - } - ,.body_size= 0 - ,.body= "" - } - -#define NO_BODY_HTTP11_KA_200 15 -, {.name= "HTTP/1.1 with an EOF-terminated 200 status" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 200 OK\r\n" - "\r\n" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= TRUE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 200 - ,.response_status= "OK" - ,.num_headers= 0 - ,.headers={} - ,.body_size= 0 - ,.body= "" - } - -#define NO_BODY_HTTP11_KA_204 16 -, {.name= "HTTP/1.1 with a 204 status" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 204 No content\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 204 - ,.response_status= "No content" - ,.num_headers= 0 - ,.headers={} - ,.body_size= 0 - ,.body= "" - } - -#define NO_BODY_HTTP11_NOKA_204 17 -, {.name= "HTTP/1.1 with a 204 status and keep-alive disabled" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 204 No content\r\n" - "Connection: close\r\n" - "\r\n" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 204 - ,.response_status= "No content" - ,.num_headers= 1 - ,.headers= - { { "Connection", "close" } - } - ,.body_size= 0 - ,.body= "" - } - -#define NO_BODY_HTTP11_KA_CHUNKED_200 18 -, {.name= "HTTP/1.1 with chunked endocing and a 200 response" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 200 OK\r\n" - "Transfer-Encoding: chunked\r\n" - "\r\n" - "0\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 200 - ,.response_status= "OK" - ,.num_headers= 1 - ,.headers= - { { "Transfer-Encoding", "chunked" } - } - ,.body_size= 0 - ,.body= "" - ,.num_chunks_complete= 1 - } - -#if !HTTP_PARSER_STRICT -#define SPACE_IN_FIELD_RES 19 -/* Should handle spaces in header fields */ -, {.name= "field space" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 200 OK\r\n" - "Server: Microsoft-IIS/6.0\r\n" - "X-Powered-By: ASP.NET\r\n" - "en-US Content-Type: text/xml\r\n" /* this is the problem */ - "Content-Type: text/xml\r\n" - "Content-Length: 16\r\n" - "Date: Fri, 23 Jul 2010 18:45:38 GMT\r\n" - "Connection: keep-alive\r\n" - "\r\n" - "hello" /* fake body */ - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 200 - ,.response_status= "OK" - ,.num_headers= 7 - ,.headers= - { { "Server", "Microsoft-IIS/6.0" } - , { "X-Powered-By", "ASP.NET" } - , { "en-US Content-Type", "text/xml" } - , { "Content-Type", "text/xml" } - , { "Content-Length", "16" } - , { "Date", "Fri, 23 Jul 2010 18:45:38 GMT" } - , { "Connection", "keep-alive" } - } - ,.body= "hello" - } -#endif /* !HTTP_PARSER_STRICT */ - -#define AMAZON_COM 20 -, {.name= "amazon.com" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 301 MovedPermanently\r\n" - "Date: Wed, 15 May 2013 17:06:33 GMT\r\n" - "Server: Server\r\n" - "x-amz-id-1: 0GPHKXSJQ826RK7GZEB2\r\n" - "p3p: policyref=\"http://www.amazon.com/w3c/p3p.xml\",CP=\"CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC \"\r\n" - "x-amz-id-2: STN69VZxIFSz9YJLbz1GDbxpbjG6Qjmmq5E3DxRhOUw+Et0p4hr7c/Q8qNcx4oAD\r\n" - "Location: http://www.amazon.com/Dan-Brown/e/B000AP9DSU/ref=s9_pop_gw_al1?_encoding=UTF8&refinementId=618073011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=0SHYY5BZXN3KR20BNFAY&pf_rd_t=101&pf_rd_p=1263340922&pf_rd_i=507846\r\n" - "Vary: Accept-Encoding,User-Agent\r\n" - "Content-Type: text/html; charset=ISO-8859-1\r\n" - "Transfer-Encoding: chunked\r\n" - "\r\n" - "1\r\n" - "\n\r\n" - "0\r\n" - "\r\n" - ,.should_keep_alive= TRUE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 301 - ,.response_status= "MovedPermanently" - ,.num_headers= 9 - ,.headers= { { "Date", "Wed, 15 May 2013 17:06:33 GMT" } - , { "Server", "Server" } - , { "x-amz-id-1", "0GPHKXSJQ826RK7GZEB2" } - , { "p3p", "policyref=\"http://www.amazon.com/w3c/p3p.xml\",CP=\"CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC \"" } - , { "x-amz-id-2", "STN69VZxIFSz9YJLbz1GDbxpbjG6Qjmmq5E3DxRhOUw+Et0p4hr7c/Q8qNcx4oAD" } - , { "Location", "http://www.amazon.com/Dan-Brown/e/B000AP9DSU/ref=s9_pop_gw_al1?_encoding=UTF8&refinementId=618073011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=0SHYY5BZXN3KR20BNFAY&pf_rd_t=101&pf_rd_p=1263340922&pf_rd_i=507846" } - , { "Vary", "Accept-Encoding,User-Agent" } - , { "Content-Type", "text/html; charset=ISO-8859-1" } - , { "Transfer-Encoding", "chunked" } - } - ,.body= "\n" - ,.num_chunks_complete= 2 - ,.chunk_lengths= { 1 } - } - -#define EMPTY_REASON_PHRASE_AFTER_SPACE 20 -, {.name= "empty reason phrase after space" - ,.type= HTTP_RESPONSE - ,.raw= "HTTP/1.1 200 \r\n" - "\r\n" - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= TRUE - ,.http_major= 1 - ,.http_minor= 1 - ,.status_code= 200 - ,.response_status= "" - ,.num_headers= 0 - ,.headers= {} - ,.body= "" - } - -, {.name= NULL } /* sentinel */ -}; - -/* strnlen() is a POSIX.2008 addition. Can't rely on it being available so - * define it ourselves. - */ -size_t -strnlen(const char *s, size_t maxlen) -{ - const char *p; - - p = memchr(s, '\0', maxlen); - if (p == NULL) - return maxlen; - - return p - s; -} - -size_t -strlncat(char *dst, size_t len, const char *src, size_t n) -{ - size_t slen; - size_t dlen; - size_t rlen; - size_t ncpy; - - slen = strnlen(src, n); - dlen = strnlen(dst, len); - - if (dlen < len) { - rlen = len - dlen; - ncpy = slen < rlen ? slen : (rlen - 1); - memcpy(dst + dlen, src, ncpy); - dst[dlen + ncpy] = '\0'; - } - - assert(len > slen + dlen); - return slen + dlen; -} - -size_t -strlcat(char *dst, const char *src, size_t len) -{ - return strlncat(dst, len, src, (size_t) -1); -} - -size_t -strlncpy(char *dst, size_t len, const char *src, size_t n) -{ - size_t slen; - size_t ncpy; - - slen = strnlen(src, n); - - if (len > 0) { - ncpy = slen < len ? slen : (len - 1); - memcpy(dst, src, ncpy); - dst[ncpy] = '\0'; - } - - assert(len > slen); - return slen; -} - -size_t -strlcpy(char *dst, const char *src, size_t len) -{ - return strlncpy(dst, len, src, (size_t) -1); -} - -int -request_url_cb (http_parser *p, const char *buf, size_t len) -{ - assert(p == parser); - strlncat(messages[num_messages].request_url, - sizeof(messages[num_messages].request_url), - buf, - len); - return 0; -} - -int -header_field_cb (http_parser *p, const char *buf, size_t len) -{ - assert(p == parser); - struct message *m = &messages[num_messages]; - - if (m->last_header_element != FIELD) - m->num_headers++; - - strlncat(m->headers[m->num_headers-1][0], - sizeof(m->headers[m->num_headers-1][0]), - buf, - len); - - m->last_header_element = FIELD; - - return 0; -} - -int -header_value_cb (http_parser *p, const char *buf, size_t len) -{ - assert(p == parser); - struct message *m = &messages[num_messages]; - - strlncat(m->headers[m->num_headers-1][1], - sizeof(m->headers[m->num_headers-1][1]), - buf, - len); - - m->last_header_element = VALUE; - - return 0; -} - -void -check_body_is_final (const http_parser *p) -{ - if (messages[num_messages].body_is_final) { - fprintf(stderr, "\n\n *** Error http_body_is_final() should return 1 " - "on last on_body callback call " - "but it doesn't! ***\n\n"); - assert(0); - abort(); - } - messages[num_messages].body_is_final = http_body_is_final(p); -} - -int -body_cb (http_parser *p, const char *buf, size_t len) -{ - assert(p == parser); - strlncat(messages[num_messages].body, - sizeof(messages[num_messages].body), - buf, - len); - messages[num_messages].body_size += len; - check_body_is_final(p); - // printf("body_cb: '%s'\n", requests[num_messages].body); - return 0; -} - -int -count_body_cb (http_parser *p, const char *buf, size_t len) -{ - assert(p == parser); - assert(buf); - messages[num_messages].body_size += len; - check_body_is_final(p); - return 0; -} - -int -message_begin_cb (http_parser *p) -{ - assert(p == parser); - messages[num_messages].message_begin_cb_called = TRUE; - return 0; -} - -int -headers_complete_cb (http_parser *p) -{ - assert(p == parser); - messages[num_messages].method = parser->method; - messages[num_messages].status_code = parser->status_code; - messages[num_messages].http_major = parser->http_major; - messages[num_messages].http_minor = parser->http_minor; - messages[num_messages].headers_complete_cb_called = TRUE; - messages[num_messages].should_keep_alive = http_should_keep_alive(parser); - return 0; -} - -int -message_complete_cb (http_parser *p) -{ - assert(p == parser); - if (messages[num_messages].should_keep_alive != http_should_keep_alive(parser)) - { - fprintf(stderr, "\n\n *** Error http_should_keep_alive() should have same " - "value in both on_message_complete and on_headers_complete " - "but it doesn't! ***\n\n"); - assert(0); - abort(); - } - - if (messages[num_messages].body_size && - http_body_is_final(p) && - !messages[num_messages].body_is_final) - { - fprintf(stderr, "\n\n *** Error http_body_is_final() should return 1 " - "on last on_body callback call " - "but it doesn't! ***\n\n"); - assert(0); - abort(); - } - - messages[num_messages].message_complete_cb_called = TRUE; - - messages[num_messages].message_complete_on_eof = currently_parsing_eof; - - num_messages++; - return 0; -} - -int -response_status_cb (http_parser *p, const char *buf, size_t len) -{ - assert(p == parser); - strlncat(messages[num_messages].response_status, - sizeof(messages[num_messages].response_status), - buf, - len); - return 0; -} - -int -chunk_header_cb (http_parser *p) -{ - assert(p == parser); - int chunk_idx = messages[num_messages].num_chunks; - messages[num_messages].num_chunks++; - if (chunk_idx < MAX_CHUNKS) { - messages[num_messages].chunk_lengths[chunk_idx] = p->content_length; - } - - return 0; -} - -int -chunk_complete_cb (http_parser *p) -{ - assert(p == parser); - - /* Here we want to verify that each chunk_header_cb is matched by a - * chunk_complete_cb, so not only should the total number of calls to - * both callbacks be the same, but they also should be interleaved - * properly */ - assert(messages[num_messages].num_chunks == - messages[num_messages].num_chunks_complete + 1); - - messages[num_messages].num_chunks_complete++; - return 0; -} - -/* These dontcall_* callbacks exist so that we can verify that when we're - * paused, no additional callbacks are invoked */ -int -dontcall_message_begin_cb (http_parser *p) -{ - if (p) { } // gcc - fprintf(stderr, "\n\n*** on_message_begin() called on paused parser ***\n\n"); - abort(); -} - -int -dontcall_header_field_cb (http_parser *p, const char *buf, size_t len) -{ - if (p || buf || len) { } // gcc - fprintf(stderr, "\n\n*** on_header_field() called on paused parser ***\n\n"); - abort(); -} - -int -dontcall_header_value_cb (http_parser *p, const char *buf, size_t len) -{ - if (p || buf || len) { } // gcc - fprintf(stderr, "\n\n*** on_header_value() called on paused parser ***\n\n"); - abort(); -} - -int -dontcall_request_url_cb (http_parser *p, const char *buf, size_t len) -{ - if (p || buf || len) { } // gcc - fprintf(stderr, "\n\n*** on_request_url() called on paused parser ***\n\n"); - abort(); -} - -int -dontcall_body_cb (http_parser *p, const char *buf, size_t len) -{ - if (p || buf || len) { } // gcc - fprintf(stderr, "\n\n*** on_body_cb() called on paused parser ***\n\n"); - abort(); -} - -int -dontcall_headers_complete_cb (http_parser *p) -{ - if (p) { } // gcc - fprintf(stderr, "\n\n*** on_headers_complete() called on paused " - "parser ***\n\n"); - abort(); -} - -int -dontcall_message_complete_cb (http_parser *p) -{ - if (p) { } // gcc - fprintf(stderr, "\n\n*** on_message_complete() called on paused " - "parser ***\n\n"); - abort(); -} - -int -dontcall_response_status_cb (http_parser *p, const char *buf, size_t len) -{ - if (p || buf || len) { } // gcc - fprintf(stderr, "\n\n*** on_status() called on paused parser ***\n\n"); - abort(); -} - -int -dontcall_chunk_header_cb (http_parser *p) -{ - if (p) { } // gcc - fprintf(stderr, "\n\n*** on_chunk_header() called on paused parser ***\n\n"); - exit(1); -} - -int -dontcall_chunk_complete_cb (http_parser *p) -{ - if (p) { } // gcc - fprintf(stderr, "\n\n*** on_chunk_complete() " - "called on paused parser ***\n\n"); - exit(1); -} - -static http_parser_settings settings_dontcall = - {.on_message_begin = dontcall_message_begin_cb - ,.on_header_field = dontcall_header_field_cb - ,.on_header_value = dontcall_header_value_cb - ,.on_url = dontcall_request_url_cb - ,.on_status = dontcall_response_status_cb - ,.on_body = dontcall_body_cb - ,.on_headers_complete = dontcall_headers_complete_cb - ,.on_message_complete = dontcall_message_complete_cb - ,.on_chunk_header = dontcall_chunk_header_cb - ,.on_chunk_complete = dontcall_chunk_complete_cb - }; - -/* These pause_* callbacks always pause the parser and just invoke the regular - * callback that tracks content. Before returning, we overwrite the parser - * settings to point to the _dontcall variety so that we can verify that - * the pause actually did, you know, pause. */ -int -pause_message_begin_cb (http_parser *p) -{ - http_parser_pause(p, 1); - *current_pause_parser = settings_dontcall; - return message_begin_cb(p); -} - -int -pause_header_field_cb (http_parser *p, const char *buf, size_t len) -{ - http_parser_pause(p, 1); - *current_pause_parser = settings_dontcall; - return header_field_cb(p, buf, len); -} - -int -pause_header_value_cb (http_parser *p, const char *buf, size_t len) -{ - http_parser_pause(p, 1); - *current_pause_parser = settings_dontcall; - return header_value_cb(p, buf, len); -} - -int -pause_request_url_cb (http_parser *p, const char *buf, size_t len) -{ - http_parser_pause(p, 1); - *current_pause_parser = settings_dontcall; - return request_url_cb(p, buf, len); -} - -int -pause_body_cb (http_parser *p, const char *buf, size_t len) -{ - http_parser_pause(p, 1); - *current_pause_parser = settings_dontcall; - return body_cb(p, buf, len); -} - -int -pause_headers_complete_cb (http_parser *p) -{ - http_parser_pause(p, 1); - *current_pause_parser = settings_dontcall; - return headers_complete_cb(p); -} - -int -pause_message_complete_cb (http_parser *p) -{ - http_parser_pause(p, 1); - *current_pause_parser = settings_dontcall; - return message_complete_cb(p); -} - -int -pause_response_status_cb (http_parser *p, const char *buf, size_t len) -{ - http_parser_pause(p, 1); - *current_pause_parser = settings_dontcall; - return response_status_cb(p, buf, len); -} - -int -pause_chunk_header_cb (http_parser *p) -{ - http_parser_pause(p, 1); - *current_pause_parser = settings_dontcall; - return chunk_header_cb(p); -} - -int -pause_chunk_complete_cb (http_parser *p) -{ - http_parser_pause(p, 1); - *current_pause_parser = settings_dontcall; - return chunk_complete_cb(p); -} - -static http_parser_settings settings_pause = - {.on_message_begin = pause_message_begin_cb - ,.on_header_field = pause_header_field_cb - ,.on_header_value = pause_header_value_cb - ,.on_url = pause_request_url_cb - ,.on_status = pause_response_status_cb - ,.on_body = pause_body_cb - ,.on_headers_complete = pause_headers_complete_cb - ,.on_message_complete = pause_message_complete_cb - ,.on_chunk_header = pause_chunk_header_cb - ,.on_chunk_complete = pause_chunk_complete_cb - }; - -static http_parser_settings settings = - {.on_message_begin = message_begin_cb - ,.on_header_field = header_field_cb - ,.on_header_value = header_value_cb - ,.on_url = request_url_cb - ,.on_status = response_status_cb - ,.on_body = body_cb - ,.on_headers_complete = headers_complete_cb - ,.on_message_complete = message_complete_cb - ,.on_chunk_header = chunk_header_cb - ,.on_chunk_complete = chunk_complete_cb - }; - -static http_parser_settings settings_count_body = - {.on_message_begin = message_begin_cb - ,.on_header_field = header_field_cb - ,.on_header_value = header_value_cb - ,.on_url = request_url_cb - ,.on_status = response_status_cb - ,.on_body = count_body_cb - ,.on_headers_complete = headers_complete_cb - ,.on_message_complete = message_complete_cb - ,.on_chunk_header = chunk_header_cb - ,.on_chunk_complete = chunk_complete_cb - }; - -static http_parser_settings settings_null = - {.on_message_begin = 0 - ,.on_header_field = 0 - ,.on_header_value = 0 - ,.on_url = 0 - ,.on_status = 0 - ,.on_body = 0 - ,.on_headers_complete = 0 - ,.on_message_complete = 0 - ,.on_chunk_header = 0 - ,.on_chunk_complete = 0 - }; - -void -parser_init (enum http_parser_type type) -{ - num_messages = 0; - - assert(parser == NULL); - - parser = malloc(sizeof(http_parser)); - - http_parser_init(parser, type); - - memset(&messages, 0, sizeof messages); - -} - -void -parser_free () -{ - assert(parser); - free(parser); - parser = NULL; -} - -size_t parse (const char *buf, size_t len) -{ - size_t nparsed; - currently_parsing_eof = (len == 0); - nparsed = http_parser_execute(parser, &settings, buf, len); - return nparsed; -} - -size_t parse_count_body (const char *buf, size_t len) -{ - size_t nparsed; - currently_parsing_eof = (len == 0); - nparsed = http_parser_execute(parser, &settings_count_body, buf, len); - return nparsed; -} - -size_t parse_pause (const char *buf, size_t len) -{ - size_t nparsed; - http_parser_settings s = settings_pause; - - currently_parsing_eof = (len == 0); - current_pause_parser = &s; - nparsed = http_parser_execute(parser, current_pause_parser, buf, len); - return nparsed; -} - -static inline int -check_str_eq (const struct message *m, - const char *prop, - const char *expected, - const char *found) { - if ((expected == NULL) != (found == NULL)) { - printf("\n*** Error: %s in '%s' ***\n\n", prop, m->name); - printf("expected %s\n", (expected == NULL) ? "NULL" : expected); - printf(" found %s\n", (found == NULL) ? "NULL" : found); - return 0; - } - if (expected != NULL && 0 != strcmp(expected, found)) { - printf("\n*** Error: %s in '%s' ***\n\n", prop, m->name); - printf("expected '%s'\n", expected); - printf(" found '%s'\n", found); - return 0; - } - return 1; -} - -static inline int -check_num_eq (const struct message *m, - const char *prop, - int expected, - int found) { - if (expected != found) { - printf("\n*** Error: %s in '%s' ***\n\n", prop, m->name); - printf("expected %d\n", expected); - printf(" found %d\n", found); - return 0; - } - return 1; -} - -#define MESSAGE_CHECK_STR_EQ(expected, found, prop) \ - if (!check_str_eq(expected, #prop, expected->prop, found->prop)) return 0 - -#define MESSAGE_CHECK_NUM_EQ(expected, found, prop) \ - if (!check_num_eq(expected, #prop, expected->prop, found->prop)) return 0 - -#define MESSAGE_CHECK_URL_EQ(u, expected, found, prop, fn) \ -do { \ - char ubuf[256]; \ - \ - if ((u)->field_set & (1 << (fn))) { \ - memcpy(ubuf, (found)->request_url + (u)->field_data[(fn)].off, \ - (u)->field_data[(fn)].len); \ - ubuf[(u)->field_data[(fn)].len] = '\0'; \ - } else { \ - ubuf[0] = '\0'; \ - } \ - \ - check_str_eq(expected, #prop, expected->prop, ubuf); \ -} while(0) - -int -message_eq (int index, const struct message *expected) -{ - int i; - struct message *m = &messages[index]; - - MESSAGE_CHECK_NUM_EQ(expected, m, http_major); - MESSAGE_CHECK_NUM_EQ(expected, m, http_minor); - - if (expected->type == HTTP_REQUEST) { - MESSAGE_CHECK_NUM_EQ(expected, m, method); - } else { - MESSAGE_CHECK_NUM_EQ(expected, m, status_code); - MESSAGE_CHECK_STR_EQ(expected, m, response_status); - } - - MESSAGE_CHECK_NUM_EQ(expected, m, should_keep_alive); - MESSAGE_CHECK_NUM_EQ(expected, m, message_complete_on_eof); - - assert(m->message_begin_cb_called); - assert(m->headers_complete_cb_called); - assert(m->message_complete_cb_called); - - - MESSAGE_CHECK_STR_EQ(expected, m, request_url); - - /* Check URL components; we can't do this w/ CONNECT since it doesn't - * send us a well-formed URL. - */ - if (*m->request_url && m->method != HTTP_CONNECT) { - struct http_parser_url u; - - if (http_parser_parse_url(m->request_url, strlen(m->request_url), 0, &u)) { - fprintf(stderr, "\n\n*** failed to parse URL %s ***\n\n", - m->request_url); - abort(); - } - - if (expected->host) { - MESSAGE_CHECK_URL_EQ(&u, expected, m, host, UF_HOST); - } - - if (expected->userinfo) { - MESSAGE_CHECK_URL_EQ(&u, expected, m, userinfo, UF_USERINFO); - } - - m->port = (u.field_set & (1 << UF_PORT)) ? - u.port : 0; - - MESSAGE_CHECK_URL_EQ(&u, expected, m, query_string, UF_QUERY); - MESSAGE_CHECK_URL_EQ(&u, expected, m, fragment, UF_FRAGMENT); - MESSAGE_CHECK_URL_EQ(&u, expected, m, request_path, UF_PATH); - MESSAGE_CHECK_NUM_EQ(expected, m, port); - } - - if (expected->body_size) { - MESSAGE_CHECK_NUM_EQ(expected, m, body_size); - } else { - MESSAGE_CHECK_STR_EQ(expected, m, body); - } - - assert(m->num_chunks == m->num_chunks_complete); - MESSAGE_CHECK_NUM_EQ(expected, m, num_chunks_complete); - for (i = 0; i < m->num_chunks && i < MAX_CHUNKS; i++) { - MESSAGE_CHECK_NUM_EQ(expected, m, chunk_lengths[i]); - } - - MESSAGE_CHECK_NUM_EQ(expected, m, num_headers); - - int r; - for (i = 0; i < m->num_headers; i++) { - r = check_str_eq(expected, "header field", expected->headers[i][0], m->headers[i][0]); - if (!r) return 0; - r = check_str_eq(expected, "header value", expected->headers[i][1], m->headers[i][1]); - if (!r) return 0; - } - - MESSAGE_CHECK_STR_EQ(expected, m, upgrade); - - return 1; -} - -/* Given a sequence of varargs messages, return the number of them that the - * parser should successfully parse, taking into account that upgraded - * messages prevent all subsequent messages from being parsed. - */ -size_t -count_parsed_messages(const size_t nmsgs, ...) { - size_t i; - va_list ap; - - va_start(ap, nmsgs); - - for (i = 0; i < nmsgs; i++) { - struct message *m = va_arg(ap, struct message *); - - if (m->upgrade) { - va_end(ap); - return i + 1; - } - } - - va_end(ap); - return nmsgs; -} - -/* Given a sequence of bytes and the number of these that we were able to - * parse, verify that upgrade bodies are correct. - */ -void -upgrade_message_fix(char *body, const size_t nread, const size_t nmsgs, ...) { - va_list ap; - size_t i; - size_t off = 0; - - va_start(ap, nmsgs); - - for (i = 0; i < nmsgs; i++) { - struct message *m = va_arg(ap, struct message *); - - off += strlen(m->raw); - - if (m->upgrade) { - off -= strlen(m->upgrade); - - /* Check the portion of the response after its specified upgrade */ - if (!check_str_eq(m, "upgrade", body + off, body + nread)) { - abort(); - } - - /* Fix up the response so that message_eq() will verify the beginning - * of the upgrade */ - *(body + nread + strlen(m->upgrade)) = '\0'; - messages[num_messages -1 ].upgrade = body + nread; - - va_end(ap); - return; - } - } - - va_end(ap); - printf("\n\n*** Error: expected a message with upgrade ***\n"); - - abort(); -} - -static void -print_error (const char *raw, size_t error_location) -{ - fprintf(stderr, "\n*** %s ***\n\n", - http_errno_description(HTTP_PARSER_ERRNO(parser))); - - int this_line = 0, char_len = 0; - size_t i, j, len = strlen(raw), error_location_line = 0; - for (i = 0; i < len; i++) { - if (i == error_location) this_line = 1; - switch (raw[i]) { - case '\r': - char_len = 2; - fprintf(stderr, "\\r"); - break; - - case '\n': - fprintf(stderr, "\\n\n"); - - if (this_line) goto print; - - error_location_line = 0; - continue; - - default: - char_len = 1; - fputc(raw[i], stderr); - break; - } - if (!this_line) error_location_line += char_len; - } - - fprintf(stderr, "[eof]\n"); - - print: - for (j = 0; j < error_location_line; j++) { - fputc(' ', stderr); - } - fprintf(stderr, "^\n\nerror location: %u\n", (unsigned int)error_location); -} - -void -test_preserve_data (void) -{ - char my_data[] = "application-specific data"; - http_parser parser; - parser.data = my_data; - http_parser_init(&parser, HTTP_REQUEST); - if (parser.data != my_data) { - printf("\n*** parser.data not preserved accross http_parser_init ***\n\n"); - abort(); - } -} - -struct url_test { - const char *name; - const char *url; - int is_connect; - struct http_parser_url u; - int rv; -}; - -const struct url_test url_tests[] = -{ {.name="proxy request" - ,.url="http://hostname/" - ,.is_connect=0 - ,.u= - {.field_set=(1 << UF_SCHEMA) | (1 << UF_HOST) | (1 << UF_PATH) - ,.port=0 - ,.field_data= - {{ 0, 4 } /* UF_SCHEMA */ - ,{ 7, 8 } /* UF_HOST */ - ,{ 0, 0 } /* UF_PORT */ - ,{ 15, 1 } /* UF_PATH */ - ,{ 0, 0 } /* UF_QUERY */ - ,{ 0, 0 } /* UF_FRAGMENT */ - ,{ 0, 0 } /* UF_USERINFO */ - } - } - ,.rv=0 - } - -, {.name="proxy request with port" - ,.url="http://hostname:444/" - ,.is_connect=0 - ,.u= - {.field_set=(1 << UF_SCHEMA) | (1 << UF_HOST) | (1 << UF_PORT) | (1 << UF_PATH) - ,.port=444 - ,.field_data= - {{ 0, 4 } /* UF_SCHEMA */ - ,{ 7, 8 } /* UF_HOST */ - ,{ 16, 3 } /* UF_PORT */ - ,{ 19, 1 } /* UF_PATH */ - ,{ 0, 0 } /* UF_QUERY */ - ,{ 0, 0 } /* UF_FRAGMENT */ - ,{ 0, 0 } /* UF_USERINFO */ - } - } - ,.rv=0 - } - -, {.name="CONNECT request" - ,.url="hostname:443" - ,.is_connect=1 - ,.u= - {.field_set=(1 << UF_HOST) | (1 << UF_PORT) - ,.port=443 - ,.field_data= - {{ 0, 0 } /* UF_SCHEMA */ - ,{ 0, 8 } /* UF_HOST */ - ,{ 9, 3 } /* UF_PORT */ - ,{ 0, 0 } /* UF_PATH */ - ,{ 0, 0 } /* UF_QUERY */ - ,{ 0, 0 } /* UF_FRAGMENT */ - ,{ 0, 0 } /* UF_USERINFO */ - } - } - ,.rv=0 - } - -, {.name="CONNECT request but not connect" - ,.url="hostname:443" - ,.is_connect=0 - ,.rv=1 - } - -, {.name="proxy ipv6 request" - ,.url="http://[1:2::3:4]/" - ,.is_connect=0 - ,.u= - {.field_set=(1 << UF_SCHEMA) | (1 << UF_HOST) | (1 << UF_PATH) - ,.port=0 - ,.field_data= - {{ 0, 4 } /* UF_SCHEMA */ - ,{ 8, 8 } /* UF_HOST */ - ,{ 0, 0 } /* UF_PORT */ - ,{ 17, 1 } /* UF_PATH */ - ,{ 0, 0 } /* UF_QUERY */ - ,{ 0, 0 } /* UF_FRAGMENT */ - ,{ 0, 0 } /* UF_USERINFO */ - } - } - ,.rv=0 - } - -, {.name="proxy ipv6 request with port" - ,.url="http://[1:2::3:4]:67/" - ,.is_connect=0 - ,.u= - {.field_set=(1 << UF_SCHEMA) | (1 << UF_HOST) | (1 << UF_PORT) | (1 << UF_PATH) - ,.port=67 - ,.field_data= - {{ 0, 4 } /* UF_SCHEMA */ - ,{ 8, 8 } /* UF_HOST */ - ,{ 18, 2 } /* UF_PORT */ - ,{ 20, 1 } /* UF_PATH */ - ,{ 0, 0 } /* UF_QUERY */ - ,{ 0, 0 } /* UF_FRAGMENT */ - ,{ 0, 0 } /* UF_USERINFO */ - } - } - ,.rv=0 - } - -, {.name="CONNECT ipv6 address" - ,.url="[1:2::3:4]:443" - ,.is_connect=1 - ,.u= - {.field_set=(1 << UF_HOST) | (1 << UF_PORT) - ,.port=443 - ,.field_data= - {{ 0, 0 } /* UF_SCHEMA */ - ,{ 1, 8 } /* UF_HOST */ - ,{ 11, 3 } /* UF_PORT */ - ,{ 0, 0 } /* UF_PATH */ - ,{ 0, 0 } /* UF_QUERY */ - ,{ 0, 0 } /* UF_FRAGMENT */ - ,{ 0, 0 } /* UF_USERINFO */ - } - } - ,.rv=0 - } - -, {.name="ipv4 in ipv6 address" - ,.url="http://[2001:0000:0000:0000:0000:0000:1.9.1.1]/" - ,.is_connect=0 - ,.u= - {.field_set=(1 << UF_SCHEMA) | (1 << UF_HOST) | (1 << UF_PATH) - ,.port=0 - ,.field_data= - {{ 0, 4 } /* UF_SCHEMA */ - ,{ 8, 37 } /* UF_HOST */ - ,{ 0, 0 } /* UF_PORT */ - ,{ 46, 1 } /* UF_PATH */ - ,{ 0, 0 } /* UF_QUERY */ - ,{ 0, 0 } /* UF_FRAGMENT */ - ,{ 0, 0 } /* UF_USERINFO */ - } - } - ,.rv=0 - } - -, {.name="extra ? in query string" - ,.url="http://a.tbcdn.cn/p/fp/2010c/??fp-header-min.css,fp-base-min.css," - "fp-channel-min.css,fp-product-min.css,fp-mall-min.css,fp-category-min.css," - "fp-sub-min.css,fp-gdp4p-min.css,fp-css3-min.css,fp-misc-min.css?t=20101022.css" - ,.is_connect=0 - ,.u= - {.field_set=(1<field_set, u->port); - for (i = 0; i < UF_MAX; i++) { - if ((u->field_set & (1 << i)) == 0) { - printf("\tfield_data[%u]: unset\n", i); - continue; - } - - printf("\tfield_data[%u]: off: %u len: %u part: \"%.*s\n\"", - i, - u->field_data[i].off, - u->field_data[i].len, - u->field_data[i].len, - url + u->field_data[i].off); - } -} - -void -test_parse_url (void) -{ - struct http_parser_url u; - const struct url_test *test; - unsigned int i; - int rv; - - for (i = 0; i < (sizeof(url_tests) / sizeof(url_tests[0])); i++) { - test = &url_tests[i]; - memset(&u, 0, sizeof(u)); - - rv = http_parser_parse_url(test->url, - strlen(test->url), - test->is_connect, - &u); - - if (test->rv == 0) { - if (rv != 0) { - printf("\n*** http_parser_parse_url(\"%s\") \"%s\" test failed, " - "unexpected rv %d ***\n\n", test->url, test->name, rv); - abort(); - } - - if (memcmp(&u, &test->u, sizeof(u)) != 0) { - printf("\n*** http_parser_parse_url(\"%s\") \"%s\" failed ***\n", - test->url, test->name); - - printf("target http_parser_url:\n"); - dump_url(test->url, &test->u); - printf("result http_parser_url:\n"); - dump_url(test->url, &u); - - abort(); - } - } else { - /* test->rv != 0 */ - if (rv == 0) { - printf("\n*** http_parser_parse_url(\"%s\") \"%s\" test failed, " - "unexpected rv %d ***\n\n", test->url, test->name, rv); - abort(); - } - } - } -} - -void -test_method_str (void) -{ - assert(0 == strcmp("GET", http_method_str(HTTP_GET))); - assert(0 == strcmp("", http_method_str(1337))); -} - -void -test_message (const struct message *message) -{ - size_t raw_len = strlen(message->raw); - size_t msg1len; - for (msg1len = 0; msg1len < raw_len; msg1len++) { - parser_init(message->type); - - size_t read; - const char *msg1 = message->raw; - const char *msg2 = msg1 + msg1len; - size_t msg2len = raw_len - msg1len; - - if (msg1len) { - read = parse(msg1, msg1len); - - if (message->upgrade && parser->upgrade && num_messages > 0) { - messages[num_messages - 1].upgrade = msg1 + read; - goto test; - } - - if (read != msg1len) { - print_error(msg1, read); - abort(); - } - } - - - read = parse(msg2, msg2len); - - if (message->upgrade && parser->upgrade) { - messages[num_messages - 1].upgrade = msg2 + read; - goto test; - } - - if (read != msg2len) { - print_error(msg2, read); - abort(); - } - - read = parse(NULL, 0); - - if (read != 0) { - print_error(message->raw, read); - abort(); - } - - test: - - if (num_messages != 1) { - printf("\n*** num_messages != 1 after testing '%s' ***\n\n", message->name); - abort(); - } - - if(!message_eq(0, message)) abort(); - - parser_free(); - } -} - -void -test_message_count_body (const struct message *message) -{ - parser_init(message->type); - - size_t read; - size_t l = strlen(message->raw); - size_t i, toread; - size_t chunk = 4024; - - for (i = 0; i < l; i+= chunk) { - toread = MIN(l-i, chunk); - read = parse_count_body(message->raw + i, toread); - if (read != toread) { - print_error(message->raw, read); - abort(); - } - } - - - read = parse_count_body(NULL, 0); - if (read != 0) { - print_error(message->raw, read); - abort(); - } - - if (num_messages != 1) { - printf("\n*** num_messages != 1 after testing '%s' ***\n\n", message->name); - abort(); - } - - if(!message_eq(0, message)) abort(); - - parser_free(); -} - -void -test_simple (const char *buf, enum http_errno err_expected) -{ - parser_init(HTTP_REQUEST); - - enum http_errno err; - - parse(buf, strlen(buf)); - err = HTTP_PARSER_ERRNO(parser); - parse(NULL, 0); - - parser_free(); - - /* In strict mode, allow us to pass with an unexpected HPE_STRICT as - * long as the caller isn't expecting success. - */ -#if HTTP_PARSER_STRICT - if (err_expected != err && err_expected != HPE_OK && err != HPE_STRICT) { -#else - if (err_expected != err) { -#endif - fprintf(stderr, "\n*** test_simple expected %s, but saw %s ***\n\n%s\n", - http_errno_name(err_expected), http_errno_name(err), buf); - abort(); - } -} - -void -test_header_overflow_error (int req) -{ - http_parser parser; - http_parser_init(&parser, req ? HTTP_REQUEST : HTTP_RESPONSE); - size_t parsed; - const char *buf; - buf = req ? "GET / HTTP/1.1\r\n" : "HTTP/1.0 200 OK\r\n"; - parsed = http_parser_execute(&parser, &settings_null, buf, strlen(buf)); - assert(parsed == strlen(buf)); - - buf = "header-key: header-value\r\n"; - size_t buflen = strlen(buf); - - int i; - for (i = 0; i < 10000; i++) { - parsed = http_parser_execute(&parser, &settings_null, buf, buflen); - if (parsed != buflen) { - //fprintf(stderr, "error found on iter %d\n", i); - assert(HTTP_PARSER_ERRNO(&parser) == HPE_HEADER_OVERFLOW); - return; - } - } - - fprintf(stderr, "\n*** Error expected but none in header overflow test ***\n"); - abort(); -} - - -void -test_header_nread_value () -{ - http_parser parser; - http_parser_init(&parser, HTTP_REQUEST); - size_t parsed; - const char *buf; - buf = "GET / HTTP/1.1\r\nheader: value\nhdr: value\r\n"; - parsed = http_parser_execute(&parser, &settings_null, buf, strlen(buf)); - assert(parsed == strlen(buf)); - - assert(parser.nread == strlen(buf)); -} - - -static void -test_content_length_overflow (const char *buf, size_t buflen, int expect_ok) -{ - http_parser parser; - http_parser_init(&parser, HTTP_RESPONSE); - http_parser_execute(&parser, &settings_null, buf, buflen); - - if (expect_ok) - assert(HTTP_PARSER_ERRNO(&parser) == HPE_OK); - else - assert(HTTP_PARSER_ERRNO(&parser) == HPE_INVALID_CONTENT_LENGTH); -} - -void -test_header_content_length_overflow_error (void) -{ -#define X(size) \ - "HTTP/1.1 200 OK\r\n" \ - "Content-Length: " #size "\r\n" \ - "\r\n" - const char a[] = X(1844674407370955160); /* 2^64 / 10 - 1 */ - const char b[] = X(18446744073709551615); /* 2^64-1 */ - const char c[] = X(18446744073709551616); /* 2^64 */ -#undef X - test_content_length_overflow(a, sizeof(a) - 1, 1); /* expect ok */ - test_content_length_overflow(b, sizeof(b) - 1, 0); /* expect failure */ - test_content_length_overflow(c, sizeof(c) - 1, 0); /* expect failure */ -} - -void -test_chunk_content_length_overflow_error (void) -{ -#define X(size) \ - "HTTP/1.1 200 OK\r\n" \ - "Transfer-Encoding: chunked\r\n" \ - "\r\n" \ - #size "\r\n" \ - "..." - const char a[] = X(FFFFFFFFFFFFFFE); /* 2^64 / 16 - 1 */ - const char b[] = X(FFFFFFFFFFFFFFFF); /* 2^64-1 */ - const char c[] = X(10000000000000000); /* 2^64 */ -#undef X - test_content_length_overflow(a, sizeof(a) - 1, 1); /* expect ok */ - test_content_length_overflow(b, sizeof(b) - 1, 0); /* expect failure */ - test_content_length_overflow(c, sizeof(c) - 1, 0); /* expect failure */ -} - -void -test_no_overflow_long_body (int req, size_t length) -{ - http_parser parser; - http_parser_init(&parser, req ? HTTP_REQUEST : HTTP_RESPONSE); - size_t parsed; - size_t i; - char buf1[3000]; - size_t buf1len = sprintf(buf1, "%s\r\nConnection: Keep-Alive\r\nContent-Length: %lu\r\n\r\n", - req ? "POST / HTTP/1.0" : "HTTP/1.0 200 OK", (unsigned long)length); - parsed = http_parser_execute(&parser, &settings_null, buf1, buf1len); - if (parsed != buf1len) - goto err; - - for (i = 0; i < length; i++) { - char foo = 'a'; - parsed = http_parser_execute(&parser, &settings_null, &foo, 1); - if (parsed != 1) - goto err; - } - - parsed = http_parser_execute(&parser, &settings_null, buf1, buf1len); - if (parsed != buf1len) goto err; - return; - - err: - fprintf(stderr, - "\n*** error in test_no_overflow_long_body %s of length %lu ***\n", - req ? "REQUEST" : "RESPONSE", - (unsigned long)length); - abort(); -} - -void -test_multiple3 (const struct message *r1, const struct message *r2, const struct message *r3) -{ - int message_count = count_parsed_messages(3, r1, r2, r3); - - char total[ strlen(r1->raw) - + strlen(r2->raw) - + strlen(r3->raw) - + 1 - ]; - total[0] = '\0'; - - strcat(total, r1->raw); - strcat(total, r2->raw); - strcat(total, r3->raw); - - parser_init(r1->type); - - size_t read; - - read = parse(total, strlen(total)); - - if (parser->upgrade) { - upgrade_message_fix(total, read, 3, r1, r2, r3); - goto test; - } - - if (read != strlen(total)) { - print_error(total, read); - abort(); - } - - read = parse(NULL, 0); - - if (read != 0) { - print_error(total, read); - abort(); - } - -test: - - if (message_count != num_messages) { - fprintf(stderr, "\n\n*** Parser didn't see 3 messages only %d *** \n", num_messages); - abort(); - } - - if (!message_eq(0, r1)) abort(); - if (message_count > 1 && !message_eq(1, r2)) abort(); - if (message_count > 2 && !message_eq(2, r3)) abort(); - - parser_free(); -} - -/* SCAN through every possible breaking to make sure the - * parser can handle getting the content in any chunks that - * might come from the socket - */ -void -test_scan (const struct message *r1, const struct message *r2, const struct message *r3) -{ - char total[80*1024] = "\0"; - char buf1[80*1024] = "\0"; - char buf2[80*1024] = "\0"; - char buf3[80*1024] = "\0"; - - strcat(total, r1->raw); - strcat(total, r2->raw); - strcat(total, r3->raw); - - size_t read; - - int total_len = strlen(total); - - int total_ops = 2 * (total_len - 1) * (total_len - 2) / 2; - int ops = 0 ; - - size_t buf1_len, buf2_len, buf3_len; - int message_count = count_parsed_messages(3, r1, r2, r3); - - int i,j,type_both; - for (type_both = 0; type_both < 2; type_both ++ ) { - for (j = 2; j < total_len; j ++ ) { - for (i = 1; i < j; i ++ ) { - - if (ops % 1000 == 0) { - printf("\b\b\b\b%3.0f%%", 100 * (float)ops /(float)total_ops); - fflush(stdout); - } - ops += 1; - - parser_init(type_both ? HTTP_BOTH : r1->type); - - buf1_len = i; - strlncpy(buf1, sizeof(buf1), total, buf1_len); - buf1[buf1_len] = 0; - - buf2_len = j - i; - strlncpy(buf2, sizeof(buf1), total+i, buf2_len); - buf2[buf2_len] = 0; - - buf3_len = total_len - j; - strlncpy(buf3, sizeof(buf1), total+j, buf3_len); - buf3[buf3_len] = 0; - - read = parse(buf1, buf1_len); - - if (parser->upgrade) goto test; - - if (read != buf1_len) { - print_error(buf1, read); - goto error; - } - - read += parse(buf2, buf2_len); - - if (parser->upgrade) goto test; - - if (read != buf1_len + buf2_len) { - print_error(buf2, read); - goto error; - } - - read += parse(buf3, buf3_len); - - if (parser->upgrade) goto test; - - if (read != buf1_len + buf2_len + buf3_len) { - print_error(buf3, read); - goto error; - } - - parse(NULL, 0); - -test: - if (parser->upgrade) { - upgrade_message_fix(total, read, 3, r1, r2, r3); - } - - if (message_count != num_messages) { - fprintf(stderr, "\n\nParser didn't see %d messages only %d\n", - message_count, num_messages); - goto error; - } - - if (!message_eq(0, r1)) { - fprintf(stderr, "\n\nError matching messages[0] in test_scan.\n"); - goto error; - } - - if (message_count > 1 && !message_eq(1, r2)) { - fprintf(stderr, "\n\nError matching messages[1] in test_scan.\n"); - goto error; - } - - if (message_count > 2 && !message_eq(2, r3)) { - fprintf(stderr, "\n\nError matching messages[2] in test_scan.\n"); - goto error; - } - - parser_free(); - } - } - } - puts("\b\b\b\b100%"); - return; - - error: - fprintf(stderr, "i=%d j=%d\n", i, j); - fprintf(stderr, "buf1 (%u) %s\n\n", (unsigned int)buf1_len, buf1); - fprintf(stderr, "buf2 (%u) %s\n\n", (unsigned int)buf2_len , buf2); - fprintf(stderr, "buf3 (%u) %s\n", (unsigned int)buf3_len, buf3); - abort(); -} - -// user required to free the result -// string terminated by \0 -char * -create_large_chunked_message (int body_size_in_kb, const char* headers) -{ - int i; - size_t wrote = 0; - size_t headers_len = strlen(headers); - size_t bufsize = headers_len + (5+1024+2)*body_size_in_kb + 6; - char * buf = malloc(bufsize); - - memcpy(buf, headers, headers_len); - wrote += headers_len; - - for (i = 0; i < body_size_in_kb; i++) { - // write 1kb chunk into the body. - memcpy(buf + wrote, "400\r\n", 5); - wrote += 5; - memset(buf + wrote, 'C', 1024); - wrote += 1024; - strcpy(buf + wrote, "\r\n"); - wrote += 2; - } - - memcpy(buf + wrote, "0\r\n\r\n", 6); - wrote += 6; - assert(wrote == bufsize); - - return buf; -} - -/* Verify that we can pause parsing at any of the bytes in the - * message and still get the result that we're expecting. */ -void -test_message_pause (const struct message *msg) -{ - char *buf = (char*) msg->raw; - size_t buflen = strlen(msg->raw); - size_t nread; - - parser_init(msg->type); - - do { - nread = parse_pause(buf, buflen); - - // We can only set the upgrade buffer once we've gotten our message - // completion callback. - if (messages[0].message_complete_cb_called && - msg->upgrade && - parser->upgrade) { - messages[0].upgrade = buf + nread; - goto test; - } - - if (nread < buflen) { - - // Not much do to if we failed a strict-mode check - if (HTTP_PARSER_ERRNO(parser) == HPE_STRICT) { - parser_free(); - return; - } - - assert (HTTP_PARSER_ERRNO(parser) == HPE_PAUSED); - } - - buf += nread; - buflen -= nread; - http_parser_pause(parser, 0); - } while (buflen > 0); - - nread = parse_pause(NULL, 0); - assert (nread == 0); - -test: - if (num_messages != 1) { - printf("\n*** num_messages != 1 after testing '%s' ***\n\n", msg->name); - abort(); - } - - if(!message_eq(0, msg)) abort(); - - parser_free(); -} - -int -main (void) -{ - parser = NULL; - int i, j, k; - int request_count; - int response_count; - unsigned long version; - unsigned major; - unsigned minor; - unsigned patch; - - version = http_parser_version(); - major = (version >> 16) & 255; - minor = (version >> 8) & 255; - patch = version & 255; - printf("http_parser v%u.%u.%u (0x%06lx)\n", major, minor, patch, version); - - printf("sizeof(http_parser) = %u\n", (unsigned int)sizeof(http_parser)); - - for (request_count = 0; requests[request_count].name; request_count++); - for (response_count = 0; responses[response_count].name; response_count++); - - //// API - test_preserve_data(); - test_parse_url(); - test_method_str(); - - //// NREAD - test_header_nread_value(); - - //// OVERFLOW CONDITIONS - - test_header_overflow_error(HTTP_REQUEST); - test_no_overflow_long_body(HTTP_REQUEST, 1000); - test_no_overflow_long_body(HTTP_REQUEST, 100000); - - test_header_overflow_error(HTTP_RESPONSE); - test_no_overflow_long_body(HTTP_RESPONSE, 1000); - test_no_overflow_long_body(HTTP_RESPONSE, 100000); - - test_header_content_length_overflow_error(); - test_chunk_content_length_overflow_error(); - - //// RESPONSES - - for (i = 0; i < response_count; i++) { - test_message(&responses[i]); - } - - for (i = 0; i < response_count; i++) { - test_message_pause(&responses[i]); - } - - for (i = 0; i < response_count; i++) { - if (!responses[i].should_keep_alive) continue; - for (j = 0; j < response_count; j++) { - if (!responses[j].should_keep_alive) continue; - for (k = 0; k < response_count; k++) { - test_multiple3(&responses[i], &responses[j], &responses[k]); - } - } - } - - test_message_count_body(&responses[NO_HEADERS_NO_BODY_404]); - test_message_count_body(&responses[TRAILING_SPACE_ON_CHUNKED_BODY]); - - // test very large chunked response - { - char * msg = create_large_chunked_message(31337, - "HTTP/1.0 200 OK\r\n" - "Transfer-Encoding: chunked\r\n" - "Content-Type: text/plain\r\n" - "\r\n"); - struct message large_chunked = - {.name= "large chunked" - ,.type= HTTP_RESPONSE - ,.raw= msg - ,.should_keep_alive= FALSE - ,.message_complete_on_eof= FALSE - ,.http_major= 1 - ,.http_minor= 0 - ,.status_code= 200 - ,.response_status= "OK" - ,.num_headers= 2 - ,.headers= - { { "Transfer-Encoding", "chunked" } - , { "Content-Type", "text/plain" } - } - ,.body_size= 31337*1024 - ,.num_chunks_complete= 31338 - }; - for (i = 0; i < MAX_CHUNKS; i++) { - large_chunked.chunk_lengths[i] = 1024; - } - test_message_count_body(&large_chunked); - free(msg); - } - - - - printf("response scan 1/2 "); - test_scan( &responses[TRAILING_SPACE_ON_CHUNKED_BODY] - , &responses[NO_BODY_HTTP10_KA_204] - , &responses[NO_REASON_PHRASE] - ); - - printf("response scan 2/2 "); - test_scan( &responses[BONJOUR_MADAME_FR] - , &responses[UNDERSTORE_HEADER_KEY] - , &responses[NO_CARRIAGE_RET] - ); - - puts("responses okay"); - - - /// REQUESTS - - test_simple("GET / HTP/1.1\r\n\r\n", HPE_INVALID_VERSION); - - // Well-formed but incomplete - test_simple("GET / HTTP/1.1\r\n" - "Content-Type: text/plain\r\n" - "Content-Length: 6\r\n" - "\r\n" - "fooba", - HPE_OK); - - static const char *all_methods[] = { - "DELETE", - "GET", - "HEAD", - "POST", - "PUT", - //"CONNECT", //CONNECT can't be tested like other methods, it's a tunnel - "OPTIONS", - "TRACE", - "COPY", - "LOCK", - "MKCOL", - "MOVE", - "PROPFIND", - "PROPPATCH", - "UNLOCK", - "REPORT", - "MKACTIVITY", - "CHECKOUT", - "MERGE", - "M-SEARCH", - "NOTIFY", - "SUBSCRIBE", - "UNSUBSCRIBE", - "PATCH", - 0 }; - const char **this_method; - for (this_method = all_methods; *this_method; this_method++) { - char buf[200]; - sprintf(buf, "%s / HTTP/1.1\r\n\r\n", *this_method); - test_simple(buf, HPE_OK); - } - - static const char *bad_methods[] = { - "ASDF", - "C******", - "COLA", - "GEM", - "GETA", - "M****", - "MKCOLA", - "PROPPATCHA", - "PUN", - "PX", - "SA", - "hello world", - 0 }; - for (this_method = bad_methods; *this_method; this_method++) { - char buf[200]; - sprintf(buf, "%s / HTTP/1.1\r\n\r\n", *this_method); - test_simple(buf, HPE_INVALID_METHOD); - } - - // illegal header field name line folding - test_simple("GET / HTTP/1.1\r\n" - "name\r\n" - " : value\r\n" - "\r\n", - HPE_INVALID_HEADER_TOKEN); - - const char *dumbfuck2 = - "GET / HTTP/1.1\r\n" - "X-SSL-Bullshit: -----BEGIN CERTIFICATE-----\r\n" - "\tMIIFbTCCBFWgAwIBAgICH4cwDQYJKoZIhvcNAQEFBQAwcDELMAkGA1UEBhMCVUsx\r\n" - "\tETAPBgNVBAoTCGVTY2llbmNlMRIwEAYDVQQLEwlBdXRob3JpdHkxCzAJBgNVBAMT\r\n" - "\tAkNBMS0wKwYJKoZIhvcNAQkBFh5jYS1vcGVyYXRvckBncmlkLXN1cHBvcnQuYWMu\r\n" - "\tdWswHhcNMDYwNzI3MTQxMzI4WhcNMDcwNzI3MTQxMzI4WjBbMQswCQYDVQQGEwJV\r\n" - "\tSzERMA8GA1UEChMIZVNjaWVuY2UxEzARBgNVBAsTCk1hbmNoZXN0ZXIxCzAJBgNV\r\n" - "\tBAcTmrsogriqMWLAk1DMRcwFQYDVQQDEw5taWNoYWVsIHBhcmQYJKoZIhvcNAQEB\r\n" - "\tBQADggEPADCCAQoCggEBANPEQBgl1IaKdSS1TbhF3hEXSl72G9J+WC/1R64fAcEF\r\n" - "\tW51rEyFYiIeZGx/BVzwXbeBoNUK41OK65sxGuflMo5gLflbwJtHBRIEKAfVVp3YR\r\n" - "\tgW7cMA/s/XKgL1GEC7rQw8lIZT8RApukCGqOVHSi/F1SiFlPDxuDfmdiNzL31+sL\r\n" - "\t0iwHDdNkGjy5pyBSB8Y79dsSJtCW/iaLB0/n8Sj7HgvvZJ7x0fr+RQjYOUUfrePP\r\n" - "\tu2MSpFyf+9BbC/aXgaZuiCvSR+8Snv3xApQY+fULK/xY8h8Ua51iXoQ5jrgu2SqR\r\n" - "\twgA7BUi3G8LFzMBl8FRCDYGUDy7M6QaHXx1ZWIPWNKsCAwEAAaOCAiQwggIgMAwG\r\n" - "\tA1UdEwEB/wQCMAAwEQYJYIZIAYb4QgHTTPAQDAgWgMA4GA1UdDwEB/wQEAwID6DAs\r\n" - "\tBglghkgBhvhCAQ0EHxYdVUsgZS1TY2llbmNlIFVzZXIgQ2VydGlmaWNhdGUwHQYD\r\n" - "\tVR0OBBYEFDTt/sf9PeMaZDHkUIldrDYMNTBZMIGaBgNVHSMEgZIwgY+AFAI4qxGj\r\n" - "\tloCLDdMVKwiljjDastqooXSkcjBwMQswCQYDVQQGEwJVSzERMA8GA1UEChMIZVNj\r\n" - "\taWVuY2UxEjAQBgNVBAsTCUF1dGhvcml0eTELMAkGA1UEAxMCQ0ExLTArBgkqhkiG\r\n" - "\t9w0BCQEWHmNhLW9wZXJhdG9yQGdyaWQtc3VwcG9ydC5hYy51a4IBADApBgNVHRIE\r\n" - "\tIjAggR5jYS1vcGVyYXRvckBncmlkLXN1cHBvcnQuYWMudWswGQYDVR0gBBIwEDAO\r\n" - "\tBgwrBgEEAdkvAQEBAQYwPQYJYIZIAYb4QgEEBDAWLmh0dHA6Ly9jYS5ncmlkLXN1\r\n" - "\tcHBvcnQuYWMudmT4sopwqlBWsvcHViL2NybC9jYWNybC5jcmwwPQYJYIZIAYb4QgEDBDAWLmh0\r\n" - "\tdHA6Ly9jYS5ncmlkLXN1cHBvcnQuYWMudWsvcHViL2NybC9jYWNybC5jcmwwPwYD\r\n" - "\tVR0fBDgwNjA0oDKgMIYuaHR0cDovL2NhLmdyaWQt5hYy51ay9wdWIv\r\n" - "\tY3JsL2NhY3JsLmNybDANBgkqhkiG9w0BAQUFAAOCAQEAS/U4iiooBENGW/Hwmmd3\r\n" - "\tXCy6Zrt08YjKCzGNjorT98g8uGsqYjSxv/hmi0qlnlHs+k/3Iobc3LjS5AMYr5L8\r\n" - "\tUO7OSkgFFlLHQyC9JzPfmLCAugvzEbyv4Olnsr8hbxF1MbKZoQxUZtMVu29wjfXk\r\n" - "\thTeApBv7eaKCWpSp7MCbvgzm74izKhu3vlDk9w6qVrxePfGgpKPqfHiOoGhFnbTK\r\n" - "\twTC6o2xq5y0qZ03JonF7OJspEd3I5zKY3E+ov7/ZhW6DqT8UFvsAdjvQbXyhV8Eu\r\n" - "\tYhixw1aKEPzNjNowuIseVogKOLXxWI5vAi5HgXdS0/ES5gDGsABo4fqovUKlgop3\r\n" - "\tRA==\r\n" - "\t-----END CERTIFICATE-----\r\n" - "\r\n"; - test_simple(dumbfuck2, HPE_OK); - - const char *corrupted_connection = - "GET / HTTP/1.1\r\n" - "Host: www.example.com\r\n" - "Connection\r\033\065\325eep-Alive\r\n" - "Accept-Encoding: gzip\r\n" - "\r\n"; - test_simple(corrupted_connection, HPE_INVALID_HEADER_TOKEN); - - const char *corrupted_header_name = - "GET / HTTP/1.1\r\n" - "Host: www.example.com\r\n" - "X-Some-Header\r\033\065\325eep-Alive\r\n" - "Accept-Encoding: gzip\r\n" - "\r\n"; - test_simple(corrupted_header_name, HPE_INVALID_HEADER_TOKEN); - -#if 0 - // NOTE(Wed Nov 18 11:57:27 CET 2009) this seems okay. we just read body - // until EOF. - // - // no content-length - // error if there is a body without content length - const char *bad_get_no_headers_no_body = "GET /bad_get_no_headers_no_body/world HTTP/1.1\r\n" - "Accept: */*\r\n" - "\r\n" - "HELLO"; - test_simple(bad_get_no_headers_no_body, 0); -#endif - /* TODO sending junk and large headers gets rejected */ - - - /* check to make sure our predefined requests are okay */ - for (i = 0; requests[i].name; i++) { - test_message(&requests[i]); - } - - for (i = 0; i < request_count; i++) { - test_message_pause(&requests[i]); - } - - for (i = 0; i < request_count; i++) { - if (!requests[i].should_keep_alive) continue; - for (j = 0; j < request_count; j++) { - if (!requests[j].should_keep_alive) continue; - for (k = 0; k < request_count; k++) { - test_multiple3(&requests[i], &requests[j], &requests[k]); - } - } - } - - printf("request scan 1/4 "); - test_scan( &requests[GET_NO_HEADERS_NO_BODY] - , &requests[GET_ONE_HEADER_NO_BODY] - , &requests[GET_NO_HEADERS_NO_BODY] - ); - - printf("request scan 2/4 "); - test_scan( &requests[POST_CHUNKED_ALL_YOUR_BASE] - , &requests[POST_IDENTITY_BODY_WORLD] - , &requests[GET_FUNKY_CONTENT_LENGTH] - ); - - printf("request scan 3/4 "); - test_scan( &requests[TWO_CHUNKS_MULT_ZERO_END] - , &requests[CHUNKED_W_TRAILING_HEADERS] - , &requests[CHUNKED_W_BULLSHIT_AFTER_LENGTH] - ); - - printf("request scan 4/4 "); - test_scan( &requests[QUERY_URL_WITH_QUESTION_MARK_GET] - , &requests[PREFIX_NEWLINE_GET ] - , &requests[CONNECT_REQUEST] - ); - - puts("requests okay"); - - return 0; -} diff --git a/vendor/libgit2 b/vendor/libgit2 index da12bb87a7..2644628edb 160000 --- a/vendor/libgit2 +++ b/vendor/libgit2 @@ -1 +1 @@ -Subproject commit da12bb87a7d206d3c8dfdd0922d0c3c7009965ba +Subproject commit 2644628edb8742338a952d40f5e9549b17480e3a diff --git a/vendor/libgit2.gyp b/vendor/libgit2.gyp index 59e2931b27..aff29d76a2 100644 --- a/vendor/libgit2.gyp +++ b/vendor/libgit2.gyp @@ -7,7 +7,10 @@ "library%": "static_library", "openssl_enable_asm%": 0, # only supported with the Visual Studio 2012 (VC11) toolchain. "gcc_version%": 0, - "is_clang%": 0 + "is_electron%": " * Copyright (c) 2006-2007 The Written Word, Inc. * Copyright (c) 2007 Eli Fant - * Copyright (c) 2009-2014 Daniel Stenberg + * Copyright (c) 2009-2021 Daniel Stenberg * Copyright (C) 2008, 2009 Simon Josefsson + * Copyright (c) 2000 Markus Friedl + * Copyright (c) 2015 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, diff --git a/vendor/libssh2/Makefile.OpenSSL.inc b/vendor/libssh2/Makefile.OpenSSL.inc index 76f3e85cad..1e4e8f0bbb 100644 --- a/vendor/libssh2/Makefile.OpenSSL.inc +++ b/vendor/libssh2/Makefile.OpenSSL.inc @@ -1,2 +1,3 @@ CRYPTO_CSOURCES = openssl.c CRYPTO_HHEADERS = openssl.h +CRYPTO_LTLIBS = $(LTLIBSSL) diff --git a/vendor/libssh2/Makefile.WinCNG.inc b/vendor/libssh2/Makefile.WinCNG.inc index c18350eedf..bbcb82bfde 100644 --- a/vendor/libssh2/Makefile.WinCNG.inc +++ b/vendor/libssh2/Makefile.WinCNG.inc @@ -1,2 +1,3 @@ CRYPTO_CSOURCES = wincng.c CRYPTO_HHEADERS = wincng.h +CRYPTO_LTLIBS = $(LTLIBBCRYPT) $(LTLIBCRYPT32) diff --git a/vendor/libssh2/Makefile.am b/vendor/libssh2/Makefile.am index 761733e734..986441bd68 100644 --- a/vendor/libssh2/Makefile.am +++ b/vendor/libssh2/Makefile.am @@ -43,7 +43,7 @@ os400/libssh2rpg/libssh2_publickey.rpgle \ os400/libssh2rpg/libssh2_sftp.rpgle \ Makefile.os400qc3.inc -EXTRA_DIST = $(WIN32FILES) buildconf $(NETWAREFILES) get_ver.awk \ +EXTRA_DIST = $(WIN32FILES) $(NETWAREFILES) get_ver.awk \ maketgz NMakefile RELEASE-NOTES libssh2.pc.in $(VMSFILES) config.rpath \ CMakeLists.txt cmake $(OS400FILES) @@ -88,8 +88,8 @@ coverage: init-coverage build-coverage gen-coverage # DSP/VCPROJ generation adapted from libcurl # only OpenSSL and WinCNG are supported with this build system -CRYPTO_CSOURCES = openssl.c wincng.c -CRYPTO_HHEADERS = openssl.h wincng.h +CRYPTO_CSOURCES = openssl.c wincng.c mbedtls.c +CRYPTO_HHEADERS = openssl.h wincng.h mbedtls.h # Makefile.inc provides the CSOURCES and HHEADERS defines include Makefile.inc @@ -119,7 +119,7 @@ $(DSP): win32/msvcproj.head win32/msvcproj.foot Makefile.am for file in $$sorted_hdrs; do \ echo "# Begin Source File"; \ echo ""; \ - if [ "$$file" == "libssh2_config.h" ]; \ + if [ "$$file" = "libssh2_config.h" ]; \ then \ echo "SOURCE=.\\"$$file; \ else \ @@ -147,3 +147,8 @@ $(VCPROJ): win32/vc8proj.head win32/vc8proj.foot Makefile.am done; \ cat $(srcdir)/vc8proj.foot) | \ awk '{printf("%s\r\n", gensub("\r", "", "g"))}' > $@ ) + +checksrc: + perl src/checksrc.pl -i4 -m79 -ASIZEOFNOPAREN -ASNPRINTF -ACOPYRIGHT \ + -AFOPENMODE -Wsrc/libssh2_config.h src/*.[ch] include/*.h example/*.c \ + tests/*.[ch] diff --git a/vendor/libssh2/Makefile.in b/vendor/libssh2/Makefile.in index 624dfebd4a..c60873ab8e 100644 --- a/vendor/libssh2/Makefile.in +++ b/vendor/libssh2/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -105,8 +105,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/src/libssh2_config.h \ - $(top_builddir)/example/libssh2_config.h +CONFIG_HEADER = $(top_builddir)/src/libssh2_config.h CONFIG_CLEAN_FILES = libssh2.pc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) @@ -174,7 +173,7 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir dist dist-all distcheck + cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -192,9 +191,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope DIST_SUBDIRS = src tests docs example am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.inc \ $(srcdir)/libssh2.pc.in COPYING ChangeLog NEWS README compile \ @@ -238,6 +234,8 @@ am__relativize = \ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -257,6 +255,12 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -267,12 +271,14 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_LIBBCRYPT = @HAVE_LIBBCRYPT@ HAVE_LIBCRYPT32 = @HAVE_LIBCRYPT32@ HAVE_LIBGCRYPT = @HAVE_LIBGCRYPT@ +HAVE_LIBMBEDCRYPTO = @HAVE_LIBMBEDCRYPTO@ HAVE_LIBSSL = @HAVE_LIBSSL@ HAVE_LIBZ = @HAVE_LIBZ@ INSTALL = @INSTALL@ @@ -288,6 +294,8 @@ LIBCRYPT32 = @LIBCRYPT32@ LIBCRYPT32_PREFIX = @LIBCRYPT32_PREFIX@ LIBGCRYPT = @LIBGCRYPT@ LIBGCRYPT_PREFIX = @LIBGCRYPT_PREFIX@ +LIBMBEDCRYPTO = @LIBMBEDCRYPTO@ +LIBMBEDCRYPTO_PREFIX = @LIBMBEDCRYPTO_PREFIX@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSREQUIRED = @LIBSREQUIRED@ @@ -297,14 +305,17 @@ LIBSSL_PREFIX = @LIBSSL_PREFIX@ LIBTOOL = @LIBTOOL@ LIBZ = @LIBZ@ LIBZ_PREFIX = @LIBZ_PREFIX@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBBCRYPT = @LTLIBBCRYPT@ LTLIBCRYPT32 = @LTLIBCRYPT32@ LTLIBGCRYPT = @LTLIBGCRYPT@ +LTLIBMBEDCRYPTO = @LTLIBMBEDCRYPTO@ LTLIBOBJS = @LTLIBOBJS@ LTLIBSSL = @LTLIBSSL@ LTLIBZ = @LTLIBZ@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -336,6 +347,7 @@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -420,7 +432,7 @@ os400/libssh2rpg/libssh2_publickey.rpgle \ os400/libssh2rpg/libssh2_sftp.rpgle \ Makefile.os400qc3.inc -EXTRA_DIST = $(WIN32FILES) buildconf $(NETWAREFILES) get_ver.awk \ +EXTRA_DIST = $(WIN32FILES) $(NETWAREFILES) get_ver.awk \ maketgz NMakefile RELEASE-NOTES libssh2.pc.in $(VMSFILES) config.rpath \ CMakeLists.txt cmake $(OS400FILES) @@ -428,14 +440,15 @@ ACLOCAL_AMFLAGS = -I m4 # DSP/VCPROJ generation adapted from libcurl # only OpenSSL and WinCNG are supported with this build system -CRYPTO_CSOURCES = openssl.c wincng.c -CRYPTO_HHEADERS = openssl.h wincng.h +CRYPTO_CSOURCES = openssl.c wincng.c mbedtls.c +CRYPTO_HHEADERS = openssl.h wincng.h mbedtls.h CSOURCES = channel.c comp.c crypt.c hostkey.c kex.c mac.c misc.c \ packet.c publickey.c scp.c session.c sftp.c userauth.c transport.c \ - version.c knownhost.c agent.c $(CRYPTO_CSOURCES) pem.c keepalive.c global.c + version.c knownhost.c agent.c $(CRYPTO_CSOURCES) pem.c keepalive.c global.c \ + blowfish.c bcrypt_pbkdf.c agent_win.c HHEADERS = libssh2_priv.h $(CRYPTO_HHEADERS) transport.h channel.h comp.h \ - mac.h misc.h packet.h userauth.h session.h sftp.h crypto.h + mac.h misc.h packet.h userauth.h session.h sftp.h crypto.h blf.h agent.h # Makefile.inc provides the CSOURCES and HHEADERS defines WIN32SOURCES = $(CSOURCES) @@ -464,8 +477,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(srcdir)/Makefile.inc $(am__empty): @@ -636,8 +649,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -705,7 +720,7 @@ distdir: $(DISTFILES) ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir @@ -720,6 +735,10 @@ dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -731,7 +750,7 @@ dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir @@ -749,7 +768,7 @@ dist dist-all: distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ @@ -759,9 +778,11 @@ distcheck: dist *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -777,7 +798,7 @@ distcheck: dist $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -943,7 +964,7 @@ uninstall-am: uninstall-includeHEADERS uninstall-pkgconfigDATA am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ - dist-tarZ dist-xz dist-zip distcheck distclean \ + dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \ distclean-generic distclean-libtool distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ @@ -1019,7 +1040,7 @@ $(DSP): win32/msvcproj.head win32/msvcproj.foot Makefile.am for file in $$sorted_hdrs; do \ echo "# Begin Source File"; \ echo ""; \ - if [ "$$file" == "libssh2_config.h" ]; \ + if [ "$$file" = "libssh2_config.h" ]; \ then \ echo "SOURCE=.\\"$$file; \ else \ @@ -1048,6 +1069,11 @@ $(VCPROJ): win32/vc8proj.head win32/vc8proj.foot Makefile.am cat $(srcdir)/vc8proj.foot) | \ awk '{printf("%s\r\n", gensub("\r", "", "g"))}' > $@ ) +checksrc: + perl src/checksrc.pl -i4 -m79 -ASIZEOFNOPAREN -ASNPRINTF -ACOPYRIGHT \ + -AFOPENMODE -Wsrc/libssh2_config.h src/*.[ch] include/*.h example/*.c \ + tests/*.[ch] + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/vendor/libssh2/Makefile.inc b/vendor/libssh2/Makefile.inc index 8f2e570cb5..20d2ebeeb2 100644 --- a/vendor/libssh2/Makefile.inc +++ b/vendor/libssh2/Makefile.inc @@ -1,6 +1,7 @@ CSOURCES = channel.c comp.c crypt.c hostkey.c kex.c mac.c misc.c \ packet.c publickey.c scp.c session.c sftp.c userauth.c transport.c \ - version.c knownhost.c agent.c $(CRYPTO_CSOURCES) pem.c keepalive.c global.c + version.c knownhost.c agent.c $(CRYPTO_CSOURCES) pem.c keepalive.c global.c \ + blowfish.c bcrypt_pbkdf.c agent_win.c HHEADERS = libssh2_priv.h $(CRYPTO_HHEADERS) transport.h channel.h comp.h \ - mac.h misc.h packet.h userauth.h session.h sftp.h crypto.h + mac.h misc.h packet.h userauth.h session.h sftp.h crypto.h blf.h agent.h diff --git a/vendor/libssh2/Makefile.libgcrypt.inc b/vendor/libssh2/Makefile.libgcrypt.inc index 5d56292ce8..0a3aae9aad 100644 --- a/vendor/libssh2/Makefile.libgcrypt.inc +++ b/vendor/libssh2/Makefile.libgcrypt.inc @@ -1,2 +1,3 @@ CRYPTO_CSOURCES = libgcrypt.c CRYPTO_HHEADERS = libgcrypt.h +CRYPTO_LTLIBS = $(LTLIBGCRYPT) diff --git a/vendor/libssh2/Makefile.mbedTLS.inc b/vendor/libssh2/Makefile.mbedTLS.inc new file mode 100644 index 0000000000..b9f19fce1a --- /dev/null +++ b/vendor/libssh2/Makefile.mbedTLS.inc @@ -0,0 +1,3 @@ +CRYPTO_CSOURCES = mbedtls.c +CRYPTO_HHEADERS = mbedtls.h +CRYPTO_LTLIBS = $(LTLIBMBEDCRYPTO) diff --git a/vendor/libssh2/NEWS b/vendor/libssh2/NEWS index 52ba0d4abe..7e22b3dd85 100644 --- a/vendor/libssh2/NEWS +++ b/vendor/libssh2/NEWS @@ -1,5430 +1,6831 @@ Changelog for the libssh2 project. Generated with git2news.pl -Version 1.7.0 (23 Feb 2016) +Daniel Stenberg (29 Aug 2021) +- [Will Cosgrove brought this change] -Daniel Stenberg (23 Feb 2016) -- web: the site is now HTTPS + updated docs for 1.10.0 release -- RELEASE-NOTES: 1.7.0 release +Marc Hörsken (30 May 2021) +- [Laurent Stacul brought this change] -- diffie_hellman_sha256: convert bytes to bits + [tests] Try several times to connect the ssh server - As otherwise we get far too small numbers. + Sometimes, as the OCI container is run in detached mode, it is possible + the actual server is not ready yet to handle SSH traffic. The goal of + this PR is to try several times (max 3). The mechanism is the same as + for the connection to the docker machine. + +- [Laurent Stacul brought this change] + + Remove openssh_server container on test exit + +- [Laurent Stacul brought this change] + + Allow the tests to run inside a container - Reported-by: Andreas Schneider + The current tests suite starts SSH server as OCI container. This commit + add the possibility to run the tests in a container provided that: - CVE-2016-0787 + * the docker client is installed builder container + * the host docker daemon unix socket has been mounted in the builder + container (with, if needed, the DOCKER_HOST environment variable + accordingly set, and the permission to write on this socket) + * the builder container is run on the default bridge network, or the + host network. This PR does not handle the case where the builder + container is on another network. -Alexander Lamaison (18 Feb 2016) -- Allow CI failures with VS 2008 x64. +Marc Hoersken (28 May 2021) +- CI/appveyor: run SSH server for tests on GitHub Actions (#607) - Appveyor doesn't support this combination. + No longer rely on DigitalOcean to host the Docker container. + + Unfortunately we require a small dispatcher script that has + access to a GitHub access token with scope repo in order to + trigger the daemon workflow on GitHub Actions also for PRs. + + This script is hosted by myself for the time being until GitHub + provides a tighter scope to trigger the workflow_dispatch event. -Daniel Stenberg (16 Feb 2016) -- [Viktor Szakats brought this change] +GitHub (26 May 2021) +- [Will Cosgrove brought this change] - GNUmakefile: list system libs after user libs + openssl.c: guards around calling FIPS_mode() #596 (#603) - Otherwise some referenced WinSock functions will fail to - resolve when linking against LibreSSL 2.3.x static libraries - with mingw. + Notes: + FIPS_mode() is not implemented in LibreSSL and this API is removed in OpenSSL 3.0 and was introduced in 0.9.7. Added guards around making this call. - Closes #80 + Credit: + Will Cosgrove -- [Viktor Szakats brought this change] +- [Will Cosgrove brought this change] - openssl: apply new HAVE_OPAQUE_STRUCTS macro + configure.ac: don't undefine scoped variable (#594) - Closes #81 - -- [Viktor Szakats brought this change] + * configure.ac: don't undefine scoped variable + + To get this script to run with Autoconf 2.71 on macOS I had to remove the undefine of the backend for loop variable. It seems scoped to the for loop and also isn't referenced later in the script so it seems OK to remove it. + + * configure.ac: remove cygwin specific CFLAGS #598 + + Notes: + Remove cygwin specific Win32 CFLAGS and treat the build like a posix build + + Credit: + Will Cosgrove, Brian Inglis - openssl: fix LibreSSL support after OpenSSL 1.1.0-pre1/2 support +- [Laurent Stacul brought this change] -Alexander Lamaison (14 Feb 2016) -- sftp.h: Fix non-C90 type. + tests: Makefile.am: Add missing tests client keys in distribution tarball (#604) - uint64_t does not exist in C90. Use libssh2_uint64_t instead. - -- Exclude sshd tests from AppVeyor. + Notes: + Added missing test keys. - They fail complaining that sshd wasn't invoked with an absolute path. + Credit: + Laurent Stacul -- Test on more versions of Visual Studio. +- [Laurent Stacul brought this change] -- Fix Appveyor builds. + Makefile.am: Add missing test keys in the distribution tarball (#601) + + Notes: + Fix tests missing key to build the OCI image + + Credit: + Laurent Stacul -Daniel Stenberg (14 Feb 2016) -- [Viktor Szakats brought this change] +Daniel Stenberg (16 May 2021) +- dist: add src/agent.h + + Fixes #597 + Closes #599 - openssl: add OpenSSL 1.1.0-pre3-dev compatibility +GitHub (12 May 2021) +- [Will Cosgrove brought this change] + + packet.c: Reset read timeout after received a packet (#576) (#586) - by using API instead of accessing an internal structure. + File: + packet.c - Closes #83 + Notes: + Attempt keyboard interactive login (Azure AD 2FA login) and use more than 60 seconds to complete the login, the connection fails. + + The _libssh2_packet_require function does almost the same as _libssh2_packet_requirev but this function sets state->start = 0 before returning. + + Credit: + teottin, Co-authored-by: Tor Erik Ottinsen -- RELEASE-NOTES: synced with 996b04ececdf +- [kkoenig brought this change] -- include/libssh2.h: next version is 1.7.0 + Support ECDSA certificate authentication (#570) + + Files: hostkey.c, userauth.c, test_public_key_auth_succeeds_with_correct_ecdsa_key.c + + Notes: + Support ECDSA certificate authentication + + Add a test for: + - Existing ecdsa basic public key authentication + - ecdsa public key authentication with a signed public key + + Credit: + kkoenig -- configure: build "silent" if possible +- [Gabriel Smith brought this change] -- sftp: re-indented some minor stuff + agent.c: Add support for Windows OpenSSH agent (#517) + + Files: agent.c, agent.h, agent_win.c + + Notes: + * agent: Add support for Windows OpenSSH agent + + The implementation was partially taken and modified from that found in + the Portable OpenSSH port to Win32 by the PowerShell team, but mostly + based on the existing Unix OpenSSH agent support. + + https://github.com/PowerShell/openssh-portable + + Regarding the partial transfer support implementation: partial transfers + are easy to deal with, but you need to track additional state when + non-blocking IO enters the picture. A tracker of how many bytes have + been transfered has been placed in the transfer context struct as that's + where it makes most sense. This tracker isn't placed behind a WIN32 + #ifdef as it will probably be useful for other agent implementations. + + * agent: win32 openssh: Disable overlapped IO + + Non-blocking IO is not currently supported by the surrounding agent + code, despite a lot of the code having everything set up to handle it. + + Credit: + Co-authored-by: Gabriel Smith -- [Jakob Egger brought this change] +- [Zenju brought this change] - sftp.c: ensure minimum read packet size + Fix detailed _libssh2_error being overwritten (#473) - For optimum performance we need to ensure we don't request tiny packets. + Files: openssl.c, pem.c, userauth.c + + Notes: + * Fix detailed _libssh2_error being overwritten by generic errors + * Unified error handling + + Credit: + Zenju -- [Jakob Egger brought this change] +- [Paul Capron brought this change] - sftp.c: Explicit return values & sanity checks + Fix _libssh2_random() silently discarding errors (#520) + + Notes: + * Make _libssh2_random return code consistent + + Previously, _libssh2_random was advertized in HACKING.CRYPTO as + returning `void` (and was implemented that way in os400qc3.c), but that + was in other crypto backends a lie; _libssh2_random is (a macro + expanding) to an int-value expression or function. + + Moreover, that returned code was: + — 0 or success, -1 on error for the MbedTLS & WinCNG crypto backends + But also: + — 1 on success, -1 or 0 on error for the OpenSSL backend! + – 1 on success, error cannot happen for libgcrypt! + + This commit makes explicit that _libssh2_random can fail (because most of + the underlying crypto functions can indeed fail!), and it makes its result + code consistent: 0 on success, -1 on error. + + This is related to issue #519 https://github.com/libssh2/libssh2/issues/519 + It fixes the first half of it. + + * Don't silent errors of _libssh2_random + + Make sure to check the returned code of _libssh2_random(), and + propagates any failure. + + A new LIBSSH_ERROR_RANDGEN constant is added to libssh2.h + None of the existing error constants seemed fit. + + This commit is related to d74285b68450c0e9ea6d5f8070450837fb1e74a7 + and to https://github.com/libssh2/libssh2/issues/519 (see the issue + for more info.) It closes #519. + + Credit: + Paul Capron -- [Jakob Egger brought this change] +- [Gabriel Smith brought this change] - sftp.c: Check Read Packet File Offset + ci: Remove caching of docker image layers (#589) - This commit adds a simple check to see if the offset of the read - request matches the expected file offset. + Notes: + continued ci reliability work. - We could try to recover, from this condition at some point in the future. - Right now it is better to return an error instead of corrupted data. + Credit: + Gabriel Smith -- [Jakob Egger brought this change] +- [Gabriel Smith brought this change] - sftp.c: Don't return EAGAIN if data was written to buffer + ci: Speed up docker builds for tests (#587) + + Notes: + The OpenSSH server docker image used for tests is pre-built to prevent + wasting time building it during a test, and unneeded rebuilds are + prevented by caching the image layers. + + Credit: + Gabriel Smith -- [Jakob Egger brought this change] +- [Will Cosgrove brought this change] - sftp.c: Send at least one read request before reading + userauth.c: don't error if using keys without RSA (#555) - This commit ensures that we have sent at least one read request before - we try to read data in sftp_read(). + file: userauth.c - Otherwise sftp_read() would return 0 bytes (indicating EOF) if the - socket is not ready for writing. + notes: libssh2 now supports many other key types besides RSA, if the library is built without RSA support and a user attempts RSA auth it shouldn't be an automatic error + + credit: + Will Cosgrove -- [Jakob Egger brought this change] +- [Marc brought this change] - sftp.c: stop reading when buffer is full + openssl.c: Avoid OpenSSL latent error in FIPS mode (#528) - Since we can only store data from a single chunk in filep, - we have to stop receiving data as soon as the buffer is full. + File: + openssl.c - This adresses the following bug report: - https://github.com/libssh2/libssh2/issues/50 + Notes: + Avoid initing MD5 digest, which is not permitted in OpenSSL FIPS certified cryptography mode. + + Credit: + Marc -Salvador Fandiño (21 Jan 2016) -- agent_disconnect_unix: unset the agent fd after closing it +- [Laurent Stacul brought this change] + + openssl.c: Fix EVP_Cipher interface change in openssl 3 #463 - "agent_disconnect_unix", called by "libssh2_agent_disconnect", was - leaving the file descriptor in the agent structure unchanged. Later, - "libssh2_agent_free" would call again "libssh2_agent_disconnect" under - the hood and it would try to close again the same file descriptor. In - most cases that resulted in just a harmless error, but it is also - possible that the file descriptor had been reused between the two - calls resulting in the closing of an unrelated file descriptor. + File: + openssl.c - This patch sets agent->fd to LIBSSH2_INVALID_SOCKET avoiding that - issue. + Notes: + Fixes building with OpenSSL 3, #463. - Signed-off-by: Salvador Fandiño + The change is described there: + https://github.com/openssl/openssl/commit/f7397f0d58ce7ddf4c5366cd1846f16b341fbe43 + + Credit: + Laurent Stacul, reported by Sergei -Daniel Stenberg (18 Jan 2016) -- [Patrick Monnerat brought this change] +- [Gabriel Smith brought this change] - os400qc3: support encrypted private keys + openssh_fixture.c: Fix potential overwrite of buffer when reading stdout of command (#580) - PKCS#8 EncryptedPrivateKeyinfo structures are recognized and decoded to get - values accepted by the Qc3 crypto library. + File: + openssh_fixture.c + Notes: + If reading the full output from the executed command took multiple + passes (such as when reading multiple lines) the old code would read + into the buffer starting at the some position (the start) every time. + The old code only works if fgets updated p or had an offset parameter, + both of which are not true. + + Credit: + Gabriel Smith -- [Patrick Monnerat brought this change] +- [Gabriel Smith brought this change] - os400qc3: New PKCS#5 decoder + ci: explicitly state the default branch (#585) - The Qc3 library is not able to handle PKCS#8 EncryptedPrivateKeyInfo structures - by itself. It is only capable of decrypting the (encrypted) PrivateKeyInfo - part, providing a key encryption key and an encryption algorithm are given. - Since the encryption key and algorithm description part in a PKCS#8 - EncryptedPrivateKeyInfo is a PKCS#5 structure, such a decoder is needed to - get the derived key method and hash, as well as encryption algorith and - initialisation vector. + Notes: + It looks like the $default-branch macro only works in templates, not + workflows. This is not explicitly stated anywhere except the linked PR + comment. + + https://github.com/actions/starter-workflows/pull/590#issuecomment-672360634 + + credit: + Gabriel Smith -- [Patrick Monnerat brought this change] +- [Gabriel Smith brought this change] - os400qc3: force continuous update on non-final hash/hmac computation + ci: Swap from Travis to Github Actions (#581) + + Files: ci files + + Notes: + Move Linux CI using Github Actions + + Credit: + Gabriel Smith, Marc Hörsken -- [Patrick Monnerat brought this change] +- [Mary brought this change] - os400qc3: Be sure hmac keys have a minimum length + libssh2_priv.h: add iovec on 3ds (#575) - The Qc3 library requires a minimum key length depending on the target - hash algorithm. Append binary zeroes to the given key if not long enough. - This matches RFC 2104 specifications. + file: libssh2_priv.h + note: include iovec for 3DS + credit: Mary Mstrodl -- [Patrick Monnerat brought this change] +- [Laurent Stacul brought this change] - os400qc3: Slave descriptor for key encryption key + Tests: Fix unused variables warning (#561) - The Qc3 library requires the key encryption key to exist as long as - the encrypted key is used. Its descriptor token is then kept as an - "encrypted key slave" for recursive release. + file: test_public_key_auth_succeeds_with_correct_ed25519_key_from_mem.c + + notes: fixed unused vars + + credit: + Laurent Stacul -- [Patrick Monnerat brought this change] +- [Viktor Szakats brought this change] - os400qc3.c: comment PEM/DER decoding + bcrypt_pbkdf.c: fix clang10 false positive warning (#563) + + File: bcrypt_pbkdf.c + + Notes: + blf_enc() takes a number of 64-bit blocks to encrypt, but using + sizeof(uint64_t) in the calculation triggers a warning with + clang 10 because the actual data type is uint32_t. Pass + BCRYPT_BLOCKS / 2 for the number of blocks like libc bcrypt(3) + does. + + Ref: https://github.com/openbsd/src/commit/04a2240bd8f465bcae6b595d912af3e2965856de + + Fixes #562 + + Credit: + Viktor Szakats -- [Patrick Monnerat brought this change] +- [Will Cosgrove brought this change] - os400qc3.c: improve ASN.1 header byte checks + transport.c: release payload on error (#554) + + file: transport.c + notes: If the payload is invalid and there is an early return, we could leak the payload + credit: + Will Cosgrove -- [Patrick Monnerat brought this change] +- [Will Cosgrove brought this change] - os400qc3.c: improve OID matching + ssh2_client_fuzzer.cc: fixed building + + The GitHub web editor did some funky things -- [Patrick Monnerat brought this change] +- [Will Cosgrove brought this change] - os400: os400qc3.c: replace malloc by LIBSSH2_ALLOC or alloca where possible + ssh_client_fuzzer.cc: set blocking mode on (#553) + + file: ssh_client_fuzzer.cc + + notes: the session needs blocking mode turned on to avoid EAGAIN being returned from libssh2_session_handshake() + + credit: + Will Cosgrove, reviewed by Michael Buckley -- [Patrick Monnerat brought this change] +- [Etienne Samson brought this change] - os400: asn1_new_from_bytes(): use data from a single element only + Add a LINT option to CMake (#372) + + * ci: make style-checking available locally + + * cmake: add a linting target + + * tests: check test suite syntax with checksrc.pl -- [Patrick Monnerat brought this change] +- [Will Cosgrove brought this change] - os400: fix an ILE/RPG prototype + kex.c: kex_agree_instr() improve string reading (#552) + + * kex.c: kex_agree_instr() improve string reading + + file: kex.c + notes: if haystack isn't null terminated we should use memchr() not strchar(). We should also make sure we don't walk off the end of the buffer. + credit: + Will Cosgrove, reviewed by Michael Buckley -- [Patrick Monnerat brought this change] +- [Will Cosgrove brought this change] - os400: implement character encoding conversion support + kex.c: use string_buf in ecdh_sha2_nistp (#551) + + * kex.c: use string_buf in ecdh_sha2_nistp + + file: kex.c + + notes: + use string_buf in ecdh_sha2_nistp() to avoid attempting to parse malformed data -- [Patrick Monnerat brought this change] +- [Will Cosgrove brought this change] - os400: do not miss some external prototypes + kex.c: move EC macro outside of if check #549 (#550) - Build procedure extproto() did not strip braces from header files, thus - possibly prepended them to true prototypes. This prevented the prototype to - be recognized as such. - The solution implemented here is to map braces to semicolons, effectively - considering them as potential prototype delimiters. + File: kex.c + + Notes: + Moved the macro LIBSSH2_KEX_METHOD_EC_SHA_HASH_CREATE_VERIFY outside of the LIBSSH2_ECDSA since it's also now used by the ED25519 code. + + Sha 256, 384 and 512 need to be defined for all backends now even if they aren't used directly. I believe this is already the case, but just a heads up. + + Credit: + Stefan-Ghinea -- [Patrick Monnerat brought this change] +- [Tim Gates brought this change] - os400: Really add specific README + kex.c: fix simple typo, niumber -> number (#545) + + File: kex.c + + Notes: + There is a small typo in src/kex.c. + + Should read `number` rather than `niumber`. + + Credit: + Tim Gates -- [Patrick Monnerat brought this change] +- [Tseng Jun brought this change] - os400: Add specific README and include new files in dist tarball + session.c: Correct a typo which may lead to stack overflow (#533) + + File: session.c + + Notes: + Seems the author intend to terminate banner_dup buffer, later, print it to the debug console. + + Author: + Tseng Jun -- [Patrick Monnerat brought this change] +Marc Hoersken (10 Oct 2020) +- wincng: fix random big number generation to match openssl + + The old function would set the least significant bits in + the most significant byte instead of the most significant bits. + + The old function would also zero pad too much bits in the + most significant byte. This lead to a reduction of key space + in the most significant byte according to the following listing: + - 8 bits reduced to 0 bits => eg. 2048 bits to 2040 bits DH key + - 7 bits reduced to 1 bits => eg. 2047 bits to 2041 bits DH key + - 6 bits reduced to 2 bits => eg. 2046 bits to 2042 bits DH key + - 5 bits reduced to 3 bits => eg. 2045 bits to 2043 bits DH key + + No change would occur for the case of 4 significant bits. + For 1 to 3 significant bits in the most significant byte + the DH key would actually be expanded instead of reduced: + - 3 bits expanded to 5 bits => eg. 2043 bits to 2045 bits DH key + - 2 bits expanded to 6 bits => eg. 2042 bits to 2046 bits DH key + - 1 bits expanded to 7 bits => eg. 2041 bits to 2047 bits DH key + + There is no case of 0 significant bits in the most significant byte + since this would be a case of 8 significant bits in the next byte. + + At the moment only the following case applies due to a fixed + DH key size value currently being used in libssh2: + + The DH group_order is fixed to 256 (bytes) which leads to a + 2047 bits DH key size by calculating (256 * 8) - 1. + + This means the DH keyspace was previously reduced from 2047 bits + to 2041 bits (while the top and bottom bits are always set), so the + keyspace is actually always reduced from 2045 bits to 2039 bits. + + All of this is only relevant for Windows versions supporting the + WinCNG backend (Vista or newer) before Windows 10 version 1903. + + Closes #521 - os400: add compilation scripts +Daniel Stenberg (28 Sep 2020) +- libssh2_session_callback_set.3: explain the recv/send callbacks + + Describe how to actually use these callbacks. + + Closes #518 -- [Patrick Monnerat brought this change] +GitHub (23 Sep 2020) +- [Will Cosgrove brought this change] - os400: include files for ILE/RPG + agent.c: formatting - In addition, file os400/macros.h declares all procedures originally - defined as macros. It must not be used for real inclusion and is only - intended to be used as a `database' for macro wrapping procedures generation. + Improved formatting of RECV_SEND_ALL macro. -- [Patrick Monnerat brought this change] +- [Will Cosgrove brought this change] - os400: add supplementary header files/wrappers. Define configuration. + CMakeLists.txt: respect install lib dir #405 (#515) + + Files: + CMakeLists.txt + + Notes: + Use CMAKE_INSTALL_LIBDIR directory + + Credit: Arfrever -- [Patrick Monnerat brought this change] +- [Will Cosgrove brought this change] - Protect callback function calls from macro substitution + kex.c: group16-sha512 and group18-sha512 support #457 (#468) - Some structure fields holding callback addresses have the same name as the - underlying system function (connect, send, recv). Set parentheses around - their reference to suppress a possible macro substitution. + Files: kex.c - Use a macro for connect() on OS/400 to resolve a const/nonconst parameter - problem. + Notes: + Added key exchange group16-sha512 and group18-sha512. As a result did the following: + + Abstracted diffie_hellman_sha256() to diffie_hellman_sha_algo() which is now algorithm agnostic and takes the algorithm as a parameter since we needed sha512 support. Unfortunately it required some helper functions but they are simple. + Deleted diffie_hellman_sha1() + Deleted diffie_hellman_sha1 specific macro + Cleaned up some formatting + Defined sha384 in os400 and wincng backends + Defined LIBSSH2_DH_MAX_MODULUS_BITS to abort the connection if we receive too large of p from the server doing sha1 key exchange. + Reorder the default key exchange list to match OpenSSH and improve security + + Credit: + Will Cosgrove -- [Patrick Monnerat brought this change] +- [Igor Klevanets brought this change] - Add interface for OS/400 crypto library QC3 + agent.c: Recv and send all bytes via network in agent_transact_unix() (#510) + + Files: agent.c + + Notes: + Handle sending/receiving partial packet replies in agent.c API. + + Credit: Klevanets Igor -- [Patrick Monnerat brought this change] +- [Daniel Stenberg brought this change] - misc: include stdarg.h for debug code + Makefile.am: include all test files in the dist #379 + + File: + Makefile.am + + Notes: + No longer conditionally include OpenSSL specific test files, they aren't run if we're not building against OpenSSL 1.1.x anyway. + + Credit: + Daniel Stenberg -- [Patrick Monnerat brought this change] +- [Max Dymond brought this change] - Document crypto library interface + Add support for an OSS Fuzzer fuzzing target (#392) + + Files: + .travis.yml, configure.ac, ossfuzz + + Notes: + This adds support for an OSS-Fuzz fuzzing target in ssh2_client_fuzzer, + which is a cut down example of ssh2.c. Future enhancements can improve + coverage. + + Credit: + Max Dymond -- [Patrick Monnerat brought this change] +- [Sebastián Katzer brought this change] - Feature an optional crypto-specific macro to rsa sign a data fragment vector + mbedtls.c: ECDSA support for mbed TLS (#385) - OS/400 crypto library is unable to sign a precomputed SHA1 hash: however - it does support a procedure that hashes data fragments and rsa signs. - If defined, the new macro _libssh2_rsa_sha1_signv() implements this function - and disables use of _libssh2_rsa_sha1_sign(). + Files: + mbedtls.c, mbedtls.h, .travis.yml - The function described above requires that the struct iovec unused slacks are - cleared: for this reason, macro libssh2_prepare_iovec() has been introduced. - It should be defined as empty for crypto backends that are not sensitive - to struct iovec unused slack values. + Notes: + This PR adds support for ECDSA for both key exchange and host key algorithms. + + The following elliptic curves are supported: + + 256-bit curve defined by FIPS 186-4 and SEC1 + 384-bit curve defined by FIPS 186-4 and SEC1 + 521-bit curve defined by FIPS 186-4 and SEC1 + + Credit: + Sebastián Katzer -- [Patrick Monnerat brought this change] +Marc Hoersken (1 Sep 2020) +- buildconf: exec autoreconf to avoid additional process (#512) + + Also make buildconf exit with the return code of autoreconf. + + Follow up to #224 - Fold long lines in include files +- scp.c: fix indentation in shell_quotearg documentation -- [Viktor Szakats brought this change] +- wincng: make more use of new helper functions (#496) - kex.c: fix indentation +- wincng: make sure algorithm providers are closed once (#496) + +GitHub (10 Jul 2020) +- [David Benjamin brought this change] + + openssl.c: clean up curve25519 code (#499) - Closes #71 + File: openssl.c, openssl.h, crypto.h, kex.c + + Notes: + This cleans up a few things in the curve25519 implementation: + + - There is no need to create X509_PUBKEYs or PKCS8_PRIV_KEY_INFOs to + extract key material. EVP_PKEY_get_raw_private_key and + EVP_PKEY_get_raw_public_key work fine. + + - libssh2_x25519_ctx was never used (and occasionally mis-typedefed to + libssh2_ed25519_ctx). Remove it. The _libssh2_curve25519_new and + _libssh2_curve25519_gen_k interfaces use the bytes. Note, if it needs + to be added back, there is no need to roundtrip through + EVP_PKEY_new_raw_private_key. EVP_PKEY_keygen already generated an + EVP_PKEY. + + - Add some missing error checks. + + Credit: + David Benjamin -- [Viktor Szakats brought this change] +- [Will Cosgrove brought this change] - add OpenSSL-1.1.0-pre2 compatibility + transport.c: socket is disconnected, return error (#500) - Closes #70 + File: transport.c + + Notes: + This is to fix #102, instead of continuing to attempt to read a disconnected socket, it will now error out. + + Credit: + TDi-jonesds -- [Viktor Szakats brought this change] +- [Will Cosgrove brought this change] - add OpenSSL 1.1.0-pre1 compatibility + stale.yml - * close https://github.com/libssh2/libssh2/issues/69 - * sync a declaration with the rest of similar ones - * handle EVP_MD_CTX_new() returning NULL with OpenSSL 1.1.0 - * fix potential memory leak with OpenSSL 1.1.0 in - _libssh2_*_init() functions, when EVP_MD_CTX_new() succeeds, - but EVP_DigestInit() fails. + Increasing stale values. -Marc Hoersken (22 Dec 2015) -- wincng.c: fixed _libssh2_wincng_hash_final return value +Marc Hoersken (6 Jul 2020) +- wincng: try newer DH API first, fallback to legacy RSA API - _libssh2_wincng_hash_final was returning the internal BCRYPT - status code instead of a valid libssh2 return value (0 or -1). + Avoid the use of RtlGetVersion or similar Win32 functions, + since these depend on version information from manifests. - This also means that _libssh2_wincng_hash never returned 0. - -- wincng.c: fixed possible memory leak in _libssh2_wincng_hash + This commit makes the WinCNG backend first try to use the + new DH algorithm API with the raw secret derivation feature. + In case this feature is not available the WinCNG backend + will fallback to the classic approach of using RSA-encrypt + to perform the required modular exponentiation of BigNums. - If _libssh2_wincng_hash_update failed _libssh2_wincng_hash_final - would never have been called before. + The feature availability test is done during the first handshake + and the result is stored in the crypto backends global state. - Reported by Zenju. + Follow up to #397 + Closes #484 -Kamil Dudka (15 Dec 2015) -- [Paul Howarth brought this change] +- wincng: fix indentation of function arguments and comments + + Follow up to #397 - libssh2.pc.in: fix the output of pkg-config --libs +- [Wez Furlong brought this change] + + wincng: use newer DH API for Windows 8.1+ - ... such that it does not include LDFLAGS used to build libssh2 itself. - There was a similar fix in the curl project long time ago: + Since Windows 1903 the approach used to perform DH kex with the CNG + API has been failing. - https://github.com/bagder/curl/commit/curl-7_19_7-56-g4c8adc8 + This commit switches to using the `DH` algorithm provider to perform + generation of the key pair and derivation of the shared secret. - Bug: https://bugzilla.redhat.com/1279966 - Signed-off-by: Kamil Dudka - -Marc Hoersken (6 Dec 2015) -- hostkey.c: align code path of ssh_rsa_init to ssh_dss_init - -- hostkey.c: fix invalid memory access if libssh2_dsa_new fails + It uses a feature of CNG that is not yet documented. The sources of + information that I've found on this are: - Reported by dimmaq, fixes #66 + * https://stackoverflow.com/a/56378698/149111 + * https://github.com/wbenny/mini-tor/blob/5d39011e632be8e2b6b1819ee7295e8bd9b7a769/mini/crypto/cng/dh.inl#L355 + + With this change I am able to successfully connect from Windows 10 to my + ubuntu system. + + Refs: https://github.com/alexcrichton/ssh2-rs/issues/122 + Fixes: https://github.com/libssh2/libssh2/issues/388 + Closes: https://github.com/libssh2/libssh2/pull/397 -Daniel Stenberg (3 Nov 2015) -- [Will Cosgrove brought this change] +GitHub (1 Jul 2020) +- [Zenju brought this change] - gcrypt: define libssh2_sha256_ctx + comp.c: Fix name clash with ZLIB macro "compress" (#418) - Looks like it didn't make it into the latest commit for whatever reason. + File: comp.c - Closes #58 + Notes: + * Fix name clash with ZLIB macro "compress". + + Credit: + Zenju -- [Salvador Fandino brought this change] +- [yann-morin-1998 brought this change] - libssh2_session_set_last_error: Add function + buildsystem: drop custom buildconf script, rely on autoreconf (#224) - Net::SSH2, the Perl wrapping module for libssh2 implements several features* - on top of libssh2 that can fail and so need some mechanism to report the error - condition to the user. + Notes: + The buildconf script is currently required, because we need to copy a + header around, because it is used both from the library and the examples + sources. - Until now, besides the error state maintained internally by libssh2, another - error state was maintained at the Perl level for every session object and then - additional logic was used to merge both error states. That is a maintenance - nighmare, and actually there is no way to do it correctly and consistently. + However, having a custom 'buildconf'-like script is not needed if we can + ensure that the header exists by the time it is needed. For that, we can + just append the src/ directory to the headers search path for the + examples. - In order to allow the high level language to add new features to the library - but still rely in its error reporting features the new function - libssh2_session_set_last_error (that just exposses _libssh2_error_flags) is - introduced. + And then it means we no longer need to generate the same header twice, + so we remove the second one from configure.ac. - *) For instance, connecting to a remote SSH service giving the hostname and - port. + Now, we can just call "autoreconf -fi" to generate the autotools files, + instead of relying on the canned sequence in "buildconf", since + autoreconf has now long known what to do at the correct moment (future + versions of autotools, automake, autopoint, autoheader etc... may + require an other ordering, or other intermediate steps, etc...). - Signed-off-by: Salvador Fandino - Signed-off-by: Salvador Fandiño + Eventually, get rid of buildconf now it is no longer needed. In fact, we + really keep it for legacy, but have it just call autoreconf (and print a + nice user-friendly warning). Don't include it in the release tarballs, + though. + + Update doc, gitignore, and travis-CI jobs accordingly. + + Credit: + Signed-off-by: "Yann E. MORIN" + Cc: Sam Voss -- [Salvador Fandino brought this change] +- [Will Cosgrove brought this change] - _libssh2_error: Support allocating the error message - - Before this patch "_libssh2_error" required the error message to be a - static string. + libssh2.h: Update Diffie Hellman group values (#493) - This patch adds a new function "_libssh2_error_flags" accepting an - additional "flags" argument and specifically the flag - "LIBSSH2_ERR_FLAG_DUP" indicating that the passed string must be - duplicated into the heap. + File: libssh2.h - Then, the method "_libssh2_error" has been rewritten to use that new - function under the hood. + Notes: + Update the min, preferred and max DH group values based on RFC 8270. - Signed-off-by: Salvador Fandino - Signed-off-by: Salvador Fandiño + Credit: + Will Cosgrove, noted from email list by Mitchell Holland -- [Will Cosgrove brought this change] +Marc Hoersken (22 Jun 2020) +- travis: use existing Makefile target to run checksrc - added engine.h include to fix warning +- Makefile: also run checksrc on test source files -- [sune brought this change] +- tests: avoid use of deprecated function _sleep (#490) - kex.c: removed dupe entry from libssh2_kex_methods[] - - Closes #51 +- tests: avoid use of banned function strncat (#489) -- [Salvador Fandiño brought this change] +- tests: satisfy checksrc regarding max line length of 79 chars + + Follow up to 2764bc8e06d51876b6796d6080c6ac51e20f3332 - userauth: Fix off by one error when reading public key file +- tests: satisfy checksrc with whitespace only fixes - After reading the public key from file the size was incorrectly - decremented by one. + checksrc.pl -i4 -m79 -ASIZEOFNOPAREN -ASNPRINTF + -ACOPYRIGHT -AFOPENMODE tests/*.[ch] + +- tests: add support for ports published via Docker for Windows + +- tests: restore retry behaviour for docker-machine ip command + +- tests: fix mix of declarations and code failing C89 compliance + +- wincng: add and improve checks in bit counting function + +- wincng: align bits to bytes calculation in all functions + +- wincng: do not disable key validation that can be enabled - This was usually a harmless error as the last character on the public - key file is an unimportant EOL. But if due to some error the public key - file is empty, the public key size becomes (uint)(0 - 1), resulting in - an unrecoverable out of memory error later. + The modular exponentiation also works with key validation enabled. + +- wincng: fix return value in _libssh2_dh_secret - Signed-off-by: Salvador Fandi??o + Do not ignore return value of modular exponentiation. -- [Salvador Fandino brought this change] +- appveyor: build and run tests for WinCNG crypto backend - channel: Detect bad usage of libssh2_channel_process_startup +GitHub (1 Jun 2020) +- [suryakalpo brought this change] + + INSTALL_CMAKE.md: Update formatting (#481) - A common novice programmer error (at least among those using the - wrapping Perl module Net::SSH2), is to try to reuse channels. + File: INSTALL_CMAKE.md - This patchs detects that incorrect usage and fails with a - LIBSSH2_ERROR_BAD_USE error instead of hanging. + Notes: + Although the original text would be immediately clear to seasoned users of CMAKE and/or Unix shell, the lack of newlines may cause some confusion for newcomers. Hence, wrapping the texts in a md code-block such that the newlines appear as intended. - Signed-off-by: Salvador Fandino + credit: + suryakalpo +Marc Hoersken (31 May 2020) +- src: add new and align include guards in header files (#480) + + Make sure all include guards exist and follow the same format. + +- wincng: fix multiple definition of `_libssh2_wincng' (#479) + + Add missing include guard and move global state + from header to source file by using extern. + +GitHub (28 May 2020) - [Will Cosgrove brought this change] - kex: Added diffie-hellman-group-exchange-sha256 support + transport.c: moving total_num check from #476 (#478) - ... and fixed HMAC_Init depricated usage + file: transport.c - Closes #48 - -Alexander Lamaison (21 Sep 2015) -- Prefixed new #defines to prevent collisions. + notes: + moving total_num zero length check from #476 up to the prior bounds check which already includes a total_num check. Makes it slightly more readable. - Other libraries might have their own USE_WIN32_*FILES. + credit: + Will Cosgrove -- [keith-daigle brought this change] +- [lutianxiong brought this change] - Update examples/scp.c to fix bug where large files on win32 would cause got to wrap and go negative + transport.c: fix use-of-uninitialized-value (#476) + + file:transport.c + + notes: + return error if malloc(0) + + credit: + lutianxiong -- [David Byron brought this change] +- [Dr. Koutheir Attouchi brought this change] - add libssh2_scp_recv2 to support large (> 2GB) files on windows + libssh2_sftp.h: Changed type of LIBSSH2_FX_* constants to unsigned long, fixes #474 + + File: + libssh2_sftp.h + + Notes: + Error constants `LIBSSH2_FX_*` are only returned by `libssh2_sftp_last_error()` which returns `unsigned long`. + Therefore these constants should be defined as unsigned long literals, instead of int literals. + + Credit: + Dr. Koutheir Attouchi -Daniel Stenberg (17 Sep 2015) -- [sune brought this change] +- [monnerat brought this change] - WinCNG: support for SHA256/512 HMAC + os400qc3.c: constify libssh2_os400qc3_hash_update() data parameter. (#469) - Closes #47 + Files: os400qc3.c, os400qc3.h + + Notes: + Fixes building on OS400. #426 + + Credit: + Reported-by: hjindra on github, dev by Monnerat -- [brian m. carlson brought this change] +- [monnerat brought this change] - Add support for HMAC-SHA-256 and HMAC-SHA-512. + HACKING.CRYPTO: keep up to date with new crypto definitions from code. (#466) - Implement support for these algorithms and wire them up to the libgcrypt - and OpenSSL backends. Increase the maximum MAC buffer size to 64 bytes - to prevent buffer overflows. Prefer HMAC-SHA-256 over HMAC-SHA-512, and - that over HMAC-SHA-1, as OpenSSH does. + File: HACKING.CRYPTO - Closes #40 + Notes: + This commit updates the HACKING.CRYPTO documentation file in an attempt to make it in sync with current code. + New documented features are: + + SHA384 + SHA512 + ECDSA + ED25519 + + Credit: + monnerat -- [Zenju brought this change] +- [Harry Sintonen brought this change] - kex: free server host key before allocating it (again) + kex.c: Add diffie-hellman-group14-sha256 Key Exchange Method (#464) - Fixes a memory leak when Synology server requests key exchange + File: kex.c - Closes #43 + Notes: Added diffie-hellman-group14-sha256 kex + + Credit: Harry Sintonen -- [Viktor Szakats brought this change] +- [Will Cosgrove brought this change] - GNUmakefile: up OpenSSL version + os400qc3.h: define sha512 macros (#465) - closes #23 + file: os400qc3.h + notes: fixes for building libssh2 1.9.x -- [Viktor Szakats brought this change] +- [Will Cosgrove brought this change] - GNUmakefile: add -m64 CFLAGS when targeting mingw64, add -m32/-m64 to LDFLAGS + os400qc3.h: define EC types to fix building #426 (#462) - libssh2 equivalent of curl patch https://github.com/bagder/curl/commit/d21b66835f2af781a3c2a685abc92ef9f0cd86be - - This allows to build for the non-default target when using a multi-target mingw distro. - Also bump default OpenSSL dependency path to 1.0.2c. + File: os400qc3.h + Notes: define missing EC types which prevents building + Credit: hjindra -- [Viktor Szakats brought this change] +- [Brendan Shanks brought this change] - GNUmakefile: add support for LIBSSH2_LDFLAG_EXTRAS + hostkey.c: Fix 'unsigned int'/'uint32_t' mismatch (#461) - It is similar to existing LIBSSH2_CFLAG_EXTRAS, but for - extra linker options. + File: hostkey.c - Also delete some line/file ending whitespace. + Notes: + These types are the same size so most compilers are fine with it, but CodeWarrior (on classic MacOS) throws an ‘illegal implicit conversion’ error - closes #27 + Credit: Brendan Shanks -- [nasacj brought this change] +- [Thomas Klausner brought this change] - hostkey.c: Fix compiling error when OPENSSL_NO_MD5 is defined + Makefile.am: Fix unportable test(1) operator. (#459) - Closes #32 + file: Makefile.am + + Notes: + The POSIX comparison operator for test(1) is =; bash supports == but not even test from GNU coreutils does. + + Credit: + Thomas Klausner -- [Mizunashi Mana brought this change] +- [Tseng Jun brought this change] - openssl.h: adjust the rsa/dsa includes + openssl.c: minor changes of coding style (#454) - ... to work when built without DSA support. + File: openssl.c - Closes #36 - -Alexander Lamaison (26 Jul 2015) -- Let CMake build work as a subproject. + Notes: + minor changes of coding style and align preprocessor conditional for #439 - Patch contributed by JasonHaslam. + Credit: + Tseng Jun -- Fix builds with Visual Studio 2015. - - VS2015 moved stdio functions to the header files as inline function. That means check_function_exists can't detect them because it doesn't use header files - just does a link check. Instead we need to use check_symbol_exists with the correct headers. +- [Hans Meier brought this change] -Kamil Dudka (2 Jul 2015) -- cmake: include CMake files in the release tarballs + openssl.c: Fix for use of uninitialized aes_ctr_cipher.key_len (#453) - Despite we announced the CMake support in libssh2-1.6.0 release notes, - the files required by the CMake build system were not included in the - release tarballs. Hence, the only way to use CMake for build was the - upstream git repository. + File: + Openssl.c - This commit makes CMake actually supported in the release tarballs. - -- tests/mansyntax.sh: fix 'make distcheck' with recent autotools + Notes: + * Fix for use of uninitialized aes_ctr_cipher.key_len when using HAVE_OPAQUE_STRUCTS, regression from #439 - Do not create symbolic links off the build directory. Recent autotools - verify that out-of-source build works even if the source directory tree - is not writable. + Credit: + Hans Meirer, Tseng Jun -- openssl: fix memleak in _libssh2_dsa_sha1_verify() +- [Zenju brought this change] -Daniel Stenberg (12 Jun 2015) -- openssl: make libssh2_sha1 return error code + agent.c: Fix Unicode builds on Windows (#417) - - use the internal prefix _libssh2_ for non-exported functions + File: agent.c - - removed libssh2_md5() since it wasn't used + Notes: + Fixes unicode builds for Windows in Visual Studio 16.3.2. - Reported-by: Kamil Dudka + Credit: + Zenju -- [LarsNordin-LNdata brought this change] +- [Hans Meier brought this change] - SFTP: Increase speed and datasize in SFTP read + openssl.c: Fix use-after-free crash in openssl backend without memory leak (#439) - The function sftp_read never return more then 2000 bytes (as it should - when I asked Daniel). I increased the MAX_SFTP_READ_SIZE to 30000 but - didn't get the same speed as a sftp read in SecureSSH. I analyzed the - code and found that a return always was dona when a chunk has been read. - I changed it to a sliding buffer and worked on all available chunks. I - got an increase in speed and non of the test I have done has failed - (both local net and over Internet). Please review and test. I think - 30000 is still not the optimal MAX_SFTP_READ_SIZE, my next goal is to - make an API to enable changing this value (The SecureSSH sftp_read has - more complete filled packages when comparing the network traffic) + Files: openssl.c + + Notes: + Fixes memory leaks and use after free AES EVP_CIPHER contexts when using OpenSSL 1.0.x. + + Credit: + Hans Meier -- bump: start working on 1.6.1 +- [Romain Geissler @ Amadeus brought this change] -Version 1.6.0 (5 Jun 2015) + Session.c: Fix undefined warning when mixing with LTO-enabled libcurl. (#449) + + File: Session.c + + Notes: + With gcc 9, libssh2, libcurl and LTO enabled for all binaries I see this + warning (error with -Werror): + + vssh/libssh2.c: In function ‘ssh_statemach_act’: + /data/mwrep/rgeissler/ospack/ssh2/BUILD/libssh2-libssh2-03c7c4a/src/session.c:579:9: error: ‘seconds_to_next’ is used uninitialized in this function [-Werror=uninitialized] + 579 | int seconds_to_next; + | ^ + lto1: all warnings being treated as errors + + Gcc normally issues -Wuninitialized when it is sure there is a problem, + and -Wmaybe-uninitialized when it's not sure, but it's possible. Here + the compiler seems to have find a real case where this could happen. I + looked in your code and overall it seems you always check if the return + code is non null, not often that it's below zero. I think we should do + the same here. With this patch, gcc is fine. + + Credit: + Romain-Geissler-1A -Daniel Stenberg (5 Jun 2015) -- RELEASE-NOTES: synced with 858930cae5c6a +- [Zenju brought this change] -Marc Hoersken (19 May 2015) -- wincng.c: fixed indentation + transport.c: Fix crash with delayed compression (#443) + + Files: transport.c + + Notes: + Fixes crash with delayed compression option using Bitvise server. + + Contributor: + Zenju -- [sbredahl brought this change] +- [Will Cosgrove brought this change] - wincng.c: fixed memleak in (block) cipher destructor + Update INSTALL_MAKE path to INSTALL_MAKE.md (#446) + + Included for #429 -Alexander Lamaison (6 May 2015) -- [Jakob Egger brought this change] +- [Will Cosgrove brought this change] - libssh2_channel_open: more detailed error message + Update INSTALL_CMAKE filename to INSTALL_CMAKE.md (#445) - The error message returned by libssh2_channel_open in case of a server side channel open failure is now more detailed and includes the four standard error conditions in RFC 4254. + Fixing for #429 -- [Hannes Domani brought this change] +- [Wallace Souza brought this change] - kex: fix libgcrypt memory leaks of bignum + Rename INSTALL_CMAKE to INTALL_CMAKE.md (#429) - Fixes #168. + Adding Markdown file extension in order to Github render the instructions properly -Marc Hoersken (3 Apr 2015) -- configure.ac: check for SecureZeroMemory for clear memory feature +Will Cosgrove (17 Dec 2019) +- [Daniel Stenberg brought this change] -- Revert "wincng.c: fix clear memory feature compilation with mingw" + include/libssh2.h: fix comment: the known host key uses 4 bits (#438) + +- [Zenju brought this change] + + ssh-ed25519: Support PKIX + calc pubkey from private (#416) - This reverts commit 2d2744efdd0497b72b3e1ff6e732aa4c0037fc43. + Files: openssl.c/h + Author: Zenju + Notes: + Adds support for PKIX key reading by fixing: - Autobuilds show that this did not solve the issue. - And it seems like RtlFillMemory is defined to memset, - which would be optimized out by some compilers. - -- wincng.c: fix clear memory feature compilation with mingw + _libssh2_pub_priv_keyfile() is missing the code to extract the ed25519 public key from a given private key + + _libssh2_ed25519_new_private_frommemory is only parsing the openssh key format but does not understand PKIX (as retrieved via PEM_read_bio_PrivateKey) -Alexander Lamaison (1 Apr 2015) -- [LarsNordin-LNdata brought this change] +GitHub (15 Oct 2019) +- [Will Cosgrove brought this change] - Enable use of OpenSSL that doesn't have DSA. + .travis.yml: Fix Chrome and 32 bit builds (#423) - Added #if LIBSSH2_DSA for all DSA functions. + File: .travis.yml + + Notes: + * Fix Chrome installing by using Travis build in directive + * Update to use libgcrypt20-dev package to fix 32 bit builds based on comments found here: + https://launchpad.net/ubuntu/xenial/i386/libgcrypt11-dev -- [LarsNordin-LNdata brought this change] +- [Will Cosgrove brought this change] - Use correct no-blowfish #define with OpenSSL. + packet.c: improved parsing in packet_x11_open (#410) - The OpenSSL define is OPENSSL_NO_BF, not OPENSSL_NO_BLOWFISH. + Use new API to parse data in packet_x11_open() for better bounds checking. -Marc Hoersken (25 Mar 2015) -- configure: error if explicitly enabled clear-memory is not supported - - This takes 22bd8d81d8fab956085e2079bf8c29872455ce59 and - b8289b625e291bbb785ed4add31f4759241067f3 into account, - but still makes it enabled by default if it is supported - and error out in case it is unsupported and was requested. +Will Cosgrove (12 Sep 2019) +- [Michael Buckley brought this change] -Daniel Stenberg (25 Mar 2015) -- configure: make clear-memory default but only WARN if backend unsupported + knownhost.c: Double the static buffer size when reading and writing known hosts (#409) - ... instead of previous ERROR. + Notes: + We had a user who was being repeatedly prompted to accept a server key repeatedly. It turns out the base64-encoded key was larger than the static buffers allocated to read and write known hosts. I doubled the size of these buffers. + + Credit: + Michael Buckley -Marc Hoersken (24 Mar 2015) -- wincng.h: fix warning about computed return value not being used +GitHub (4 Sep 2019) +- [Will Cosgrove brought this change] -- nonblocking examples: fix warning about unused tvdiff on Mac OS X + packet.c: improved packet parsing in packet_queue_listener (#404) + + * improved bounds checking in packet_queue_listener + + file: packet.c + + notes: + improved parsing packet in packet_queue_listener -Daniel Stenberg (24 Mar 2015) -- openssl: fix compiler warnings +- [Will Cosgrove brought this change] -- cofigure: fix --disable-clear-memory check + packet.c: improve message parsing (#402) + + * packet.c: improve parsing of packets + + file: packet.c + + notes: + Use _libssh2_get_string API in SSH_MSG_DEBUG/SSH_MSG_DISCONNECT. Additional uint32 bounds check in SSH_MSG_GLOBAL_REQUEST. -Marc Hoersken (23 Mar 2015) -- scp.c: improved command length calculation +- [Will Cosgrove brought this change] + + misc.c: _libssh2_ntohu32 cast bit shifting (#401) - Reduced number of calls to strlen, because shell_quotearg already - returns the length of the resulting string (e.q. quoted path) - which we can add to the existing and known cmd_len. - Removed obsolete call to memset again, because we can put a final - NULL-byte at the end of the string using the calculated length. + To quite overly aggressive analyzers. + + Note, the builds pass, Travis is having some issues with Docker images. -- scp.c: improved and streamlined formatting +- [Will Cosgrove brought this change] -- scp.c: fix that scp_recv may transmit not initialised memory + kex.c: improve bounds checking in kex_agree_methods() (#399) + + file: kex.c + + notes: + use _libssh2_get_string instead of kex_string_pair which does additional checks -- scp.c: fix that scp_send may transmit not initialised memory +Will Cosgrove (23 Aug 2019) +- [Fabrice Fontaine brought this change] + + acinclude.m4: add mbedtls to LIBS (#371) - Fixes ticket 244. Thanks Torsten. + Notes: + This is useful for static builds so that the Libs.private field in + libssh2.pc contains correct info for the benefit of pkg-config users. + Static link with libssh2 requires this information. + + Signed-off-by: Baruch Siach + [Retrieved from: + https://git.buildroot.net/buildroot/tree/package/libssh2/0002-acinclude.m4-add-mbedtls-to-LIBS.patch] + Signed-off-by: Fabrice Fontaine + + Credit: + Fabrice Fontaine -- kex: do not ignore failure of libssh2_sha1_init() +- [jethrogb brought this change] + + Generate debug info when building with MSVC (#178) - Based upon 43b730ce56f010e9d33573fcb020df49798c1ed8. - Fixes ticket 290. Thanks for the suggestion, mstrsn. + files: CMakeLists.txt + + notes: Generate debug info when building with MSVC + + credit: + jethrogb -- wincng.h: fix return code of libssh2_md5_init() +- [Panos brought this change] -- openssl.c: fix possible segfault in case EVP_DigestInit fails + Add agent forwarding implementation (#219) + + files: channel.c, test_agent_forward_succeeds.c, libssh2_priv.h, libssh2.h, ssh2_agent_forwarding.c + + notes: + * Adding SSH agent forwarding. + * Fix agent forwarding message, updated example. + Added integration test code and cmake target. Added example to cmake list. + + credit: + pkittenis -- wincng.c: fix possible use of uninitialized variables +GitHub (2 Aug 2019) +- [Will Cosgrove brought this change] -- wincng.c: fix unused argument warning if clear memory is not enabled + Update EditorConfig + + Added max_line_length = 80 -- wincng: Added explicit clear memory feature to WinCNG backend +- [Will Cosgrove brought this change] + + global.c : fixed call to libssh2_crypto_exit #394 (#396) + + * global.c : fixed call to libssh2_crypto_exit #394 + + File: global.c + + Notes: Don't call `libssh2_crypto_exit()` until `_libssh2_initialized` count is down to zero. + + Credit: seba30 + +Will Cosgrove (30 Jul 2019) +- [hlefebvre brought this change] + + misc.c : Add an EWOULDBLOCK check for better portability (#172) + + File: misc.c + + Notes: Added support for all OS' that implement EWOULDBLOCK, not only VMS + + Credit: hlefebvre + +- [Etienne Samson brought this change] + + userauth.c: fix off by one error when loading public keys with no id (#386) - This re-introduces the original feature proposed during - the development of the WinCNG crypto backend. It still needs - to be added to libssh2 itself and probably other backends. + File: userauth.c - Memory is cleared using the function SecureZeroMemory which is - available on Windows systems, just like the WinCNG backend. + Credit: + Etienne Samson + + Notes: + Caught by ASAN: + + ================================================================= + ==73797==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60700001bcf0 at pc 0x00010026198d bp 0x7ffeefbfed30 sp 0x7ffeefbfe4d8 + READ of size 69 at 0x60700001bcf0 thread T0 + 2019-07-04 08:35:30.292502+0200 atos[73890:2639175] examining /Users/USER/*/libssh2_clar [73797] + #0 0x10026198c in wrap_memchr (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c) + #1 0x1000f8e66 in file_read_publickey userauth.c:633 + #2 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513 + #3 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590 + #4 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69 + #5 0x1000090c3 in clar_run_test clar.c:260 + #6 0x1000038f3 in clar_run_suite clar.c:343 + #7 0x100003272 in clar_test_run clar.c:522 + #8 0x10000c3cc in main runner.c:60 + #9 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4) + + 0x60700001bcf0 is located 0 bytes to the right of 80-byte region [0x60700001bca0,0x60700001bcf0) + allocated by thread T0 here: + #0 0x10029e053 in wrap_malloc (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x5c053) + #1 0x1000b4978 in libssh2_default_alloc session.c:67 + #2 0x1000f8aba in file_read_publickey userauth.c:597 + #3 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513 + #4 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590 + #5 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69 + #6 0x1000090c3 in clar_run_test clar.c:260 + #7 0x1000038f3 in clar_run_suite clar.c:343 + #8 0x100003272 in clar_test_run clar.c:522 + #9 0x10000c3cc in main runner.c:60 + #10 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4) + + SUMMARY: AddressSanitizer: heap-buffer-overflow (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c) in wrap_memchr + Shadow bytes around the buggy address: + 0x1c0e00003740: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fd fd + 0x1c0e00003750: fd fd fd fd fd fd fd fa fa fa fa fa 00 00 00 00 + 0x1c0e00003760: 00 00 00 00 00 00 fa fa fa fa 00 00 00 00 00 00 + 0x1c0e00003770: 00 00 00 fa fa fa fa fa fd fd fd fd fd fd fd fd + 0x1c0e00003780: fd fd fa fa fa fa fd fd fd fd fd fd fd fd fd fa + =>0x1c0e00003790: fa fa fa fa 00 00 00 00 00 00 00 00 00 00[fa]fa + 0x1c0e000037a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x1c0e000037b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x1c0e000037c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x1c0e000037d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x1c0e000037e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + Shadow byte legend (one shadow byte represents 8 application bytes): + Addressable: 00 + Partially addressable: 01 02 03 04 05 06 07 + Heap left redzone: fa + Freed heap region: fd + Stack left redzone: f1 + Stack mid redzone: f2 + Stack right redzone: f3 + Stack after return: f5 + Stack use after scope: f8 + Global redzone: f9 + Global init order: f6 + Poisoned by user: f7 + Container overflow: fc + Array cookie: ac + Intra object redzone: bb + ASan internal: fe + Left alloca redzone: ca + Right alloca redzone: cb + Shadow gap: cc -- wincng.c: fixed mixed line-endings +- [Thilo Schulz brought this change] -- wincng.c: fixed use of invalid parameter types in a8d14c5dcf + openssl.c : Fix use-after-free crash on reinitialization of openssl backend + + file : openssl.c + + notes : + libssh2's openssl backend has a use-after-free condition if HAVE_OPAQUE_STRUCTS is defined and you call libssh2_init() again after prior initialisation/deinitialisation of libssh2 + + credit : Thilo Schulz + +- [axjowa brought this change] + + openssl.h : Use of ifdef where if should be used (#389) + + File : openssl.h + + Notes : + LIBSSH2_ECDSA and LIBSSH2_ED25519 are always defined so the #ifdef + checks would never be false. + + This change makes it possible to build libssh2 against OpenSSL built + without EC support. + + Change-Id: I0a2f07c2d80178314dcb7d505d1295d19cf15afd + + Credit : axjowa -- wincng.c: only try to load keys corresponding to the algorithm +- [Zenju brought this change] -- wincng.c: moved PEM headers into definitions + Agent.c : Preserve error info from agent_list_identities() (#374) + + Files : agent.c + + Notes : + Currently the error details as returned by agent_transact_pageant() are overwritten by a generic "agent list id failed" message by int agent_list_identities(LIBSSH2_AGENT* agent). + + Credit : + Zenju -- wincng.h: fixed invalid parameter name +- [Who? Me?! brought this change] -- wincng: fixed mismatch with declarations in crypto.h + Channel.c: Make sure the error code is set in _libssh2_channel_open() (#381) + + File : Channel.c + + Notes : + if _libssh2_channel_open() fails, set the error code. + + Credit : + mark-i-m -- userauth.c: fixed warning C6001: using uninitialized sig and sig_len +- [Orgad Shaneh brought this change] -- pem.c: fixed warning C6269: possible incorrect order of operations + Kex.c, Remove unneeded call to strlen (#373) + + File : Kex.c + + Notes : + Removed call to strlen + + Credit : + Orgad Shaneh -- wincng: add support for authentication keys to be passed in memory +- [Pedro Monreal brought this change] + + Spelling corrections (#380) - Based upon 18cfec8336e and daa2dfa2db. + Files : + libssh2.h, libssh2_sftp.h, bcrypt_pbkdf.c, mbedtls.c, sftp.c, ssh2.c + + Notes : + * Fixed misspellings + + Credit : + Pedro Monreal -- pem.c: add _libssh2_pem_parse_memory to parse PEM from memory +- [Sebastián Katzer brought this change] + + Fix Potential typecast error for `_libssh2_ecdsa_key_get_curve_type` (#383) - Requirement to implement 18cfec8336e for Libgcrypt and WinCNG. + Issue : #383 + + Files : hostkey.c, crypto.h, openssl.c + + Notes : + * Fix potential typecast error for `_libssh2_ecdsa_key_get_curve_type` + * Rename _libssh2_ecdsa_key_get_curve_type to _libssh2_ecdsa_get_curve_type + + Credit : + Sebastián Katzer -- pem.c: fix copy and paste mistake from 55d030089b8 +GitHub (20 Jun 2019) +- [Will Cosgrove brought this change] -- userauth.c: fix another possible dereference of a null pointer + bump copyright date -- userauth.c: fix possible dereference of a null pointer +Version 1.9.0 (19 Jun 2019) -- pem.c: reduce number of calls to strlen in readline +GitHub (19 Jun 2019) +- [Will Cosgrove brought this change] + + 1.9 Formatting -Alexander Lamaison (17 Mar 2015) - [Will Cosgrove brought this change] - Initialise HMAC_CTX in more places. - - Missed a couple more places we init ctx to avoid openssl threading crash. + 1.9 Release notes -- Build build breakage in WinCNG backend caused when adding libssh2_userauth_publickey_frommemory. +Will Cosgrove (17 May 2019) +- [Alexander Curtiss brought this change] + + libgcrypt.c : Fixed _libssh2_rsa_sha1_sign memory leak. (#370) - The new feature isn't implemented for the WinCNG backend currently, but the WinCNG backend didn't contain any implementation of the required backend functions - even ones that returns an error. That caused link errors. + File: libgcrypt.c - This change fixes the problem by providing an implementation of the backend functions that returns an error. + Notes : Added calls to gcry_sexp_release to free memory allocated by gcry_sexp_find_token + + Credit : + Reporter : beckmi + PR by: Alexander Curtiss -- Fix breakage in WinCNG backend caused by introducing libssh2_hmac_ctx_init. +- [Orivej Desh brought this change] + + libssh2_priv.h : Fix musl build warning on sys/poll.h (#346) - The macro was defined to nothing for the libgcrypt backend, but not for WinCNG. This brings the latter into line with the former. + File : libssh2_priv.h + + Notes : + musl prints `redirecting incorrect #include to ` + http://git.musl-libc.org/cgit/musl/commit/include/sys/poll.h?id=54446d730cfb17c5f7bcf57f139458678f5066cc + + poll is defined by POSIX to be in poll.h: + http://pubs.opengroup.org/onlinepubs/7908799/xsh/poll.html + + Credit : Orivej Desh -Daniel Stenberg (15 Mar 2015) -- userauth_publickey_frommemory.3: add AVAILABILITY +GitHub (1 May 2019) +- [Will Cosgrove brought this change] + + kex.c : additional bounds checks in diffie_hellman_sha1/256 (#361) - ... it will be added in 1.6.0 + Files : kex.c, misc.c, misc.h + + Notes : + Fixed possible out of bounds memory access when reading malformed data in diffie_hellman_sha1() and diffie_hellman_sha256(). + + Added _libssh2_copy_string() to misc.c to return an allocated and filled char buffer from a string_buf offset. Removed no longer needed s var in kmdhgGPshakex_state_t. -- libssh2: next version will be called 1.6.0 +Will Cosgrove (26 Apr 2019) +- [Tseng Jun brought this change] + + sftp.c : sftp_bin2attr() Correct attrs->gid assignment (#366) - ... since we just added a new function. + Regression with fix for #339 + + Credit : Tseng Jun -- docs: add libssh2_userauth_publickey_frommemory.3 to dist +- [Tseng Jun brought this change] + + kex.c : Correct type cast in curve25519_sha256() (#365) + +GitHub (24 Apr 2019) +- [Will Cosgrove brought this change] + + transport.c : scope local total_num var (#364) - The function and man page were added in commit 18cfec8336e + file : transport.c + notes : move local `total_num` variable inside of if block to prevent scope access issues which caused #360. -- [Jakob Egger brought this change] +Will Cosgrove (24 Apr 2019) +- [doublex brought this change] - direct_tcpip: Fixed channel write + transport.c : fixes bounds check if partial packet is read - There were 3 bugs in this loop: - 1) Started from beginning after partial writes - 2) Aborted when 0 bytes were sent - 3) Ignored LIBSSH2_ERROR_EAGAIN + Files : transport.c - See also: - https://trac.libssh2.org/ticket/281 - https://trac.libssh2.org/ticket/293 + Issue : #360 + + Notes : + 'p->total_num' instead of local value total_num when doing bounds check. + + Credit : Doublex -Alexander Lamaison (15 Mar 2015) +GitHub (23 Apr 2019) - [Will Cosgrove brought this change] - Must init HMAC_CTX before using it. + Editor config file for source files (#322) - Must init ctx before using it or openssl will reuse the hmac which is not thread safe and causes a crash. - Added libssh2_hmac_ctx_init macro. + Simple start to an editor config file when editing source files to make sure they are configured correctly. -- Add continuous integration configurations. +- [Will Cosgrove brought this change] + + misc.c : String buffer API improvements (#332) - Linux-based CI is done by Travis CI. Windows-based CI is done by Appveyor. + Files : misc.c, hostkey.c, kex.c, misc.h, openssl.c, sftp.c + + Notes : + * updated _libssh2_get_bignum_bytes and _libssh2_get_string. Now pass in length as an argument instead of returning it to keep signedness correct. Now returns -1 for failure, 0 for success. + + _libssh2_check_length now returns 0 on success and -1 on failure to match the other string_buf functions. Added comment to _libssh2_check_length. + + Credit : Will Cosgrove -- [David Calavera brought this change] +Will Cosgrove (19 Apr 2019) +- [doublex brought this change] - Allow authentication keys to be passed in memory. + mbedtls.c : _libssh2_mbedtls_rsa_new_private_frommemory() allow private-key from memory (#359) - All credits go to Joe Turpin, I'm just reaplying and cleaning his patch: - http://www.libssh2.org/mail/libssh2-devel-archive-2012-01/0015.shtml + File : mbedtls.c - * Use an unimplemented error for extracting keys from memory with libgcrypt. + Notes: _libssh2_mbedtls_rsa_new_private_frommemory() fixes private-key from memory reading to by adding NULL terminator before parsing; adds passphrase support. + + Credit: doublex -Daniel Stenberg (14 Mar 2015) -- docs: include the renamed INSTALL* files in dist +- [Ryan Kelley brought this change] -Alexander Lamaison (13 Mar 2015) -- Prevent collisions between CMake and Autotools in examples/ and tests/. + Session.c : banner_receive() from leaking when accessing non ssh ports (#356) + + File : session.c + + Release previous banner in banner_receive() if the session is reused after a failed connection. + + Credit : Ryan Kelley -- Avoid clash between CMake build and Autotools. +GitHub (11 Apr 2019) +- [Will Cosgrove brought this change] + + Formatting in agent.c - Autotools expects a configuration template file at src/libssh2_config.h.in, which buildconf generates. But the CMake build system has its CMake-specific version of the file at this path. This means that, if you don't run buildconf, the Autotools build will fail because it configured the wrong header template. + Removed whitespace. + +- [Will Cosgrove brought this change] + + Fixed formatting in agent.c - See https://github.com/libssh2/libssh2/pull/8. + Quiet linter around a couple if blocks and pointer. -- Merge pull request #8 from alamaison/cmake +Will Cosgrove (11 Apr 2019) +- [Zhen-Huan HWANG brought this change] + + sftp.c : discard and reset oversized packet in sftp_packet_read() (#269) - CMake build system. + file : sftp.c + + notes : when sftp_packet_read() encounters an sftp packet which exceeds SFTP max packet size it now resets the reading state so it can continue reading. + + credit : Zhen-Huan HWANG -- CMake build system. +GitHub (11 Apr 2019) +- [Will Cosgrove brought this change] + + Add agent functions libssh2_agent_get_identity_path() and libssh2_agent_set_identity_path() (#308) - Tested: - - Windows: - - Visual C++ 2005/2008/2010/2012/2013/MinGW-w64 - - static/shared - - 32/64-bit - - OpenSSL/WinCNG - - Without zlib - - Linux: - - GCC 4.6.3/Clang 3.4 - - static/shared - - 32/64-bit - - OpenSSL/Libgcrypt - - With/Without zlib - - MacOS X - - AppleClang 6.0.0 - - static - - 64-bit - - OpenSSL - - Without zlib + File : agent.c - Conflicts: - README + Notes : + Libssh2 uses the SSH_AUTH_SOCK env variable to read the system agent location. However, when using a custom agent path you have to set this value using setenv which is not thread-safe. The new functions allow for a way to set a custom agent socket path in a thread safe manor. -- Man man syntax tests fail gracefully if man version is not suitable. +- [Will Cosgrove brought this change] -- Return valid code from test fixture on failure. + Simplified _libssh2_check_length (#350) - The sshd test fixture was returning -1 if an error occurred, but negative error codes aren't technically valid (google it). Bash on Windows converted them to 0 which made setup failure look as though all tests were passing. - -- Let mansyntax.sh work regardless of where it is called from. - -Daniel Stenberg (12 Mar 2015) -- [Viktor Szakáts brought this change] - - mingw build: allow to pass custom CFLAGS + * Simplified _libssh2_check_length - Allow to pass custom `CFLAGS` options via environment variable - `LIBSSH2_CFLAG_EXTRAS`. Default and automatically added options of - `GNUmakefile` have preference over custom ones. This addition is useful - for passing f.e. custom CPU tuning or LTO optimization (`-flto - -ffat-lto-objects`) options. The only current way to do this is to edit - `GNUmakefile`. This patch makes it unnecessary. + misc.c : _libssh2_check_length() - This is a mirror of similar libcurl patch: - https://github.com/bagder/curl/pull/136 + Removed cast and improved bounds checking and format. + + Credit : Yuriy M. Kaminskiy - [Will Cosgrove brought this change] - userauth: Fixed prompt text no longer being copied to the prompts struct + _libssh2_check_length() : additional bounds check (#348) - Regression from 031566f9c - -- README: update the git repo locations + Misc.c : _libssh2_check_length() + + Ensure the requested length is less than the total length before doing the additional bounds check -- wait_socket: wrong use of difftime() +Daniel Stenberg (25 Mar 2019) +- misc: remove 'offset' from string_buf - With reversed arguments it would always return a negative value... + It isn't necessary. - Bug: https://github.com/bagder/libssh2/issues/1 - -- bump: start working toward 1.5.1 now - -Version 1.5.0 (11 Mar 2015) + Closes #343 -Daniel Stenberg (11 Mar 2015) -- RELEASE-NOTES: 1.5.0 release +- sftp: repair mtime from e1ead35e475 + + A regression from e1ead35e4759 broke the SFTP mtime logic in + sftp_bin2attr + + Also simplified the _libssh2_get_u32/u64 functions slightly. + + Closes #342 -- [Mariusz Ziulek brought this change] +- session_disconnect: don't zero state, just clear the right bit + + If we clear the entire field, the freeing of data in session_free() is + skipped. Instead just clear the bit that risk making the code get stuck + in the transport functions. + + Regression from 4d66f6762ca3fc45d9. + + Reported-by: dimmaq on github + Fixes #338 + Closes #340 - kex: bail out on rubbish in the incoming packet +- libssh2_sftp.h: restore broken ABI - CVE-2015-1782 + Commit 41fbd44 changed variable sizes/types in a public struct which + broke the ABI, which breaks applications! - Bug: http://www.libssh2.org/adv_20150311.html + This reverts that change. + + Closes #339 -- docs: move INSTALL, AUTHORS, HACKING and TODO to docs/ +- style: make includes and examples code style strict - And with this, cleanup README to be shorter and mention the new source - code home. + make travis and the makefile rule verify them too + + Closes #334 -- .gitignore: don't ignore INSTALL +GitHub (21 Mar 2019) +- [Daniel Stenberg brought this change] -Dan Fandrich (4 Mar 2015) -- examples/x11.c: include sys/select.h for improved portability + create a github issue template -Daniel Stenberg (4 Mar 2015) -- RELEASE-NOTES: synced with a8473c819bc068 +Daniel Stenberg (21 Mar 2019) +- stale-bot: activated - In preparation for the upcoming 1.5.0 release. - -Guenter Knauf (8 Jan 2015) -- NetWare build: added some missing exports. - -Marc Hoersken (29 Dec 2014) -- knownhost.c: fix use of uninitialized argument variable wrote + The stale bot will automatically mark stale issues (inactive for 90 + days) and if still untouched after 21 more days, close them. - Detected by clang scan in line 1195, column 18. + See https://probot.github.io/apps/stale/ -- examples/x11.c: fix result of operation is garbage or undefined +- libssh2_session_supported_algs.3: fix formatting mistakes - Fix use of uninitialized structure w_size_bck. - Detected by clang scan in line 386, column 28. + Reported-by: Max Horn + Fixes #57 -- examples/x11.c: remove dead assigments of some return values - - Detected by clang scan in line 212, column 9. - Detected by clang scan in line 222, column 13. - Detected by clang scan in line 410, column 13. +- [Zenju brought this change] -- examples/x11.c: fix possible memory leak if read fails + libssh2.h: Fix Error C2371 'ssize_t': redefinition - Detected by clang scan in line 224, column 21. + Closes #331 -- examples/x11.c: fix invalid removal of first list element +- travis: add code style check - Fix use of memory after it was being freed. - Detected by clang scan in line 56, column 12. + Closes #324 -- userauth.c: make sure that sp_len is positive and avoid overflows - - ... if the pointer subtraction of sp1 - pubkey - 1 resulted in a - negative or larger value than pubkey_len, memchr would fail. +- code style: unify code style - Reported by Coverity CID 89846. + Indent-level: 4 + Max columns: 79 + No spaces after if/for/while + Unified brace positions + Unified white spaces -- channel.c: remove logically dead code, host cannot be NULL here - - ... host cannot be NULL in line 525, because it is always - valid (e.g. at least set to "0.0.0.0") after lines 430 and 431. +- src/checksrc.pl: code style checker - Reported by Coverity CID 89807. + imported as-is from curl -- session.c: check return value of session_nonblock during startup +Will Cosgrove (19 Mar 2019) +- Merge branch 'MichaelBuckley-michaelbuckley-security-fixes' + +- Silence unused var warnings (#329) - Reported by Coverity CID 89803. + Silence warnings about unused variables in this test -- session.c: check return value of session_nonblock in debug mode +- Removed unneeded > 0 check - Reported by Coverity CID 89805. + When checking `userauth_kybd_num_prompts > 100` we don't care if it's also above zero. -- pem.c: fix mixed line-endings introduced with 8670f5da24 +- [Matthew D. Fuller brought this change] -- pem.c: make sure there's a trailing zero and b64data is not NULL + Spell OpenSS_H_ right when talking about their specific private key (#321) - ... if there is no base64 data between PEM header and footer. - Reported by Coverity CID 89823. + Good catch, thanks. -- kex.c: make sure mlist is not set to NULL - - ... if the currently unsupported LANG methods are called. - Reported by Coverity CID 89834. +GitHub (19 Mar 2019) +- [Will Cosgrove brought this change] -- packet.c: i < 256 was always true and i would overflow to 0 + Silence unused var warnings (#329) - Visualize that the 0-termination is intentional, because the array - is later passed to strlen within _libssh2_packet_askv. + Silence warnings about unused variables in this test -- silence multiple data conversion warnings +Michael Buckley (19 Mar 2019) +- Fix more scope and printf warning errors -Daniel Stenberg (23 Dec 2014) -- agent_connect_unix: make sure there's a trailing zero - - ... if the path name was too long. Reported by Coverity CID 89801. +- Silence unused variable warning -Marc Hoersken (22 Dec 2014) -- examples on Windows: use native SOCKET-type instead of int +GitHub (19 Mar 2019) +- [Will Cosgrove brought this change] + + Removed unneeded > 0 check - And check return values accordingly. + When checking `userauth_kybd_num_prompts > 100` we don't care if it's also above zero. -- userauth.c: improve readability and clarity of for-loops +Will Cosgrove (19 Mar 2019) +- [Matthew D. Fuller brought this change] -Daniel Stenberg (22 Dec 2014) -- calloc: introduce LIBSSH2_CALLOC() + Spell OpenSS_H_ right when talking about their specific private key (#321) - A simple function using LIBSSH2_ALLOC + memset, since this pattern was - used in multiple places and this simplies code in general. + Good catch, thanks. -Marc Hoersken (15 Dec 2014) -- libssh2_priv.h: Ignore session, context and format parameters +Michael Buckley (18 Mar 2019) +- Fix errors identified by the build process -- x11 example: check return value of socket function +- Fix casting errors after merge -- examples: fixed mixed line-endings introduced with aedfba25b8 +GitHub (18 Mar 2019) +- [Michael Buckley brought this change] -- wincng.c: explicitly ignore BCrypt*AlgorithmProvider return codes - - Fixes VS2012 code analysis warning C6031: - return value ignored: could return unexpected value + Merge branch 'master' into michaelbuckley-security-fixes -- wincng.c: fix possible invalid memory write access - - Fixes VS2012 code analysis warning C6386: - buffer overrun: accessing 'pbOutput', the writable size is - 'cbOutput' bytes, but '3' bytes may be written: libssh2 wincng.c 610 +Michael Buckley (18 Mar 2019) +- Move fallback SIZE_MAX and UINT_MAX to libssh2_priv.h -- tests on Windows: check for WSAStartup return code - - Fixes VS2012 code analysis warning C6031: - return value ignored: could return unexpected value +- Fix type and logic issues with _libssh2_get_u64 -- wincng.c: fix possible NULL pointer de-reference of bignum - - Fixes VS2012 code analysis warning C6011: - dereferencing NULL pointer 'bignum'. libssh2 wincng.c 1567 +Daniel Stenberg (17 Mar 2019) +- examples: fix various compiler warnings -- wincng.c: fix possible use of uninitialized memory - - Fixes VS2012 code analysis warning C6001: - using uninitialized memory 'cbDecoded'. libssh2 wincng.c 553 +- lib: fix various compiler warnings -- packet.c: fix possible NULL pointer de-reference within listen_state - - Fixes VS2012 code analysis warning C6011: - dereferencing NULL pointer 'listen_state->channel'. libssh2 packet.c 221 +- session: ignore pedantic warnings for funcpointer <=> void * -- kex.c: fix possible NULL pointer de-reference with session->kex +- travis: add a build using configure - Fixes VS2012 code analysis warning C6011: - dereferencing NULL pointer 'session->kex'. libssh2 kex.c 1761 + Closes #320 -- agent.c: check return code of MapViewOfFile +- configure: provide --enable-werror + +- appveyor: remove old builds that mostly cause failures - Fixes VS2012 code analysis warning C6387: 'p+4' may be '0': - this does not adhere to the specification for the function - 'memcpy': libssh2 agent.c 330 + ... and only run on master branch. - Fixes VS2012 code analysis warning C6387: 'p' may be '0': - this does not adhere to the specification for the function - 'UnmapViewOfFile': libssh2 agent.c 333 + Closes #323 -- examples on Windows: check for socket return code +- cmake: add two missing man pages to get installed too - Fixes VS2012 code analysis warning C28193: - The variable holds a value that must be examined + Both libssh2_session_handshake.3 and + libssh2_userauth_publickey_frommemory.3 were installed by the configure + build already. + + Reported-by: Arfrever on github + Fixes #278 -- examples on Windows: check for WSAStartup return code +- include/libssh2.h: warning: "_WIN64" is not defined, evaluates to 0 - Fixes VS2012 code analysis warning C6031: - return value ignored: could return unexpected value + We don't use #if for defines that might not be defined. -Guenter Knauf (11 Dec 2014) -- wincng.c: silent some more gcc compiler warnings. +- pem: //-comments are not allowed -- wincng.c: silent gcc compiler warnings. +Will Cosgrove (14 Mar 2019) +- [Daniel Stenberg brought this change] -- Watcom build: added support for WinCNG build. + userauth: fix "Function call argument is an uninitialized value" (#318) + + Detected by scan-build. -- build: updated dependencies in makefiles. +- fixed unsigned/signed issue -Daniel Stenberg (4 Dec 2014) -- configure: change LIBS not LDFLAGS when checking for libs +Daniel Stenberg (15 Mar 2019) +- session_disconnect: clear state - Closes #289 + If authentication is started but not completed before the application + gives up and instead wants to shut down the session, the '->state' field + might still be set and thus effectively dead-lock session_disconnect. - Patch-by: maurerpe - -Guenter Knauf (3 Dec 2014) -- MinGW build: some more GNUMakefile tweaks. + This happens because both _libssh2_transport_send() and + _libssh2_transport_read() refuse to do anything as long as state is set + without the LIBSSH2_STATE_KEX_ACTIVE bit. - test/GNUmakefile: added architecture autodetection; added switches to - CFLAGS and RCFLAGS to make sure that the right architecture is used. - Added support to build with WinCNG. - -- sftpdir.c: added authentication method detection. + Reported in curl bug https://github.com/curl/curl/issues/3650 - Stuff copied over from ssh2.c to make testing a bit easier. + Closes #310 -- NMake build: fixed LIBS settings. +Will Cosgrove (14 Mar 2019) +- Release notes from 1.8.1 -- NMake build: added support for WinCNG build. +Michael Buckley (14 Mar 2019) +- Use string_buf in sftp_init(). -- MinGW build: some GNUMakefile tweaks. - - Added architecture autodetection; added switches to CFLAGS and - RCFLAGS to make sure that the right architecture is used. - Added support to build with WinCNG. +- Guard against out-of-bounds reads in publickey.c -- MinGW build: Fixed redefine warnings. +- Guard against out-of-bounds reads in session.c -- Updated copyright year. +- Guard against out-of-bounds reads in userauth.c -Daniel Stenberg (31 Aug 2014) -- COPYING: bump the copyright year +- Use LIBSSH2_ERROR_BUFFER_TOO_SMALL instead of LIBSSH2_ERROR_OUT_OF_BOUNDARY in sftp.c -Dan Fandrich (28 Jul 2014) -- docs: fixed a bunch of typos +- Additional bounds checking in sftp.c -- docs: added missing libssh2_session_handshake.3 file +- Additional length checks to prevent out-of-bounds reads and writes in _libssh2_packet_add(). https://libssh2.org/CVE-2019-3862.html -Marc Hoersken (19 May 2014) -- wincng.c: specify the required libraries for dependencies using MSVC - - Initially reported by Bob Kast as "for MS VS builds, specify the - libraries that are required so they don't need to go into all - project files that may use this library". Thanks a lot. +- Add a required_size parameter to sftp_packet_require et. al. to require callers of these functions to handle packets that are too short. https://libssh2.org/CVE-2019-3860.html -- [Bob Kast brought this change] +- Check the length of data passed to sftp_packet_add() to prevent out-of-bounds reads. - windows build: do not export externals from static library - - If you are building a DLL, then you need to explicitly export each - entry point. When building a static library, you should not. +- Prevent zero-byte allocation in sftp_packet_read() which could lead to an out-of-bounds read. https://libssh2.org/CVE-2019-3858.html + +- Sanitize padding_length - _libssh2_transport_read(). https://libssh2.org/CVE-2019-3861.html - libssh2 was exporting the entry points whether it was building a DLL or a - static library. To elaborate further, if libssh2 was used as a static - library, which was being linked into a DLL, the libssh2 API would be - exported from that separate DLL. + This prevents an underflow resulting in a potential out-of-bounds read if a server sends a too-large padding_length, possibly with malicious intent. -Daniel Stenberg (19 May 2014) -- [Mikhail Gusarov brought this change] +- Defend against writing beyond the end of the payload in _libssh2_transport_read(). - Fix typos in manpages +- Defend against possible integer overflows in comp_method_zlib_decomp. -Marc Hoersken (18 May 2014) -- wincng.c: Fixed memory leak in case of an error during ASN.1 decoding +GitHub (14 Mar 2019) +- [Will Cosgrove brought this change] -- configure: Display individual crypto backends on separate lines + Security fixes (#315) - This avoids line-wrapping in between parameters and makes the - error message look like the following: + * Bounds checks - configure: error: No crypto library found! - Try --with-libssl-prefix=PATH - or --with-libgcrypt-prefix=PATH - or --with-wincng on Windows - -- [Bob Kast brought this change] - - libssh2_priv.h: a 1 bit bit-field should be unsigned + Fixes for CVEs + https://www.libssh2.org/CVE-2019-3863.html + https://www.libssh2.org/CVE-2019-3856.html - some compilers may not like this - -- knownhost.c: Fixed warning that pointer targets differ in signedness - -- wincng.c: Fixed warning about pointer targets differing in signedness - -- tcpip-forward.c: Fixed warning that pointer targets differ in signedness + * Packet length bounds check - libssh2_channel_forward_listen_ex uses ints instead of unsigned ints. + CVE + https://www.libssh2.org/CVE-2019-3855.html + + * Response length check + + CVE + https://www.libssh2.org/CVE-2019-3859.html + + * Bounds check + + CVE + https://www.libssh2.org/CVE-2019-3857.html + + * Bounds checking + + CVE + https://www.libssh2.org/CVE-2019-3859.html + + and additional data validation + + * Check bounds before reading into buffers + + * Bounds checking + + CVE + https://www.libssh2.org/CVE-2019-3859.html + + * declare SIZE_MAX and UINT_MAX if needed -- misc.c: Fixed warning about mixed declarations and code +- [Will Cosgrove brought this change] -- libgcrypt.h: Fixed warning about pointer targets differing in signedness + fixed type warnings (#309) -- wincng.h: Fixed warning about pointer targets differing in signedness +- [Will Cosgrove brought this change] -- misc.c: Fixed warning about unused parameter abstract + Bumping version number for pending 1.8.1 release -- tcpip-forward.c: Removed unused variables shost, sport and sockopt +Will Cosgrove (4 Mar 2019) +- [Daniel Stenberg brought this change] -- wincng.h: Added forward declarations for all WinCNG functions + _libssh2_string_buf_free: use correct free (#304) - Initially reported by Bob Kast as "Wincng - define function - prototypes for wincng routines". Thanks a lot. + Use LIBSSH2_FREE() here, not free(). We allow memory function + replacements so free() is rarely the right choice... + +GitHub (26 Feb 2019) +- [Will Cosgrove brought this change] + + Fix for building against libreSSL #302 - Also replaced structure definitions with type definitions. + Changed to use the check we use elsewhere. -- [Bob Kast brought this change] +- [Will Cosgrove brought this change] - libssh2.h: on Windows, a socket is of type SOCKET, not int + Fix for when building against LibreSSL #302 -- win32: Added WinCNG targets to generated Visual Studio project - - Inspired by Bob Kast's reports, this commit enables the compilation - of libssh2 with WinCNG using the generated Visual Studio project files. - This commit adds WinCNG support to parts of the existing Win32 build - infrastructure, until new build systems, like pre-defined VS project - files or CMake files may be added. - - This commit and b20bfeb3e519119a48509a1099c06d65aa7da1d7 raise one - question: How to handle build systems, like VS project files, that - need to include all source files regardless of the desired target, - including all supported crypto backends? For now the mentioned commit - added a check for LIBSSH2_OPENSSL to openssl.c and with this commit - the supported crypto backends are hardcoded within Makefile.am. +Will Cosgrove (25 Feb 2019) +- [gartens brought this change] -- libssh2_priv msvc: Removed redundant definition of inline keyword - - Initially reported by Bob Kast as "Remove redundant 'inline' define". - Thanks a lot. + docs: update libssh2_hostkey_hash.3 [ci skip] (#301) -- wincng: Made data parameter to hash update function constant - - Initially reported by Bob Kast as "formal parameter must be const - since it is used in contexts where the actual parameter may be const". - Thanks a lot. +GitHub (21 Feb 2019) +- [Will Cosgrove brought this change] -- wincng: fix cross-compilation against the w64 mingw-runtime package + fix malloc/free mismatches #296 (#297) -- openssl: Check for LIBSSH2_OPENSSL in order to compile with openssl +- [Will Cosgrove brought this change] -- wincng: Fixed use of possible uninitialized variable pPaddingInfo - - Reported by Bob Kast, thanks a lot. + Replaced malloc with calloc #295 -- wincng: Added cast for double to unsigned long conversion +- [Will Cosgrove brought this change] -- wincng: Cleaned up includes and check NTSTATUS using macro - - Removed header file combination that is not supported on a real - Windows platform and can only be compiled using MinGW. Replaced - custom NTSTATUS return code checks with BCRYPT_SUCCESS macro. + Abstracted OpenSSL calls out of hostkey.c (#294) -Daniel Stenberg (16 Mar 2014) -- userauth_hostbased_fromfile: zero assign to avoid uninitialized use - - Detected by clang-analyze +- [Will Cosgrove brought this change] -- channel_receive_window_adjust: store windows size always + Fix memory dealloc impedance mis-match #292 (#293) - Avoid it sometimes returning without storing it, leaving calling - functions with unknown content! + When using ed25519 host keys and a custom memory allocator. + +- [Will Cosgrove brought this change] + + Added call to OpenSSL_add_all_digests() #288 - Detected by clang-analyzer + For OpenSSL 1.0.x we need to call OpenSSL_add_all_digests(). -- publickey_packet_receive: avoid junk in returned pointers +Will Cosgrove (12 Feb 2019) +- [Zhen-Huan HWANG brought this change] + + SFTP: increase maximum packet size to 256K (#268) - clang-analyzer found this risk it would return a non-initialized pointer - in a success case + to match implementations like OpenSSH. -Peter Stuge (16 Mar 2014) -- [Marc Hoersken brought this change] +- [Zenju brought this change] - Added Windows Cryptography API: Next Generation based backend + Fix https://github.com/libssh2/libssh2/pull/271 (#284) -- [Marc Hoersken brought this change] +GitHub (16 Jan 2019) +- [Will Cosgrove brought this change] - knownhost.c: fixed that 'key_type_len' may be used uninitialized + Agent NULL check in shutdown #281 + +Will Cosgrove (15 Jan 2019) +- [Adrian Moran brought this change] + + mbedtls: Fix leak of 12 bytes by each key exchange. (#280) - ../src/knownhost.c: In function 'libssh2_knownhost_readline': - ../src/knownhost.c:651:16: warning: 'key_type_len' may be used - uninitialized in this function [-Wmaybe-uninitialized] - rc = knownhost_add(hosts, hostbuf, NULL, - ^ - ../src/knownhost.c:745:12: note: 'key_type_len' was declared here - size_t key_type_len; - ^ + Correctly free ducts by calling _libssh2_mbedtls_bignum_free() in dtor. -- [Marc Hoersken brought this change] +- [alex-weaver brought this change] - pem.c: always compile pem.c independently of crypto backend + Fix error compiling on Win32 with STDCALL=ON (#275) -- Fix non-autotools builds: Always define the LIBSSH2_OPENSSL CPP macro - - Commit d512b25f69a1b6778881f6b4b5ff9cfc6023be42 introduced a crypto - library abstraction in the autotools build system, to allow us to more - easily support new crypto libraries. In that process it was found that - all other build system which we support are hard-coded to build with - OpenSSL. Commit f5c1a0d98bd51aeb24aca3d49c7c81dcf8bd858d fixes automake - introduced into non-autotools build systems but still overlooked the - CPP macro saying that we are using OpenSSL. +GitHub (8 Nov 2018) +- [Will Cosgrove brought this change] + + Allow default permissions to be used in sftp_mkdir (#271) - Thanks to Marc Hörsken for identifying this issue and proposing a fix - for win32/{GNUmakefile,config.mk}. This commit uses a slightly different - approach but the end result is the same. + Added constant LIBSSH2_SFTP_DEFAULT_MODE to use the server default permissions when making a new directory -Dan Fandrich (15 Mar 2014) -- channel_close: Close the channel even in the case of errors +Will Cosgrove (13 Sep 2018) +- [Giulio Benetti brought this change] -- sftp_close_handle: ensure the handle is always closed + openssl: fix dereferencing ambiguity potentially causing build failure (#267) - Errors are reported on return, but otherwise the close path is - completed as much as possible and the handle is freed on exit. + When dereferencing from *aes_ctr_cipher, being a pointer itself, + ambiguity can occur; fixed possible build errors. -Alexander Lamaison (6 Mar 2014) -- knownhost: Restore behaviour of `libssh2_knownhost_writeline` with short buffer. +Viktor Szakats (12 Sep 2018) +- win32/GNUmakefile: define HAVE_WINDOWS_H - Commit 85c6627c changed the behaviour of `libssh2_knownhost_writeline` so that it stopped returning the number of bytes needed when the given buffer was too small. Also, the function changed such that is might write to part of the buffer before realising it is too small. + This macro was only used in test/example code before, now it is + also used in library code, but only defined automatically by + automake/cmake, so let's do the same for the standalone win32 + make file. - This commit restores the original behaviour, whilst keeping the unknown-key-type functionality that 85c6627c. Instead of writing to the buffer piecemeal, the length of the various parts is calculated up front and the buffer written only if there is enough space. The calculated necessary size is output in `outlen` regardless of whether the buffer was written to. + It'd be probably better to just rely on the built-in _WIN32 macro + to detect the presence of windows.h though. It's already used + in most of libssh2 library code. There is a 3rd, similar macro + named LIBSSH2_WIN32, which might also be replaced with _WIN32. - The main use-case for the original behaviour that this commit restores is to allow passing in a NULL buffer to get the actual buffer size needed, before calling the function again with the buffer allocated to the exact size required. + Ref: https://github.com/libssh2/libssh2/commit/8b870ad771cbd9cd29edbb3dbb0878e950f868ab + Closes https://github.com/libssh2/libssh2/pull/266 -- knownhost: Fix DSS keys being detected as unknown. +Marc Hoersken (2 Sep 2018) +- Fix conditional check for HAVE_DECL_SECUREZEROMEMORY - I missing `else` meant ssh-dss format keys were being re-detected as unknown format. + "Unlike the other `AC_CHECK_*S' macros, when a symbol is not declared, + HAVE_DECL_symbol is defined to `0' instead of leaving HAVE_DECL_symbol + undeclared. When you are sure that the check was performed, + use HAVE_DECL_symbol in #if." + + Source: autoconf documentation for AC_CHECK_DECLS. -Dan Fandrich (6 Mar 2014) -- knownhosts: Abort if the hosts buffer is too small +- Fix implicit declaration of function 'SecureZeroMemory' - This could otherwise cause a match on the wrong host + Include window.h in order to use SecureZeroMemory on Windows. -- agent_list_identities: Fixed memory leak on OOM +- Fix implicit declaration of function 'free' by including stdlib.h -- Fixed a few typos +GitHub (27 Aug 2018) +- [Will Cosgrove brought this change] -- userauth: Fixed an attempt to free from stack on error + Use malloc abstraction function in pem parse + + Fix warning on WinCNG build. -- Fixed a few memory leaks in error paths +- [Will Cosgrove brought this change] -- Fixed two potential use-after-frees of the payload buffer + Fixed possible junk memory read in sftp_stat #258 + +- [Will Cosgrove brought this change] + + removed INT64_C define (#260) - The first might occur if _libssh2_packet_add returns an error, as - fullpacket_state wasn't reset to idle so if it were possible for - fullpacket to be called again, it would return to the same state - handler and re-use the freed p->packet buffer. + No longer used. + +- [Will Cosgrove brought this change] + + Added conditional around engine.h include + +Will Cosgrove (6 Aug 2018) +- [Alex Crichton brought this change] + + Fix OpenSSL link error with `no-engine` support (#259) - The second could occur if decrypt returned an error, as it freed the - packet buffer but did not clear total_num, meaning that freed buffer - could be written into again later. + This commit fixes linking against an OpenSSL library that was compiled with + `no-engine` support by bypassing the initialization routines as they won't be + available anyway. -Alexander Lamaison (28 Nov 2013) -- Fix missing `_libssh2_error` in `_libssh2_channel_write`. +GitHub (2 Aug 2018) +- [Will Cosgrove brought this change] + + ED25519 Key Support #39 (#248) - In one case, the error code from `_libssh2_transport_read` was being returned from `_libssh2_channel_write` without setting it as the last error by calling `_libssh2_error`. This commit fixes that. + OpenSSH Key and ED25519 support #39 + Added _libssh2_explicit_zero() to explicitly zero sensitive data in memory #120 - Found when using a session whose socket had been inadvertently destroyed. The calling code got confused because via `libssh2_session_last_error` it appeared no error had occurred, despite one being returned from the previous function. + * ED25519 Key file support - Requires OpenSSL 1.1.1 or later + * OpenSSH Key format reading support - Supports RSA/DSA/ECDSA/ED25519 types + * New string buffer reading functions - These add build-in bounds checking and convenance methods. Used for OpenSSL PEM file reading. + * Added new tests for OpenSSH formatted Keys -Kamil Dudka (21 Nov 2013) -- [Mark McPherson brought this change] +- [Will Cosgrove brought this change] - openssl: initialise the digest context before calling EVP_DigestInit() + ECDSA key types are now explicit (#251) - When using the OpenSSL libraries in FIPS mode, the function call - EVP_DigestInit() is actually #defined to FIPS_digestinit(). - Unfortunately wheres EVP_DigestInit() initialises the context and then - calls EVP_DigestInit_ex(), this function assumes that the context has - been pre-initialised and crashes when it isn't. + * ECDSA key types are now explicit - Bug: https://trac.libssh2.org/ticket/279 + Issue was brough up in pull request #248 + +Will Cosgrove (2 May 2018) +- [Jakob Egger brought this change] + + Add Instructions for building from Master (#249) + +GitHub (27 Apr 2018) +- [Will Cosgrove brought this change] + + Initialize sb_intl #226 + +Will Cosgrove (19 Apr 2018) +- [doublex brought this change] + + buffer overflow (valgrind) (#159) + +- [Brendan Shanks brought this change] + + mbedTLS: Remove some C99-style intermingled variable declarations (#196) + +GitHub (18 Apr 2018) +- [Will Cosgrove brought this change] + + fix for #160 + +Will Cosgrove (18 Apr 2018) +- [doublex brought this change] + + fix memory leak when using mbedtls backend (#158) - Fixes #279 + _libssh2_bn_init_from_bin/_libssh2_bn_free would leak bignum from mbedtls_calloc(). -- [Marc Hörsken brought this change] +- [Brendan Shanks brought this change] - .gitignore: Ignore files like src/libssh2_config.h.in~ + mbedTLS: Avoid multiple definition errors for context handles (#197) -Peter Stuge (13 Nov 2013) -- Move automake conditionals added by commit d512b25f out of Makefile.inc +- [Tseng Jun brought this change] + + Fix the EVP cipher meth memory leakage problem (#244) - Commit d512b25f69a1b6778881f6b4b5ff9cfc6023be42 added automake - conditionals to Makefile.inc but since Makefile.inc is included - from Makefile for all other build systems that does not work. + * Fix the EVP cipher meth memory leakage problem - This commit instead adds Makefile.OpenSSL.inc and Makefile.libgcrypt.inc - and moves the automake conditional to its proper place, src/Makefile.am. + Looks good, thanks for the fixes. + +Marc Hörsken (31 Mar 2018) +- [Will Cosgrove brought this change] + + Added ECDSA defines for WinCNG (#245) - The automake conditional includes the correct Makefile.$name.inc per - the crypto library selection/detection done by configure. + Fixed missing defines preventing building using WinCNG + +GitHub (30 Mar 2018) +- [Will Cosgrove brought this change] + + Fix for _libssh2_rsa_new with OpenSSL 1.0.x - All non-autotools build system files in libssh2 are hardcoded to use - OpenSSL and do not get a conditional but at least there is some reuse - because they can all include the new Makefile.OpenSSL.inc. + missing d value assignment. -Daniel Stenberg (27 Oct 2013) -- [Salvador Fandino brought this change] +Will Cosgrove (20 Mar 2018) +- [Etienne Samson brought this change] - Set default window size to 2MB + A collection of small fixes (#198) - The default channel window size used until now was 256KB. This value is - too small and results on a bottleneck on real-life networks where - round-trip delays can easily reach 300ms. + * tests: Remove if-pyramids - The issue was not visible because the configured channel window size - was being ignored and a hard-coded value of ~22MB being used instead, - but that was fixed on a previous commit. + * tests: Switch run_command arguments - This patch just changes the default window size - (LIBSSH2_CHANNEL_WINDOW_DEFAULT) to 2MB. It is the same value used by - OpenSSH and in our opinion represents a good compromise between memory - used and transfer speed. + * tests: Make run_command a vararg function - Performance tests were run to determine the optimum value. The details - and related discussion are available from the following thread on the - libssh2 mailing-list: + * tests: Xcode doesn't obey CMake's test working directory - http://www.libssh2.org/mail/libssh2-devel-archive-2013-10/0018.shtml - http://article.gmane.org/gmane.network.ssh.libssh2.devel/6543 + * openssl: move manual AES-CTR cipher into crypto init - An excerpt follows: + * cmake: Move our include dir before all other include paths + +GitHub (15 Mar 2018) +- [Will Cosgrove brought this change] + + Fixes incorrect indexing of KEX prefs string - "I have been running some transfer test and measuring their speed. + After stripping out an invalid KEX pref entry, it would incorrectly advance again leaving invalid values in the list. + +Viktor Szakats (13 Mar 2018) +- tests: fix checksrc warnings - My setup was composed of a quad-core Linux machine running Ubuntu 13.10 - x86_64 with a LXC container inside. The data transfers were performed - from the container to the host (never crossing through a physical - network device). + Also: + * add 'static' qualifier to file-wide const buffers + * fix a non-ANSI C89 comment + * silence a mismatched fprintf() mask warning by adding a cast + +- cmake: recognize OpenSSL 1.1 .dll names - Network delays were simulated using the tc tool. And ping was used to - verify that they worked as intended during the tests. + Also fix some comment typos and a stray tab. + +- docs: update an URL [ci skip] + +Daniel Stenberg (12 Mar 2018) +- docs/SECURITY: the max embargo is 14 days now + +Viktor Szakats (12 Mar 2018) +- docs: spelling fixes [ci skip] - The operation performed was the equivalent to the following ssh command: + Closes https://github.com/libssh2/libssh2/pull/222 + +GitHub (12 Mar 2018) +- [Will Cosgrove brought this change] + + Fixed minor tabs/spacing issues + +- [Will Cosgrove brought this change] + + Update kex.c + +- [Will Cosgrove brought this change] + + Added basic bounds checking #206 - $ ssh container "dd bs=16K count=8K if=/dev/zero" >/dev/null + Basic bounds checking in ecdh_sha2_nistp() + +- [Will Cosgrove brought this change] + + Fixed Clang warning #206 - Though, establishment and closing of the SSH connection was excluded - from the timings. - - I run the tests several times transferring files of sizes up to 128MB - and the results were consistent between runs. - - The results corresponding to the 128MB transfer are available here: - - https://docs.google.com/spreadsheet/ccc?key=0Ao1yRmX6PQQzdG5wSFlrZl9HRWNET3ZyN0hnaGo5ZFE&usp=sharing - - It clearly shows that 256KB is too small as the default window size. - Moving to a 512MB generates a great improvement and after the 1MB mark - the returns rapidly diminish. Other factors (TCP window size, probably) - become more limiting than the channel window size - - For comparison I also performed the same transfers using OpenSSH. Its - speed is usually on par with that of libssh2 using a window size of 1MB - (even if it uses a 2MB window, maybe it is less aggressive sending the - window adjust msgs)." - - Signed-off-by: Salvador Fandino + Fixed possible garbage value for secret in an error case -- [Salvador brought this change] +- [Will Cosgrove brought this change] - _libssh2_channel_read: Honour window_size_initial - - _libssh2_channel_read was using an arbitrary hard-coded limit to trigger - the window adjusting code. The adjustment used was also hard-coded and - arbitrary, 15MB actually, which would limit the usability of libssh2 on - systems with little RAM. - - This patch, uses the window_size parameter passed to - libssh2_channel_open_ex (stored as remote.window_size_initial) plus the - buflen as the base for the trigger and the adjustment calculation. - - The memory usage when using the default window size is reduced from 22MB - to 256KB per channel (actually, if compression is used, these numbers - should be incremented by ~50% to account for the errors between the - decompressed packet sizes and the predicted sizes). + Fixed incorrect #if to #ifdef #206 - My tests indicate that this change does not impact the performance of - transfers across localhost or a LAN, being it on par with that of - OpenSSH. On the other hand, it will probably slow down transfers on - networks with high bandwidth*delay when the default window size - (LIBSSH2_CHANNEL_WINDOW_DEFAULT=256KB) is used. + When checking HAVE_OPAQUE_STRUCTS. + +Viktor Szakats (12 Mar 2018) +- src: suppress two checksrc warnings - Signed-off-by: Salvador Fandino + Ref: https://github.com/libssh2/libssh2/pull/235 -- [Salvador Fandino brought this change] +- src: address fopen() warnings, add missing copyright headers + + Ref: https://github.com/libssh2/libssh2/pull/235 - knownhosts: handle unknown key types +- src: replace sprintf() with snprintf() - Store but don't use keys of unsupported types on the known_hosts file. + Ref: https://github.com/libssh2/libssh2/pull/235 + +- src: fix checksrc warnings - Currently, when libssh2 parses a known_host file containing keys of some - type it doesn't natively support, it stops reading the file and returns - an error. + Use checksrc.pl from the curl project, with (for now) + suppressed long line warnings and indentation set to + 4 spaces. Fixes are whitespace for the most part. - That means, that the known_host file can not be safely shared with other - software supporting other key types (i.e. OpenSSH). + Warning count went down from 2704 to 12. - This patch adds support for handling keys of unknown type. It can read - and write them, even if they are never going to be matched. + Also fix codespell typos, two non-ANSI C89 comments + and a stray tab in include/libssh2.h. - At the source level the patch does the following things: + Ref: https://github.com/libssh2/libssh2/pull/235 + +- checksrc: add source style checker - - add a new unknown key type LIBSSH2_KNOWNHOST_KEY_UNKNOWN + This is a slightly extended version of this original source + from the curl project: + https://github.com/curl/curl/blob/8b754c430b9a4c51aa606c687ee5014faf7c7b06/lib/checksrc.pl - - add a new slot (key_type_name) on the known_host struct that is - used to store the key type in ascii form when it is not supported + This version adds the following options to customize it for + libssh2 (plus some whitespace formatting): - - parse correctly known_hosts entries with unknown key types and - populate the key_type_name slot + `-i` to override indentation spaces (2) + `-m` to override maximum line length (79) - - print correctly known_hosts entries of unknown type + Command-line used to check libssh2 sources: - - when checking a host key ignore keys that do not match the key + $ ./checksrc.pl -i4 -m500 *.c *.h - Fixes #276 + Closes https://github.com/libssh2/libssh2/pull/236 -- windows build: fix build errors +- src: add static qualifier - Fixes various link errors with VS2010 + To private, const strings. - Reported-by: "kdekker" - Fixes #272 + Closes https://github.com/libssh2/libssh2/pull/237 -- man page: add missing function argument +- [Will Cosgrove brought this change] + + Add support for ECDSA keys and host keys (#41) - for libssh2_userauth_publickey_fromfile_ex() + This commit lands full ECDSA key support when using the OpenSSL + backend. Which includes: - Reported-by: "pastey" + New KEX methods: + ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521 - Fixes #262 - -- [Salvador brought this change] - - Fix zlib deflate usage + Can now read OpenSSL formatted ECDSA key files. - Deflate may return Z_OK even when not all data has been compressed - if the output buffer becomes full. + Now supports known host keys of type ecdsa-sha2-nistp256. - In practice this is very unlikely to happen because the output buffer - size is always some KBs larger than the size of the data passed for - compression from the upper layers and I think that zlib never expands - the data so much, even on the worst cases. + New curve types: + NID_X9_62_prime256v1, NID_secp384r1, NID_secp521r1 - Anyway, this patch plays on the safe side checking that the output - buffer is not exhausted. + Default host key preferred ordering is now nistp256, nistp384, + nistp521, rsa, dss. - Signed-off-by: Salvador + Ref: https://github.com/libssh2/libssh2/issues/41 + + Closes https://github.com/libssh2/libssh2/pull/206 -- [Salvador brought this change] +GitHub (15 Dec 2017) +- [Will Cosgrove brought this change] - comp_method_zlib_decomp: Improve buffer growing algorithm - - The old algorithm was O(N^2), causing lots and lots of reallocations - when highly compressed data was transferred. + Fixed possible crash when decoding invalid data - This patch implements a simpler one that just doubles the buffer size - everytime it is exhausted. It results in O(N) complexity. + When trying to decode invalid data, it frees the buffer but doesn't nil it so the caller gets a junk memory pointer which they could potentially double free. + +- [Will Cosgrove brought this change] + + Remove call to OpenSSL_add_all_ciphers() - Also a smaller inflate ratio is used to calculate the initial size (x4). + Now lives in libssh2 init() from PR #189 + +- [Will Cosgrove brought this change] + + Fixed incorrect reference to decrypted block - Signed-off-by: Salvador + Fixed incorrectly copied memory from p->buf into init instead of from the decrypted buffer block. The only reason this worked was because the crypt() function decrypts the value in-place and overwrites p->buf. I'm working on a fork that no longer does this and exposed this bug. -- [Salvador brought this change] +Will Cosgrove (20 Oct 2017) +- [Pan brought this change] - Fix zlib usage + Fix typo in crypt.c (#218) + +Kamil Dudka (17 Oct 2017) +- session: avoid printing misleading debug messages - Data may remain in zlib internal buffers when inflate() returns Z_OK - and avail_out == 0. In that case, inflate has to be called again. + ... while throwing LIBSSH2_ERROR_EAGAIN out of session_startup() - Also, once all the data has been inflated, it returns Z_BUF_ERROR to - signal that the input buffer has been exhausted. + If the session runs in blocking mode, LIBSSH2_ERROR_EAGAIN never reaches + the libssh2 API boundary and, in non-blocking mode, these messages are + suppressed by the condition in _libssh2_error_flags() anyway. - Until now, the way to detect that a packet payload had been completely - decompressed was to check that no data remained on the input buffer - but that didn't account for the case where data remained on the internal - zlib buffers. + Closes #211 + +Viktor Szakats (15 Oct 2017) +- win32/GNUmakefile: allow customizing dll suffixes - That resulted in packets not being completely decompressed and the - missing data reappearing on the next packet, though the bug was masked - by the buffer allocation algorithm most of the time and only manifested - when transferring highly compressible data. + - New `LIBSSH2_DLL_SUFFIX` envvar will add a suffix to the generated + libssh2 dll name. Useful to add `-x64` to 64-bit builds so that + it can live in the same directory as the 32-bit one. By default + this is empty. - This patch fixes the zlib usage. + - New `LIBSSH2_DLL_A_SUFFIX` envvar to customize the suffix of the + generated import library (implib) for libssh2 .dll. It defaults + to `dll`, and it's useful to modify that to `.dll` to have the + standard naming scheme for mingw-built .dlls, i.e. `libssh2.dll.a`. - Signed-off-by: Salvador - -- [Salvador brought this change] - - _libssh2_channel_read: fix data drop when out of window + Ref: https://github.com/curl/curl/commit/aaa16f80256abc1463fd9374815130a165222257 - After filling the read buffer with data from the read queue, when the - window size was too small, "libssh2_channel_receive_window_adjust" was - called to increase it. In non-blocking mode that function could return - EAGAIN and, in that case, the EAGAIN was propagated upwards and the data - already read on the buffer lost. + Closes https://github.com/libssh2/libssh2/pull/215 + +- makefile.m32: allow to override gcc, ar and ranlib - The function was also moving between the two read states - "libssh2_NB_state_idle" and "libssh2_NB_state_created" both of which - behave in the same way (excepting a debug statment). + Allow to ovverride certain build tools, making it possible to + use LLVM/Clang to build libssh2. The default behavior is unchanged. + To build with clang (as offered by MSYS2), these settings can + be used: - This commit modifies "_libssh2_channel_read" so that the - "libssh2_channel_receive_window_adjust" call is performed first (when - required) and if everything goes well, then it reads the data from the - queued packets into the read buffer. + LIBSSH2_CC=clang + LIBSSH2_AR=llvm-ar + LIBSSH2_RANLIB=llvm-ranlib - It also removes the useless "libssh2_NB_state_created" read state. + Also adjust ranlib parameters to be compatible with LLVM/Clang's + ranlib tool. - Some rotted comments have also been updated. + Closes https://github.com/libssh2/libssh2/pull/214 + +GitHub (27 Sep 2017) +- [Will Cosgrove brought this change] + + Fixes out of bounds memory access (#210) - Signed-off-by: Salvador + If an invalid PEM file is read and the lines are longer than 128 characters it will go out of bounds and crash on line 91. -- [Salvador Fandino brought this change] +Will Cosgrove (11 Sep 2017) +- [Kamil Dudka brought this change] - window_size: redid window handling for flow control reasons + scp: do not NUL-terminate the command for remote exec (#208) - Until now, the window size (channel->remote.window_size) was being - updated just after receiving the packet from the transport layer. + It breaks SCP download/upload from/to certain server implementations. - That behaviour is wrong because the channel queue may grow uncontrolled - when data arrives from the network faster that the upper layer consumes - it. + The bug does not manifest with OpenSSH, which silently drops the NUL + byte (eventually with any garbage that follows the NUL byte) before + executing it. - This patch adds a new counter, read_avail, which keeps a count of the - bytes available from the packet queue for reading. Also, now the window - size is adjusted when the data is actually read by an upper layer. + Bug: https://bugzilla.redhat.com/1489736 + +GitHub (21 Aug 2017) +- [Viktor Szakats brought this change] + + openssl.c: remove no longer used variable (#204) - That way, if the upper layer stops reading data, the window will - eventually fill and the remote host will stop sending data. When the - upper layers reads enough data, a window adjust packet is delivered and - the transfer resumes. + after e378d2e30a40bd9bcee06dc3a4250f269098e200 + +- [Will Cosgrove brought this change] + + Fix for #188 (#189) - The read_avail counter is used to detect the situation when the remote - server tries to send data surpassing the window size. In that case, the - extra data is discarded. + * Update openssl.c - Signed-off-by: Salvador - -Peter Stuge (15 Sep 2013) -- configure.ac: Call zlib zlib and not libz in text but keep option names + * Create openssl.h -- configure.ac: Reorder --with-* options in --help output +Will Cosgrove (24 May 2017) +- [Marcel Raad brought this change] -- configure.ac: Rework crypto library detection + openssl: fix build with OpenSSL 1.1 API (#176) - This further simplifies adding new crypto libraries. + When building with OPENSSL_API_COMPAT=0x10100000L, OpenSSL_add_all_algorithms + and OpenSSL_add_all_ciphers don't exist. The corresponding functionality is + handled automatically with OpenSSL 1.1. -- Clean up crypto library abstraction in build system and source code - - libssh2 used to explicitly check for libgcrypt and default to OpenSSL. +- [Sune Bredahl brought this change] + + Add support for SHA256 hostkey fingerprints (#180) - Now all possible crypto libraries are checked for explicitly, making - the addition of further crypto libraries both simpler and cleaner. + Looks good, thanks! -- configure.ac: Add zlib to Requires.private in libssh2.pc if using zlib +GitHub (12 May 2017) +- [Will Cosgrove brought this change] -- Revert "Added Windows Cryptography API: Next Generation based backend" + Fix memory leak of crypt_ctx->h using openSSL 1.1+ (#177) - This reverts commit d385230e15715e67796f16f3e65fd899f21a638b. + Need to use EVP_CIPHER_CTX_free instead of EVP_CIPHER_CTX_reset. -Daniel Stenberg (7 Sep 2013) -- [Leif Salomonsson brought this change] +Marc Hoersken (2 Mar 2017) +- tests/openssh_server/authorized_keys: add key_rsa_encrypted.pub - sftp_statvfs: fix for servers not supporting statfvs extension - - Fixes issue arising when server does not support statfvs and or fstatvfs - extensions. sftp_statvfs() and sftp_fstatvfs() after this patch will - handle the case when SSH_FXP_STATUS is returned from server. +- tests: add simple test for passphrase-protected PEM file support -- [Marc Hoersken brought this change] +- os400qc3: enable passphrase-protected PEM file support using pem.c - Added Windows Cryptography API: Next Generation based backend +- pem: fix indentation and replace assert after 386e012292 -- [Kamil Dudka brought this change] +- [Keno Fischer brought this change] - partially revert "window_size: explicit adjustments only" + pem: add passphrase-protected PEM file support for libgcrypt and wincng - This partially reverts commit 03ca9020756a4e16f0294e5b35e9826ee6af2364 - in order to fix extreme slowdown when uploading to localhost via SFTP. + Since they use our own PEM parser which did not support encrypted + PEM files, trying to use such files on these backends failed. + Fix that by augmenting the PEM parser to support encrypted PEM files. + +- [Thomas brought this change] + + misc: use time constant implementation for AES CTR increment + +- [Thomas brought this change] + + wincng: add AES CTR mode support (aes128-ctr, aes192-ctr, aes256-ctr) + +- [Thomas brought this change] + + openssl: move shared AES-CTR code into misc + +Daniel Stenberg (20 Dec 2016) +- [Alex Crichton brought this change] + + kex: acknowledge error code from libssh2_dh_key_pair() - I was able to repeat the issue on RHEL-7 on localhost only. It did not - occur when uploading via network and it did not occur on a RHEL-6 box - with the same version of libssh2. + Fixes a segfault using ssh-agent on Windows - The problem was that sftp_read() used a read-ahead logic to figure out - the window_size, but sftp_packet_read() called indirectly from - sftp_write() did not use any read-ahead logic. - -- _libssh2_channel_write: client spins on write when window full + This commit fixes a segfault seen dereferencing a null pointer on + Windows when using ssh-agent. The problem ended up being that errors + weren't being communicated all the way through, causing null pointers to + be used when functions should have bailed out sooner. - When there's no window to "write to", there's no point in waiting for - the socket to become writable since it most likely just will continue to - be. + The `_libssh2_dh_key_pair` function for WinCNG was modified to propagate + errors, and then the two callsites in kex.c of + `diffie_hellman_sha{1,256}` were updated to recognize this error and + bail out. - Patch-by: ncm - Fixes #258 + Fixes #162 + Closes #163 -- _libssh2_channel_forward_cancel: avoid memory leaks on error +Alexander Lamaison (27 Nov 2016) +- [monnerat brought this change] + + Implement Diffie-Hellman computations in crypto backends. (#149) - Fixes #257 + Not all backends feature the low level API needed to compute a Diffie-Hellman + secret, but some of them directly implement Diffie-Hellman support with opaque + private data. The later approach is now generalized and backends are + responsible for all Diffie Hellman computations. + As a side effect, procedures/macros _libssh2_bn_rand and _libssh2_bn_mod_exp + are no longer needed outside the backends. -- _libssh2_packet_add: avoid using uninitialized memory +Peter Stuge (16 Nov 2016) +- acinclude.m4: The mbedtls crypto backend actually requires libmbedcrypto - In _libssh2_packet_add, called by _libssh2_packet_read, a call to - _libssh2_packet_send that is supposed to send a one-byte message - SSH_MSG_REQUEST_FAILURE would send an uninitialized byte upon re-entry - if its call to _send returns _EAGAIN. + Examples can't be linked with libmbedtls but need libmbedcrypto, and + any users of libssh2 which use libtool and libssh2.la would encounter + the same problem. - Fixes #259 + This changes the mbedtls detection to search for libmbedcrypto, which + is the actual dependency for the backend. -- _libssh2_channel_forward_cancel: accessed struct after free - - ... and the assignment was pointless anyway since the struct was about - to be freed. Bug introduced in dde2b094. +- acinclude.m4: Add CPPFLAGS=-I$prefix-dir/include in LIBSSH2_LIB_HAVE_LINKFLAGS - Fixes #268 + This is absolutely neccessary for header files to be found when + AC_LIB_HAVE_LINKFLAGS searches for libraries. -Peter Stuge (2 Jun 2013) -- [Marc Hoersken brought this change] +- acinclude.m4: Make saved variables in LIBSSH2_LIB_HAVE_LINKFLAGS uniform - Fixed compilation using mingw-w64 +- docs/HACKING.CRYPTO: Improve documentation for autoconf build system -- [Marc Hoersken brought this change] +Alexander Lamaison (16 Nov 2016) +- [Alex Arslan brought this change] - knownhost.c: use LIBSSH2_FREE macro instead of free - - Use LIBSSH2_FREE instead of free since - _libssh2_base64_encode uses LIBSSH2_ALLOC + Check for netinet/in.h in the tests cmake file (#148) -Daniel Stenberg (18 May 2013) -- [Matthias Kerestesch brought this change] +- [Patrick Monnerat brought this change] - libssh2_agent_init: init ->fd to LIBSSH2_INVALID_SOCKET + Define new Diffie-Hellman context for mbedTLS + +- [monnerat brought this change] + + Make libssh2 work again on os400. (#118) - ... previously it was left at 0 which is a valid file descriptor! + * os400: minimum supported OS version is now V6R1. + Do not log compiler informational messages. - Bug: https://trac.libssh2.org/ticket/265 + * Implement crypto backend specific Diffie-Hellman computation. - Fixes #265 - -- userauth_password: pass on the underlying error code + This feature is now needed on os400 because the QC3 library does not + implement bn_mod_exp() natively. Up to now, this function was emulated using + an RSA encryption, but commits ca5222ea819cc5ed797860070b4c6c1aeeb28420 and + 7934c9ce2a029c43e3642a492d3b9e494d1542be (CVE-2016-0787) broke the emulation + because QC3 only supports RSA exponents up to 512 bits. - _libssh2_packet_requirev() may return different errors and we pass that - to the parent instead of rewriting it. + Happily, QC3 supports a native API for Diffie-Hellman computation, with + opaque random value: this commit implements the use of this API and, as a + side effect, enables support of this feature for any other crypto backend that + would use it. - Bug: http://libssh2.org/mail/libssh2-devel-archive-2013-04/0029.shtml - Reported by: Cosmin + A "generic" Diffie-Hellman computation internal API supports crypto backends + not implementing their own: this generic API uses the same functions as before. + + * Fix typos in docs/HACKING.CRYPTO. -Peter Stuge (9 May 2013) -- [Marc Hoersken brought this change] +- [Peter Stuge brought this change] - libcrypt.c: Fix typo in _libssh2_rsa_sha1_sign() parameter type + acinclude.m4: Fixup OpenSSL EVP_aes_128_ctr() detection -Kamil Dudka (4 May 2013) -- configure.ac: replace AM_CONFIG_HEADER with AC_CONFIG_HEADERS - - Reported by: Quintus - Bug: https://trac.libssh2.org/ticket/261 +- [Peter Stuge brought this change] -Guenter Knauf (12 Apr 2013) -- Fixed copyright string for NetWare build. + configure.ac: Add --with-crypto= instead of many different --with-$backend + + The new --with-crypto option replaces the previous backend-specific + --with-{openssl,libgcrypt,mbedtls,wincng} options and fixes some issues. + + * libgcrypt or mbedtls would previously be used whenever found, even + if configure was passed --without-libgcrypt or --without-mbedtls. + + * If --with-$backend was specified then configure would not fail even + if that library could not be found, and would instead use whichever + crypto library was found first. + + The new option defaults to `auto`, which makes configure check for all + supported crypto libraries in turn, choosing the first one found, or + exiting with an error if none can be found. -Daniel Stenberg (9 Apr 2013) -- [Richard W.M. Jones brought this change] +- [Tony Kelman brought this change] - sftp: Add support for fsync (OpenSSH extension). + Build mbedtls from source on Travis (#133) - The new libssh2_sftp_fsync API causes data and metadata in the - currently open file to be committed to disk at the server. + * Revert "Revert "travis: Test mbedtls too"" - This is an OpenSSH extension to the SFTP protocol. See: + This reverts commit c4c60eac5ca756333034b07dd9e0b97741493ed3. - https://bugzilla.mindrot.org/show_bug.cgi?id=1798 + * travis: Build mbedtls from source on Travis + + Use TOOLCHAIN_OPTION when calling cmake on mbedtls + + * tests: only run DSA tests for non-mbedtls + + crypto backends -- [Richard W.M. Jones brought this change] +- [Peter Stuge brought this change] - sftp: statvfs: Along error path, reset the correct 'state' variable. + configure.ac src/Makefile.am: Remove dead AM_CONDITIONAL(OS400QC3) + + According to os400/README400 this backend can not be built + with configure+make, and the conditional is hard coded to false. -- [Richard W.M. Jones brought this change] +- [Peter Stuge brought this change] - sftp: seek: Don't flush buffers on same offset + configure.ac: Add -DNDEBUG to CPPFLAGS in non-debug builds - Signed-off-by: Richard W.M. Jones + There are a few uses of assert() in channel.c, sftp.c and transport.c. -Guenter Knauf (9 Feb 2013) -- Updated dependency libs. +- [Peter Stuge brought this change] -- Fixed tool macro names. + src/global.c: Fix conditional AES-CTR support + + Most of libssh2 already has conditional support for AES-CTR according to + the LIBSSH2_AES_CTR crypto backend #define, but global.c needed fixing. -Daniel Stenberg (29 Nov 2012) -- [Seth Willits brought this change] +- [Peter Stuge brought this change] - compiler warnings: typecast strlen in macros - - ... in macro parameters to avoid compiler warnings about lost precision. + src/crypto.h src/userauth.c: Fix conditional RSA support - Several macros in libssh2.h call strlen and pass the result directly to - unsigned int parameters of other functions, which warns about precision - loss because strlen returns size_t which is unsigned long on at least - some platforms (such as OS X). The fix is to simply typecast the - strlen() result to unsigned int. - -- libssh2.h: bump version to 1.4.4-DEV + Most of libssh2 already has conditional support for RSA according to + the LIBSSH2_RSA crypto backend #define, but crypto.h and userauth.c + needed a few small fixes. -Version 1.4.3 (27 Nov 2012) +- [Peter Stuge brought this change] -Daniel Stenberg (27 Nov 2012) -- RELEASE-NOTES: fixed for 1.4.3 + src/kex.c: Cast libssh2_sha{1,256}_update data arguments properly + + The update functions take a const unsigned char * but were called + with (const) char * in some places, causing unneccessary warnings. -- sftp_read: return error if a too large package arrives +- [Peter Stuge brought this change] -Peter Stuge (13 Nov 2012) -- Only define _libssh2_dsa_*() functions when building with DSA support + docs/HACKING.CRYPTO: Fix two type typos -Guenter Knauf (8 Nov 2012) -- Added .def file to output. +- [Sergei Trofimovich brought this change] -Kamil Dudka (1 Nov 2012) -- libssh2_hostkey_hash.3: update the description of return value + acinclude.m4: fix ./configure --with-libgcrypt - The function returns NULL also if the hash algorithm is not available. - -Guenter Knauf (24 Oct 2012) -- Fixed mode acciedently committed. + The change fixes passing of bogus gcrypt prefix. + Reproducible as: + + $ ./configure --with-libgcrypt + $ make V=1 + ... + /bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -Iyes/include -version-info 1:1:0 -no-undefined -export-symbols-regex '^libssh2_.*' -lgcrypt -lz -Lyes/lib -o libssh2.la -rpath /usr/local/lib channel.lo comp.lo crypt.lo hostkey.lo kex.lo mac.lo misc.lo packet.lo publickey.lo scp.lo session.lo sftp.lo userauth.lo transport.lo version.lo knownhost.lo agent.lo libgcrypt.lo pem.lo keepalive.lo global.lo -lgcrypt + ../libtool: line 7475: cd: yes/lib: No such file or directory + libtool: error: cannot determine absolute directory name of 'yes/lib' + + These + -Iyes/include + -Lyes/lib + come from libgcrypt code autodetection: + if test -n "$use_libgcrypt" && test "$use_libgcrypt" != "no"; then + LDFLAGS="$LDFLAGS -L$use_libgcrypt/lib" + CFLAGS="$CFLAGS -I$use_libgcrypt/include" + + I assume it's a typo to use yes/no flag as a prefix and changed + it to '$with_libgcrypt_prefix'. + + Reported-by: Mikhail Pukhlikov + Signed-off-by: Sergei Trofimovich -- Ignore generated file. +- [Zenju brought this change] -- Added hack to make use of Makefile.inc. + libssh2_sftp_init hang: last error not set - This should avoid further maintainance of the objects list. - -- Fixed MSVC NMakefile. + The problem is that the original if statement simply returns NULL, but does not set the session last error code. The consequence is that libssh2_sftp_init() also returns NULL and libssh2_session_last_errno(sshSession) == LIBSSH2_ERROR_NONE. - Added missing source files; added resource for DLL. - -Kamil Dudka (22 Oct 2012) -- examples: use stderr for messages, stdout for data + In my test the LIBSSH2_ERROR_EAGAIN is coming from sftp.c row 337: + if(4 != sftp->partial_size_len) + /* we got a short read for the length part */ + return LIBSSH2_ERROR_EAGAIN; - Reported by: Karel Srot - Bug: https://bugzilla.redhat.com/867462 + with "partial_size_len == 0". Not sure if this is expected. -- openssl: do not leak memory when handling errors +- [Aidan Hobson Sayers brought this change] + + docs: correctly describe channel_wait_eof - ,.. in aes_ctr_init(). Detected by Coverity. + channel_wait_eof waits for channel->remote.eof, which is set on + receiving a `SSH_MSG_CHANNEL_EOF` message. This message is sent + when a party has no more data to send on a channel. -- channel: fix possible NULL dereference +- [Zenju brought this change] + + Fix MSVC 14 compilation warning (#92) - ... in libssh2_channel_get_exit_signal(). Detected by Coverity. + 1> sftp.c + 1>libssh2-files\src\sftp.c(3393): warning C4456: declaration of 'retcode' hides previous local declaration + 1> libssh2-files\src\sftp.c(3315): note: see declaration of 'retcode' -- Revert "aes: the init function fails when OpenSSL has AES support" +- [Salvador Fandino brought this change] + + LIBSSH2_ERROR_CHANNEL_WINDOW_FULL: add new error code - This partially reverts commit f4f2298ef3635acd031cc2ee0e71026cdcda5864. + In order to signal that the requested operation can not succeed + because the receiving window had been exhausted, the error code + LIBSSH2_ERROR_BUFFER_TOO_SMALL has been reused but I have found + that in certain context it may be ambigous. - We need to use the EVP_aes_???_ctr() functions in FIPS mode. - -- crypt: use hard-wired cipher block sizes consistently + This patch introduces a new error code, + LIBSSH2_ERROR_CHANNEL_WINDOW_FULL, exclusive to signal that condition. -- openssl: do not ignore failure of EVP_CipherInit() +- [Salvador Fandino brought this change] -- kex: do not ignore failure of libssh2_md5_init() + channel_wait_eof: handle receive window exhaustion - The MD5 algorithm is disabled when running in FIPS mode. + Until now, in blocking mode, if the remote receiving window is + exhausted this function hangs forever as data is not read and the + remote side just keeps waiting for the window to grow before sending + more data. + + This patch, makes this function check for that condition and abort + with an error when it happens. -Daniel Stenberg (21 Aug 2012) -- [Peter Krempa brought this change] +- [Salvador Fandino brought this change] - known_hosts: Fail when parsing unknown keys in known_hosts file. + channel_wait_closed: don't fail when unread data is queued - libssh2_knownhost_readfile() silently ignored problems when reading keys - in unsupported formats from the known hosts file. When the file is - written again from the internal structures of libssh2 it gets truntcated - to the point where the first unknown key was located. + This function was calling channel_wait_eof to ensure that the EOF + packet has already been received, but that function also checks that + the read data queue is empty before reporting the EOF. That caused + channel_wait_closed to fail with a LIBSSH2_ERROR_INVAL when some data + was queued even after a successful call to libssh2_channel_wait_eof. - * src/knownhost.c:libssh2_knownhost_readfile() - return error if key - parsing fails + This patch changes libssh2_channel_wait_closed to look directly into + channel->remote.eof so that both libssh2_channel_wait_eof and + libssh2_channel_wait_closed bahave consistently. -- AUTHORS: synced with 42fec44c8a4 - - 31 recent authors added +- [Salvador Fandino brought this change] -- [Dave Hayden brought this change] + channel_wait_eof: fix debug message - compression: add support for zlib@openssh.com - - Add a "use_in_auth" flag to the LIBSSH2_COMP_METHOD struct and a - separate "zlib@openssh.com" method, along with checking session->state - for LIBSSH2_STATE_AUTHENTICATED. Appears to work on the OpenSSH servers - I've tried against, and it should work as before with normal zlib - compression. +Daniel Stenberg (25 Oct 2016) +- libssh2.h: start working on 1.8.1 -- [Dmitry Smirnov brought this change] +Version 1.8.0 (25 Oct 2016) - configure: gcrypt doesn't come with pkg-config support +Daniel Stenberg (25 Oct 2016) +- RELEASE-NOTES: adjusted for 1.8.0 + +Kamil Dudka (20 Oct 2016) +- Revert "aes: the init function fails when OpenSSL has AES support" - ... so use plain old -lgcrypt to the linker to link with it. + This partially reverts commit f4f2298ef3635acd031cc2ee0e71026cdcda5864 + because it caused the compatibility code to call initialization routines + redundantly, leading to memory leakage with OpenSSL 1.1 and broken curl + test-suite in Fedora: - Fixes #225 + 88 bytes in 1 blocks are definitely lost in loss record 5 of 8 + at 0x4C2DB8D: malloc (vg_replace_malloc.c:299) + by 0x72C607D: CRYPTO_zalloc (mem.c:100) + by 0x72A2480: EVP_CIPHER_meth_new (cmeth_lib.c:18) + by 0x4E5A550: make_ctr_evp.isra.0 (openssl.c:407) + by 0x4E5A8E8: _libssh2_init_aes_ctr (openssl.c:471) + by 0x4E5BB5A: libssh2_init (global.c:49) -- sftp_read: Value stored to 'next' is never read - - Detected by clang-analyzer +Daniel Stenberg (19 Oct 2016) +- [Charles Collicutt brought this change] -- publickey_init: errors are negative, fix check + libssh2_wait_socket: Fix comparison with api_timeout to use milliseconds (#134) - Detected by clang-analyzer. + Fixes #74 -- [Maxime Larocque brought this change] +- [Charles Collicutt brought this change] - session_free: wrong variable used for keeping state + Set err_msg on _libssh2_wait_socket errors (#135) + +- Revert "travis: Test mbedtls too" - If libssh2_session_free is called without the channel being freed - previously by libssh2_channel_free a memory leak could occur. + This reverts commit 3e6de50a24815e72ec5597947f1831f6083b7da8. - A mismatch of states variables in session_free() prevent the call to - libssh2_channel_free function. session->state member is used instead of - session->free_state. + Travis doesn't seem to support the mbedtls-dev package + +- maketgz: support "only" to only update version number locally - It causes a leak of around 600 bytes on every connection on my systems - (Linux, x64 and PPC). + and fix the date output locale + +- configure: make the --with-* options override the OpenSSL default - (Debugging done under contract for Accedian Networks) + ... previously it would default to OpenSSL even with the --with-[crypto] + options used unless you specificly disabled OpenSSL. Now, enabling another + backend will automatically disable OpenSSL if the other one is found. + +- [Keno Fischer brought this change] + + docs: Add documentation on new cmake/configure options + +- [Keno Fischer brought this change] + + configure: Add support for building with mbedtls + +- [wildart brought this change] + + travis: Test mbedtls too + +- [wildart brought this change] + + crypto: add support for the mbedTLS backend - Fixes #246 + Closes #132 -Guenter Knauf (29 Jun 2012) -- Small NetWare makefile tweak. +- [wildart brought this change] -- Some small Win32 makefile fixes. + cmake: Add CLEAR_MEMORY option, analogously to that for autoconf -Daniel Stenberg (19 Jun 2012) -- libssh2_userauth_publickey_fromfile_ex.3: mention publickey == NULL +- README.md: fix link typo -- comp_method_zlib_decomp: handle Z_BUF_ERROR when inflating +- README: markdown version to look nicer on github + +Viktor Szakats (5 Sep 2016) +- [Taylor Holberton brought this change] + + openssl: add OpenSSL 1.1.0 compatibility + +Daniel Stenberg (4 Sep 2016) +- [Antenore Gatta brought this change] + + tests: HAVE_NETINET_IN_H was not defined correctly (#127) - When using libssh2 to perform an SFTP file transfer from the "JSCAPE MFT - Server" (http://www.jscape.com) the transfer failed. The default JSCAPE - configuration is to enforce zlib compression on SSH2 sessions so the - session was compressed. The relevant part of the debug trace contained: + Fixes #125 + +- SECURITY: fix web site typo + +- SECURITY: security process + +GitHub (14 Aug 2016) +- [Alexander Lamaison brought this change] + + Basic dockerised test suite. - [libssh2] 1.052750 Transport: unhandled zlib error -5 - [libssh2] 1.052750 Failure Event: -29 - decompression failure + This introduces a test suite for libssh2. It runs OpenSSH in a Docker + container because that works well on Windows (via docker-machine) as + well as Linux. Presumably it works on Mac too with docker-machine, but + I've not tested that. - The trace comes from comp_method_zlib_decomp() in comp.c. The "unhandled - zlib error -5" is the status returned from the zlib function - inflate(). The -5 status corresponds to "Z_BUF_ERROR". + Because the test suite is docker-machine aware, you can also run it + against a cloud provider, for more realistic network testing, by setting + your cloud provider as your active docker machine. The Appveyor CI setup + in this commit does that because Appveyor doesn't support docker + locally. + +Kamil Dudka (3 Aug 2016) +- [Viktor Szakats brought this change] + + misc.c: Delete unused static variables - The inflate() function takes a pointer to a z_stream structure and - "inflates" (decompresses) as much as it can. The relevant fields of the - z_stream structure are: + Closes #114 + +Daniel Stenberg (9 Apr 2016) +- [Will Cosgrove brought this change] + + Merge pull request #103 from willco007/patch-2 - next_in - pointer to the input buffer containing compressed data - avail_in - the number of bytes available at next_in - next_out - pointer to the output buffer to be filled with uncompressed - data - avail_out - how much space available at next_out + Fix for security issue CVE-2016-0787 + +Alexander Lamaison (2 Apr 2016) +- [Zenju brought this change] + + Fix MSVC 14 compilation errors - To decompress data you set up a z_stream struct with the relevant fields - filled in and pass it to inflate(). On return the fields will have been - updated so next_in and avail_in show how much compressed data is yet to - be processed and next_out and avail_out show how much space is left in - the output buffer. + For _MSC_VER == 1900 these macros are not needed and create problems: - If the supplied output buffer is too small then on return there will be - compressed data yet to be processed (avail_in != 0) and inflate() will - return Z_OK. In this case the output buffer must be grown, avail_out - updated and inflate() called again. - If the supplied output buffer was big enough then on return the - compressed data will have been exhausted (avail_in == 0) and inflate() - will return Z_OK, so the data has all been uncompressed. - There is a corner case where inflate() makes no progress. That is, there - may be unprocessed compressed data and space available in the output - buffer and yet the function does nothing. In this case inflate() will - return Z_BUF_ERROR. From the zlib documentation and the source code it - is not clear under what circumstances this happens. It could be that it - needs to write multiple bytes (all in one go) from its internal state to - the output buffer before processing the next chunk of input but but - can't because there is not enough space (though my guesses as to the - cause are not really relevant). Recovery from Z_BUF_ERROR is pretty - simple - just grow the output buffer, update avail_out and call - inflate() again. + 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition (compiling source file libssh2-files\src\mac.c) - The comp_method_zlib_decomp() function does not handle the case when - inflate() returns Z_BUF_ERROR. It treats it as a non-recoverable error - and basically aborts the session. + 1> \win32\libssh2_config.h(27): note: see previous definition of 'snprintf' (compiling source file libssh2-files\src\mac.c) - Fixes #240 + 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration (compiling source file libssh2-files\src\mac.c) -Guenter Knauf (12 Jun 2012) -- MinGW makefile tweaks. - - Use GNU tools when compiling on Linux. - Fixed dist and dev targets. +Daniel Stenberg (26 Mar 2016) +- [Brad Harder brought this change] -- NetWare makefile tweaks. - - Changed to use Windows commandline tools instead of - GNU tools when compiling on Windows. Fixed dist and - dev targets. Enabled nlmconv error for unresolved - symbols. + _libssh2_channel_open: speeling error fixed in channel error message -Daniel Stenberg (11 Jun 2012) -- Revert "config.rpath: generated file, no need to keep in git" +Alexander Lamaison (15 Mar 2016) +- Link with crypt32.lib on Windows. - This reverts commit 1ac7bd09cc685755577fb2c8829adcd081e7ab3c. + Makes linking with static OpenSSL work again. Although it's not + required for dynamic OpenSSL, it does no harm. - This file still used by lib/*m4 functions so we need to keep the file - around. + Fixes #98. -- BINDINGS: added PySsh2, a Python-ctypes binding - -Guenter Knauf (8 Jun 2012) -- Fixed MinGW debug build. +- [Craig A. Berry brought this change] -Daniel Stenberg (5 Jun 2012) -- BINDINGS: Added the Cocoa/Objective-C one - - ... and sorted the bindings after the languages, alphabetically + Tweak VMS help file building. - Reported by: Mike Abdullah + Primarily this is handling cases where top-level files moved into + the docs/ directory. I also corrected a typo and removed the + claim that libssh2 is public domain. -- BINDINGS: document the bindings we know of +- [Craig A. Berry brought this change] -Guenter Knauf (4 Jun 2012) -- Fixed LIBSSH2_INT64_T_FORMAT macro. + Build with standard stat structure on VMS. - Usually a format macro should hold the whole format, otherwise - it should be named a prefix. Also fixed usage of this macro in - scp.c for a signed var where it was used as prefix for unsigned. + This gets us large file support, is available on any VMS release + in the last decade and more, and gives stat other modern features + such as 64-bit ino_t. -- Removed obsolete define from makefiles. +- [Craig A. Berry brought this change] -- Renamed NetWare makefiles. - -- Renamed NetWare makefiles. - -- Synced MinGW makefiles with 56c64a6..39e438f. + Update vms/libssh2_config.h. - Also synced MinGW test makefile with b092696..f8cb874. + VMS does have stdlib.h, gettimeofday(), and OpenSSL. The latter + is appropriate to hard-wire in the configuration because it's + installed by default as part of the base operating system and + there is currently no libgcrypt port. -Peter Stuge (30 May 2012) -- Revert "sftp: Don't send attrs.permissions on read-only SSH_FXP_OPEN" - - This reverts commit 04e79e0c798674a0796be8a55f63dd92e6877790. +- [Craig A. Berry brought this change] -- sftp: Don't send attrs.permissions on read-only SSH_FXP_OPEN - - This works around a protocol violation in the ProFTPD 1.3.4 mod_sftp - server, as reported by Will Cosgrove in: - - http://libssh2.org/mail/libssh2-devel-archive-2012-05/0079.shtml + VMS can't use %zd for off_t format. - Based on a suggested fix by TJ Saunders in: - - http://libssh2.org/mail/libssh2-devel-archive-2012-05/0104.shtml + %z is a C99-ism that VMS doesn't currently have; even though the + compiler is C99-compliant, the library isn't quite. The off_t used + for the st_size element of the stat can be 32-bit or 64-bit, so + detect what we've got and pick a format accordingly. -Guenter Knauf (28 May 2012) -- Try to detect OpenSSL build type automatically. +- [Craig A. Berry brought this change] + + Normalize line endings in libssh2_sftp_get_channel.3. - Also fixed recently added libgdi32 linkage which is only - required when OpenSSL libs are linked statically. + Somehow it got Windows-style CRLF endings so convert to just LF, + for consistency as well as not to confuse tools that will regard + the \r as content (e.g. the OpenVMS help librarian). -Daniel Stenberg (25 May 2012) -- config.rpath: generated file, no need to keep in git +Dan Fandrich (29 Feb 2016) +- libgcrypt: Fixed a NULL pointer dereference on OOM -Guenter Knauf (22 May 2012) -- Updated dependency libary versions. +Daniel Stenberg (24 Feb 2016) +- [Viktor Szakats brought this change] -Daniel Stenberg (18 May 2012) -- 1.4.3: towards the future + url updates, HTTP => HTTPS + + Closes #87 -Version 1.4.2 (18 May 2012) +Dan Fandrich (23 Feb 2016) +- RELEASE-NOTES: removed some duplicated names -Daniel Stenberg (18 May 2012) -- RELEASE-NOTES: synced with 92a9f952794 +Version 1.7.0 (23 Feb 2016) -Alexander Lamaison (15 May 2012) -- win32/libssh2_config.h: Remove hardcoded #define LIBSSH2_HAVE_ZLIB. - - Rationale: Everything else in this file states a fact about the win32 - platform that is unconditional for that platform. There is nothing - unconditional about the presence of zlib. It is neither included with - Windows nor with the platform SDK. Therefore, this is not an appropriate - place to assert its presence. Especially as, once asserted, it cannot be - overridden using a compiler flag. - - In contrast, if it is omitted, then it can easily be reasserted by adding - a compiler flag defining LIBSSH2_HAVE_ZLIB. +Daniel Stenberg (23 Feb 2016) +- web: the site is now HTTPS -Daniel Stenberg (14 May 2012) -- RELEASE-NOTES: synced with 69a3354467c +- RELEASE-NOTES: 1.7.0 release -- _libssh2_packet_add: SSH_MSG_CHANNEL_REQUEST default to want_reply +- diffie_hellman_sha256: convert bytes to bits - RFC4254 says the default 'want_reply' is TRUE but the code defaulted to - FALSE. Now changed. + As otherwise we get far too small numbers. - Fixes #233 + Reported-by: Andreas Schneider + + CVE-2016-0787 -- gettimeofday: no need for a replacement under cygwin +Alexander Lamaison (18 Feb 2016) +- Allow CI failures with VS 2008 x64. - Fixes #224 + Appveyor doesn't support this combination. -Alexander Lamaison (13 May 2012) -- Prevent sftp_packet_read accessing freed memory. +Daniel Stenberg (16 Feb 2016) +- [Viktor Szakats brought this change] + + GNUmakefile: list system libs after user libs - sftp_packet_add takes ownership of the packet passed to it and (now that we - handle zombies) might free the packet. sftp_packet_read uses the packet type - byte as its return code but by this point sftp_packet_add might have freed - it. This change fixes the problem by caching the packet type before calling - sftp_packet_add. + Otherwise some referenced WinSock functions will fail to + resolve when linking against LibreSSL 2.3.x static libraries + with mingw. - I don't understand why sftp_packet_read uses the packet type as its return - code. A future change might get rid of this entirely. + Closes #80 -Daniel Stenberg (12 May 2012) -- sftp_packet_flush: flush zombies too - - As this function is called when the SFTP session is closed, it needs to - also kill all zombies left in the SFTP session to avoid leaking memory - just in case some zombie would still be in there. +- [Viktor Szakats brought this change] -- sftp_packetlist_flush: zombies must not have responses already + openssl: apply new HAVE_OPAQUE_STRUCTS macro - When flushing the packetlist, we must only add the request as a zombie - if no response has already been received. Otherwise we could wrongly - make it a zombie even though the response was already received and then - we'd get a zombie stuck there "forever"... + Closes #81 -- sftp_read: on EOF remove packet before flush - - Since the sftp_packetlist_flush() function will move all the existing - FXP_READ requests in this handle to the zombie list we must first remove - this just received packet as it is clearly not a zombie. +- [Viktor Szakats brought this change] -- sftp_packet_require: sftp_packet_read() returning 0 is not an error + openssl: fix LibreSSL support after OpenSSL 1.1.0-pre1/2 support + +Alexander Lamaison (14 Feb 2016) +- sftp.h: Fix non-C90 type. - Exactly as the comment in the code said, checking the return code from - sftp_packet_read() with <= was wrong and it should be < 0. With the new - filtering on incoming packets that are "zombies" we can now see this - getting zero returned. + uint64_t does not exist in C90. Use libssh2_uint64_t instead. -- sftp_packetlist_flush: only make it zombie if it was sent +- Exclude sshd tests from AppVeyor. - The list of outgoing packets may also contain packets that never were - sent off and we better not make them zombies too. + They fail complaining that sshd wasn't invoked with an absolute path. -- [Alexander Lamaison brought this change] +- Test on more versions of Visual Studio. - Mark outstanding read requests after EOF as zombies. +- Fix Appveyor builds. + +Daniel Stenberg (14 Feb 2016) +- [Viktor Szakats brought this change] + + openssl: add OpenSSL 1.1.0-pre3-dev compatibility - In order to be fast, sftp_read sends many read requests at once. With a small - file, this can mean that when EOF is received back, many of these requests are - still outstanding. Responses arriving after we close the file and abandon the - file handle are queued in the SFTP packet queue and never collected. This - causes transfer speed to drop as a progressively longer queue must be searched - for every packet. + by using API instead of accessing an internal structure. - This change introduces a zombie request-ID list in the SFTP session that is - used to recognise these outstanding requests and prevent them being added to - the queue. + Closes #83 -Peter Stuge (23 Apr 2012) -- [Rafael Kitover brought this change] +- RELEASE-NOTES: synced with 996b04ececdf - Update win32/GNUmakefile to use OpenSSL 1.0.1a - - libcrypto on win32 now depends on gdi32.dll, so move the OpenSSL LDLIBS - block to before the compiler definitions, so that libcrypto gets added - first, and then add -lgdi32 into the following common LDLIBS for gcc. +- include/libssh2.h: next version is 1.7.0 -Guenter Knauf (23 Apr 2012) -- Changed 'Requires' to 'Requires.private'. - - Only static builds need to link against the crypto libs. +- configure: build "silent" if possible -- Fixed 'Requires:' names. - - The 'Requires:' line lists the names of the .pc files. +- sftp: re-indented some minor stuff -- Added 'Requires:' line to libssh2.pc. +- [Jakob Egger brought this change] + + sftp.c: ensure minimum read packet size - This is necessary so that other libs which lookup libssh2 info - via pkg-config can add the right crypto lib dependencies. + For optimum performance we need to ensure we don't request tiny packets. -- Updated dependency lib versions. +- [Jakob Egger brought this change] -Peter Stuge (18 Apr 2012) -- configure.ac: Add option to disable build of the example applications - - Examples are built by default. Any of the following options on the - configure command line will skip building them: - - --disable-examples-build - --enable-examples-build=no - --enable-examples-build=false + sftp.c: Explicit return values & sanity checks -- userauth.c: fread() from public key file to correctly detect any errors - - If the filename parameter for file_read_publickey() was the name of a - directory instead of a file then libssh2 would spin trying to fgetc() - from the FILE * for the opened directory when trying to determine the - length of the encoded public key, since fgetc() can't report errors. - - Use fread() instead to correctly detect this error condition along - with many others. +- [Jakob Egger brought this change] + + sftp.c: Check Read Packet File Offset - This fixes the problem reported in - http://www.libssh2.org/mail/libssh2-devel-archive-2012-04/0021.shtml + This commit adds a simple check to see if the offset of the read + request matches the expected file offset. - Reported-by: Oleksiy Zagorskyi + We could try to recover, from this condition at some point in the future. + Right now it is better to return an error instead of corrupted data. -- Return LIBSSH2_ERROR_SOCKET_DISCONNECT on EOF when reading banner +- [Jakob Egger brought this change] -Guenter Knauf (17 Apr 2012) -- Fixed copyright year. + sftp.c: Don't return EAGAIN if data was written to buffer -- Updated dependency lib versions in static makefiles. +- [Jakob Egger brought this change] -Daniel Stenberg (6 Apr 2012) -- version: bump to 1.4.2 + sftp.c: Send at least one read request before reading - We're on the 1.4.2 track now (at least) - -Version 1.4.1 (4 Apr 2012) + This commit ensures that we have sent at least one read request before + we try to read data in sftp_read(). + + Otherwise sftp_read() would return 0 bytes (indicating EOF) if the + socket is not ready for writing. -Daniel Stenberg (4 Apr 2012) -- RELEASE-NOTES: updated for 1.4.1 release +- [Jakob Egger brought this change] -- always do "forced" window updates + sftp.c: stop reading when buffer is full - When calling _libssh2_channel_receive_window_adjust() internally, we now - always use the 'force' option to prevent libssh2 to avoid sending the - update if the update isn't big enough. + Since we can only store data from a single chunk in filep, + we have to stop receiving data as soon as the buffer is full. - It isn't fully analyzed but we have seen corner cases which made a - necessary window update not get send due to this and then the other side - doesn't send data our side then sits waiting for forever. + This adresses the following bug report: + https://github.com/libssh2/libssh2/issues/50 -- channel_read: force window adjusts! +Salvador Fandiño (21 Jan 2016) +- agent_disconnect_unix: unset the agent fd after closing it - if there's not enough room to receive the data that's being requested, - the window adjustment needs to be sent to the remote and thus the force - option has to be used. _libssh2_channel_receive_window_adjust() would - otherwise "queue" small window adjustments for a later packet but that - is really terribly for the small buffer read that for example is the - final little piece of a very large file as then there is no logical next - packet! + "agent_disconnect_unix", called by "libssh2_agent_disconnect", was + leaving the file descriptor in the agent structure unchanged. Later, + "libssh2_agent_free" would call again "libssh2_agent_disconnect" under + the hood and it would try to close again the same file descriptor. In + most cases that resulted in just a harmless error, but it is also + possible that the file descriptor had been reused between the two + calls resulting in the closing of an unrelated file descriptor. - Reported by: Armen Babakhanian - Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0130.shtml + This patch sets agent->fd to LIBSSH2_INVALID_SOCKET avoiding that + issue. + + Signed-off-by: Salvador Fandiño -- [Paul Howarth brought this change] +Daniel Stenberg (18 Jan 2016) +- [Patrick Monnerat brought this change] - aes: the init function fails when OpenSSL has AES support + os400qc3: support encrypted private keys - The internal init function only worked fine when the configure script - didn't detect the OpenSSL AES_CTR function! - - Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0111.shtml - Reported by: Paul Howarth - -- [Matthew Booth brought this change] + PKCS#8 EncryptedPrivateKeyinfo structures are recognized and decoded to get + values accepted by the Qc3 crypto library. - transport_send: Finish in-progress key exchange before sending data - - _libssh2_channel_write() first reads outstanding packets before writing - new data. If it reads a key exchange request, it will immediately start - key re-exchange, which will require sending a response. If the output - socket is full, this will result in a return from - _libssh2_transport_read() of LIBSSH2_ERROR_EAGAIN. In order not to block - a write because there is no data to read, this error is explicitly - ignored and the code continues marshalling a packet for sending. When it - is sent, the remote end immediately drops the connection because it was - expecting a continuation of the key exchange, but got a data packet. - - This change adds the same check for key exchange to - _libssh2_transport_send() that is in _libssh2_transport_read(). This - ensures that key exchange is completed before any data packet is sent. +- [Patrick Monnerat brought this change] -- channel_write: acknowledge transport errors - - When draining data off the socket with _libssh2_transport_read() (which - in turn has to be done so that we can be sure to have read any possible - window-increasing packets), this code previously ignored errors which - could lead to nasty loops. Now all error codes except EAGAIN will cause - the error to be returned at once. + os400qc3: New PKCS#5 decoder - Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0068.shtml - Reported by: Matthew Booth - -- [Steven Dake brought this change] + The Qc3 library is not able to handle PKCS#8 EncryptedPrivateKeyInfo structures + by itself. It is only capable of decrypting the (encrypted) PrivateKeyInfo + part, providing a key encryption key and an encryption algorithm are given. + Since the encryption key and algorithm description part in a PKCS#8 + EncryptedPrivateKeyInfo is a PKCS#5 structure, such a decoder is needed to + get the derived key method and hash, as well as encryption algorith and + initialisation vector. - In examples/x11.c, Make sure sizeof passed to read operation is correct - - sizeof(buf) expands to 8 or 4 (since its a pointer). This variable may - have been static in the past, leading to this error. - - Signed-off-by: Steven Dake +- [Patrick Monnerat brought this change] -- [Steven Dake brought this change] + os400qc3: force continuous update on non-final hash/hmac computation - Fix suspicious sizeof usage in examples/x11.c - - In the x11 example, sizeof(buf) = 8UL (on x86_64), when this should - probably represent the buffer size available. I am not sure how to - test that this change is actually correct, however. - - Signed-off-by: Steven Dake +- [Patrick Monnerat brought this change] -- sftp_packet_read: follow-up fix for EAGAIN/window adjust + os400qc3: Be sure hmac keys have a minimum length - The commit in 7194a9bd7ba45 wasn't complete. This change makes sure - variables are initialized properly before used in the EAGAIN and window - adjust cases. + The Qc3 library requires a minimum key length depending on the target + hash algorithm. Append binary zeroes to the given key if not long enough. + This matches RFC 2104 specifications. -- sftp_packet_add: use named error code instead of number +- [Patrick Monnerat brought this change] -- sftp_packet_add: verify the packet before accepting it + os400qc3: Slave descriptor for key encryption key - In order to bail out as quickly as possible when things are wrong and - out of sync, make sure the SFTP message is one we understand. + The Qc3 library requires the key encryption key to exist as long as + the encrypted key is used. Its descriptor token is then kept as an + "encrypted key slave" for recursive release. -- SFTP: preserve the original error code more - - Lots of places in the code translated the original error into the more - generic LIBSSH2_ERROR_SOCKET_TIMEOUT but this turns out to distort the - original error reason a lot and makes tracking down the real origin of a - problem really hard. This change makes the original error code be - preserved to a larger extent when return up to the parent function. +- [Patrick Monnerat brought this change] -- sftp_packet_read: adjust window size as necessary - - Commit 03ca9020756 tried to simplify the window sizing logic but broke - SFTP readdir as there was no window sizing code left there so large - directory listings no longer worked. - - This change introduces window sizing logic to the sftp_packet_read() - function so that it now tells the remote about the local size having a - window size that suffice when it is about to ask for directory data. - - Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0069.shtml - Reported by: Eric + os400qc3.c: comment PEM/DER decoding -- [Steven Dake brought this change] +- [Patrick Monnerat brought this change] - Tell C compiler we don't care about return code of libssh2_init - - The call of libssh2_init returns a return code, but nothing could be done - within the _libssh2_init_if_needed execution path. - - Signed-off-by: Steven Dake + os400qc3.c: improve ASN.1 header byte checks -- [Steven Dake brought this change] +- [Patrick Monnerat brought this change] - Add comment indicating a resource leak is not really a resource leak - - While possibly obvious to those investigating the code, coverity complains - about this out of scope leak. - - Signed-off-by: Steven Dake + os400qc3.c: improve OID matching -- [Steven Dake brought this change] +- [Patrick Monnerat brought this change] - Use safer snprintf rather then sprintf in scp_send() - - Signed-off-by: Steven Dake + os400: os400qc3.c: replace malloc by LIBSSH2_ALLOC or alloca where possible -- [Steven Dake brought this change] +- [Patrick Monnerat brought this change] - Use safer snprintf rather then sprintf in scp_recv() - - While the buffer is indeed allocated to a safe length, better safe then sorry. - - Signed-off-by: Steven Dake + os400: asn1_new_from_bytes(): use data from a single element only -- [Steven Dake brought this change] +- [Patrick Monnerat brought this change] - use snprintf in knownhost_writeline() rather then sprintf - - Although the function checks the length, if the code was in error, there - could potentially be a buffer overrun with the use of sprintf. Instead replace - with snprintf. - - Signed-off-by: Steven Dake + os400: fix an ILE/RPG prototype -- [Steven Dake brought this change] +- [Patrick Monnerat brought this change] - Add tracing to print packets left on session at libssh2_session_free - - Signed-off-by: Steven Dake + os400: implement character encoding conversion support -Peter Stuge (2 Mar 2012) -- Define and use LIBSSH2_INVALID_SOCKET instead of INVALID_SOCKET - - INVALID_SOCKET is a special value in Windows representing a - non-valid socket identifier. We were #defining this to -1 on - non-Windows platforms, causing unneccessary namespace pollution. - Let's have our own identifier instead. +- [Patrick Monnerat brought this change] + + os400: do not miss some external prototypes - Thanks to Matt Lawson for pointing this out. + Build procedure extproto() did not strip braces from header files, thus + possibly prepended them to true prototypes. This prevented the prototype to + be recognized as such. + The solution implemented here is to map braces to semicolons, effectively + considering them as potential prototype delimiters. -- nw/Makefile.netware: Fix project name typo to avoid needless confusion +- [Patrick Monnerat brought this change] -- example/x11: Set raw terminal mode manually instead of with cfmakeraw() - - OpenSolaris has no cfmakeraw() so to make the example more portable - we simply do the equivalent operations on struct termios ourselves. - - Thanks to Tom Weber for reporting this problem, and finding a solution. + os400: Really add specific README -Daniel Stenberg (17 Feb 2012) -- sftp_write: cannot return acked data *and* EAGAIN - - Whenever we have acked data and is about to call a function that *MAY* - return EAGAIN we must return the number now and wait to get called - again. Our API only allows data *or* EAGAIN and we must never try to get - both. +- [Patrick Monnerat brought this change] -Peter Stuge (13 Feb 2012) -- example/x11: Build only when sys/un.h is found by configure - - The example can't be built on systems without AF_UNIX sockets. + os400: Add specific README and include new files in dist tarball -Daniel Stenberg (10 Feb 2012) -- [Alexander Lamaison brought this change] +- [Patrick Monnerat brought this change] - Simplified sftp_read. - - Removed the total_read variable that originally must have tracked how - much data had been written to the buffer. With non-blocking reads, we - must return straight away once we have read data into the buffer so this - variable served not purpose. - - I think it was still hanging around in case the initial processing of - 'leftover' data meant we wrote to the buffer but this case, like the - others, must return immediately. Now that it does, the last remaining - need for the variable is gone. + os400: add compilation scripts -- [Alexander Lamaison brought this change] +- [Patrick Monnerat brought this change] - Cleaned up sftp_read and added more explanation. + os400: include files for ILE/RPG - Replaced the gotos which were implementing the state machine with - a switch statement which makes the states more explicit. + In addition, file os400/macros.h declares all procedures originally + defined as macros. It must not be used for real inclusion and is only + intended to be used as a `database' for macro wrapping procedures generation. -- sftp_read: avoid data *and* EAGAIN - - Whenever we have data and is about to call a function that *MAY* return - EAGAIN we must return the data now and wait to get called again. Our API - only allows data *or* EAGAIN and we must never try to get both. +- [Patrick Monnerat brought this change] -Peter Stuge (2 Feb 2012) -- Add a tcpip-forward example which demonstrates remote port forwarding + os400: add supplementary header files/wrappers. Define configuration. -- libssh2.h: Add missing prototype for libssh2_session_banner_set() +- [Patrick Monnerat brought this change] -- example/subsystem_netconf.c: Return error when read buffer is too small + Protect callback function calls from macro substitution - Also remove a little redundancy in the read loop condition. - -- example/subsystem_netconf.c: Add a missing newline in an error message - -- Fix undefined reference to _libssh_error in libgcrypt backend + Some structure fields holding callback addresses have the same name as the + underlying system function (connect, send, recv). Set parentheses around + their reference to suppress a possible macro substitution. - Commit 209de22299b4b58e582891dfba70f57e1e0492db introduced a function - call to a non-existing function, and since then the libgcrypt backend - has not been buildable. - -Version 1.4.0 (31 Jan 2012) + Use a macro for connect() on OS/400 to resolve a const/nonconst parameter + problem. -Daniel Stenberg (31 Jan 2012) -- RELEASE-NOTES: synced with 6bd584d29 for 1.4.0 +- [Patrick Monnerat brought this change] -- s/1.3.1/1.4.0 - - We're bumping the minor number + Add interface for OS/400 crypto library QC3 -- [Jernej Kovacic brought this change] +- [Patrick Monnerat brought this change] - libssh2_session_supported_algs: fix compiler warning + misc: include stdarg.h for debug code -- [Jernej Kovacic brought this change] +- [Patrick Monnerat brought this change] - session_supported_algs docs: added an example + Document crypto library interface -- [Gellule Xg brought this change] +- [Patrick Monnerat brought this change] - sftp-seek: clear EOF flag + Feature an optional crypto-specific macro to rsa sign a data fragment vector - Set the EOF flag to False when calling seek64 to be able to get some - data back on a following read + OS/400 crypto library is unable to sign a precomputed SHA1 hash: however + it does support a procedure that hashes data fragments and rsa signs. + If defined, the new macro _libssh2_rsa_sha1_signv() implements this function + and disables use of _libssh2_rsa_sha1_sign(). + + The function described above requires that the struct iovec unused slacks are + cleared: for this reason, macro libssh2_prepare_iovec() has been introduced. + It should be defined as empty for crypto backends that are not sensitive + to struct iovec unused slack values. -- [Peter Krempa brought this change] +- [Patrick Monnerat brought this change] - userauth: Provide more informations if ssh pub key extraction fails - - If the function that extracts/computes the public key from a private key - fails the errors it reports were masked by the function calling it. This - patch modifies the key extraction function to return errors using - _libssh_error() function. The error messages are tweaked to contain - reference to the failed operaton in addition to the reason. - - * AUTHORS: - add my name - * libgcrypt.c: _libssh2_pub_priv_keyfile(): - return a more verbose - error using - _libssh2_error() func. - * openssl.c: - modify call graph of _libssh2_pub_priv_keyfile() to use - _libssh2_error for error reporting(); - * userauth.c: - tweak functions calling _libssh2_pub_priv_keyfile() not - to shadow error messages + Fold long lines in include files -- TODO: remove issues we (sort of) did already +- [Viktor Szakats brought this change] -- ssh2_exec: skip error outputs for EAGAIN + kex.c: fix indentation - Since the example uses non-blocking mode, it will just flood the output - with this "nonsense" error. + Closes #71 -Guenter Knauf (30 Nov 2011) -- Some NetWare makefile tweaks. +- [Viktor Szakats brought this change] -Daniel Stenberg (18 Nov 2011) -- LIBSSH2_SFTP_PACKET_MAXLEN: increase to 80000 - - Some SFTP servers send SFTP packets larger than 40000. Since the limit - is only present to avoid insane sizes anyway, we can easily bump it. - - The define was formerly in the public header libssh2_sftp.h but served - no external purpose and was moved into the source dir. + add OpenSSL-1.1.0-pre2 compatibility - Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-11/0004.shtml - Reported by: Michael Harris + Closes #70 -Alexander Lamaison (18 Nov 2011) -- [Peter Krempa brought this change] +- [Viktor Szakats brought this change] - knownhost_check(): Don't dereference ext if NULL is passed - - Documentation for libssh2_knownhost_checkp() and related functions - states that the last argument is filled with data if non-NULL. - - "knownhost if set to non-NULL, it must be a pointer to a 'struct - libssh2_knownhost' pointer that gets filled in to point to info about a - known host that matches or partially matches." + add OpenSSL 1.1.0-pre1 compatibility - In this function ext is dereferenced even if set to NULL, causing - segfault in applications not needing the extra data. - -Daniel Stenberg (11 Nov 2011) -- [Peter Krempa brought this change] + * close https://github.com/libssh2/libssh2/issues/69 + * sync a declaration with the rest of similar ones + * handle EVP_MD_CTX_new() returning NULL with OpenSSL 1.1.0 + * fix potential memory leak with OpenSSL 1.1.0 in + _libssh2_*_init() functions, when EVP_MD_CTX_new() succeeds, + but EVP_DigestInit() fails. - knownhost_add: Avoid dereferencing uninitialized memory on error path. +Marc Hoersken (22 Dec 2015) +- wincng.c: fixed _libssh2_wincng_hash_final return value - In function knownhost_add, memory is alocated for a new entry. If normal - alocation is used, memory is not initialized to 0 right after, but a - check is done to verify if correct key type is passed. This test is done - BEFORE setting the memory to null, and on the error path function - free_host() is called, that tries to dereference unititialized memory, - resulting into a glibc abort(). + _libssh2_wincng_hash_final was returning the internal BCRYPT + status code instead of a valid libssh2 return value (0 or -1). - * knownhost.c - knownhost_add(): - move typemask check before alloc + This also means that _libssh2_wincng_hash never returned 0. -- windows build: add define to avoid compiler warning +- wincng.c: fixed possible memory leak in _libssh2_wincng_hash - A recent mingw compiler has started to complain on "#warning Please - include winsock2.h before windows.h" unless the magic define is set - first. + If _libssh2_wincng_hash_update failed _libssh2_wincng_hash_final + would never have been called before. - Reported by: Vincent Torri - Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-10/0064.shtml + Reported by Zenju. -Henrik Nordstrom (31 Oct 2011) -- [Vincent Torri brought this change] +Kamil Dudka (15 Dec 2015) +- [Paul Howarth brought this change] - Correct Windows include file name case, simplifying cross-compilation + libssh2.pc.in: fix the output of pkg-config --libs - When cross compiling to Windows, libssh2.h include Windows header files - with upper case filenames : BaseTsd.h and WinSock2.h. + ... such that it does not include LDFLAGS used to build libssh2 itself. + There was a similar fix in the curl project long time ago: - These files have lowercase names with mingw-w64 (iirc, it's the same with - mingw). And as on Windows, being lowercase or uppercase does not matter. + https://github.com/bagder/curl/commit/curl-7_19_7-56-g4c8adc8 + + Bug: https://bugzilla.redhat.com/1279966 + Signed-off-by: Kamil Dudka -Daniel Stenberg (25 Oct 2011) -- [Jernej Kovacic brought this change] +Marc Hoersken (6 Dec 2015) +- hostkey.c: align code path of ssh_rsa_init to ssh_dss_init - libssh2_session_supported_algs: added +- hostkey.c: fix invalid memory access if libssh2_dsa_new fails + + Reported by dimmaq, fixes #66 -- [Kamil Dudka brought this change] +Daniel Stenberg (3 Nov 2015) +- [Will Cosgrove brought this change] - example/sftp_RW_nonblock: do not ignore LIBSSH2_ERROR_EAGAIN + gcrypt: define libssh2_sha256_ctx - Bug: https://bugzilla.redhat.com/745420 - -Peter Stuge (5 Oct 2011) -- example/ssh2_agent: Print host key fingerprint before authentication + Looks like it didn't make it into the latest commit for whatever reason. - Also moves the comment about not being authenticated to before the - agent authentication takes place, so that it better matches the code. + Closes #58 -Daniel Stenberg (29 Sep 2011) -- OpenSSL EVP: fix threaded use of structs +- [Salvador Fandino brought this change] + + libssh2_session_set_last_error: Add function - Make sure we don't clear or reset static structs after first init so - that they work fine even when used from multiple threads. Init the - structs in the global init. + Net::SSH2, the Perl wrapping module for libssh2 implements several features* + on top of libssh2 that can fail and so need some mechanism to report the error + condition to the user. - Help and assistance by: John Engstrom + Until now, besides the error state maintained internally by libssh2, another + error state was maintained at the Perl level for every session object and then + additional logic was used to merge both error states. That is a maintenance + nighmare, and actually there is no way to do it correctly and consistently. - Fixes #229 (again) - -- openssl: don't init static structs differently + In order to allow the high level language to add new features to the library + but still rely in its error reporting features the new function + libssh2_session_set_last_error (that just exposses _libssh2_error_flags) is + introduced. - make_ctr_evp() is changed to take a struct pointer, and then each - _libssh2_EVP_aes_[keylen]_ctr function is made to pass in their own - static struct + *) For instance, connecting to a remote SSH service giving the hostname and + port. - Reported by: John Engstrom - Fixes #229 + Signed-off-by: Salvador Fandino + Signed-off-by: Salvador Fandiño -Guenter Knauf (27 Sep 2011) -- Removed obsolete include path. +- [Salvador Fandino brought this change] -Daniel Stenberg (21 Sep 2011) -- read_state: clear the state variable better + _libssh2_error: Support allocating the error message - Set read_state back to idle before trying to send anything so that if - the state somehow is wrongly set. + Before this patch "_libssh2_error" required the error message to be a + static string. - Also, avoid such a case of confusion by resetting the read_state when an - sftp handle is closed. - -- sftp_read: remove leftover fprintf + This patch adds a new function "_libssh2_error_flags" accepting an + additional "flags" argument and specifically the flag + "LIBSSH2_ERR_FLAG_DUP" indicating that the passed string must be + duplicated into the heap. - Reported by: Alexander Lamaison + Then, the method "_libssh2_error" has been rewritten to use that new + function under the hood. + + Signed-off-by: Salvador Fandino + Signed-off-by: Salvador Fandiño -- sftp.h: fix the #ifdef to prevent multiple inclusions +- [Will Cosgrove brought this change] -- sftp_read: use a state variable to avoid bad writes + added engine.h include to fix warning + +- [sune brought this change] + + kex.c: removed dupe entry from libssh2_kex_methods[] - When a channel_write call has gotten an EAGAIN back, we try harder to - continue the same write in the subsequent invoke. + Closes #51 -- window_size: explicit adjustments only +- [Salvador Fandiño brought this change] + + userauth: Fix off by one error when reading public key file - Removed the automatic window_size adjustments from - _libssh2_channel_read() and instead all channel readers must now make - sure to enlarge the window sizes properly themselves. + After reading the public key from file the size was incorrectly + decremented by one. - libssh2_channel_read_ex() - the public function, now grows the window - size according to the requested buffer size. Applications can still opt - to grow the window more on demand. Larger windows tend to give higher - performance. + This was usually a harmless error as the last character on the public + key file is an unimportant EOL. But if due to some error the public key + file is empty, the public key size becomes (uint)(0 - 1), resulting in + an unrecoverable out of memory error later. - sftp_read() now uses the read-ahead logic to figure out a window_size. + Signed-off-by: Salvador Fandi??o -- libssh2.h: bump the default window size to 256K +- [Salvador Fandino brought this change] -- libssh2_userauth_keyboard_interactive.3: fix man warning + channel: Detect bad usage of libssh2_channel_process_startup - It seemed to occur due to the excessive line length - -- [Mikhail Gusarov brought this change] + A common novice programmer error (at least among those using the + wrapping Perl module Net::SSH2), is to try to reuse channels. + + This patchs detects that incorrect usage and fails with a + LIBSSH2_ERROR_BAD_USE error instead of hanging. + + Signed-off-by: Salvador Fandino - Add missing .gitignore entries +- [Will Cosgrove brought this change] -- [Mikhail Gusarov brought this change] + kex: Added diffie-hellman-group-exchange-sha256 support + + ... and fixed HMAC_Init depricated usage + + Closes #48 - Add manpage syntax checker to 'check' target +Alexander Lamaison (21 Sep 2015) +- Prefixed new #defines to prevent collisions. - In virtually every libssh2 release Debian's lintian catches syntax errors in - manpages. Prevent it by checking manpages as a part of testsuite. + Other libraries might have their own USE_WIN32_*FILES. -- libssh2_banner_set.3: fix nroff syntax mistake +- [keith-daigle brought this change] -Guenter Knauf (10 Sep 2011) -- Use predefined resource compiler macro. + Update examples/scp.c to fix bug where large files on win32 would cause got to wrap and go negative -- Added casts to silent compiler warnings. +- [David Byron brought this change] -- Fixed uint64_t printf. - -- Fixed macro function signatures. - -- NetWare makefile tweaks. + add libssh2_scp_recv2 to support large (> 2GB) files on windows -- Removed unused var. +Daniel Stenberg (17 Sep 2015) +- [sune brought this change] -- Added 2 samples not mentioned. + WinCNG: support for SHA256/512 HMAC + + Closes #47 -- Dont build x11 sample with MinGW. +- [brian m. carlson brought this change] -- Fixed executable file description. + Add support for HMAC-SHA-256 and HMAC-SHA-512. + + Implement support for these algorithms and wire them up to the libgcrypt + and OpenSSL backends. Increase the maximum MAC buffer size to 64 bytes + to prevent buffer overflows. Prefer HMAC-SHA-256 over HMAC-SHA-512, and + that over HMAC-SHA-1, as OpenSSH does. + + Closes #40 -- Removed unused var. +- [Zenju brought this change] -- Kill stupid gcc 3.x uninitialized warning. + kex: free server host key before allocating it (again) + + Fixes a memory leak when Synology server requests key exchange + + Closes #43 -- Build all examples. +- [Viktor Szakats brought this change] -- More MinGW makefile tweaks. + GNUmakefile: up OpenSSL version - Renamed *.mingw makefiles to GNUmakefile since GNU make picks these - up automatically, and therefore win32/Makefile removed. + closes #23 -- Removed forgotten WINSOCK_VERSION defines. +- [Viktor Szakats brought this change] -Daniel Stenberg (9 Sep 2011) -- libssh2_session_startup(3) => libssh2_session_handshake(3) + GNUmakefile: add -m64 CFLAGS when targeting mingw64, add -m32/-m64 to LDFLAGS - Propagate for the current function in docs and examples. - libssh2_session_startup() is deprecated. - -- libssh2_banner_set => libssh2_session_banner_get + libssh2 equivalent of curl patch https://github.com/bagder/curl/commit/d21b66835f2af781a3c2a685abc92ef9f0cd86be - Marked the old function as deprecated. Added the new name in the correct - name space with the same arguments and functionality. + This allows to build for the non-default target when using a multi-target mingw distro. + Also bump default OpenSSL dependency path to 1.0.2c. -- new function: libssh2_session_banner_get +- [Viktor Szakats brought this change] + + GNUmakefile: add support for LIBSSH2_LDFLAG_EXTRAS - Returns the banner from the server handshake + It is similar to existing LIBSSH2_CFLAG_EXTRAS, but for + extra linker options. - Fixes #226 + Also delete some line/file ending whitespace. + + closes #27 -- libssh2.h: bump version to 1.4.0 for new function(s) +- [nasacj brought this change] -- remove embedded CVS/svn tags + hostkey.c: Fix compiling error when OPENSSL_NO_MD5 is defined + + Closes #32 -- [liuzl brought this change] +- [Mizunashi Mana brought this change] - API add:libssh2_sftp_get_channel + openssl.h: adjust the rsa/dsa includes - Return the channel of sftp, then caller can - control the channel's behavior. + ... to work when built without DSA support. - Signed-off-by: liuzl + Closes #36 -- _libssh2_channel_read: react on errors from receive_window_adjust +Alexander Lamaison (26 Jul 2015) +- Let CMake build work as a subproject. - Previously the function would ignore all errors except for EAGAIN. + Patch contributed by JasonHaslam. -- sftp_read: extend and clarify the documentation +- Fix builds with Visual Studio 2015. + + VS2015 moved stdio functions to the header files as inline function. That means check_function_exists can't detect them because it doesn't use header files - just does a link check. Instead we need to use check_symbol_exists with the correct headers. -- sftp_read: cap the read ahead maximum amount +Kamil Dudka (2 Jul 2015) +- cmake: include CMake files in the release tarballs - Now we only go up to LIBSSH2_CHANNEL_WINDOW_DEFAULT*30 bytes SFTP read - ahead, which currently equals 64K*30 == 1966080 bytes. + Despite we announced the CMake support in libssh2-1.6.0 release notes, + the files required by the CMake build system were not included in the + release tarballs. Hence, the only way to use CMake for build was the + upstream git repository. + + This commit makes CMake actually supported in the release tarballs. -- _libssh2_channel_read: fix non-blocking window adjusting +- tests/mansyntax.sh: fix 'make distcheck' with recent autotools - If EAGAIN is returned when adjusting the receive window, we must not - read from the transport directly until we've finished the adjusting. + Do not create symbolic links off the build directory. Recent autotools + verify that out-of-source build works even if the source directory tree + is not writable. -Guenter Knauf (8 Sep 2011) -- Fix for systems which need sys/select.h. +- openssl: fix memleak in _libssh2_dsa_sha1_verify() -- The files were not gone but renamed ... +Daniel Stenberg (12 Jun 2015) +- openssl: make libssh2_sha1 return error code + + - use the internal prefix _libssh2_ for non-exported functions + + - removed libssh2_md5() since it wasn't used + + Reported-by: Kamil Dudka -Daniel Stenberg (6 Sep 2011) -- sftp_read: added documenting comment +- [LarsNordin-LNdata brought this change] + + SFTP: Increase speed and datasize in SFTP read - Taken from some recent email conversations I added some descriptions of - the logic in sftp_read() to aid readers. + The function sftp_read never return more then 2000 bytes (as it should + when I asked Daniel). I increased the MAX_SFTP_READ_SIZE to 30000 but + didn't get the same speed as a sftp read in SecureSSH. I analyzed the + code and found that a return always was dona when a chunk has been read. + I changed it to a sliding buffer and worked on all available chunks. I + got an increase in speed and non of the test I have done has failed + (both local net and over Internet). Please review and test. I think + 30000 is still not the optimal MAX_SFTP_READ_SIZE, my next goal is to + make an API to enable changing this value (The SecureSSH sftp_read has + more complete filled packages when comparing the network traffic) -- 1.3.1: start the work +- bump: start working on 1.6.1 -Version 1.3.0 (6 Sep 2011) +Version 1.6.0 (5 Jun 2015) -Daniel Stenberg (6 Sep 2011) -- Makefile.am: the Makefile.win32 files are gone +Daniel Stenberg (5 Jun 2015) +- RELEASE-NOTES: synced with 858930cae5c6a -- RELEASE-NOTES: updated for 1.3.0 +Marc Hoersken (19 May 2015) +- wincng.c: fixed indentation -- sftp_read: a short read is not end of file - - A returned READ packet that is short will now only reduce the - offset. - - This is a temporary fix as it is slightly better than the previous - approach but still not very good. +- [sbredahl brought this change] -- [liuzl brought this change] + wincng.c: fixed memleak in (block) cipher destructor - _libssh2_packet_add: adjust window size when truncating +Alexander Lamaison (6 May 2015) +- [Jakob Egger brought this change] + + libssh2_channel_open: more detailed error message - When receiving more data than what the window size allows on a - particular channel, make sure that the window size is adjusted in that - case too. Previously it would only adjust the window in the non-error - case. + The error message returned by libssh2_channel_open in case of a server side channel open failure is now more detailed and includes the four standard error conditions in RFC 4254. -Guenter Knauf (29 Aug 2011) -- Silent compiler warning with MinGW64. +- [Hannes Domani brought this change] -- Fixed link to native Win32 awk tool. + kex: fix libgcrypt memory leaks of bignum + + Fixes #168. -- Renamed MinGW makefiles. +Marc Hoersken (3 Apr 2015) +- configure.ac: check for SecureZeroMemory for clear memory feature -- Some MinGW makefile tweaks. +- Revert "wincng.c: fix clear memory feature compilation with mingw" - Enable build without GNU tools and with MinGW64 compiler. + This reverts commit 2d2744efdd0497b72b3e1ff6e732aa4c0037fc43. + + Autobuilds show that this did not solve the issue. + And it seems like RtlFillMemory is defined to memset, + which would be optimized out by some compilers. -- Fixed aes_ctr_do_cipher() signature. +- wincng.c: fix clear memory feature compilation with mingw -Daniel Stenberg (26 Aug 2011) -- [liuzl brought this change] +Alexander Lamaison (1 Apr 2015) +- [LarsNordin-LNdata brought this change] - libssh2_sftp_seek64: flush packetlist and buffered data + Enable use of OpenSSL that doesn't have DSA. - When seeking to a new position, flush the packetlist and buffered data - to prevent already received or pending data to wrongly get used when - sftp-reading from the new offset within the file. + Added #if LIBSSH2_DSA for all DSA functions. -- sftp_read: advance offset correctly for buffered copies - - In the case where a read packet has been received from the server, but - the entire contents couldn't be copied to the user-buffer, the data is - instead buffered and copied to the user's buffer in the next invocation - of sftp_read(). When that "extra" copy is made, the 'offset' pointer was - not advanced accordingly. - - The biggest impact of this flaw was that the 'already' variable at the - top of the function that figures out how much data "ahead" that has - already been asked for would slowly go more and more out of sync, which - could lead to the file not being read all the way to the end. +- [LarsNordin-LNdata brought this change] + + Use correct no-blowfish #define with OpenSSL. - This problem was most noticable in cases where the application would - only try to read the exact file size amount, like curl does. In the - examples libssh2 provides the sftp read function is most often called - with a fixed size large buffer and then the bug would not appear as - easily. + The OpenSSL define is OPENSSL_NO_BF, not OPENSSL_NO_BLOWFISH. + +Marc Hoersken (25 Mar 2015) +- configure: error if explicitly enabled clear-memory is not supported - This bug was introduced in the SFTP rewrite in 1.2.8. + This takes 22bd8d81d8fab956085e2079bf8c29872455ce59 and + b8289b625e291bbb785ed4add31f4759241067f3 into account, + but still makes it enabled by default if it is supported + and error out in case it is unsupported and was requested. + +Daniel Stenberg (25 Mar 2015) +- configure: make clear-memory default but only WARN if backend unsupported - Bug: http://curl.haxx.se/mail/lib-2011-08/0305.html - http://www.libssh2.org/mail/libssh2-devel-archive-2011-08/0085.shtml + ... instead of previous ERROR. -- wrap some long lines < 80 columns +Marc Hoersken (24 Mar 2015) +- wincng.h: fix warning about computed return value not being used -- LIBSSH2_RECV: fix typo, use the RECV_FD macro +- nonblocking examples: fix warning about unused tvdiff on Mac OS X -- subsystem_netconf.c: fix compiler warnings +Daniel Stenberg (24 Mar 2015) +- openssl: fix compiler warnings -- [Henrik Nordstrom brought this change] +- cofigure: fix --disable-clear-memory check - Custom callbacks for performing low level socket I/O +Marc Hoersken (23 Mar 2015) +- scp.c: improved command length calculation + + Reduced number of calls to strlen, because shell_quotearg already + returns the length of the resulting string (e.q. quoted path) + which we can add to the existing and known cmd_len. + Removed obsolete call to memset again, because we can put a final + NULL-byte at the end of the string using the calculated length. -- version bump: start working towards 1.3.0 +- scp.c: improved and streamlined formatting -Version 1.2.9 (16 Aug 2011) +- scp.c: fix that scp_recv may transmit not initialised memory -Daniel Stenberg (16 Aug 2011) -- RELEASE-NOTES: synced with 95d69d3a81261 +- scp.c: fix that scp_send may transmit not initialised memory + + Fixes ticket 244. Thanks Torsten. -- [Henrik Nordstrom brought this change] +- kex: do not ignore failure of libssh2_sha1_init() + + Based upon 43b730ce56f010e9d33573fcb020df49798c1ed8. + Fixes ticket 290. Thanks for the suggestion, mstrsn. - Document prototypes for macro defined functions +- wincng.h: fix return code of libssh2_md5_init() -- [Henrik Nordstrom brought this change] +- openssl.c: fix possible segfault in case EVP_DigestInit fails - Avoid reuse after free when closing X11 channels +- wincng.c: fix possible use of uninitialized variables -- _libssh2_channel_write: handle window_size == 0 better - - When about to send data on the channel and the window size is 0, we must - not just return 0 if the transport_read() function returned EAGAIN as it - then causes a busy-loop. - - Bug: http://libssh2.org/mail/libssh2-devel-archive-2011-08/0011.shtml +- wincng.c: fix unused argument warning if clear memory is not enabled -- gettimeofday: fix name space pollution +- wincng: Added explicit clear memory feature to WinCNG backend - For systems without its own gettimeofday() implementation, we still must - not provide one outside our namespace. + This re-introduces the original feature proposed during + the development of the WinCNG crypto backend. It still needs + to be added to libssh2 itself and probably other backends. - Reported by: Bill Segall + Memory is cleared using the function SecureZeroMemory which is + available on Windows systems, just like the WinCNG backend. -Dan Fandrich (5 Aug 2011) -- libssh2.pc.in: Fixed spelling in pkgconfig file +- wincng.c: fixed mixed line-endings -Peter Stuge (17 Jul 2011) -- example/subsystem_netconf.c: Add missing #include +- wincng.c: fixed use of invalid parameter types in a8d14c5dcf -- example/subsystem_netconf.c: Discard ]]>]]> and return only XML response +- wincng.c: only try to load keys corresponding to the algorithm -- example/subsystem_netconf.c: Fix uninitialized variable bug +- wincng.c: moved PEM headers into definitions -- example: Add subsystem_netconf.c - - This example demonstrates how to use libssh2 to send a request to - the NETCONF subsystem available e.g. in JunOS. - - See also http://tools.ietf.org/html/draft-ietf-netconf-ssh-06 +- wincng.h: fixed invalid parameter name -Daniel Stenberg (16 Jul 2011) -- man page cleanups: non-existing functions need no man pages +- wincng: fixed mismatch with declarations in crypto.h -- libssh2_new_host_entry.3: removed - - This is just junk leftovers. +- userauth.c: fixed warning C6001: using uninitialized sig and sig_len -- userauth_keyboard_interactive: fix buffer overflow +- pem.c: fixed warning C6269: possible incorrect order of operations + +- wincng: add support for authentication keys to be passed in memory - Partly reverse 566894494b4972ae12 which was simplifying the code far too - much and ended up overflowing a buffer within the LIBSSH2_SESSION - struct. Back to allocating the buffer properly like it used to do. + Based upon 18cfec8336e and daa2dfa2db. + +- pem.c: add _libssh2_pem_parse_memory to parse PEM from memory - Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-06/0032.shtml - Reported by: Alfred Gebert + Requirement to implement 18cfec8336e for Libgcrypt and WinCNG. -- keyboard-interactive man page: cleaned up +- pem.c: fix copy and paste mistake from 55d030089b8 -- [Alfred Gebert brought this change] +- userauth.c: fix another possible dereference of a null pointer - _libssh2_recv(): handle ENOENT error as EAGAIN - - A sftp session failed with error "failure establishing ssh session" on - Solaris and HP-UX. Sometimes the first recv() function call sets errno - to ENOENT. In the man pages for recv of Solaris and HP-UX the error - ENOENT is not documented. - - I tested Solaris SPARC and x86, HP-UX i64, AIX, Windows and Linux. +- userauth.c: fix possible dereference of a null pointer -- agent_list_identities: fix out of scope access - - An auto variable out of scope was being referenced and used. - - fixes #220 +- pem.c: reduce number of calls to strlen in readline -- _libssh2_wait_socket: fix timeouts for poll() uses +Alexander Lamaison (17 Mar 2015) +- [Will Cosgrove brought this change] -- windows: inclusion fix + Initialise HMAC_CTX in more places. - include winsock2.h for all windows compilers + Missed a couple more places we init ctx to avoid openssl threading crash. -- keyb-interactive: add the fixed buffer +- Build build breakage in WinCNG backend caused when adding libssh2_userauth_publickey_frommemory. - Belongs to commit 5668944 - -- code cleanup: don't use C99/c++ comments + The new feature isn't implemented for the WinCNG backend currently, but the WinCNG backend didn't contain any implementation of the required backend functions - even ones that returns an error. That caused link errors. - We aim for C89 compliance + This change fixes the problem by providing an implementation of the backend functions that returns an error. -- keyb-interactive: allow zero length fields - - Allow zero length fields so they don't cause malloc(0) calls - - Avoid free()ing NULL pointers +- Fix breakage in WinCNG backend caused by introducing libssh2_hmac_ctx_init. - Avoid a malloc of a fixed 5 byte buffer. + The macro was defined to nothing for the libgcrypt backend, but not for WinCNG. This brings the latter into line with the former. -- libssh2_channel_process_startup.3: clean up +Daniel Stenberg (15 Mar 2015) +- userauth_publickey_frommemory.3: add AVAILABILITY - Remove the references to the macro-fied shortcuts as they have their own - individual man pages. + ... it will be added in 1.6.0 + +- libssh2: next version will be called 1.6.0 - Made the prototype different and more readable. + ... since we just added a new function. -- man page: fix .BR lines +- docs: add libssh2_userauth_publickey_frommemory.3 to dist - We don't use \fI etc on .BR lines + The function and man page were added in commit 18cfec8336e -- userauth_keyboard_interactive: skip code on zero length auth +- [Jakob Egger brought this change] -- libssh2_channel_forward_accept.3: mention how to get error + direct_tcpip: Fixed channel write - Since this returns a pointer, libssh2_session_last_errno() must be used - to get the actual error code and it wasn't that clear before. + There were 3 bugs in this loop: + 1) Started from beginning after partial writes + 2) Aborted when 0 bytes were sent + 3) Ignored LIBSSH2_ERROR_EAGAIN + + See also: + https://trac.libssh2.org/ticket/281 + https://trac.libssh2.org/ticket/293 -- timeout docs: mention they're added in 1.2.9 +Alexander Lamaison (15 Mar 2015) +- [Will Cosgrove brought this change] -- sftp_write_sliding.c: indent fix + Must init HMAC_CTX before using it. - Use the standard indenting and removed CVS leftover comment - -- [zl liu brought this change] + Must init ctx before using it or openssl will reuse the hmac which is not thread safe and causes a crash. + Added libssh2_hmac_ctx_init macro. - sftp_write_sliding: send the complete file +- Add continuous integration configurations. - When reaching the end of file there can still be data left not sent. + Linux-based CI is done by Travis CI. Windows-based CI is done by Appveyor. -- [Douglas Masterson brought this change] +- [David Calavera brought this change] - session_startup: init state properly + Allow authentication keys to be passed in memory. - libssh2_session_startup() didn't set the state correctly so it could get - confused. + All credits go to Joe Turpin, I'm just reaplying and cleaning his patch: + http://www.libssh2.org/mail/libssh2-devel-archive-2012-01/0015.shtml - Fixes #218 - -- timeout: added man pages + * Use an unimplemented error for extracting keys from memory with libgcrypt. -- BLOCK_ADJUST_ERRNO: move rc to right level - - We can't declare the variable within the block and use it in the final - do-while() expression to be properly portable C89. +Daniel Stenberg (14 Mar 2015) +- docs: include the renamed INSTALL* files in dist -- [Matt Lilley brought this change] +Alexander Lamaison (13 Mar 2015) +- Prevent collisions between CMake and Autotools in examples/ and tests/. - adds a timeout to blocking calls +- Avoid clash between CMake build and Autotools. - Fixes bug #160 as per Daniel's suggestion + Autotools expects a configuration template file at src/libssh2_config.h.in, which buildconf generates. But the CMake build system has its CMake-specific version of the file at this path. This means that, if you don't run buildconf, the Autotools build will fail because it configured the wrong header template. - Adds libssh2_session_set_timeout() and libssh2_session_get_timeout() + See https://github.com/libssh2/libssh2/pull/8. -- SCP: fix incorrect error code +- Merge pull request #8 from alamaison/cmake - After an error occurs in libssh2_scp_recv() or libssh2_scp_send(), the - function libssh2_session_last_error() would return - LIBSSH2_ERROR_SOCKET_NONE on error. + CMake build system. + +- CMake build system. - Bug: http://trac.libssh2.org/ticket/216 - Patch by: "littlesavage" + Tested: + - Windows: + - Visual C++ 2005/2008/2010/2012/2013/MinGW-w64 + - static/shared + - 32/64-bit + - OpenSSL/WinCNG + - Without zlib + - Linux: + - GCC 4.6.3/Clang 3.4 + - static/shared + - 32/64-bit + - OpenSSL/Libgcrypt + - With/Without zlib + - MacOS X + - AppleClang 6.0.0 + - static + - 64-bit + - OpenSSL + - Without zlib - Fixes #216 + Conflicts: + README -Guenter Knauf (19 Apr 2011) -- Updated default (recommended) dependency versions. +- Man man syntax tests fail gracefully if man version is not suitable. -Daniel Stenberg (17 Apr 2011) -- libssh2_session_block_directions: fix mistake - - The last LIBSSH2_SESSION_BLOCK_INBOUND should be - LIBSSH2_SESSION_BLOCK_OUTBOUND - - And I shortened the short description +- Return valid code from test fixture on failure. - Reported by: "drswinghead" + The sshd test fixture was returning -1 if an error occurred, but negative error codes aren't technically valid (google it). Bash on Windows converted them to 0 which made setup failure look as though all tests were passing. -- msvcproj: added libs and debug stuff - - Added libraries needed to link whether using openssl dynamically or - statically +- Let mansyntax.sh work regardless of where it is called from. + +Daniel Stenberg (12 Mar 2015) +- [Viktor Szakáts brought this change] + + mingw build: allow to pass custom CFLAGS - Added LIBSSH2DEBUG define to debug versions to enable tracing + Allow to pass custom `CFLAGS` options via environment variable + `LIBSSH2_CFLAG_EXTRAS`. Default and automatically added options of + `GNUmakefile` have preference over custom ones. This addition is useful + for passing f.e. custom CPU tuning or LTO optimization (`-flto + -ffat-lto-objects`) options. The only current way to do this is to edit + `GNUmakefile`. This patch makes it unnecessary. - URL: http://trac.libssh2.org/ticket/215 - Patch by: Mark Smith + This is a mirror of similar libcurl patch: + https://github.com/bagder/curl/pull/136 -- sftp_write: clean offsets on error +- [Will Cosgrove brought this change] + + userauth: Fixed prompt text no longer being copied to the prompts struct - When an error has occurred on FXP_WRITE, we must make sure that the - offset, sent offset and acked counter are reset properly. + Regression from 031566f9c -- example/.gitignore: ignore built binaries +- README: update the git repo locations -- sftp_write: flush the packetlist on error +- wait_socket: wrong use of difftime() - When an error occurs during write, flush the entire list of pending - outgoing SFTP packets. - -- keepalive: add first basic man pages + With reversed arguments it would always return a negative value... - Someone on IRC pointed out that we don't have these documented so I - wrote up a first set based on the information in the wiki: - http://trac.libssh2.org/wiki/KeepAlive + Bug: https://github.com/bagder/libssh2/issues/1 -- scp_write_nonblock.c: remove pointless check - - libssh2_channel_write() cannot return a value that is larger than the - input length value +- bump: start working toward 1.5.1 now -Mikhail Gusarov (9 Apr 2011) -- s/\.NF/.nf/ to fix wrong macro name caught by man --warnings +Version 1.5.0 (11 Mar 2015) -Daniel Stenberg (6 Apr 2011) -- version: bump to 1.2.9_dev - - Also update the copyright year range to include 2011 +Daniel Stenberg (11 Mar 2015) +- RELEASE-NOTES: 1.5.0 release -- configure: fix $VERSION +- [Mariusz Ziulek brought this change] + + kex: bail out on rubbish in the incoming packet - Stop using the $VERSION variable as it seems to be magically used by - autoconfig itself and thus gets set to the value set in AC_INIT() - without us wanting that. $LIBSSH2VER is now the libssh2 version as - detected. + CVE-2015-1782 - Reported by: Paul Howarth - Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-04/0008.shtml - -- maketgz: use git2news.pl by the correct name + Bug: http://www.libssh2.org/adv_20150311.html -Version 1.2.8 (4 Apr 2011) +- docs: move INSTALL, AUTHORS, HACKING and TODO to docs/ + + And with this, cleanup README to be shorter and mention the new source + code home. -Daniel Stenberg (4 Apr 2011) -- RELEASE-NOTES: synced with fabf1a45ee +- .gitignore: don't ignore INSTALL -- NEWS: auto-generated from git - - Starting now, the NEWS file is generated from git using the git2news.pl - script. This makes it always accurate and up-to-date, even for daily - snapshots etc. +Dan Fandrich (4 Mar 2015) +- examples/x11.c: include sys/select.h for improved portability -- sftp_write: handle FXP_WRITE errors +Daniel Stenberg (4 Mar 2015) +- RELEASE-NOTES: synced with a8473c819bc068 - When an sftp server returns an error back on write, make sure the - function bails out and returns the proper error. + In preparation for the upcoming 1.5.0 release. -- configure: stop using the deprecated AM_INIT_AUTOMAKE syntax +Guenter Knauf (8 Jan 2015) +- NetWare build: added some missing exports. -Alexander Lamaison (13 Mar 2011) -- Support unlimited number of host names in a single line of the known_hosts file. - - Previously the code assumed either a single host name or a hostname,ip-address pair. However, according to the spec [1], there can be any number of comma separated host names or IP addresses. +Marc Hoersken (29 Dec 2014) +- knownhost.c: fix use of uninitialized argument variable wrote - [1] http://www.openbsd.org/cgi-bin/man.cgi?query=sshd&sektion=8 + Detected by clang scan in line 1195, column 18. -Daniel Stenberg (26 Feb 2011) -- libssh2_knownhost_readfile.3: clarify return value +- examples/x11.c: fix result of operation is garbage or undefined - This function returns the number of parsed hosts on success, not just - zero as previously documented. + Fix use of uninitialized structure w_size_bck. + Detected by clang scan in line 386, column 28. -Peter Stuge (26 Feb 2011) -- Don't save allocated packet size until it has actually been allocated +- examples/x11.c: remove dead assigments of some return values - The allocated packet size is internal state which needs to match reality - in order to avoid problems. This commit fixes #211. + Detected by clang scan in line 212, column 9. + Detected by clang scan in line 222, column 13. + Detected by clang scan in line 410, column 13. -Daniel Stenberg (21 Feb 2011) -- [Alfred Gebert brought this change] +- examples/x11.c: fix possible memory leak if read fails + + Detected by clang scan in line 224, column 21. - session_startup: manage server data before server identification +- examples/x11.c: fix invalid removal of first list element - Fix the bug that libssh2 could not connect if the sftp server - sends data before sending the version string. + Fix use of memory after it was being freed. + Detected by clang scan in line 56, column 12. + +- userauth.c: make sure that sp_len is positive and avoid overflows - http://tools.ietf.org/html/rfc4253#section-4.2 + ... if the pointer subtraction of sp1 - pubkey - 1 resulted in a + negative or larger value than pubkey_len, memchr would fail. - "The server MAY send other lines of data before sending the version - string. Each line SHOULD be terminated by a Carriage Return and Line - Feed. Such lines MUST NOT begin with "SSH-", and SHOULD be encoded - in ISO-10646 UTF-8 [RFC3629] (language is not specified). Clients - MUST be able to process such lines." - -- [Alfred Gebert brought this change] + Reported by Coverity CID 89846. - fullpacket: decompression only after init +- channel.c: remove logically dead code, host cannot be NULL here - The buffer for the decompression (remote.comp_abstract) is initialised - in time when it is needed. With this fix decompression is disabled when - the buffer (remote.comp_abstract) is not initialised. + ... host cannot be NULL in line 525, because it is always + valid (e.g. at least set to "0.0.0.0") after lines 430 and 431. - Bug: http://trac.libssh2.org/ticket/200 + Reported by Coverity CID 89807. -- _libssh2_channel_read: store last error +- session.c: check return value of session_nonblock during startup - When the transport layer returns EAGAIN this function didn't call - _libssh2_error() which made the last_error not get set. - -- sftp_write: clarified the comment header + Reported by Coverity CID 89803. -- sftp_read: avoid wrapping counter to insanity - - As pointed out in bug #206, if a second invoke of libssh2_sftp_read() - would shrink the buffer size, libssh2 would go nuts and send out read - requests like crazy. This was due to an unsigned variable turning - "negative" by some wrong math, and that value would be the amount of - data attempt to pre-buffer! +- session.c: check return value of session_nonblock in debug mode - Bug: http://trac.libssh2.org/ticket/206 + Reported by Coverity CID 89805. -- sftp_packet_read: use 32bit variables for 32bit data +- pem.c: fix mixed line-endings introduced with 8670f5da24 -- libssh2_sftp_stat_ex.3: cleaned up, extended - - Removed the macros from it as they have their own man pages. +- pem.c: make sure there's a trailing zero and b64data is not NULL - Added the LIBSSH2_SFTP_ATTRIBUTES struct in here for easier reference. + ... if there is no base64 data between PEM header and footer. + Reported by Coverity CID 89823. -- sftp_readdir: return error if buffer is too small +- kex.c: make sure mlist is not set to NULL - If asked to read data into a buffer and the buffer is too small to hold - the data, this function now returns an error instead of as previously - just copy as much as fits. + ... if the currently unsupported LANG methods are called. + Reported by Coverity CID 89834. -- sftp_symlink: return error if receive buffer too small - - and clean up some variable type mismatches +- packet.c: i < 256 was always true and i would overflow to 0 - Discussion: http://www.libssh2.org/mail/libssh2-devel-archive-2011-01/0001.shtml + Visualize that the 0-termination is intentional, because the array + is later passed to strlen within _libssh2_packet_askv. -- docs: clarify what happens with a too small buffer - - This flaw is subject to change, but I figured it might be valuable to - users of existing code to know how it works. +- silence multiple data conversion warnings -- channel_request_pty_size: fix reqPTY_state - - The state variable isn't properly set so every other call to the - function fails! +Daniel Stenberg (23 Dec 2014) +- agent_connect_unix: make sure there's a trailing zero - Bug: http://libssh2.org/mail/libssh2-devel-archive-2010-12/0096.shtml - Reported by: Steve Legg + ... if the path name was too long. Reported by Coverity CID 89801. -- data size: cleanup +Marc Hoersken (22 Dec 2014) +- examples on Windows: use native SOCKET-type instead of int - Fix 64bit warnings by using (s)size_t and dedicated uint32_t types more. + And check return values accordingly. -- [Pierre Joye brought this change] +- userauth.c: improve readability and clarity of for-loops - ssize_t: proper typedef with MSVC compilers +Daniel Stenberg (22 Dec 2014) +- calloc: introduce LIBSSH2_CALLOC() - As discussed on the mailing list, it was wrong for win64 and using the - VC-provided type is the safest approach instead of second- guessing - which one it should be. + A simple function using LIBSSH2_ALLOC + memset, since this pattern was + used in multiple places and this simplies code in general. -Guenter Knauf (22 Dec 2010) -- Updated OpenSSL version. +Marc Hoersken (15 Dec 2014) +- libssh2_priv.h: Ignore session, context and format parameters -- Expanded tabs to spaces. +- x11 example: check return value of socket function -Peter Stuge (21 Dec 2010) -- [Joey Degges brought this change] +- examples: fixed mixed line-endings introduced with aedfba25b8 - _libssh2_ntohu64: fix conversion from network bytes to uint64 +- wincng.c: explicitly ignore BCrypt*AlgorithmProvider return codes - Cast individual bytes to uint64 to avoid overflow in arithmetic. + Fixes VS2012 code analysis warning C6031: + return value ignored: could return unexpected value -Daniel Stenberg (20 Dec 2010) -- libssh2_userauth_list: language fix +- wincng.c: fix possible invalid memory write access - "faily" is not a good English word, and I also cleaned up some other minor - mistakes + Fixes VS2012 code analysis warning C6386: + buffer overrun: accessing 'pbOutput', the writable size is + 'cbOutput' bytes, but '3' bytes may be written: libssh2 wincng.c 610 -- crypto: unify the generic functions +- tests on Windows: check for WSAStartup return code - Added crypto.h that is the unified header to include when using crypto - functionality. It should be the only header that needs to adapt to the - underlying crypto library in use. It provides the set of prototypes that - are library agnostic. - -- [Mark Smith brought this change] + Fixes VS2012 code analysis warning C6031: + return value ignored: could return unexpected value - userauth: derive publickey from private - - Pass a NULL pointer for the publickey parameter of - libssh2_userauth_publickey_fromfile and - libssh2_userauth_hostbased_fromfile functions. In this case, the - functions recompute the public key from the private key file data. - - This is work done by Jean-Louis CHARTON - , then adapted by Mark Smith and - slightly edited further by me Daniel. +- wincng.c: fix possible NULL pointer de-reference of bignum - WARNING: this does leave the feature NOT WORKING when libssh2 is built - to use libgcrypt instead of OpenSSL simply due to lack of - implementation. - -- ssh2_echo: Value stored to 'exitcode' is never read + Fixes VS2012 code analysis warning C6011: + dereferencing NULL pointer 'bignum'. libssh2 wincng.c 1567 -- _libssh2_packet_add: fix SSH_MSG_DEBUG weirdness +- wincng.c: fix possible use of uninitialized memory - I believe I may have caused this weird typo style error when I cleaned - up this function a while ago. Corrected now. + Fixes VS2012 code analysis warning C6001: + using uninitialized memory 'cbDecoded'. libssh2 wincng.c 553 -- uint32: more longs converted to proper types +- packet.c: fix possible NULL pointer de-reference within listen_state - I also moved the MAC struct over to the mac.h header file and made sure - that the users of that struct include that file. + Fixes VS2012 code analysis warning C6011: + dereferencing NULL pointer 'listen_state->channel'. libssh2 packet.c 221 -- SFTP: more types to uint32_t +- kex.c: fix possible NULL pointer de-reference with session->kex - The 'num_names' field in the SSH_FXP_NAME response is an unsigned 32bit - value so we make sure to treat it like that. + Fixes VS2012 code analysis warning C6011: + dereferencing NULL pointer 'session->kex'. libssh2 kex.c 1761 -- SFTP: request_ids are uint32_t +- agent.c: check return code of MapViewOfFile - I went over the code and made sure we use uint32_t all over for the - request_id data. It is an unsigned 32bit value on the wire. - -- SFTP: store request_id separately in packets + Fixes VS2012 code analysis warning C6387: 'p+4' may be '0': + this does not adhere to the specification for the function + 'memcpy': libssh2 agent.c 330 + + Fixes VS2012 code analysis warning C6387: 'p' may be '0': + this does not adhere to the specification for the function + 'UnmapViewOfFile': libssh2 agent.c 333 + +- examples on Windows: check for socket return code + + Fixes VS2012 code analysis warning C28193: + The variable holds a value that must be examined + +- examples on Windows: check for WSAStartup return code + + Fixes VS2012 code analysis warning C6031: + return value ignored: could return unexpected value + +Guenter Knauf (11 Dec 2014) +- wincng.c: silent some more gcc compiler warnings. + +- wincng.c: silent gcc compiler warnings. + +- Watcom build: added support for WinCNG build. + +- build: updated dependencies in makefiles. + +Daniel Stenberg (4 Dec 2014) +- configure: change LIBS not LDFLAGS when checking for libs + + Closes #289 + + Patch-by: maurerpe + +Guenter Knauf (3 Dec 2014) +- MinGW build: some more GNUMakefile tweaks. + + test/GNUmakefile: added architecture autodetection; added switches to + CFLAGS and RCFLAGS to make sure that the right architecture is used. + Added support to build with WinCNG. + +- sftpdir.c: added authentication method detection. + + Stuff copied over from ssh2.c to make testing a bit easier. + +- NMake build: fixed LIBS settings. + +- NMake build: added support for WinCNG build. + +- MinGW build: some GNUMakefile tweaks. + + Added architecture autodetection; added switches to CFLAGS and + RCFLAGS to make sure that the right architecture is used. + Added support to build with WinCNG. + +- MinGW build: Fixed redefine warnings. + +- Updated copyright year. + +Daniel Stenberg (31 Aug 2014) +- COPYING: bump the copyright year + +Dan Fandrich (28 Jul 2014) +- docs: fixed a bunch of typos + +- docs: added missing libssh2_session_handshake.3 file + +Marc Hoersken (19 May 2014) +- wincng.c: specify the required libraries for dependencies using MSVC + + Initially reported by Bob Kast as "for MS VS builds, specify the + libraries that are required so they don't need to go into all + project files that may use this library". Thanks a lot. + +- [Bob Kast brought this change] + + windows build: do not export externals from static library + + If you are building a DLL, then you need to explicitly export each + entry point. When building a static library, you should not. + + libssh2 was exporting the entry points whether it was building a DLL or a + static library. To elaborate further, if libssh2 was used as a static + library, which was being linked into a DLL, the libssh2 API would be + exported from that separate DLL. + +Daniel Stenberg (19 May 2014) +- [Mikhail Gusarov brought this change] + + Fix typos in manpages + +Marc Hoersken (18 May 2014) +- wincng.c: Fixed memory leak in case of an error during ASN.1 decoding + +- configure: Display individual crypto backends on separate lines + + This avoids line-wrapping in between parameters and makes the + error message look like the following: + + configure: error: No crypto library found! + Try --with-libssl-prefix=PATH + or --with-libgcrypt-prefix=PATH + or --with-wincng on Windows + +- [Bob Kast brought this change] + + libssh2_priv.h: a 1 bit bit-field should be unsigned + + some compilers may not like this + +- knownhost.c: Fixed warning that pointer targets differ in signedness + +- wincng.c: Fixed warning about pointer targets differing in signedness + +- tcpip-forward.c: Fixed warning that pointer targets differ in signedness + + libssh2_channel_forward_listen_ex uses ints instead of unsigned ints. + +- misc.c: Fixed warning about mixed declarations and code + +- libgcrypt.h: Fixed warning about pointer targets differing in signedness + +- wincng.h: Fixed warning about pointer targets differing in signedness + +- misc.c: Fixed warning about unused parameter abstract + +- tcpip-forward.c: Removed unused variables shost, sport and sockopt + +- wincng.h: Added forward declarations for all WinCNG functions + + Initially reported by Bob Kast as "Wincng - define function + prototypes for wincng routines". Thanks a lot. + + Also replaced structure definitions with type definitions. + +- [Bob Kast brought this change] + + libssh2.h: on Windows, a socket is of type SOCKET, not int + +- win32: Added WinCNG targets to generated Visual Studio project + + Inspired by Bob Kast's reports, this commit enables the compilation + of libssh2 with WinCNG using the generated Visual Studio project files. + This commit adds WinCNG support to parts of the existing Win32 build + infrastructure, until new build systems, like pre-defined VS project + files or CMake files may be added. + + This commit and b20bfeb3e519119a48509a1099c06d65aa7da1d7 raise one + question: How to handle build systems, like VS project files, that + need to include all source files regardless of the desired target, + including all supported crypto backends? For now the mentioned commit + added a check for LIBSSH2_OPENSSL to openssl.c and with this commit + the supported crypto backends are hardcoded within Makefile.am. + +- libssh2_priv msvc: Removed redundant definition of inline keyword + + Initially reported by Bob Kast as "Remove redundant 'inline' define". + Thanks a lot. + +- wincng: Made data parameter to hash update function constant + + Initially reported by Bob Kast as "formal parameter must be const + since it is used in contexts where the actual parameter may be const". + Thanks a lot. + +- wincng: fix cross-compilation against the w64 mingw-runtime package + +- openssl: Check for LIBSSH2_OPENSSL in order to compile with openssl + +- wincng: Fixed use of possible uninitialized variable pPaddingInfo + + Reported by Bob Kast, thanks a lot. + +- wincng: Added cast for double to unsigned long conversion + +- wincng: Cleaned up includes and check NTSTATUS using macro + + Removed header file combination that is not supported on a real + Windows platform and can only be compiled using MinGW. Replaced + custom NTSTATUS return code checks with BCRYPT_SUCCESS macro. + +Daniel Stenberg (16 Mar 2014) +- userauth_hostbased_fromfile: zero assign to avoid uninitialized use + + Detected by clang-analyze + +- channel_receive_window_adjust: store windows size always + + Avoid it sometimes returning without storing it, leaving calling + functions with unknown content! + + Detected by clang-analyzer + +- publickey_packet_receive: avoid junk in returned pointers + + clang-analyzer found this risk it would return a non-initialized pointer + in a success case + +Peter Stuge (16 Mar 2014) +- [Marc Hoersken brought this change] + + Added Windows Cryptography API: Next Generation based backend + +- [Marc Hoersken brought this change] + + knownhost.c: fixed that 'key_type_len' may be used uninitialized + + ../src/knownhost.c: In function 'libssh2_knownhost_readline': + ../src/knownhost.c:651:16: warning: 'key_type_len' may be used + uninitialized in this function [-Wmaybe-uninitialized] + rc = knownhost_add(hosts, hostbuf, NULL, + ^ + ../src/knownhost.c:745:12: note: 'key_type_len' was declared here + size_t key_type_len; + ^ + +- [Marc Hoersken brought this change] + + pem.c: always compile pem.c independently of crypto backend + +- Fix non-autotools builds: Always define the LIBSSH2_OPENSSL CPP macro + + Commit d512b25f69a1b6778881f6b4b5ff9cfc6023be42 introduced a crypto + library abstraction in the autotools build system, to allow us to more + easily support new crypto libraries. In that process it was found that + all other build system which we support are hard-coded to build with + OpenSSL. Commit f5c1a0d98bd51aeb24aca3d49c7c81dcf8bd858d fixes automake + introduced into non-autotools build systems but still overlooked the + CPP macro saying that we are using OpenSSL. + + Thanks to Marc Hörsken for identifying this issue and proposing a fix + for win32/{GNUmakefile,config.mk}. This commit uses a slightly different + approach but the end result is the same. + +Dan Fandrich (15 Mar 2014) +- channel_close: Close the channel even in the case of errors + +- sftp_close_handle: ensure the handle is always closed + + Errors are reported on return, but otherwise the close path is + completed as much as possible and the handle is freed on exit. + +Alexander Lamaison (6 Mar 2014) +- knownhost: Restore behaviour of `libssh2_knownhost_writeline` with short buffer. + + Commit 85c6627c changed the behaviour of `libssh2_knownhost_writeline` so that it stopped returning the number of bytes needed when the given buffer was too small. Also, the function changed such that is might write to part of the buffer before realising it is too small. + + This commit restores the original behaviour, whilst keeping the unknown-key-type functionality that 85c6627c. Instead of writing to the buffer piecemeal, the length of the various parts is calculated up front and the buffer written only if there is enough space. The calculated necessary size is output in `outlen` regardless of whether the buffer was written to. + + The main use-case for the original behaviour that this commit restores is to allow passing in a NULL buffer to get the actual buffer size needed, before calling the function again with the buffer allocated to the exact size required. + +- knownhost: Fix DSS keys being detected as unknown. + + I missing `else` meant ssh-dss format keys were being re-detected as unknown format. + +Dan Fandrich (6 Mar 2014) +- knownhosts: Abort if the hosts buffer is too small + + This could otherwise cause a match on the wrong host + +- agent_list_identities: Fixed memory leak on OOM + +- Fixed a few typos + +- userauth: Fixed an attempt to free from stack on error + +- Fixed a few memory leaks in error paths + +- Fixed two potential use-after-frees of the payload buffer + + The first might occur if _libssh2_packet_add returns an error, as + fullpacket_state wasn't reset to idle so if it were possible for + fullpacket to be called again, it would return to the same state + handler and re-use the freed p->packet buffer. + + The second could occur if decrypt returned an error, as it freed the + packet buffer but did not clear total_num, meaning that freed buffer + could be written into again later. + +Alexander Lamaison (28 Nov 2013) +- Fix missing `_libssh2_error` in `_libssh2_channel_write`. + + In one case, the error code from `_libssh2_transport_read` was being returned from `_libssh2_channel_write` without setting it as the last error by calling `_libssh2_error`. This commit fixes that. + + Found when using a session whose socket had been inadvertently destroyed. The calling code got confused because via `libssh2_session_last_error` it appeared no error had occurred, despite one being returned from the previous function. + +Kamil Dudka (21 Nov 2013) +- [Mark McPherson brought this change] + + openssl: initialise the digest context before calling EVP_DigestInit() + + When using the OpenSSL libraries in FIPS mode, the function call + EVP_DigestInit() is actually #defined to FIPS_digestinit(). + Unfortunately wheres EVP_DigestInit() initialises the context and then + calls EVP_DigestInit_ex(), this function assumes that the context has + been pre-initialised and crashes when it isn't. + + Bug: https://trac.libssh2.org/ticket/279 + + Fixes #279 + +- [Marc Hörsken brought this change] + + .gitignore: Ignore files like src/libssh2_config.h.in~ + +Peter Stuge (13 Nov 2013) +- Move automake conditionals added by commit d512b25f out of Makefile.inc + + Commit d512b25f69a1b6778881f6b4b5ff9cfc6023be42 added automake + conditionals to Makefile.inc but since Makefile.inc is included + from Makefile for all other build systems that does not work. + + This commit instead adds Makefile.OpenSSL.inc and Makefile.libgcrypt.inc + and moves the automake conditional to its proper place, src/Makefile.am. + + The automake conditional includes the correct Makefile.$name.inc per + the crypto library selection/detection done by configure. + + All non-autotools build system files in libssh2 are hardcoded to use + OpenSSL and do not get a conditional but at least there is some reuse + because they can all include the new Makefile.OpenSSL.inc. + +Daniel Stenberg (27 Oct 2013) +- [Salvador Fandino brought this change] + + Set default window size to 2MB + + The default channel window size used until now was 256KB. This value is + too small and results on a bottleneck on real-life networks where + round-trip delays can easily reach 300ms. + + The issue was not visible because the configured channel window size + was being ignored and a hard-coded value of ~22MB being used instead, + but that was fixed on a previous commit. + + This patch just changes the default window size + (LIBSSH2_CHANNEL_WINDOW_DEFAULT) to 2MB. It is the same value used by + OpenSSH and in our opinion represents a good compromise between memory + used and transfer speed. + + Performance tests were run to determine the optimum value. The details + and related discussion are available from the following thread on the + libssh2 mailing-list: + + http://www.libssh2.org/mail/libssh2-devel-archive-2013-10/0018.shtml + http://article.gmane.org/gmane.network.ssh.libssh2.devel/6543 + + An excerpt follows: + + "I have been running some transfer test and measuring their speed. + + My setup was composed of a quad-core Linux machine running Ubuntu 13.10 + x86_64 with a LXC container inside. The data transfers were performed + from the container to the host (never crossing through a physical + network device). + + Network delays were simulated using the tc tool. And ping was used to + verify that they worked as intended during the tests. + + The operation performed was the equivalent to the following ssh command: + + $ ssh container "dd bs=16K count=8K if=/dev/zero" >/dev/null + + Though, establishment and closing of the SSH connection was excluded + from the timings. + + I run the tests several times transferring files of sizes up to 128MB + and the results were consistent between runs. + + The results corresponding to the 128MB transfer are available here: + + https://docs.google.com/spreadsheet/ccc?key=0Ao1yRmX6PQQzdG5wSFlrZl9HRWNET3ZyN0hnaGo5ZFE&usp=sharing + + It clearly shows that 256KB is too small as the default window size. + Moving to a 512MB generates a great improvement and after the 1MB mark + the returns rapidly diminish. Other factors (TCP window size, probably) + become more limiting than the channel window size + + For comparison I also performed the same transfers using OpenSSH. Its + speed is usually on par with that of libssh2 using a window size of 1MB + (even if it uses a 2MB window, maybe it is less aggressive sending the + window adjust msgs)." + + Signed-off-by: Salvador Fandino + +- [Salvador brought this change] + + _libssh2_channel_read: Honour window_size_initial + + _libssh2_channel_read was using an arbitrary hard-coded limit to trigger + the window adjusting code. The adjustment used was also hard-coded and + arbitrary, 15MB actually, which would limit the usability of libssh2 on + systems with little RAM. + + This patch, uses the window_size parameter passed to + libssh2_channel_open_ex (stored as remote.window_size_initial) plus the + buflen as the base for the trigger and the adjustment calculation. + + The memory usage when using the default window size is reduced from 22MB + to 256KB per channel (actually, if compression is used, these numbers + should be incremented by ~50% to account for the errors between the + decompressed packet sizes and the predicted sizes). + + My tests indicate that this change does not impact the performance of + transfers across localhost or a LAN, being it on par with that of + OpenSSH. On the other hand, it will probably slow down transfers on + networks with high bandwidth*delay when the default window size + (LIBSSH2_CHANNEL_WINDOW_DEFAULT=256KB) is used. + + Signed-off-by: Salvador Fandino + +- [Salvador Fandino brought this change] + + knownhosts: handle unknown key types + + Store but don't use keys of unsupported types on the known_hosts file. + + Currently, when libssh2 parses a known_host file containing keys of some + type it doesn't natively support, it stops reading the file and returns + an error. + + That means, that the known_host file can not be safely shared with other + software supporting other key types (i.e. OpenSSH). + + This patch adds support for handling keys of unknown type. It can read + and write them, even if they are never going to be matched. + + At the source level the patch does the following things: + + - add a new unknown key type LIBSSH2_KNOWNHOST_KEY_UNKNOWN + + - add a new slot (key_type_name) on the known_host struct that is + used to store the key type in ascii form when it is not supported + + - parse correctly known_hosts entries with unknown key types and + populate the key_type_name slot + + - print correctly known_hosts entries of unknown type + + - when checking a host key ignore keys that do not match the key + + Fixes #276 + +- windows build: fix build errors + + Fixes various link errors with VS2010 + + Reported-by: "kdekker" + Fixes #272 + +- man page: add missing function argument + + for libssh2_userauth_publickey_fromfile_ex() + + Reported-by: "pastey" + + Fixes #262 + +- [Salvador brought this change] + + Fix zlib deflate usage + + Deflate may return Z_OK even when not all data has been compressed + if the output buffer becomes full. + + In practice this is very unlikely to happen because the output buffer + size is always some KBs larger than the size of the data passed for + compression from the upper layers and I think that zlib never expands + the data so much, even on the worst cases. + + Anyway, this patch plays on the safe side checking that the output + buffer is not exhausted. + + Signed-off-by: Salvador + +- [Salvador brought this change] + + comp_method_zlib_decomp: Improve buffer growing algorithm + + The old algorithm was O(N^2), causing lots and lots of reallocations + when highly compressed data was transferred. + + This patch implements a simpler one that just doubles the buffer size + everytime it is exhausted. It results in O(N) complexity. + + Also a smaller inflate ratio is used to calculate the initial size (x4). + + Signed-off-by: Salvador + +- [Salvador brought this change] + + Fix zlib usage + + Data may remain in zlib internal buffers when inflate() returns Z_OK + and avail_out == 0. In that case, inflate has to be called again. + + Also, once all the data has been inflated, it returns Z_BUF_ERROR to + signal that the input buffer has been exhausted. + + Until now, the way to detect that a packet payload had been completely + decompressed was to check that no data remained on the input buffer + but that didn't account for the case where data remained on the internal + zlib buffers. + + That resulted in packets not being completely decompressed and the + missing data reappearing on the next packet, though the bug was masked + by the buffer allocation algorithm most of the time and only manifested + when transferring highly compressible data. + + This patch fixes the zlib usage. + + Signed-off-by: Salvador + +- [Salvador brought this change] + + _libssh2_channel_read: fix data drop when out of window + + After filling the read buffer with data from the read queue, when the + window size was too small, "libssh2_channel_receive_window_adjust" was + called to increase it. In non-blocking mode that function could return + EAGAIN and, in that case, the EAGAIN was propagated upwards and the data + already read on the buffer lost. + + The function was also moving between the two read states + "libssh2_NB_state_idle" and "libssh2_NB_state_created" both of which + behave in the same way (excepting a debug statment). + + This commit modifies "_libssh2_channel_read" so that the + "libssh2_channel_receive_window_adjust" call is performed first (when + required) and if everything goes well, then it reads the data from the + queued packets into the read buffer. + + It also removes the useless "libssh2_NB_state_created" read state. + + Some rotted comments have also been updated. + + Signed-off-by: Salvador + +- [Salvador Fandino brought this change] + + window_size: redid window handling for flow control reasons + + Until now, the window size (channel->remote.window_size) was being + updated just after receiving the packet from the transport layer. + + That behaviour is wrong because the channel queue may grow uncontrolled + when data arrives from the network faster that the upper layer consumes + it. + + This patch adds a new counter, read_avail, which keeps a count of the + bytes available from the packet queue for reading. Also, now the window + size is adjusted when the data is actually read by an upper layer. + + That way, if the upper layer stops reading data, the window will + eventually fill and the remote host will stop sending data. When the + upper layers reads enough data, a window adjust packet is delivered and + the transfer resumes. + + The read_avail counter is used to detect the situation when the remote + server tries to send data surpassing the window size. In that case, the + extra data is discarded. + + Signed-off-by: Salvador + +Peter Stuge (15 Sep 2013) +- configure.ac: Call zlib zlib and not libz in text but keep option names + +- configure.ac: Reorder --with-* options in --help output + +- configure.ac: Rework crypto library detection + + This further simplifies adding new crypto libraries. + +- Clean up crypto library abstraction in build system and source code + + libssh2 used to explicitly check for libgcrypt and default to OpenSSL. + + Now all possible crypto libraries are checked for explicitly, making + the addition of further crypto libraries both simpler and cleaner. + +- configure.ac: Add zlib to Requires.private in libssh2.pc if using zlib + +- Revert "Added Windows Cryptography API: Next Generation based backend" + + This reverts commit d385230e15715e67796f16f3e65fd899f21a638b. + +Daniel Stenberg (7 Sep 2013) +- [Leif Salomonsson brought this change] + + sftp_statvfs: fix for servers not supporting statfvs extension + + Fixes issue arising when server does not support statfvs and or fstatvfs + extensions. sftp_statvfs() and sftp_fstatvfs() after this patch will + handle the case when SSH_FXP_STATUS is returned from server. + +- [Marc Hoersken brought this change] + + Added Windows Cryptography API: Next Generation based backend + +- [Kamil Dudka brought this change] + + partially revert "window_size: explicit adjustments only" + + This partially reverts commit 03ca9020756a4e16f0294e5b35e9826ee6af2364 + in order to fix extreme slowdown when uploading to localhost via SFTP. + + I was able to repeat the issue on RHEL-7 on localhost only. It did not + occur when uploading via network and it did not occur on a RHEL-6 box + with the same version of libssh2. + + The problem was that sftp_read() used a read-ahead logic to figure out + the window_size, but sftp_packet_read() called indirectly from + sftp_write() did not use any read-ahead logic. + +- _libssh2_channel_write: client spins on write when window full + + When there's no window to "write to", there's no point in waiting for + the socket to become writable since it most likely just will continue to + be. + + Patch-by: ncm + Fixes #258 + +- _libssh2_channel_forward_cancel: avoid memory leaks on error + + Fixes #257 + +- _libssh2_packet_add: avoid using uninitialized memory + + In _libssh2_packet_add, called by _libssh2_packet_read, a call to + _libssh2_packet_send that is supposed to send a one-byte message + SSH_MSG_REQUEST_FAILURE would send an uninitialized byte upon re-entry + if its call to _send returns _EAGAIN. + + Fixes #259 + +- _libssh2_channel_forward_cancel: accessed struct after free + + ... and the assignment was pointless anyway since the struct was about + to be freed. Bug introduced in dde2b094. + + Fixes #268 + +Peter Stuge (2 Jun 2013) +- [Marc Hoersken brought this change] + + Fixed compilation using mingw-w64 + +- [Marc Hoersken brought this change] + + knownhost.c: use LIBSSH2_FREE macro instead of free + + Use LIBSSH2_FREE instead of free since + _libssh2_base64_encode uses LIBSSH2_ALLOC + +Daniel Stenberg (18 May 2013) +- [Matthias Kerestesch brought this change] + + libssh2_agent_init: init ->fd to LIBSSH2_INVALID_SOCKET + + ... previously it was left at 0 which is a valid file descriptor! + + Bug: https://trac.libssh2.org/ticket/265 + + Fixes #265 + +- userauth_password: pass on the underlying error code + + _libssh2_packet_requirev() may return different errors and we pass that + to the parent instead of rewriting it. + + Bug: http://libssh2.org/mail/libssh2-devel-archive-2013-04/0029.shtml + Reported by: Cosmin + +Peter Stuge (9 May 2013) +- [Marc Hoersken brought this change] + + libcrypt.c: Fix typo in _libssh2_rsa_sha1_sign() parameter type + +Kamil Dudka (4 May 2013) +- configure.ac: replace AM_CONFIG_HEADER with AC_CONFIG_HEADERS + + Reported by: Quintus + Bug: https://trac.libssh2.org/ticket/261 + +Guenter Knauf (12 Apr 2013) +- Fixed copyright string for NetWare build. + +Daniel Stenberg (9 Apr 2013) +- [Richard W.M. Jones brought this change] + + sftp: Add support for fsync (OpenSSH extension). + + The new libssh2_sftp_fsync API causes data and metadata in the + currently open file to be committed to disk at the server. + + This is an OpenSSH extension to the SFTP protocol. See: + + https://bugzilla.mindrot.org/show_bug.cgi?id=1798 + +- [Richard W.M. Jones brought this change] + + sftp: statvfs: Along error path, reset the correct 'state' variable. + +- [Richard W.M. Jones brought this change] + + sftp: seek: Don't flush buffers on same offset + + Signed-off-by: Richard W.M. Jones + +Guenter Knauf (9 Feb 2013) +- Updated dependency libs. + +- Fixed tool macro names. + +Daniel Stenberg (29 Nov 2012) +- [Seth Willits brought this change] + + compiler warnings: typecast strlen in macros + + ... in macro parameters to avoid compiler warnings about lost precision. + + Several macros in libssh2.h call strlen and pass the result directly to + unsigned int parameters of other functions, which warns about precision + loss because strlen returns size_t which is unsigned long on at least + some platforms (such as OS X). The fix is to simply typecast the + strlen() result to unsigned int. + +- libssh2.h: bump version to 1.4.4-DEV + +Version 1.4.3 (27 Nov 2012) + +Daniel Stenberg (27 Nov 2012) +- RELEASE-NOTES: fixed for 1.4.3 + +- sftp_read: return error if a too large package arrives + +Peter Stuge (13 Nov 2012) +- Only define _libssh2_dsa_*() functions when building with DSA support + +Guenter Knauf (8 Nov 2012) +- Added .def file to output. + +Kamil Dudka (1 Nov 2012) +- libssh2_hostkey_hash.3: update the description of return value + + The function returns NULL also if the hash algorithm is not available. + +Guenter Knauf (24 Oct 2012) +- Fixed mode acciedently committed. + +- Ignore generated file. + +- Added hack to make use of Makefile.inc. + + This should avoid further maintainance of the objects list. + +- Fixed MSVC NMakefile. + + Added missing source files; added resource for DLL. + +Kamil Dudka (22 Oct 2012) +- examples: use stderr for messages, stdout for data + + Reported by: Karel Srot + Bug: https://bugzilla.redhat.com/867462 + +- openssl: do not leak memory when handling errors + + ,.. in aes_ctr_init(). Detected by Coverity. + +- channel: fix possible NULL dereference + + ... in libssh2_channel_get_exit_signal(). Detected by Coverity. + +- Revert "aes: the init function fails when OpenSSL has AES support" + + This partially reverts commit f4f2298ef3635acd031cc2ee0e71026cdcda5864. + + We need to use the EVP_aes_???_ctr() functions in FIPS mode. + +- crypt: use hard-wired cipher block sizes consistently + +- openssl: do not ignore failure of EVP_CipherInit() + +- kex: do not ignore failure of libssh2_md5_init() + + The MD5 algorithm is disabled when running in FIPS mode. + +Daniel Stenberg (21 Aug 2012) +- [Peter Krempa brought this change] + + known_hosts: Fail when parsing unknown keys in known_hosts file. + + libssh2_knownhost_readfile() silently ignored problems when reading keys + in unsupported formats from the known hosts file. When the file is + written again from the internal structures of libssh2 it gets truntcated + to the point where the first unknown key was located. + + * src/knownhost.c:libssh2_knownhost_readfile() - return error if key + parsing fails + +- AUTHORS: synced with 42fec44c8a4 + + 31 recent authors added + +- [Dave Hayden brought this change] + + compression: add support for zlib@openssh.com + + Add a "use_in_auth" flag to the LIBSSH2_COMP_METHOD struct and a + separate "zlib@openssh.com" method, along with checking session->state + for LIBSSH2_STATE_AUTHENTICATED. Appears to work on the OpenSSH servers + I've tried against, and it should work as before with normal zlib + compression. + +- [Dmitry Smirnov brought this change] + + configure: gcrypt doesn't come with pkg-config support + + ... so use plain old -lgcrypt to the linker to link with it. + + Fixes #225 + +- sftp_read: Value stored to 'next' is never read + + Detected by clang-analyzer + +- publickey_init: errors are negative, fix check + + Detected by clang-analyzer. + +- [Maxime Larocque brought this change] + + session_free: wrong variable used for keeping state + + If libssh2_session_free is called without the channel being freed + previously by libssh2_channel_free a memory leak could occur. + + A mismatch of states variables in session_free() prevent the call to + libssh2_channel_free function. session->state member is used instead of + session->free_state. - By using a new separate struct for incoming SFTP packets and not sharing - the generic packet struct, we can get rid of an unused field and add a - new one dedicated for holding the request_id for the incoming - package. As sftp_packet_ask() is called fairly often, a "mere" integer - comparison is MUCH faster than the previous memcmp() of (typically) 5 - bytes. + It causes a leak of around 600 bytes on every connection on my systems + (Linux, x64 and PPC). + + (Debugging done under contract for Accedian Networks) + + Fixes #246 -- libssh2_sftp_open_ex: man page extended and cleaned up +Guenter Knauf (29 Jun 2012) +- Small NetWare makefile tweak. + +- Some small Win32 makefile fixes. + +Daniel Stenberg (19 Jun 2012) +- libssh2_userauth_publickey_fromfile_ex.3: mention publickey == NULL + +- comp_method_zlib_decomp: handle Z_BUF_ERROR when inflating - I added the missing documentation for the 'flags' argument. + When using libssh2 to perform an SFTP file transfer from the "JSCAPE MFT + Server" (http://www.jscape.com) the transfer failed. The default JSCAPE + configuration is to enforce zlib compression on SSH2 sessions so the + session was compressed. The relevant part of the debug trace contained: + + [libssh2] 1.052750 Transport: unhandled zlib error -5 + [libssh2] 1.052750 Failure Event: -29 - decompression failure + + The trace comes from comp_method_zlib_decomp() in comp.c. The "unhandled + zlib error -5" is the status returned from the zlib function + inflate(). The -5 status corresponds to "Z_BUF_ERROR". + + The inflate() function takes a pointer to a z_stream structure and + "inflates" (decompresses) as much as it can. The relevant fields of the + z_stream structure are: + + next_in - pointer to the input buffer containing compressed data + avail_in - the number of bytes available at next_in + next_out - pointer to the output buffer to be filled with uncompressed + data + avail_out - how much space available at next_out + + To decompress data you set up a z_stream struct with the relevant fields + filled in and pass it to inflate(). On return the fields will have been + updated so next_in and avail_in show how much compressed data is yet to + be processed and next_out and avail_out show how much space is left in + the output buffer. + + If the supplied output buffer is too small then on return there will be + compressed data yet to be processed (avail_in != 0) and inflate() will + return Z_OK. In this case the output buffer must be grown, avail_out + updated and inflate() called again. + + If the supplied output buffer was big enough then on return the + compressed data will have been exhausted (avail_in == 0) and inflate() + will return Z_OK, so the data has all been uncompressed. + + There is a corner case where inflate() makes no progress. That is, there + may be unprocessed compressed data and space available in the output + buffer and yet the function does nothing. In this case inflate() will + return Z_BUF_ERROR. From the zlib documentation and the source code it + is not clear under what circumstances this happens. It could be that it + needs to write multiple bytes (all in one go) from its internal state to + the output buffer before processing the next chunk of input but but + can't because there is not enough space (though my guesses as to the + cause are not really relevant). Recovery from Z_BUF_ERROR is pretty + simple - just grow the output buffer, update avail_out and call + inflate() again. + + The comp_method_zlib_decomp() function does not handle the case when + inflate() returns Z_BUF_ERROR. It treats it as a non-recoverable error + and basically aborts the session. + + Fixes #240 -- SFTP: unify the READ/WRITE chunk structs +Guenter Knauf (12 Jun 2012) +- MinGW makefile tweaks. + + Use GNU tools when compiling on Linux. + Fixed dist and dev targets. + +- NetWare makefile tweaks. + + Changed to use Windows commandline tools instead of + GNU tools when compiling on Windows. Fixed dist and + dev targets. Enabled nlmconv error for unresolved + symbols. + +Daniel Stenberg (11 Jun 2012) +- Revert "config.rpath: generated file, no need to keep in git" + + This reverts commit 1ac7bd09cc685755577fb2c8829adcd081e7ab3c. + + This file still used by lib/*m4 functions so we need to keep the file + around. + +- BINDINGS: added PySsh2, a Python-ctypes binding + +Guenter Knauf (8 Jun 2012) +- Fixed MinGW debug build. + +Daniel Stenberg (5 Jun 2012) +- BINDINGS: Added the Cocoa/Objective-C one + + ... and sorted the bindings after the languages, alphabetically + + Reported by: Mike Abdullah + +- BINDINGS: document the bindings we know of + +Guenter Knauf (4 Jun 2012) +- Fixed LIBSSH2_INT64_T_FORMAT macro. + + Usually a format macro should hold the whole format, otherwise + it should be named a prefix. Also fixed usage of this macro in + scp.c for a signed var where it was used as prefix for unsigned. + +- Removed obsolete define from makefiles. + +- Renamed NetWare makefiles. + +- Renamed NetWare makefiles. + +- Synced MinGW makefiles with 56c64a6..39e438f. + + Also synced MinGW test makefile with b092696..f8cb874. + +Peter Stuge (30 May 2012) +- Revert "sftp: Don't send attrs.permissions on read-only SSH_FXP_OPEN" + + This reverts commit 04e79e0c798674a0796be8a55f63dd92e6877790. + +- sftp: Don't send attrs.permissions on read-only SSH_FXP_OPEN + + This works around a protocol violation in the ProFTPD 1.3.4 mod_sftp + server, as reported by Will Cosgrove in: + + http://libssh2.org/mail/libssh2-devel-archive-2012-05/0079.shtml + + Based on a suggested fix by TJ Saunders in: + + http://libssh2.org/mail/libssh2-devel-archive-2012-05/0104.shtml + +Guenter Knauf (28 May 2012) +- Try to detect OpenSSL build type automatically. + + Also fixed recently added libgdi32 linkage which is only + required when OpenSSL libs are linked statically. + +Daniel Stenberg (25 May 2012) +- config.rpath: generated file, no need to keep in git + +Guenter Knauf (22 May 2012) +- Updated dependency libary versions. + +Daniel Stenberg (18 May 2012) +- 1.4.3: towards the future + +Version 1.4.2 (18 May 2012) + +Daniel Stenberg (18 May 2012) +- RELEASE-NOTES: synced with 92a9f952794 + +Alexander Lamaison (15 May 2012) +- win32/libssh2_config.h: Remove hardcoded #define LIBSSH2_HAVE_ZLIB. + + Rationale: Everything else in this file states a fact about the win32 + platform that is unconditional for that platform. There is nothing + unconditional about the presence of zlib. It is neither included with + Windows nor with the platform SDK. Therefore, this is not an appropriate + place to assert its presence. Especially as, once asserted, it cannot be + overridden using a compiler flag. + + In contrast, if it is omitted, then it can easily be reasserted by adding + a compiler flag defining LIBSSH2_HAVE_ZLIB. + +Daniel Stenberg (14 May 2012) +- RELEASE-NOTES: synced with 69a3354467c + +- _libssh2_packet_add: SSH_MSG_CHANNEL_REQUEST default to want_reply + + RFC4254 says the default 'want_reply' is TRUE but the code defaulted to + FALSE. Now changed. + + Fixes #233 + +- gettimeofday: no need for a replacement under cygwin + + Fixes #224 + +Alexander Lamaison (13 May 2012) +- Prevent sftp_packet_read accessing freed memory. + + sftp_packet_add takes ownership of the packet passed to it and (now that we + handle zombies) might free the packet. sftp_packet_read uses the packet type + byte as its return code but by this point sftp_packet_add might have freed + it. This change fixes the problem by caching the packet type before calling + sftp_packet_add. + + I don't understand why sftp_packet_read uses the packet type as its return + code. A future change might get rid of this entirely. + +Daniel Stenberg (12 May 2012) +- sftp_packet_flush: flush zombies too + + As this function is called when the SFTP session is closed, it needs to + also kill all zombies left in the SFTP session to avoid leaking memory + just in case some zombie would still be in there. + +- sftp_packetlist_flush: zombies must not have responses already + + When flushing the packetlist, we must only add the request as a zombie + if no response has already been received. Otherwise we could wrongly + make it a zombie even though the response was already received and then + we'd get a zombie stuck there "forever"... + +- sftp_read: on EOF remove packet before flush + + Since the sftp_packetlist_flush() function will move all the existing + FXP_READ requests in this handle to the zombie list we must first remove + this just received packet as it is clearly not a zombie. + +- sftp_packet_require: sftp_packet_read() returning 0 is not an error + + Exactly as the comment in the code said, checking the return code from + sftp_packet_read() with <= was wrong and it should be < 0. With the new + filtering on incoming packets that are "zombies" we can now see this + getting zero returned. + +- sftp_packetlist_flush: only make it zombie if it was sent + + The list of outgoing packets may also contain packets that never were + sent off and we better not make them zombies too. + +- [Alexander Lamaison brought this change] + + Mark outstanding read requests after EOF as zombies. + + In order to be fast, sftp_read sends many read requests at once. With a small + file, this can mean that when EOF is received back, many of these requests are + still outstanding. Responses arriving after we close the file and abandon the + file handle are queued in the SFTP packet queue and never collected. This + causes transfer speed to drop as a progressively longer queue must be searched + for every packet. + + This change introduces a zombie request-ID list in the SFTP session that is + used to recognise these outstanding requests and prevent them being added to + the queue. + +Peter Stuge (23 Apr 2012) +- [Rafael Kitover brought this change] -- SFTP: fix memory leaks + Update win32/GNUmakefile to use OpenSSL 1.0.1a - Make sure that we cleanup remainders when the handle is closed and when - the subsystem is shutdown. + libcrypto on win32 now depends on gdi32.dll, so move the OpenSSL LDLIBS + block to before the compiler definitions, so that libcrypto gets added + first, and then add -lgdi32 into the following common LDLIBS for gcc. + +Guenter Knauf (23 Apr 2012) +- Changed 'Requires' to 'Requires.private'. - Existing flaw: if a single handle sends packets that haven't been - replied to yet at the time when the handle is closed, those packets will - arrive later and end up in the generic packet brigade queue and they - will remain in there until flushed. They will use unnecessary memory, - make things slower and they will ruin the SFTP handling if the - request_id counter ever wraps (highly unlikely to every happen). + Only static builds need to link against the crypto libs. -- sftp_close_handle: packet list is generic +- Fixed 'Requires:' names. - Fix comment, simplify the loop logic + The 'Requires:' line lists the names of the .pc files. -- sftp_read: pipeline reads +- Added 'Requires:' line to libssh2.pc. - The SFTP read function now does transfers the same way the SFTP write - function was made to recently: it creates a list of many outgoing - FXP_READ packets that each asks for a small data chunk. The code then - tries to keep sending read request while collecting the acks for the - previous requests and returns the received data. + This is necessary so that other libs which lookup libssh2 info + via pkg-config can add the right crypto lib dependencies. -- sftp_write: removed unused variable +- Updated dependency lib versions. -- _libssh2_channel_close: don't call transport read if disconnected +Peter Stuge (18 Apr 2012) +- configure.ac: Add option to disable build of the example applications - The loop that waits for remote.close to get set may end up looping - forever since session->socket_state gets set to - LIBSSH2_SOCKET_DISCONNECTED by the packet_add() function called from the - transport_read() function and after having been set to - LIBSSH2_SOCKET_DISCONNECTED, the transport_read() function will only - return 0. + Examples are built by default. Any of the following options on the + configure command line will skip building them: - Bug: http://trac.libssh2.org/ticket/198 + --disable-examples-build + --enable-examples-build=no + --enable-examples-build=false -- libssh2_sftp_seek64: new man page +- userauth.c: fread() from public key file to correctly detect any errors - Split off libssh2_sftp_seek64 from the libssh2_sftp_seek man page, and - mentioned that we consider the latter deprecated. Also added a mention - about the dangers of doing seek during writing or reading. - -- sftp_seek: fix + If the filename parameter for file_read_publickey() was the name of a + directory instead of a file then libssh2 would spin trying to fgetc() + from the FILE * for the opened directory when trying to determine the + length of the encoded public key, since fgetc() can't report errors. - The new SFTP write code caused a regression as the seek function no - longer worked as it didn't set the write position properly. + Use fread() instead to correctly detect this error condition along + with many others. - It should be noted that seeking is STRONGLY PROHIBITED during upload, as - the upload magic uses two different offset positions and the multiple - outstanding packets etc make them sensitive to change in the midst of - operations. + This fixes the problem reported in + http://www.libssh2.org/mail/libssh2-devel-archive-2012-04/0021.shtml - This functionality was just verified with the new example code - sftp_append. This bug was filed as bug #202: + Reported-by: Oleksiy Zagorskyi + +- Return LIBSSH2_ERROR_SOCKET_DISCONNECT on EOF when reading banner + +Guenter Knauf (17 Apr 2012) +- Fixed copyright year. + +- Updated dependency lib versions in static makefiles. + +Daniel Stenberg (6 Apr 2012) +- version: bump to 1.4.2 - Bug: http://trac.libssh2.org/ticket/202 + We're on the 1.4.2 track now (at least) -- sftp_append: new example doing SFTP append +Version 1.4.1 (4 Apr 2012) -- MAX_SFTP_OUTGOING_SIZE: 30000 +Daniel Stenberg (4 Apr 2012) +- RELEASE-NOTES: updated for 1.4.1 release + +- always do "forced" window updates - I ran SFTP upload tests against localhost. It showed that to make the - app reach really good speeds, I needed to do a little code tweak and - change MAX_SFTP_OUTGOING_SIZE from 4000 to 30000. The tests I did before - with the high latency tests didn't show any real difference whatever I - had that size set to. + When calling _libssh2_channel_receive_window_adjust() internally, we now + always use the 'force' option to prevent libssh2 to avoid sending the + update if the update isn't big enough. - This number is the size in bytes that libssh2 cuts off the large input - buffer and sends off as an individual sftp packet. + It isn't fully analyzed but we have seen corner cases which made a + necessary window update not get send due to this and then the other side + doesn't send data our side then sits waiting for forever. -- sftp_write_sliding.c: new example +- channel_read: force window adjusts! - This is an example that is very similar to sftp_write_nonblock.c, with - the exception that this uses + if there's not enough room to receive the data that's being requested, + the window adjustment needs to be sent to the remote and thus the force + option has to be used. _libssh2_channel_receive_window_adjust() would + otherwise "queue" small window adjustments for a later packet but that + is really terribly for the small buffer read that for example is the + final little piece of a very large file as then there is no logical next + packet! - 1 - a larger upload buffer + Reported by: Armen Babakhanian + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0130.shtml + +- [Paul Howarth brought this change] + + aes: the init function fails when OpenSSL has AES support - 2 - a sliding buffer mechnism to allow the app to keep sending lots of - data to libssh2 without having to first drain the buffer. + The internal init function only worked fine when the configure script + didn't detect the OpenSSL AES_CTR function! - These are two key issues to make libssh2 SFTP uploads really perform - well at this point in time. + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0111.shtml + Reported by: Paul Howarth -- cpp: s/#elsif/#elif - - This looks like a typo as #elsif is not really C... +- [Matthew Booth brought this change] -- _libssh2_channel_write: revert channel_write() use + transport_send: Finish in-progress key exchange before sending data - The attempts made to have _libssh2_channel_write() accept larger pieces - of data and split up the data by itself into 32700 byte chunks and pass - them on to channel_write() in a loop as a way to do faster operations on - larger data blocks was a failed attempt. + _libssh2_channel_write() first reads outstanding packets before writing + new data. If it reads a key exchange request, it will immediately start + key re-exchange, which will require sending a response. If the output + socket is full, this will result in a return from + _libssh2_transport_read() of LIBSSH2_ERROR_EAGAIN. In order not to block + a write because there is no data to read, this error is explicitly + ignored and the code continues marshalling a packet for sending. When it + is sent, the remote end immediately drops the connection because it was + expecting a continuation of the key exchange, but got a data packet. - The reason why it is difficult: + This change adds the same check for key exchange to + _libssh2_transport_send() that is in _libssh2_transport_read(). This + ensures that key exchange is completed before any data packet is sent. + +- channel_write: acknowledge transport errors - The API only allows EAGAIN or a length to be returned. When looping over - multiple blocks to get sent, one block can get sent and the next might - not. And yet: when transport_send() has returned EAGAIN we must not call - it again with new data until it has returned OK on the existing data it - is still working on. This makes it a mess and we do get a much easier - job by simply returning the bytes or EAGAIN at once, as in the EAGAIN - case we can assume that we will be called with the same arguments again - and transport_send() will be happy. + When draining data off the socket with _libssh2_transport_read() (which + in turn has to be done so that we can be sure to have read any possible + window-increasing packets), this code previously ignored errors which + could lead to nasty loops. Now all error codes except EAGAIN will cause + the error to be returned at once. - Unfortunately, I think we take a small performance hit by not being able - to do this. + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0068.shtml + Reported by: Matthew Booth -- ssh2_echo: new example - - This is a new example snippet. The code is largely based on ssh2_exec, - and is written by Tommy Lindgren. I edited it into C90 compliance and to - conform to libssh2 indent style and some more. +- [Steven Dake brought this change] -- send_existing: return after send_existing + In examples/x11.c, Make sure sizeof passed to read operation is correct - When a piece of data is sent from the send_existing() function we must - make the parent function return afterwards. Otherwise we risk that the - parent function tries to send more data and ends up getting an EGAIN for - that more data and since it can only return one return code it doesn't - return info for the successfully sent data. + sizeof(buf) expands to 8 or 4 (since its a pointer). This variable may + have been static in the past, leading to this error. - As this change is a regression I now added a larger comment explaining - why it has to work like this. + Signed-off-by: Steven Dake -- _libssh2_channel_write: count resent data as written - - In the logic that resends data that was kept for that purpose due to a - previous EAGAIN, the data was not counted as sent causing badness. +- [Steven Dake brought this change] -Peter Stuge (13 Nov 2010) -- Use fprintf(stderr, ) instead of write(2, ) for debugging + Fix suspicious sizeof usage in examples/x11.c + + In the x11 example, sizeof(buf) = 8UL (on x86_64), when this should + probably represent the buffer size available. I am not sure how to + test that this change is actually correct, however. + + Signed-off-by: Steven Dake -- session/transport: Correctly handle when _libssh2_send() returns -EAGAIN +- sftp_packet_read: follow-up fix for EAGAIN/window adjust + + The commit in 7194a9bd7ba45 wasn't complete. This change makes sure + variables are initialized properly before used in the EAGAIN and window + adjust cases. -- src/agent.c: Simplify _libssh2_send() error checking ever so slightly +- sftp_packet_add: use named error code instead of number -Daniel Stenberg (12 Nov 2010) -- send/recv: use _libssh2_recv and _libssh2_send now - - Starting now, we unconditionally use the internal replacement functions - for send() and recv() - creatively named _libssh2_recv() and - _libssh2_send(). +- sftp_packet_add: verify the packet before accepting it - On errors, these functions return the negative 'errno' value instead of - the traditional -1. This design allows systems that have no "natural" - errno support to not have to invent it. It also means that no code - outside of these two transfer functions should use the errno variable. + In order to bail out as quickly as possible when things are wrong and + out of sync, make sure the SFTP message is one we understand. -- channel_write: move some logic to _libssh2_channel_write +- SFTP: preserve the original error code more - Some checks are better done in _libssh2_channel_write just once per - write instead of in channel_write() since the looping will call the - latter function multiple times per _libssh2_channel_write() invoke. + Lots of places in the code translated the original error into the more + generic LIBSSH2_ERROR_SOCKET_TIMEOUT but this turns out to distort the + original error reason a lot and makes tracking down the real origin of a + problem really hard. This change makes the original error code be + preserved to a larger extent when return up to the parent function. -- sftp_write: handle "left over" acked data - - The SFTP handle struct now buffers number of acked bytes that haven't - yet been returned. The way this is used is as following: +- sftp_packet_read: adjust window size as necessary - 1. sftp_write() gets called with a buffer of let say size 32000. We - split 32000 into 8 smaller packets and send them off one by one. One of - them gets acked before the function returns so 4000 is returned. + Commit 03ca9020756 tried to simplify the window sizing logic but broke + SFTP readdir as there was no window sizing code left there so large + directory listings no longer worked. - 2. sftp_write() gets called again a short while after the previous one, - now with a much smaller size passed in to the function. Lets say 8000. - In the mean-time, all of the remaining packets from the previous call - have been acked (7*4000 = 28000). This function then returns 8000 as all - data passed in are already sent and it can't return any more than what - it got passed in. But we have 28000 bytes acked. We now store the - remaining 20000 in the handle->u.file.acked struct field to add up in - the next call. + This change introduces window sizing logic to the sftp_packet_read() + function so that it now tells the remote about the local size having a + window size that suffice when it is about to ask for directory data. - 3. sftp_write() gets called again, and now there's a backlogged 20000 - bytes to return as fine and that will get skipped from the beginning - of the buffer that is passed in. + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0069.shtml + Reported by: Eric -- sftp_write: polished and simplified +- [Steven Dake brought this change] + + Tell C compiler we don't care about return code of libssh2_init - Removed unnecessary struct fields and state changes within the function. + The call of libssh2_init returns a return code, but nothing could be done + within the _libssh2_init_if_needed execution path. - Made the loop that checks for ACKs only check chunks that were fully - sent. + Signed-off-by: Steven Dake -- SCP: on failure, show the numerical error reason +- [Steven Dake brought this change] + + Add comment indicating a resource leak is not really a resource leak - By calling libssh2_session_last_errno() + While possibly obvious to those investigating the code, coverity complains + about this out of scope leak. + + Signed-off-by: Steven Dake -- SFTP: provide the numerical error reason on failure +- [Steven Dake brought this change] -- SCP: clean up failure treatment + Use safer snprintf rather then sprintf in scp_send() - When SCP send or recv fails, it gets a special message from the server - with a warning or error message included. We have no current API to - expose that message but the foundation is there. Removed unnecessary use - of session struct fields. + Signed-off-by: Steven Dake -- sftp_write: enlarge buffer to perform better +- [Steven Dake brought this change] -- packets: code cleanup + Use safer snprintf rather then sprintf in scp_recv() - I added size checks in several places. I fixed the code flow to be easier - to read in some places. + While the buffer is indeed allocated to a safe length, better safe then sorry. - I removed unnecessary zeroing of structs. I removed unused struct fields. - -- LIBSSH2_CALLBACK_MACERROR: clarify return code use + Signed-off-by: Steven Dake -- _libssh2_userauth_publickey: avoid shadowing +- [Steven Dake brought this change] -- packet: avoid shadowing global symbols + use snprintf in knownhost_writeline() rather then sprintf + + Although the function checks the length, if the code was in error, there + could potentially be a buffer overrun with the use of sprintf. Instead replace + with snprintf. + + Signed-off-by: Steven Dake -- sftp_readdir: avoid shadowing +- [Steven Dake brought this change] -- shadowing: don't shadow the global compress + Add tracing to print packets left on session at libssh2_session_free + + Signed-off-by: Steven Dake -- _libssh2_packet_add: turn ifs into a single switch +Peter Stuge (2 Mar 2012) +- Define and use LIBSSH2_INVALID_SOCKET instead of INVALID_SOCKET + + INVALID_SOCKET is a special value in Windows representing a + non-valid socket identifier. We were #defining this to -1 on + non-Windows platforms, causing unneccessary namespace pollution. + Let's have our own identifier instead. + + Thanks to Matt Lawson for pointing this out. -- _libssh2_packet_add: check SSH_MSG_GLOBAL_REQUEST packet +- nw/Makefile.netware: Fix project name typo to avoid needless confusion -- _libssh2_packet_add: SSH_MSG_DEBUG length checks +- example/x11: Set raw terminal mode manually instead of with cfmakeraw() - Verify lengths before using them. Read always_display from the correct - index. Don't copy stuff around just to provide zero-termination of the - strings. + OpenSolaris has no cfmakeraw() so to make the example more portable + we simply do the equivalent operations on struct termios ourselves. + + Thanks to Tom Weber for reporting this problem, and finding a solution. -- _libssh2_packet_add: SSH_MSG_IGNORE skip memmove +Daniel Stenberg (17 Feb 2012) +- sftp_write: cannot return acked data *and* EAGAIN - There's no promise of a zero termination of the data in the callback so - no longer perform ugly operation in order to provide it. + Whenever we have acked data and is about to call a function that *MAY* + return EAGAIN we must return the number now and wait to get called + again. Our API only allows data *or* EAGAIN and we must never try to get + both. -- _libssh2_packet_add: SSH_MSG_DISCONNECT length checks +Peter Stuge (13 Feb 2012) +- example/x11: Build only when sys/un.h is found by configure - Verify lengths before trying to read data. + The example can't be built on systems without AF_UNIX sockets. -- indent: break lines at 80 columns +Daniel Stenberg (10 Feb 2012) +- [Alexander Lamaison brought this change] -- SSH_MSG_CHANNEL_OPEN_FAILURE: used defined values + Simplified sftp_read. - We don't like magic numbers in the code. Now the acceptable failure - codes sent in the SSH_MSG_CHANNEL_OPEN_FAILURE message are added as - defined values in the private header file. - -- sftp_write: don't return EAGAIN if no EAGAIN was received + Removed the total_read variable that originally must have tracked how + much data had been written to the buffer. With non-blocking reads, we + must return straight away once we have read data into the buffer so this + variable served not purpose. - This function now only returns EAGAIN if a lower layer actually returned - EAGAIN to it. If nothing was acked and no EAGAIN was received, it will - now instead return 0. + I think it was still hanging around in case the initial processing of + 'leftover' data meant we wrote to the buffer but this case, like the + others, must return immediately. Now that it does, the last remaining + need for the variable is gone. -- _libssh2_wait_socket: detect nothing-to-wait-for - - If _libssh2_wait_socket() gets called but there's no direction set to - wait for, this causes a "hang". This code now detects this situation, - set a 1 second timeout instead and outputs a debug output about it. +- [Alexander Lamaison brought this change] -- decomp: remove the free_dest argument + Cleaned up sftp_read and added more explanation. - Since the decompress function ALWAYS returns allocated memory we get a - lot simpler code by removing the ability to return data unallocated. + Replaced the gotos which were implementing the state machine with + a switch statement which makes the states more explicit. -- decomp: cleaned off old compression stuff +- sftp_read: avoid data *and* EAGAIN - I cleared off legacy code from when the compression and decompression - functions were a single unified function. Makes the code easier to read - too. - -- [TJ Saunders brought this change] - - decomp: increase decompression buffer sizes + Whenever we have data and is about to call a function that *MAY* return + EAGAIN we must return the data now and wait to get called again. Our API + only allows data *or* EAGAIN and we must never try to get both. -- [TJ Saunders brought this change] +Peter Stuge (2 Feb 2012) +- Add a tcpip-forward example which demonstrates remote port forwarding - zlib: Add debug tracing of zlib errors +- libssh2.h: Add missing prototype for libssh2_session_banner_set() -- sftp_packet_read: handle partial reads of the length field +- example/subsystem_netconf.c: Return error when read buffer is too small - SFTP packets come as [32 bit length][payload] and the code didn't - previously handle that the initial 32 bit field was read only partially - when it was read. + Also remove a little redundancy in the read loop condition. -- [Jasmeet Bagga brought this change] +- example/subsystem_netconf.c: Add a missing newline in an error message - kex_agree_hostkey: fix NULL pointer derefence - - While setting up the session, ssh tries to determine the type of - encryption method it can use for the session. This requires looking at - the keys offered by the remote host and comparing these with the methods - supported by libssh2 (rsa & dss). To do this there is an iteration over - the array containing the methods supported by libssh2. +- Fix undefined reference to _libssh_error in libgcrypt backend - If there is no agreement on the type of encryption we come to the 3rd - entry of the hostkeyp array. Here hostkeyp is valid but *hostkep is - NULL. Thus when we dereference that in (*hostkeyp)->name there is a - crash + Commit 209de22299b4b58e582891dfba70f57e1e0492db introduced a function + call to a non-existing function, and since then the libgcrypt backend + has not been buildable. -- _libssh2_transport_send: remove dead assignment - - 'data' isn't accessed beyond this point so there's no need to assign it. +Version 1.4.0 (31 Jan 2012) -- scp_recv: remove dead assignment +Daniel Stenberg (31 Jan 2012) +- RELEASE-NOTES: synced with 6bd584d29 for 1.4.0 + +- s/1.3.1/1.4.0 - Instead of assigning a variable we won't read, we now use the more - explicit (void) prefix. + We're bumping the minor number -- sftp_write: removed superfluous assignment +- [Jernej Kovacic brought this change] -- bugfix: avoid use of uninitialized value + libssh2_session_supported_algs: fix compiler warning -- sftp_packet_require: propagate error codes better - - There were some chances that they would cause -1 to get returned by - public functions and as we're hunting down all such occurances and since - the underlying functions do return valuable information the code now - passes back proper return codes better. +- [Jernej Kovacic brought this change] -- [Alfred Gebert brought this change] + session_supported_algs docs: added an example - fix memory leaks (two times cipher_data) for each sftp session +- [Gellule Xg brought this change] -- libssh2_userauth_authenticated: make it work as documented + sftp-seek: clear EOF flag - The man page clearly says it returns 1 for "already authenticated" but - the code said non-zero. I changed the code to use 1 now, as that is also - non-zero but it gets the benefit that it now matches the documentation. + Set the EOF flag to False when calling seek64 to be able to get some + data back on a following read + +- [Peter Krempa brought this change] + + userauth: Provide more informations if ssh pub key extraction fails - Using 1 instead of non-zero is better for two reasons: + If the function that extracts/computes the public key from a private key + fails the errors it reports were masked by the function calling it. This + patch modifies the key extraction function to return errors using + _libssh_error() function. The error messages are tweaked to contain + reference to the failed operaton in addition to the reason. - 1. We have the opportunity to introduce other return codes in the future for - things like error and what not. - 2. We don't expose the internal bitmask variable value. - -- userauth_keyboard_interactive: fix indent + * AUTHORS: - add my name + * libgcrypt.c: _libssh2_pub_priv_keyfile(): - return a more verbose + error using + _libssh2_error() func. + * openssl.c: - modify call graph of _libssh2_pub_priv_keyfile() to use + _libssh2_error for error reporting(); + * userauth.c: - tweak functions calling _libssh2_pub_priv_keyfile() not + to shadow error messages -- [Alfred Gebert brought this change] +- TODO: remove issues we (sort of) did already - fix memory leak in userauth_keyboard_interactive() +- ssh2_exec: skip error outputs for EAGAIN - First I wanted to free the memory in session_free() but then - I had still memory leaks because in my test case the function - userauth_keyboard_interactive() is called twice. It is called - twice perhaps because the server has this authentication - methods available: publickey,gssapi-with-mic,keyboard-interactive - The keyboard-interactive method is successful. - -- dist: include sftp.h in dist archives + Since the example uses non-blocking mode, it will just flood the output + with this "nonsense" error. -Simon Josefsson (27 Oct 2010) -- Update header to match new function prototype, see c48840ba88. +Guenter Knauf (30 Nov 2011) +- Some NetWare makefile tweaks. -Daniel Stenberg (26 Oct 2010) -- bugfixes: the transport rearrange left some subtle flaws now gone +Daniel Stenberg (18 Nov 2011) +- LIBSSH2_SFTP_PACKET_MAXLEN: increase to 80000 + + Some SFTP servers send SFTP packets larger than 40000. Since the limit + is only present to avoid insane sizes anyway, we can easily bump it. + + The define was formerly in the public header libssh2_sftp.h but served + no external purpose and was moved into the source dir. + + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-11/0004.shtml + Reported by: Michael Harris -- libssh2_userauth_publickey_fromfile_ex.3: cleaned up looks +Alexander Lamaison (18 Nov 2011) +- [Peter Krempa brought this change] -- libssh2_userauth_publickey: add man page + knownhost_check(): Don't dereference ext if NULL is passed - I found an undocumented public function and we can't have it like - that. The description here is incomplete, but should serve as a template - to allow filling in... - -- libssh2_sftp_write.3: added blurb about the "write ahead" + Documentation for libssh2_knownhost_checkp() and related functions + states that the last argument is filled with data if non-NULL. - Documented the new SFTP write concept - -- sftp_close_handle: free any trailing write chunks + "knownhost if set to non-NULL, it must be a pointer to a 'struct + libssh2_knownhost' pointer that gets filled in to point to info about a + known host that matches or partially matches." + + In this function ext is dereferenced even if set to NULL, causing + segfault in applications not needing the extra data. -- _libssh2_channel_write: fix warnings +Daniel Stenberg (11 Nov 2011) +- [Peter Krempa brought this change] -- SFTP: bufgix, move more sftp stuff to sftp.h + knownhost_add: Avoid dereferencing uninitialized memory on error path. - The sftp_write function shouldn't assume that the buffer pointer will be - the same in subsequent calls, even if it assumes that the data already - passed in before haven't changed. + In function knownhost_add, memory is alocated for a new entry. If normal + alocation is used, memory is not initialized to 0 right after, but a + check is done to verify if correct key type is passed. This test is done + BEFORE setting the memory to null, and on the error path function + free_host() is called, that tries to dereference unititialized memory, + resulting into a glibc abort(). - The sftp structs are now moved to sftp.h (which I forgot to add before) + * knownhost.c - knownhost_add(): - move typemask check before alloc -- SFTP: use multiple outgoing packets when writing +- windows build: add define to avoid compiler warning - sftp_write was rewritten to split up outgoing data into multiple packets - and deal with the acks in a more asynchronous manner. This is meant to - help overcome latency and round-trip problems with the SFTP protocol. + A recent mingw compiler has started to complain on "#warning Please + include winsock2.h before windows.h" unless the magic define is set + first. + + Reported by: Vincent Torri + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-10/0064.shtml -- TODO: implemented a lot of the ideas now +Henrik Nordstrom (31 Oct 2011) +- [Vincent Torri brought this change] -- _libssh2_channel_write: removed 32500 size limit + Correct Windows include file name case, simplifying cross-compilation - Neither _libssh2_channel_write nor sftp_write now have the 32500 size - limit anymore and instead the channel writing function now has its own - logic to send data in multiple calls until everything is sent. + When cross compiling to Windows, libssh2.h include Windows header files + with upper case filenames : BaseTsd.h and WinSock2.h. + + These files have lowercase names with mingw-w64 (iirc, it's the same with + mingw). And as on Windows, being lowercase or uppercase does not matter. -- send_existing: don't tell parent to return when drained +Daniel Stenberg (25 Oct 2011) +- [Jernej Kovacic brought this change] + + libssh2_session_supported_algs: added + +- [Kamil Dudka brought this change] + + example/sftp_RW_nonblock: do not ignore LIBSSH2_ERROR_EAGAIN - That will just cause unnecessary code execution. + Bug: https://bugzilla.redhat.com/745420 -- _libssh2_channel_write: general code cleanup +Peter Stuge (5 Oct 2011) +- example/ssh2_agent: Print host key fingerprint before authentication - simplified the function and removed some unused struct fields + Also moves the comment about not being authenticated to before the + agent authentication takes place, so that it better matches the code. -- _libssh2_transport_send: replaces _libssh2_transport_write +Daniel Stenberg (29 Sep 2011) +- OpenSSL EVP: fix threaded use of structs - The new function takes two data areas, combines them and sends them as a - single SSH packet. This allows several functions to allocate and copy - less data. + Make sure we don't clear or reset static structs after first init so + that they work fine even when used from multiple threads. Init the + structs in the global init. - I also found and fixed a mixed up use of the compression function - arguments that I introduced in my rewrite in a recent commit. - -- scp_write_nonblock: use select() instead of busyloop + Help and assistance by: John Engstrom - Make this example nicer by not busylooping. - -- send_existing: clear olen when the data is sent off + Fixes #229 (again) -- _libssh2_transport_write: allow 256 extra bytes around the packet +- openssl: don't init static structs differently + + make_ctr_evp() is changed to take a struct pointer, and then each + _libssh2_EVP_aes_[keylen]_ctr function is made to pass in their own + static struct + + Reported by: John Engstrom + Fixes #229 -- _libssh2_transport_write: remade to send without malloc +Guenter Knauf (27 Sep 2011) +- Removed obsolete include path. -- compress: compression disabled by default +Daniel Stenberg (21 Sep 2011) +- read_state: clear the state variable better - We now allow libssh2_session_flag() to enable compression with a new - flag and I added documentation for the previous LIBSSH2_FLAG_SIGPIPE - flag which I wasn't really aware of! + Set read_state back to idle before trying to send anything so that if + the state somehow is wrongly set. + + Also, avoid such a case of confusion by resetting the read_state when an + sftp handle is closed. -- comp: split the compress function +- sftp_read: remove leftover fprintf - It is now made into two separate compress and decompress functions. In - preparation for upcoming further modficications. + Reported by: Alexander Lamaison -Dan Fandrich (20 Oct 2010) -- Added header file to allow compiling in older environments +- sftp.h: fix the #ifdef to prevent multiple inclusions -Daniel Stenberg (20 Oct 2010) -- TODO: add a possible new API for SFTP transfers +- sftp_read: use a state variable to avoid bad writes + + When a channel_write call has gotten an EAGAIN back, we try harder to + continue the same write in the subsequent invoke. -- TODO: "New Transport API" added +- window_size: explicit adjustments only + + Removed the automatic window_size adjustments from + _libssh2_channel_read() and instead all channel readers must now make + sure to enlarge the window sizes properly themselves. + + libssh2_channel_read_ex() - the public function, now grows the window + size according to the requested buffer size. Applications can still opt + to grow the window more on demand. Larger windows tend to give higher + performance. + + sftp_read() now uses the read-ahead logic to figure out a window_size. -- TODO: add buffering plans +- libssh2.h: bump the default window size to 256K -Simon Josefsson (13 Oct 2010) -- Mention libssh2_channel_get_exit_signal and give kudos. +- libssh2_userauth_keyboard_interactive.3: fix man warning + + It seemed to occur due to the excessive line length -- [Tommy Lindgren brought this change] +- [Mikhail Gusarov brought this change] - Add libssh2_channel_get_exit_signal man page. - - Signed-off-by: Simon Josefsson + Add missing .gitignore entries -- [Tommy Lindgren brought this change] +- [Mikhail Gusarov brought this change] - Add libssh2_channel_get_exit_signal. + Add manpage syntax checker to 'check' target - Signed-off-by: Simon Josefsson - -- Add libssh2_free man page and fix typo. + In virtually every libssh2 release Debian's lintian catches syntax errors in + manpages. Prevent it by checking manpages as a part of testsuite. -- Add libssh2_free. +- libssh2_banner_set.3: fix nroff syntax mistake -Daniel Stenberg (11 Oct 2010) -- scp_recv: improved treatment of channel_read() returning zero - - As a zero return code from channel_read() is not an error we must make - sure that the SCP functions deal with that properly. channel_read() - always returns 0 if the channel is EOFed already so we check for EOF - after 0-reads to be able to return error properly. +Guenter Knauf (10 Sep 2011) +- Use predefined resource compiler macro. -- libssh2_session_methods.3: detail what can be asked for +- Added casts to silent compiler warnings. -- compression: send zlib before none - - As the list of algorithms in a preferred order we should send zlib - before none to increase the chances that the server will let us do - compression. +- Fixed uint64_t printf. -- compress: faster check, better return codes - - In the transport functions we avoid a strcmp() now and just check a - boolean instead. - - The compress/decompress function's return code is now acknowledged and - used as actual return code in case of failures. +- Fixed macro function signatures. -- libssh2_session_handshake: replaces libssh2_session_startup() - - The function libssh2_session_startup() is now considered deprecated due - to the portability issue with the socket argument. - libssh2_session_handshake() is the name of the replacement. +- NetWare makefile tweaks. -- libssh2_socket_t: now externally visible - - In preparation for upcominig changes, the libssh2_socket_t type is now - typedef'ed in the public header. +- Removed unused var. -- _libssh2_transport_drain: removed - - This function proved not to be used nor useful. +- Added 2 samples not mentioned. -- _libssh2_channel_write: don't iterate over transport writes - - When a call to _libssh2_transport_write() succeeds, we must return from - _libssh2_channel_write() to allow the caller to provide the next chunk - of data. - - We cannot move on to send the next piece of data that may already have - been provided in this same function call, as we risk getting EAGAIN for - that and we can't return information both about sent data as well as - EAGAIN. So, by returning short now, the caller will call this function - again with new data to send. +- Dont build x11 sample with MinGW. -- _libssh2_transport_write: updated documentation blurb +- Fixed executable file description. -- _libssh2_transport_write: remove fprintf remainder - - Mistake from previous debugging +- Removed unused var. -- session: improved errors - - Replaced -1/SOCKET_NONE errors with appropriate error defines instead. - - Made the verbose trace output during banner receiving less annoying for - non-blocking sessions. +- Kill stupid gcc 3.x uninitialized warning. -- crypt_init: use correct error define +- Build all examples. -- _libssh2_error: hide EAGAIN for non-blocking sessions +- More MinGW makefile tweaks. - In an attempt to make the trace output less cluttered for non-blocking - sessions the error function now avoids calling the debug function if the - error is the EAGAIN and the session is non-blocking. - -- agent: use better error defines + Renamed *.mingw makefiles to GNUmakefile since GNU make picks these + up automatically, and therefore win32/Makefile removed. -- comp_method_zlib_init: use correct error defines +- Removed forgotten WINSOCK_VERSION defines. -- transport: better error codes +Daniel Stenberg (9 Sep 2011) +- libssh2_session_startup(3) => libssh2_session_handshake(3) - LIBSSH2_SOCKET_NONE (-1) should no longer be used as error code as it is - (too) generic and we should instead use specific and dedicated error - codes to better describe the error. + Propagate for the current function in docs and examples. + libssh2_session_startup() is deprecated. -- channel: return code and _libssh2_error cleanup +- libssh2_banner_set => libssh2_session_banner_get - Made sure that all transport_write() call failures get _libssh2_error - called. + Marked the old function as deprecated. Added the new name in the correct + name space with the same arguments and functionality. -- _libssh2_channel_write: limit to 32700 bytes +- new function: libssh2_session_banner_get - The well known and used ssh server Dropbear has a maximum SSH packet - length at 32768 by default. Since the libssh2 design current have a - fixed one-to-one mapping from channel_write() to the packet size created - by transport_write() the previous limit of 32768 in the channel layer - caused the transport layer to create larger packets than 32768 at times - which Dropbear rejected forcibly (by closing the connection). + Returns the banner from the server handshake - The long term fix is of course to remove the hard relation between the - outgoing SSH packet size and what the input length argument is in the - transport_write() function call. + Fixes #226 -- libssh.h: add more dedicated error codes +- libssh2.h: bump version to 1.4.0 for new function(s) -- SCP: allow file names with bytes > 126 - - When parsing the SCP protocol and verifying that the data looks like a - valid file name, byte values over 126 must not be consider illegal since - UTF-8 file names will use such codes. - - Reported by: Uli Zappe - Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2010-08/0112.shtml +- remove embedded CVS/svn tags -Dan Fandrich (25 Aug 2010) -- Document the three sftp stat constants +- [liuzl brought this change] -Guenter Knauf (18 Aug 2010) -- Fixed Win32 makefile which was now broken at resource build. + API add:libssh2_sftp_get_channel + + Return the channel of sftp, then caller can + control the channel's behavior. + + Signed-off-by: liuzl -- It is sufficient to pipe stderr to NUL to get rid of the nasty messages. +- _libssh2_channel_read: react on errors from receive_window_adjust + + Previously the function would ignore all errors except for EAGAIN. -- [Author: Guenter Knauf brought this change] +- sftp_read: extend and clarify the documentation - Removed Win32 ifdef completely for sys/uio.h. +- sftp_read: cap the read ahead maximum amount - No idea why we had this ifdef at all but MSVC, MingW32, Watcom - and Borland all have no sys/uio.h header; so if there's another - Win32 compiler which needs it then it should be added explicitely - instead of this negative list. + Now we only go up to LIBSSH2_CHANNEL_WINDOW_DEFAULT*30 bytes SFTP read + ahead, which currently equals 64K*30 == 1966080 bytes. -- New files should also be added to Makefile.am. +- _libssh2_channel_read: fix non-blocking window adjusting - Otherwise they will never be included with release and snapshot tarballs ... + If EAGAIN is returned when adjusting the receive window, we must not + read from the transport directly until we've finished the adjusting. -Daniel Stenberg (18 Aug 2010) -- version: bump to 1.2.8_DEV +Guenter Knauf (8 Sep 2011) +- Fix for systems which need sys/select.h. -Version 1.2.7 (17 Aug 2010) +- The files were not gone but renamed ... -Daniel Stenberg (17 Aug 2010) -- release: updated to hold 1.2.7 info +Daniel Stenberg (6 Sep 2011) +- sftp_read: added documenting comment + + Taken from some recent email conversations I added some descriptions of + the logic in sftp_read() to aid readers. -Guenter Knauf (17 Aug 2010) -- Use the new libssh2.rc file. +- 1.3.1: start the work -- Added resource file for libssh2.dll (shamelessly stolen from libcurl). +Version 1.3.0 (6 Sep 2011) -- Updated Win32 MSVC dependencies versions. +Daniel Stenberg (6 Sep 2011) +- Makefile.am: the Makefile.win32 files are gone -- Added include for sys/select.h to get fd.set on some platforms. +- RELEASE-NOTES: updated for 1.3.0 -- Added Watcom makefile borrowed from libcurl. +- sftp_read: a short read is not end of file - This makefile compiles already all files fine for static lib, but needs - final touch when I have OpenSSL fully working with shared libs and Watcom. + A returned READ packet that is short will now only reduce the + offset. + + This is a temporary fix as it is slightly better than the previous + approach but still not very good. -- Added copyright define to libssh2.h and use it for binary builds. +- [liuzl brought this change] -- Moved version defines up in order to include from .rc file. + _libssh2_packet_add: adjust window size when truncating - Blocked rest of header with ifndef so its possible to let - the rc compiler only use the version defines. + When receiving more data than what the window size allows on a + particular channel, make sure that the window size is adjusted in that + case too. Previously it would only adjust the window in the non-error + case. -- Some minor makefile tweaks. +Guenter Knauf (29 Aug 2011) +- Silent compiler warning with MinGW64. -Daniel Stenberg (2 Aug 2010) -- example: treat the libssh2_channel_read() return code properly +- Fixed link to native Win32 awk tool. + +- Renamed MinGW makefiles. + +- Some MinGW makefile tweaks. - A short read is not an error. Only negative values are errors! + Enable build without GNU tools and with MinGW64 compiler. -- libssh2_wait_socket: reset error code to "leak" EAGAIN less +- Fixed aes_ctr_do_cipher() signature. + +Daniel Stenberg (26 Aug 2011) +- [liuzl brought this change] + + libssh2_sftp_seek64: flush packetlist and buffered data - Since libssh2 often sets LIBSSH2_ERROR_EAGAIN internally before - _libssh2_wait_socket is called, we can decrease some amount of - confusion in user programs by resetting the error code in this function - to reduce the risk of EAGAIN being stored as error when a blocking - function returns. + When seeking to a new position, flush the packetlist and buffered data + to prevent already received or pending data to wrongly get used when + sftp-reading from the new offset within the file. -- _libssh2_wait_socket: poll needs milliseconds +- sftp_read: advance offset correctly for buffered copies - As reported on the mailing list, the code path using poll() should - multiple seconds with 1000 to get milliseconds, not divide! + In the case where a read packet has been received from the server, but + the entire contents couldn't be copied to the user-buffer, the data is + instead buffered and copied to the user's buffer in the next invocation + of sftp_read(). When that "extra" copy is made, the 'offset' pointer was + not advanced accordingly. - Reported by: Jan Van Boghout - -- typedef: make ssize_t get typedef without LIBSSH2_WIN32 + The biggest impact of this flaw was that the 'already' variable at the + top of the function that figures out how much data "ahead" that has + already been asked for would slowly go more and more out of sync, which + could lead to the file not being read all the way to the end. - The condition around the ssize_t typedef depended on both LIBSSH2_WIN32 - *and* _MSC_VER being defined when it should be enough to depend on - _MSC_VER only. It also makes it nicer so libssh2-using code builds fine - without having custom defines. + This problem was most noticable in cases where the application would + only try to read the exact file size amount, like curl does. In the + examples libssh2 provides the sftp read function is most often called + with a fixed size large buffer and then the bug would not appear as + easily. + + This bug was introduced in the SFTP rewrite in 1.2.8. + + Bug: http://curl.haxx.se/mail/lib-2011-08/0305.html + http://www.libssh2.org/mail/libssh2-devel-archive-2011-08/0085.shtml -- [John Little brought this change] +- wrap some long lines < 80 columns - session_free: free more data to avoid memory leaks +- LIBSSH2_RECV: fix typo, use the RECV_FD macro -- channel_free: ignore problems with channel_close() - - As was pointed out in bug #182, we must not return failure from - _libssh2_channel_free() when _libssh2_channel_close() returns an error - that isn't EAGAIN. It can effectively cause the function to never go - through, like it did now in the case where the socket was actually - closed but socket_state still said LIBSSH2_SOCKET_CONNECTED. - - I consider this fix the right thing as it now also survives other - errors, even if making sure socket_state isn't lying is also a good - idea. +- subsystem_netconf.c: fix compiler warnings -- publickey_list_free: no return value from a void function - - Fixed a compiler warning I introduced previously when checking input - arguments more. I also added a check for the other pointer to avoid NULL - pointer dereferences. +- [Henrik Nordstrom brought this change] -- [Lars Nordin brought this change] + Custom callbacks for performing low level socket I/O - openssl: make use of the EVP interface - - Make use of the EVP interface for the AES-funktion. Using this method - supports the use of different ENGINES in OpenSSL for the AES function - (and the direct call to the AES_encrypt should not be used according to - openssl.org) +- version bump: start working towards 1.3.0 -Peter Stuge (23 Jun 2010) -- [Tor Arntsen brought this change] +Version 1.2.9 (16 Aug 2011) - Don't overflow MD5 server hostkey - - Use SHA_DIGEST_LENGTH and MD5_DIGEST_LENGTH in memcpy instead of hardcoded - values. An incorrect value was used for MD5. +Daniel Stenberg (16 Aug 2011) +- RELEASE-NOTES: synced with 95d69d3a81261 -- Fix message length bugs in libssh2_debug() +- [Henrik Nordstrom brought this change] + + Document prototypes for macro defined functions + +- [Henrik Nordstrom brought this change] + + Avoid reuse after free when closing X11 channels + +- _libssh2_channel_write: handle window_size == 0 better - There was a buffer overflow waiting to happen when a debug message was - longer than 1536 bytes. + When about to send data on the channel and the window size is 0, we must + not just return 0 if the transport_read() function returned EAGAIN as it + then causes a busy-loop. - Thanks to Daniel who spotted that there was a problem with the message - length passed to a trace handler also after commit - 0f0652a3093111fc7dac0205fdcf8d02bf16e89f. + Bug: http://libssh2.org/mail/libssh2-devel-archive-2011-08/0011.shtml -- Make libssh2_debug() create a correctly terminated string +- gettimeofday: fix name space pollution - Also use FILE *stderr rather than fd 2, which can very well be something - completely different. + For systems without its own gettimeofday() implementation, we still must + not provide one outside our namespace. + + Reported by: Bill Segall -Daniel Stenberg (23 Jun 2010) -- [TJ Saunders brought this change] +Dan Fandrich (5 Aug 2011) +- libssh2.pc.in: Fixed spelling in pkgconfig file - handshake: Compression enabled at the wrong time - - In KEXINIT messages, the client and server agree on, among other - things, whether to use compression. This method agreement occurs - in src/kex.c's kex_agree_methods() function. However, if - compression is enabled (either client->server, server->client, or - both), then the compression layer is initialized in - kex_agree_methods() -- before NEWKEYS has been received. - - Instead, the initialization of the compression layer should - happen after NEWKEYS has been received. This looks to occur - insrc/kex.c's diffie_hellman_sha1(), which even has the comment: +Peter Stuge (17 Jul 2011) +- example/subsystem_netconf.c: Add missing #include + +- example/subsystem_netconf.c: Discard ]]>]]> and return only XML response + +- example/subsystem_netconf.c: Fix uninitialized variable bug + +- example: Add subsystem_netconf.c - /* The first key exchange has been performed, + This example demonstrates how to use libssh2 to send a request to + the NETCONF subsystem available e.g. in JunOS. - switch to active crypt/comp/mac mode */ + See also http://tools.ietf.org/html/draft-ietf-netconf-ssh-06 + +Daniel Stenberg (16 Jul 2011) +- man page cleanups: non-existing functions need no man pages + +- libssh2_new_host_entry.3: removed - There, after NEWKEYS is received, the cipher and mac algorithms - are initialized, and that is where the compression should be - initialized as well. + This is just junk leftovers. + +- userauth_keyboard_interactive: fix buffer overflow - The current implementation fails if server->client compression is - enabled because most server implementations follow OpenSSH's - lead, where compression is initialized after NEWKEYS. Since the - server initializes compression after NEWKEYS, but libssh2 - initializes compression after KEXINIT (i.e. before NEWKEYS), they - are out of sync. + Partly reverse 566894494b4972ae12 which was simplifying the code far too + much and ended up overflowing a buffer within the LIBSSH2_SESSION + struct. Back to allocating the buffer properly like it used to do. - Reported in bug report #180 + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-06/0032.shtml + Reported by: Alfred Gebert -- [TJ Saunders brought this change] +- keyboard-interactive man page: cleaned up - userauth_hostbased_fromfile: packet length too short +- [Alfred Gebert brought this change] + + _libssh2_recv(): handle ENOENT error as EAGAIN - The packet length calculated in src/userauth.c's - userauth_hostbased_fromfile() function is too short by 4 bytes; - it forgets to add four bytes for the length of the hostname. - This causes hostbased authentication to fail, since the server - will read junk data. + A sftp session failed with error "failure establishing ssh session" on + Solaris and HP-UX. Sometimes the first recv() function call sets errno + to ENOENT. In the man pages for recv of Solaris and HP-UX the error + ENOENT is not documented. - verified against proftpd's mod_sftp module + I tested Solaris SPARC and x86, HP-UX i64, AIX, Windows and Linux. -- _libssh2_userauth_publickey: reject method names longer than the data +- agent_list_identities: fix out of scope access - This functions get the method length by looking at the first 32 - bit of data, and I now made it not accept method lengths that are - longer than the whole data set is, as given in the dedicated - function argument. + An auto variable out of scope was being referenced and used. - This was detected when the function was given bogus public key - data as an ascii string, which caused the first 32bits to create - a HUGE number. + fixes #220 -- NULL resistance: make more public functions survive NULL pointer input - - Sending in NULL as the primary pointer is now dealt with by more - public functions. I also narrowed the userauth.c code somewhat to - stay within 80 columns better. +- _libssh2_wait_socket: fix timeouts for poll() uses -- agent: make libssh2_agent_userauth() work blocking properly +- windows: inclusion fix - previously it would always work in a non-blocking manner + include winsock2.h for all windows compilers -Peter Stuge (17 Jun 2010) -- Fix underscore typo for 64-bit printf format specifiers on Windows +- keyb-interactive: add the fixed buffer - Commit 49ddf447ff4bd80285f926eac0115f4e595f9425 was missing underscores. + Belongs to commit 5668944 -Daniel Stenberg (16 Jun 2010) -- libssh2_session_callback_set: extended the man page +- code cleanup: don't use C99/c++ comments + + We aim for C89 compliance -- [John brought this change] +- keyb-interactive: allow zero length fields + + Allow zero length fields so they don't cause malloc(0) calls + + Avoid free()ing NULL pointers + + Avoid a malloc of a fixed 5 byte buffer. - LIBSSH2_DEBUG: macro uses incorrect function variable +- libssh2_channel_process_startup.3: clean up - The LIBSSH2_DEBUG macro, defined in libssh2_priv.h, incorrectly uses the - function variable ssh_msg_disconnect when it should use ssh_msg_debug. + Remove the references to the macro-fied shortcuts as they have their own + individual man pages. - This shows that the LIBSSH2_CALLBACK_DEBUG callback never has worked... + Made the prototype different and more readable. -- warning: fix a compiler warning 'pointer differs in signedness' +- man page: fix .BR lines - As reported in bug #177 + We don't use \fI etc on .BR lines + +- userauth_keyboard_interactive: skip code on zero length auth -- portability: introduce LIBSSH2_INT64_T_FORMAT for 64bit printf()s +- libssh2_channel_forward_accept.3: mention how to get error - As pointed out in bug #177, some of the Windows compilers use - %I64 to output 64 bit variables with the printf family. + Since this returns a pointer, libssh2_session_last_errno() must be used + to get the actual error code and it wasn't that clear before. -- debug: avoid sending NULL to sprintf %s +- timeout docs: mention they're added in 1.2.9 + +- sftp_write_sliding.c: indent fix - Via the _libssh2_debug() macro/function. Pointed out by john in bug report + Use the standard indenting and removed CVS leftover comment -- sftp docs: show macro on macro page, only function on function page +- [zl liu brought this change] + + sftp_write_sliding: send the complete file - The individual man pages for macros now show the full convenience - macro as defined, and then the man page for the actual function - only shows the function. + When reaching the end of file there can still be data left not sent. -- code police: make the code use less than 80 columns +- [Douglas Masterson brought this change] -- libssh2_channel_write_ex: remove macros, added wording on buffer size + session_startup: init state properly + + libssh2_session_startup() didn't set the state correctly so it could get + confused. + + Fixes #218 -- libssh2_sftp_write: document buffer size and changed some ordering +- timeout: added man pages -- libssh2_channel_write_stderr: show how the macro is defined +- BLOCK_ADJUST_ERRNO: move rc to right level + + We can't declare the variable within the block and use it in the final + do-while() expression to be properly portable C89. -- libssh2_channel_write: show how the macro is defined +- [Matt Lilley brought this change] -- SFTP: limit write() to not produce overly large packets + adds a timeout to blocking calls - sftp_write() now limits how much data it gets at a time even more - than before. Since this function creates a complete outgoing - packet based on what gets passed to it, it is crucial that it - doesn't create too large packets. + Fixes bug #160 as per Daniel's suggestion - With this method, there's also no longer any problem to use very - large buffers in your application and feed that to libssh2. I've - done numerous tests now with uploading data over SFTP using 100K - buffers and I've had no problems with that. + Adds libssh2_session_set_timeout() and libssh2_session_get_timeout() -- scp_write_nonblock: add transfer time info +- SCP: fix incorrect error code + + After an error occurs in libssh2_scp_recv() or libssh2_scp_send(), the + function libssh2_session_last_error() would return + LIBSSH2_ERROR_SOCKET_NONE on error. + + Bug: http://trac.libssh2.org/ticket/216 + Patch by: "littlesavage" - Using the same timing logic and output format as - sftp_write_nonblock allows us to very easily run benchmarks on - SCP vs SFTP uploads using libssh2. + Fixes #216 + +Guenter Knauf (19 Apr 2011) +- Updated default (recommended) dependency versions. -- sftp_write_nonblock: select() on socket, use *BIG* buffer, time transfer +Daniel Stenberg (17 Apr 2011) +- libssh2_session_block_directions: fix mistake + + The last LIBSSH2_SESSION_BLOCK_INBOUND should be + LIBSSH2_SESSION_BLOCK_OUTBOUND - The select() is just to make it nicer so that it doesn't - crazy-loop on EAGAIN. The buffer size thing is mostly to verify - that this really work as supposed. + And I shortened the short description - Transfer timing is just a minor thing, but it can just as well be - there and help us time and work on performance easier using out - of the box examples. + Reported by: "drswinghead" -- agent: use _libssh2_error() when returning errors +- msvcproj: added libs and debug stuff + + Added libraries needed to link whether using openssl dynamically or + statically + + Added LIBSSH2DEBUG define to debug versions to enable tracing - As pointed out in bug report #173, this module basically never - used _libssh2_error() which made it work inconstently with other - parts of the libssh2 code base. This is my first take at making - this code more in line with the rest. + URL: http://trac.libssh2.org/ticket/215 + Patch by: Mark Smith -- inputchecks: make lots of API functions check for NULL pointers +- sftp_write: clean offsets on error - If an application accidentally provides a NULL handle pointer to - the channel or sftp public functions, they now return an error - instead of segfaulting. + When an error has occurred on FXP_WRITE, we must make sure that the + offset, sent offset and acked counter are reset properly. -- libssh2_channel_eof: clarify that it returns negative on errors +- example/.gitignore: ignore built binaries -- SFTP: keep the sftp error code as 32 bit +- sftp_write: flush the packetlist on error - 'last_errno' holds to the error code from the SFTP protocol and - since that is 32 bits on the wire there's no point in using a - long for this internally which is larger on some platforms. + When an error occurs during write, flush the entire list of pending + outgoing SFTP packets. -- agent: make the code better deal with unexpected code flows +- keepalive: add first basic man pages - agent->ops gets initialized by the libssh2_agent_connect() call - but we need to make sure that we don't segfault even if a bad - sequence of function calls is used. + Someone on IRC pointed out that we don't have these documented so I + wrote up a first set based on the information in the wiki: + http://trac.libssh2.org/wiki/KeepAlive -Alexander Lamaison (10 Jun 2010) -- Better handling of invalid key files. +- scp_write_nonblock.c: remove pointless check - Passing an invalid public key to libssh2_userauth_publickey_fromfile_ex - triggered an assertion. Replaced this with a runtime check that rejects - obviously invalid key data. - -Daniel Stenberg (10 Jun 2010) -- version: we start working on 1.2.7 now - -Version 1.2.6 (10 Jun 2010) + libssh2_channel_write() cannot return a value that is larger than the + input length value -Daniel Stenberg (10 Jun 2010) -- NEWS: add the 1.2.6 release details +Mikhail Gusarov (9 Apr 2011) +- s/\.NF/.nf/ to fix wrong macro name caught by man --warnings -- RELEASE-NOTES: 1.2.6 details added +Daniel Stenberg (6 Apr 2011) +- version: bump to 1.2.9_dev + + Also update the copyright year range to include 2011 -Guenter Knauf (10 Jun 2010) -- fixed libssh2.dsw to use the generated libssh2.dsp; removed old *.dsp files. +- configure: fix $VERSION + + Stop using the $VERSION variable as it seems to be magically used by + autoconfig itself and thus gets set to the value set in AC_INIT() + without us wanting that. $LIBSSH2VER is now the libssh2 version as + detected. + + Reported by: Paul Howarth + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-04/0008.shtml -- moved MSVC strdup define to libssh2_config.h which we include already. +- maketgz: use git2news.pl by the correct name -- added missing source files to src/NMakefile. +Version 1.2.8 (4 Apr 2011) -Daniel Stenberg (8 Jun 2010) -- libssh2_poll: refer to poll(3) and select(3) instead +Daniel Stenberg (4 Apr 2011) +- RELEASE-NOTES: synced with fabf1a45ee -- example: fix strdup() for MSVC compiles +- NEWS: auto-generated from git - MSVC has a _strdup() that we better use. This was reported in bug + Starting now, the NEWS file is generated from git using the git2news.pl + script. This makes it always accurate and up-to-date, even for daily + snapshots etc. -- SFTP: fail init SFTP if session isn't authenticated +- sftp_write: handle FXP_WRITE errors - Alexander Lamaison filed bug #172 - (http://trac.libssh2.org/ticket/172), and pointed out that SFTP - init would do bad if the session isn't yet authenticated at the - time of the call, so we now check for this situation and returns - an error if detected. Calling sftp_init() at this point is bad - usage to start with. + When an sftp server returns an error back on write, make sure the + function bails out and returns the proper error. + +- configure: stop using the deprecated AM_INIT_AUTOMAKE syntax -- direct_tcpip: bring back inclusion of libssh2_config.h +Alexander Lamaison (13 Mar 2011) +- Support unlimited number of host names in a single line of the known_hosts file. - In order to increase portability of this example, I'm bringing - the inclusion of libssh2_config.h back, and I also added an - require that header for this example to compile. + Previously the code assumed either a single host name or a hostname,ip-address pair. However, according to the spec [1], there can be any number of comma separated host names or IP addresses. - I also made all code lines fit within 80 columns. - -Guenter Knauf (3 Jun 2010) -- cast away a warning. + [1] http://www.openbsd.org/cgi-bin/man.cgi?query=sshd&sektion=8 -- moved CRT_SECURE_NO_DEPRECATE define up so its defined before the winsock headers are included. +Daniel Stenberg (26 Feb 2011) +- libssh2_knownhost_readfile.3: clarify return value + + This function returns the number of parsed hosts on success, not just + zero as previously documented. -- fixed platform detection for MingW32 test makefile. +Peter Stuge (26 Feb 2011) +- Don't save allocated packet size until it has actually been allocated + + The allocated packet size is internal state which needs to match reality + in order to avoid problems. This commit fixes #211. -- MingW32 has gettimeofday() implemented, so proper ifdef this function here. +Daniel Stenberg (21 Feb 2011) +- [Alfred Gebert brought this change] -- removed MSVC ifdef since seems we can use __int64 still with latest headers. + session_startup: manage server data before server identification + + Fix the bug that libssh2 could not connect if the sftp server + sends data before sending the version string. + + http://tools.ietf.org/html/rfc4253#section-4.2 + + "The server MAY send other lines of data before sending the version + string. Each line SHOULD be terminated by a Carriage Return and Line + Feed. Such lines MUST NOT begin with "SSH-", and SHOULD be encoded + in ISO-10646 UTF-8 [RFC3629] (language is not specified). Clients + MUST be able to process such lines." -- changed copyright notice for MinW32 and NetWare binaries. +- [Alfred Gebert brought this change] -- cleaned up MSVC ifdefs which where spreaded over 3 places. + fullpacket: decompression only after init + + The buffer for the decompression (remote.comp_abstract) is initialised + in time when it is needed. With this fix decompression is disabled when + the buffer (remote.comp_abstract) is not initialised. + + Bug: http://trac.libssh2.org/ticket/200 -- added uint8_t typedef for NetWare CLIB platform. +- _libssh2_channel_read: store last error + + When the transport layer returns EAGAIN this function didn't call + _libssh2_error() which made the last_error not get set. -- if the function declaration gets changed the header should be changed too. +- sftp_write: clarified the comment header -- this is MSVC specific and doesnt apply for all Win32 compilers; - the uint8_t typedef clashes with MingW32 headers. +- sftp_read: avoid wrapping counter to insanity + + As pointed out in bug #206, if a second invoke of libssh2_sftp_read() + would shrink the buffer size, libssh2 would go nuts and send out read + requests like crazy. This was due to an unsigned variable turning + "negative" by some wrong math, and that value would be the amount of + data attempt to pre-buffer! + + Bug: http://trac.libssh2.org/ticket/206 -- updated MingW32 makefiles for latest dependency lib versions. +- sftp_packet_read: use 32bit variables for 32bit data -- updated NetWare makefiles for latest dependency lib versions. +- libssh2_sftp_stat_ex.3: cleaned up, extended + + Removed the macros from it as they have their own man pages. + + Added the LIBSSH2_SFTP_ATTRIBUTES struct in here for easier reference. -Dan Fandrich (30 May 2010) -- Fixed compiling with libgcrypt +- sftp_readdir: return error if buffer is too small - A change of parameter types from unsigned long to size_t was - missed in the prototype in libgcrypt.h + If asked to read data into a buffer and the buffer is too small to hold + the data, this function now returns an error instead of as previously + just copy as much as fits. -Daniel Stenberg (28 May 2010) -- statvfs: use libssh2_sftp_statvfs only, no "_ex" +- sftp_symlink: return error if receive buffer too small - As the long-term goal is to get rid of the extensive set of - macros from the API we can just as well start small by not adding - new macros when we add new functions. Therefore we let the - function be libssh2_sftp_statvfs() plainly without using an _ex - suffix. + and clean up some variable type mismatches - I also made it use size_t instead of unsigned int for the string - length as that too is a long-term goal for the API. - -- [Grubsky Grigory brought this change] - - DSP: output lib name typo - -- [Grubsky Grigory brought this change] + Discussion: http://www.libssh2.org/mail/libssh2-devel-archive-2011-01/0001.shtml - win32: provide a uint8_t typedef for better building on windows +- docs: clarify what happens with a too small buffer + + This flaw is subject to change, but I figured it might be valuable to + users of existing code to know how it works. -- agent: win32: fix bad _libssh2_store_str call +- channel_request_pty_size: fix reqPTY_state + + The state variable isn't properly set so every other call to the + function fails! - As pointed out by Grubsky Grigory , I - made a mistake when I added the _libssh2_store_str() call before - and I made a slightly different patch than what he suggested. - Based purely on taste. - -Peter Stuge (24 May 2010) -- [Joey Degges brought this change] + Bug: http://libssh2.org/mail/libssh2-devel-archive-2010-12/0096.shtml + Reported by: Steve Legg - Add libssh2_sftp_statvfs() and libssh2_sftp_fstatvfs() +- data size: cleanup - These can be used to get file system statistics from servers that - support the statvfs@openssh.com and fstatvfs@openssh.com extensions. + Fix 64bit warnings by using (s)size_t and dedicated uint32_t types more. -Alexander Lamaison (22 May 2010) -- [Jose Baars brought this change] +- [Pierre Joye brought this change] - VMS specific: make sure final release can be installed over daily build + ssize_t: proper typedef with MSVC compilers + + As discussed on the mailing list, it was wrong for win64 and using the + VC-provided type is the safest approach instead of second- guessing + which one it should be. -- [Jose Baars brought this change] +Guenter Knauf (22 Dec 2010) +- Updated OpenSSL version. - VMS: small improvement to the man2help utilities +- Expanded tabs to spaces. -Peter Stuge (22 May 2010) +Peter Stuge (21 Dec 2010) - [Joey Degges brought this change] - libssh2_exit and libssh2_sftp_readdir man page fixes - -Daniel Stenberg (21 May 2010) -- spelling: s/sue/use - -Alexander Lamaison (21 May 2010) -- Change magic port number for generic knownhost check. + _libssh2_ntohu64: fix conversion from network bytes to uint64 - libssh2_knownhost_checkp took 0 as a magic port number that indicated - a 'generic' check should be performed. However, 0 is a valid port - number in its own right so this commit changes the magic value to any - negative int. - -Mikhail Gusarov (5 May 2010) -- Add re-discovered copyright holders to COPYING + Cast individual bytes to uint64 to avoid overflow in arithmetic. -- Restoring copyright statements from pre-git era +Daniel Stenberg (20 Dec 2010) +- libssh2_userauth_list: language fix - Eli Fant has contributed fragmenting SFTP requests + "faily" is not a good English word, and I also cleaned up some other minor + mistakes -- Restoring my copyright statements from pre-git era +- crypto: unify the generic functions - keyboard_interactive, 'exit-status' information packet, non-atomic read/write - under FreeBSD, multi-channel operation bugfixes. - -Daniel Stenberg (3 May 2010) -- pedantic: make the code C90 clean - -Peter Stuge (3 May 2010) -- Do proper keyboard-interactive user dialog in the sftp.c example + Added crypto.h that is the unified header to include when using crypto + functionality. It should be the only header that needs to adapt to the + underlying crypto library in use. It provides the set of prototypes that + are library agnostic. -Daniel Stenberg (3 May 2010) -- added to tarball: libssh2_knownhost_checkp.3 +- [Mark Smith brought this change] -- knownhost: support [host]:port in knownhost file + userauth: derive publickey from private - OpenSSH has ways to add hosts to the knownhosts file that include - a specific port number which makes the key associated with only - that specific host+port pair. libssh2 previously did not support - this, and I was forced to add a new function to the API to - properly expose this ability to applications: - libssh2_knownhost_checkp() + Pass a NULL pointer for the publickey parameter of + libssh2_userauth_publickey_fromfile and + libssh2_userauth_hostbased_fromfile functions. In this case, the + functions recompute the public key from the private key file data. - To *add* such hosts to the knownhosts file, you make sure to pass - on the host name in that manner to the libssh2_knownhost_addc() - function. - -- init/exit: mention these were added in 1.2.5 - -- libssh2_knownhost_check docs: correct the prototype - -- examples: avoid use of uninitialized variable 'sock' - -- KEX: stop pretending we negotiate language + This is work done by Jean-Louis CHARTON + , then adapted by Mark Smith and + slightly edited further by me Daniel. - There was some stub-like parts of an implementation for - implementing kex language negotiation that caused clang-analyzer - to warn and as it did nothing I've now removed the dead code. - -- Uninitialized argument - -- sftpdir: removed dead assignment - -- Makefile.am: include the VMS-specific config header as well - -- [Jose Baars brought this change] + WARNING: this does leave the feature NOT WORKING when libssh2 is built + to use libgcrypt instead of OpenSSL simply due to lack of + implementation. - Add VMS specific libssh2_config.h +- ssh2_echo: Value stored to 'exitcode' is never read -- fix Value stored to 's' is never read warning +- _libssh2_packet_add: fix SSH_MSG_DEBUG weirdness - and moved variable declaration of s to be more local + I believe I may have caused this weird typo style error when I cleaned + up this function a while ago. Corrected now. -- kexinit: simplify the code and avoid scan-build warning +- uint32: more longs converted to proper types - Previously it would say "Value stored to 's' is never read" due - fourth increment of 's'. - -Alexander Lamaison (28 Apr 2010) -- Removed unecessary brackets. - -- Changed sftp_attrsize macro to a static function. - -Daniel Stenberg (28 Apr 2010) -- release: include the VMS-specific files + I also moved the MAC struct over to the mac.h header file and made sure + that the users of that struct include that file. -- sftp_attrsize: protect the macro argument with proper parentheses +- SFTP: more types to uint32_t + + The 'num_names' field in the SSH_FXP_NAME response is an unsigned 32bit + value so we make sure to treat it like that. -- ssh2_agent: avoid using 'session' uninitialized on failures +- SFTP: request_ids are uint32_t + + I went over the code and made sure we use uint32_t all over for the + request_id data. It is an unsigned 32bit value on the wire. -- examples: remove assignments of variable rc that's never used +- SFTP: store request_id separately in packets + + By using a new separate struct for incoming SFTP packets and not sharing + the generic packet struct, we can get rid of an unused field and add a + new one dedicated for holding the request_id for the incoming + package. As sftp_packet_ask() is called fairly often, a "mere" integer + comparison is MUCH faster than the previous memcmp() of (typically) 5 + bytes. -- publickey_init: remove useless variable increment +- libssh2_sftp_open_ex: man page extended and cleaned up + + I added the missing documentation for the 'flags' argument. -- hostkey_method_ssh_rsa_init: remove useless variable increment +- SFTP: unify the READ/WRITE chunk structs -- packet_x11_open: removed useless variable increment +- SFTP: fix memory leaks + + Make sure that we cleanup remainders when the handle is closed and when + the subsystem is shutdown. - and made the declaration of a variable more local + Existing flaw: if a single handle sends packets that haven't been + replied to yet at the time when the handle is closed, those packets will + arrive later and end up in the generic packet brigade queue and they + will remain in there until flushed. They will use unnecessary memory, + make things slower and they will ruin the SFTP handling if the + request_id counter ever wraps (highly unlikely to every happen). -- packet_queue_listener: removed useless variable increment +- sftp_close_handle: packet list is generic - and made the declaration of a variable more local + Fix comment, simplify the loop logic -- sftp_read: move a read_responses array to where its used +- sftp_read: pipeline reads - I find that this increases readability since the array is used - only in the function call just immediately below and nowhere - else. + The SFTP read function now does transfers the same way the SFTP write + function was made to recently: it creates a list of many outgoing + FXP_READ packets that each asks for a small data chunk. The code then + tries to keep sending read request while collecting the acks for the + previous requests and returns the received data. -- sftp_readdir: turn a small array static const and move it +- sftp_write: removed unused variable -- sftp_attrsize: converted function to a macro +- _libssh2_channel_close: don't call transport read if disconnected - This way, the macro can evaluate a static number at compile time - for two out of four uses, and it probably runs faster for the - other two cases too. + The loop that waits for remote.close to get set may end up looping + forever since session->socket_state gets set to + LIBSSH2_SOCKET_DISCONNECTED by the packet_add() function called from the + transport_read() function and after having been set to + LIBSSH2_SOCKET_DISCONNECTED, the transport_read() function will only + return 0. + + Bug: http://trac.libssh2.org/ticket/198 -- sftp_open: deal with short channel_write calls +- libssh2_sftp_seek64: new man page - This was an old TODO that just wasn't done before. If - channel_write returns short, that is not an error. + Split off libssh2_sftp_seek64 from the libssh2_sftp_seek man page, and + mentioned that we consider the latter deprecated. Also added a mention + about the dangers of doing seek during writing or reading. -- sftp_open: clean up, better check of input data +- sftp_seek: fix - The clang-analyzer report made it look into this function and - I've went through it to remove a potential use of an - uninitialized variable and I also added some validation of input - data received from the server. + The new SFTP write code caused a regression as the seek function no + longer worked as it didn't set the write position properly. - In general, lots of more code in this file need to validate the - input before assuming it is correct: there are servers out there - that have bugs or just have another idea of how to do the SFTP - protocol. - -- bugfix: avoid using the socket if it failed to create one + It should be noted that seeking is STRONGLY PROHIBITED during upload, as + the upload magic uses two different offset positions and the multiple + outstanding packets etc make them sensitive to change in the midst of + operations. + + This functionality was just verified with the new example code + sftp_append. This bug was filed as bug #202: + + Bug: http://trac.libssh2.org/ticket/202 -- bugfix: potential use of NULL pointer +- sftp_append: new example doing SFTP append -- libssh2_userauth_password_ex: clarify errors somewhat +- MAX_SFTP_OUTGOING_SIZE: 30000 - The errors mentioned in this man page are possible return codes - but not necessarily the only return codes that this can return. + I ran SFTP upload tests against localhost. It showed that to make the + app reach really good speeds, I needed to do a little code tweak and + change MAX_SFTP_OUTGOING_SIZE from 4000 to 30000. The tests I did before + with the high latency tests didn't show any real difference whatever I + had that size set to. - Also reformatted the typ prototypes somewhat. + This number is the size in bytes that libssh2 cuts off the large input + buffer and sends off as an individual sftp packet. -- examples: fixed and made them more similar +- sftp_write_sliding.c: new example - The channel read/write functions can return 0 in legitimate cases - without it being an error, and we need to loop properly if they - return short. - -- [Jose Baars brought this change] - - VMS port of libssh2; changes in the libssh2 common code - -- Makefile: added the two news headers userauth.h and session.h - -- cleanup: prefer the internal functions + This is an example that is very similar to sftp_write_nonblock.c, with + the exception that this uses + + 1 - a larger upload buffer - To get the blocking vs non-blocking to work as smooth as possible - and behave better internally, we avoid using the external - interfaces when calling functions internally. + 2 - a sliding buffer mechnism to allow the app to keep sending lots of + data to libssh2 without having to first drain the buffer. - Renamed a few internal functions to use _libssh2 prefix when not - being private within a file, and removed the libssh2_ for one - that was private within the file. + These are two key issues to make libssh2 SFTP uploads really perform + well at this point in time. -- session_free: remove dead code +- cpp: s/#elsif/#elif + + This looks like a typo as #elsif is not really C... -- libssh2_publickey_init: fixed to work better non-blocking +- _libssh2_channel_write: revert channel_write() use - This was triggered by a clang-analyzer complaint that turned out - to be valid, and it made me dig deeper and fix some generic non- - blocking problems I disovered in the code. + The attempts made to have _libssh2_channel_write() accept larger pieces + of data and split up the data by itself into 32700 byte chunks and pass + them on to channel_write() in a loop as a way to do faster operations on + larger data blocks was a failed attempt. - While cleaning this up, I moved session-specific stuff over to a - new session.h header from the libssh2_priv.h header. - -- channel: reduce duplicated free and returns + The reason why it is difficult: - Simplified the code by trying to free data and return on a single - spot. - -- channel: make variables more local + The API only allows EAGAIN or a length to be returned. When looping over + multiple blocks to get sent, one block can get sent and the next might + not. And yet: when transport_send() has returned EAGAIN we must not call + it again with new data until it has returned OK on the existing data it + is still working on. This makes it a mess and we do get a much easier + job by simply returning the bytes or EAGAIN at once, as in the EAGAIN + case we can assume that we will be called with the same arguments again + and transport_send() will be happy. - By making 'data' and 'data_len' more local in several places in - this file it will be easier to spot how they are used and we'll - get less risks to accidentally do bad things with them. - -Mikhail Gusarov (24 Apr 2010) -- Fix typos in manpages, catched by Lintian + Unfortunately, I think we take a small performance hit by not being able + to do this. -Daniel Stenberg (24 Apr 2010) -- channel_request_pty: simplify the code +- ssh2_echo: new example - clang-analyzer pointed out how 'data' could be accessed as a NULL - pointer if the wrong state was set, and while I don't see that - happen in real-life the code flow is easier to read and follow by - moving the LIBSSH2_FREE() call into the block that is supposed to - deal with the data pointer anyway. + This is a new example snippet. The code is largely based on ssh2_exec, + and is written by Tommy Lindgren. I edited it into C90 compliance and to + conform to libssh2 indent style and some more. -- libssh2_channel_process_startup: simplify the code +- send_existing: return after send_existing - clang-analyzer pointed out how 'data' could be accessed as a NULL - pointer if the wrong state was set, and while I don't see that - happen in real-life the code flow is easier to read and follow by - moving the LIBSSH2_FREE() call into the block that is supposed to - deal with the data pointer anyway. - -- sftp_close_handle: add precation to not access NULL pointer + When a piece of data is sent from the send_existing() function we must + make the parent function return afterwards. Otherwise we risk that the + parent function tries to send more data and ends up getting an EGAIN for + that more data and since it can only return one return code it doesn't + return info for the successfully sent data. - clang-analyzer pointed this out as a "Pass-by-value argument in - function call is undefined" but while I can't see exactly how - this can ever happen in reality I think a little check for safety - isn't such a bad thing here. - -- scp_write_nonblock: Value stored to 'nread' is never read - -- scp_write: Value stored to 'ptr' is never read + As this change is a regression I now added a larger comment explaining + why it has to work like this. -- scp_write_nonblock: Value stored to 'ptr' is never read +- _libssh2_channel_write: count resent data as written + + In the logic that resends data that was kept for that purpose due to a + previous EAGAIN, the data was not counted as sent causing badness. -- sftp_mkdir: less silly output but show failures +Peter Stuge (13 Nov 2010) +- Use fprintf(stderr, ) instead of write(2, ) for debugging -- [Jose Baars brought this change] +- session/transport: Correctly handle when _libssh2_send() returns -EAGAIN - VMS port of libssh2 including VMS specific build procedures +- src/agent.c: Simplify _libssh2_send() error checking ever so slightly -- two variable types changes, made lines less than 80 columns +Daniel Stenberg (12 Nov 2010) +- send/recv: use _libssh2_recv and _libssh2_send now - The two variable type changes are only to match type variable - fields actually read from the binary protocol. - -- remove check for negative padding_length + Starting now, we unconditionally use the internal replacement functions + for send() and recv() - creatively named _libssh2_recv() and + _libssh2_send(). - It was silly, since it is read as an unsigned char... - -- hostkey_method_ssh_dss_init: Value stored to 's' is never read - -- libssh2_banner_set: avoid unnecessary increment and explain code - -- agent_transact_unix: remove unused variable - -- remove two unnecessary increments - -- more code converted to use _libssh2_store_*() - -- libssh2_publickey_list_fetch: removed unused variables - -- libssh2_publickey_init: remove unused variables + On errors, these functions return the negative 'errno' value instead of + the traditional -1. This design allows systems that have no "natural" + errno support to not have to invent it. It also means that no code + outside of these two transfer functions should use the errno variable. -- libssh2_scp_send64: added to API to provide large file transfers +- channel_write: move some logic to _libssh2_channel_write - The previously existing libssh2_scp_send_ex() function has no way - to send files that are larger than 'size_t' which on 32bit - systems mean 4GB. This new API uses a libssh2_int64_t type and - should thus on most modern systems be able to send enormous - files. - -- sftp_init: remove unused variables and assignments - -- libssh2_knownhost_check: Value stored to 'keylen' is never read - -- hostkey: fix compiler warning - -- remove unused variable - -- data types: convert more to use size_t and uint32_t - -- channel: variable type cleanups + Some checks are better done in _libssh2_channel_write just once per + write instead of in channel_write() since the looping will call the + latter function multiple times per _libssh2_channel_write() invoke. -- cleanups: better binary packet gen, size_t fixes and PACKET_* removal - - I'll introduce a new internal function set named - - _libssh2_store_u32 - _libssh2_store_u64 - _libssh2_store_str +- sftp_write: handle "left over" acked data - That can be used all through the library to build binary outgoing - packets. Using these instead of the current approach removes - hundreds of lines from the library while at the same time greatly - enhances readability. I've not yet fully converted everything to - use these functions. + The SFTP handle struct now buffers number of acked bytes that haven't + yet been returned. The way this is used is as following: - I've converted LOTS of 'unsigned long' to 'size_t' where - data/string lengths are dealt with internally. This is The Right - Thing and it will help us make the transition to our - size_t-polished API later on as well. + 1. sftp_write() gets called with a buffer of let say size 32000. We + split 32000 into 8 smaller packets and send them off one by one. One of + them gets acked before the function returns so 4000 is returned. - I'm removing the PACKET_* error codes. They were originally - introduced as a set of separate error codes from the transport - layer, but having its own set of errors turned out to be very - awkward and they were then converted into a set of #defines that - simply maps them to the global libssh2 error codes instead. Now, - I'l take the next logical step and simply replace the PACKET_* - defines with the actual LIBSSH2_ERROR_* defines. It will increase - readability and decrease confusion. + 2. sftp_write() gets called again a short while after the previous one, + now with a much smaller size passed in to the function. Lets say 8000. + In the mean-time, all of the remaining packets from the previous call + have been acked (7*4000 = 28000). This function then returns 8000 as all + data passed in are already sent and it can't return any more than what + it got passed in. But we have 28000 bytes acked. We now store the + remaining 20000 in the handle->u.file.acked struct field to add up in + the next call. - I also separated packet stuff into its own packet.h header file. - -- clarified the return code + 3. sftp_write() gets called again, and now there's a backlogged 20000 + bytes to return as fine and that will get skipped from the beginning + of the buffer that is passed in. -- rename libssh2_error to the correct _libssh2_error +- sftp_write: polished and simplified - We reserve ^libssh2_ for public symbols and we use _libssh2 as - prefix for internal ones. I fixed the intendation of all these - edits with emacs afterwards, which then changed it slightly more - than just _libssh2_error() expressions but I didn't see any - obvious problems. - -- data type cleanup: made lots of code use size_t etc + Removed unnecessary struct fields and state changes within the function. - A lot of code used 'unsigned long' and the likes when it should - rather just use plain 'int' or use size_t for data lengths. - -- wait_socket: make c89 compliant and use two fd_sets for select() + Made the loop that checks for ACKs only check chunks that were fully + sent. -- sftp_readdir: always zero terminate, detail the return code +- SCP: on failure, show the numerical error reason - I also added a description for the 'longentry' field which was - previously undocumented! + By calling libssh2_session_last_errno() -- sftp_readdir: simplified and bugfixed - - This function no longer has any special purpose code for the - single entry case, as it was pointless. - - The previous code would overflow the buffers with an off-by-one - in case the file name or longentry data fields received from the - server were exactly as long as the buffer provided to - libssh2_sftp_readdir_ex. - - We now make sure that libssh2_sftp_readdir_ex() ALWAYS zero - terminate the buffers it fills in. - - The function no longer calls the libssh2_* function again, but - properly uses the internal sftp_* instead. +- SFTP: provide the numerical error reason on failure -- channel/transport: we now drain the outgoing send buffer when we ignore EAGAIN +- SCP: clean up failure treatment - When we ignore the EAGAIN from the transport layer within channel_write, we - now drain the outgoing transport layer buffer so that remainders in that - won't cause any problems in the next invoke of _libssh2_transport_write() + When SCP send or recv fails, it gets a special message from the server + with a warning or error message included. We have no current API to + expose that message but the foundation is there. Removed unnecessary use + of session struct fields. -- channel_write: if data has been sent, don't return EAGAIN - - When sending data in a loop, we must not return EAGAIN if we - managed to send data in an earlier round. This was reported in - bug #126 => http://libssh2.stuge.se/ticket/126 +- sftp_write: enlarge buffer to perform better -Simon Josefsson (14 Apr 2010) -- Fix OpenSSL AES-128-CTR detection. +- packets: code cleanup - Patch from Paul Howarth . - -Daniel Stenberg (13 Apr 2010) -- version in header file now says 1.2.6-DEV + I added size checks in several places. I fixed the code flow to be easier + to read in some places. + + I removed unnecessary zeroing of structs. I removed unused struct fields. -- 1.2.6: clean the RELEASE-NOTES for next release round +- LIBSSH2_CALLBACK_MACERROR: clarify return code use -- NEWS: add the stuff from the version 1.2.5 RELEASE-NOTES +- _libssh2_userauth_publickey: avoid shadowing -Version 1.2.5 (13 Apr 2010) +- packet: avoid shadowing global symbols -Daniel Stenberg (13 Apr 2010) -- channel_close: no longer wait for the SSH_MSG_CHANNEL_CLOSE message - - As the packet may simply not arrive we cannot have the close - function wait for it unconditionally. +- sftp_readdir: avoid shadowing -- less code duplication in the poll vs select code flows - - libssh2_keepalive_send and libssh2_session_block_directions are - now used outside of the #ifdef blocks. +- shadowing: don't shadow the global compress -- make it C90 compliant +- _libssh2_packet_add: turn ifs into a single switch -- updated with all changes and bugs since 1.2.4 +- _libssh2_packet_add: check SSH_MSG_GLOBAL_REQUEST packet -- Added LIBSSH2_SFTP_S_IS***() macros and updated docs +- _libssh2_packet_add: SSH_MSG_DEBUG length checks - libssh2_sftp_fstat_ex.3 is now extended quite a lot to describe a - lot of the struct and the bits it uses and how to test for them. + Verify lengths before using them. Read always_display from the correct + index. Don't copy stuff around just to provide zero-termination of the + strings. -- sftp_init() deal with _libssh2_channel_write() returns short +- _libssh2_packet_add: SSH_MSG_IGNORE skip memmove - When _libssh2_channel_write() is asked to send off 9 bytes, the - code needs to deal with the situation where less than 9 bytes - were sent off and prepare to send the remaining piece at a later - time. + There's no promise of a zero termination of the data in the callback so + no longer perform ugly operation in order to provide it. -- handle a NULL password as if it was "" +- _libssh2_packet_add: SSH_MSG_DISCONNECT length checks - libssh2_userauth_publickey_fromfile_ex() takes a "passphrase" - but didn't deal with it being set to NULL. + Verify lengths before trying to read data. -- Reduce used window sizes by factor 10 - - As reported in bug report #166 http://libssh2.stuge.se/ticket/166 - by 'ptjm', the maximum window size must be less crazy for libssh2 - to do better with more server implementations. I did not do any - testing to see how this changes raw SCP performance, but the - maximum window size is still almost 4MB. This also has the upside - that libssh2 will use less memory. +- indent: break lines at 80 columns -Peter Stuge (28 Mar 2010) -- Correctly clear blocking flag after sending multipart packet - - commit 7317edab61d2179febc38a2c2c4da0b951d74cbc cleared the outbound - blocking bit when send_existing() returned PACKET_NONE and *ret=0, as - opposed to before even calling send_existing(), but because *ret=1 when - sending parts 2..n of an existing packet, the bit would only be cleared - when calling libssh2_transport_write() for a new packet. +- SSH_MSG_CHANNEL_OPEN_FAILURE: used defined values - Clear the direction flag after the final part of a packet has been sent. + We don't like magic numbers in the code. Now the acceptable failure + codes sent in the SSH_MSG_CHANNEL_OPEN_FAILURE message are added as + defined values in the private header file. -Daniel Stenberg (24 Mar 2010) -- Added man page for libssh2_knownhost_addc() +- sftp_write: don't return EAGAIN if no EAGAIN was received - Added mention in libssh2_knownhost_add() docs that - libssh2_knownhost_addc() is the preferred function now. - -- at next soname bump remove libssh2_knownhost_add() - -- ignore TAGS ("make tags" makes them) + This function now only returns EAGAIN if a lower layer actually returned + EAGAIN to it. If nothing was acked and no EAGAIN was received, it will + now instead return 0. -- fix memory leak +- _libssh2_wait_socket: detect nothing-to-wait-for - we must not assign the pointer a NULL since it keeps allocated - data and at least parts of an error string + If _libssh2_wait_socket() gets called but there's no direction set to + wait for, this causes a "hang". This code now detects this situation, + set a 1 second timeout instead and outputs a debug output about it. -- fixed the pattern for avoiding the poll check +- decomp: remove the free_dest argument - added some comments about known problems with poll on darwin + Since the decompress function ALWAYS returns allocated memory we get a + lot simpler code by removing the ability to return data unallocated. -- avoid checking for poll on some systems +- decomp: cleaned off old compression stuff - darwin and interix are known to have broken poll implementations - so we skip the check on those and thus have them use select - unconditionally + I cleared off legacy code from when the compression and decompression + functions were a single unified function. Makes the code easier to read + too. -- ignore libssh2.dsp +- [TJ Saunders brought this change] -Simon Josefsson (23 Mar 2010) -- Fix logic in "on-the-fly" crypto init. + decomp: increase decompression buffer sizes -- Make sure keepalive is working even when poll is used. +- [TJ Saunders brought this change] -- [Paul Querna brought this change] + zlib: Add debug tracing of zlib errors - Use poll when available on blocking API. +- sftp_packet_read: handle partial reads of the length field - Signed-off-by: Simon Josefsson + SFTP packets come as [32 bit length][payload] and the code didn't + previously handle that the initial 32 bit field was read only partially + when it was read. -Peter Stuge (20 Mar 2010) -- Fix speling +- [Jasmeet Bagga brought this change] -Daniel Stenberg (19 Mar 2010) -- fix NULL dereference when window adjusting a non-existing channel + kex_agree_hostkey: fix NULL pointer derefence - Suyog Jadhav pointed out that when receiving a window adjust to - a channel not found, the code would reference a NULL pointer. - Now it will instead output a message about that fact. - -Simon Josefsson (19 Mar 2010) -- Fix build problem. - -- Eat our own dog food, call libssh2_init and libssh2_exit in the examples. - -- Fix init/exit logic. Add self-test of it. - -Daniel Stenberg (19 Mar 2010) -- fix typo - -Simon Josefsson (19 Mar 2010) -- Add man page for libssh2_init and libssh2_exit. Fix libssh2_exit prototype. - -- Shorten constant a bit. More documentation. - -- Fix namespace pollution. - -- Add global init/exit points, to do crypto initialization in one place. + While setting up the session, ssh tries to determine the type of + encryption method it can use for the session. This requires looking at + the keys offered by the remote host and comparing these with the methods + supported by libssh2 (rsa & dss). To do this there is an iteration over + the array containing the methods supported by libssh2. - By Lars Nordin. - -Daniel Stenberg (14 Mar 2010) -- libssh2 is released under the Modifed BSD license, not GPL + If there is no agreement on the type of encryption we come to the 3rd + entry of the hostkeyp array. Here hostkeyp is valid but *hostkep is + NULL. Thus when we dereference that in (*hostkeyp)->name there is a + crash -Alexander Lamaison (14 Mar 2010) -- Add libssh2_knownhost_addc to handle comments. - - Comments in known_hosts file were not handle properly. They were parsed as - part of the key causing key matching to return a mismatch if the entry had a - comment. This adds a new API function that takes an optional comment and - changes libssh2_knownhost_readline to parse the comment as pass it to the - new function. +- _libssh2_transport_send: remove dead assignment - Fixes #164. + 'data' isn't accessed beyond this point so there's no need to assign it. -- Fix gettimeofday to compile with Visual C++ 6. +- scp_recv: remove dead assignment - Reported by Steven Van Ingelgem. - -Simon Josefsson (10 Mar 2010) -- Add. - -- keepalive.c: Fix libssh2_error usage. - -- Fix typo in last commit. - -- Tidy up build option notice. - -- Add entry about keep alive stuff. - -- Add keep-alive support. - -Alexander Lamaison (7 Mar 2010) -- Untabify. - -- Fix memory leak in libssh2_knownhost_add. + Instead of assigning a variable we won't read, we now use the more + explicit (void) prefix. -Daniel Stenberg (6 Mar 2010) -- change 'int' to 'libssh2_socket_t' in the public API for sockets +- sftp_write: removed superfluous assignment -- reduce code duplication and return underlying error better +- bugfix: avoid use of uninitialized value -- acknowledge when _libssh2_packet_requirev() returns error +- sftp_packet_require: propagate error codes better - when _libssh2_packet_requirev() returns an error when waiting for - SSH_MSG_USERAUTH_SUCCESS or SSH_MSG_USERAUTH_FAILURE, it is an - error and it should be treated as such - -- wrap long lines - -- polished the phrasing in two error strings + There were some chances that they would cause -1 to get returned by + public functions and as we're hunting down all such occurances and since + the underlying functions do return valuable information the code now + passes back proper return codes better. -- silence picky compiler warnings +- [Alfred Gebert brought this change] -- silence picky compiler warnings + fix memory leaks (two times cipher_data) for each sftp session -- removed libssh2_error()'s forth argument +- libssh2_userauth_authenticated: make it work as documented - libssh2_error() no longer allocates a string and only accepts a const - error string. I also made a lot of functions use the construct of - return libssh2_error(...) instead of having one call to - libssh2_error() and then a separate return call. In several of those - cases I then also changed the former -1 return code to a more - detailed one - something that I think will not change behaviors - anywhere but it's worth keeping an eye open for any such. - -- repaired --enable-debug + The man page clearly says it returns 1 for "already authenticated" but + the code said non-zero. I changed the code to use 1 now, as that is also + non-zero but it gets the benefit that it now matches the documentation. + + Using 1 instead of non-zero is better for two reasons: + + 1. We have the opportunity to introduce other return codes in the future for + things like error and what not. + 2. We don't expose the internal bitmask variable value. -Simon Josefsson (1 Mar 2010) -- Make ./configure output a summary of build options. +- userauth_keyboard_interactive: fix indent -Daniel Stenberg (1 Mar 2010) -- let the err_msg in the session struct be const too +- [Alfred Gebert brought this change] -Simon Josefsson (1 Mar 2010) -- Revert #ifdef change that pulled in AES-CTR code when explicitly disabled. + fix memory leak in userauth_keyboard_interactive() + + First I wanted to free the memory in session_free() but then + I had still memory leaks because in my test case the function + userauth_keyboard_interactive() is called twice. It is called + twice perhaps because the server has this authentication + methods available: publickey,gssapi-with-mic,keyboard-interactive + The keyboard-interactive method is successful. -Daniel Stenberg (1 Mar 2010) -- fix #ifdefs +- dist: include sftp.h in dist archives -- make function match the new proto +Simon Josefsson (27 Oct 2010) +- Update header to match new function prototype, see c48840ba88. -Simon Josefsson (1 Mar 2010) -- Improve AES-CTR check. +Daniel Stenberg (26 Oct 2010) +- bugfixes: the transport rearrange left some subtle flaws now gone -Daniel Stenberg (1 Mar 2010) -- use const to silence a bazillion warnings +- libssh2_userauth_publickey_fromfile_ex.3: cleaned up looks -Simon Josefsson (1 Mar 2010) -- Use AES-CTR from OpenSSL when available. +- libssh2_userauth_publickey: add man page - Reported by Lars Nordin . + I found an undocumented public function and we can't have it like + that. The description here is incomplete, but should serve as a template + to allow filling in... -- Make it possible to disable DSA. +- libssh2_sftp_write.3: added blurb about the "write ahead" - Patch from Lars Nordin . + Documented the new SFTP write concept -Peter Stuge (1 Mar 2010) -- Send and receive channel EOF before sending SSH_MSG_CHANNEL_CLOSE - - Sending SSH_MSG_CHANNEL_CLOSE without channel EOF is explicitly allowed - in RFC 4254, but some non-conforming servers will hang or time out when - the channel is closed before EOF. - - Other common clients send and receive EOF before closing, there are no - drawbacks, and some servers need it to work correctly. +- sftp_close_handle: free any trailing write chunks -Alexander Lamaison (26 Feb 2010) -- Style improvements to knownhost error handling. - - Made improvements as suggested by Peter Stuge: http://www.libssh2.org/mail/libssh2-devel-archive-2010-02/0161.shtml. +- _libssh2_channel_write: fix warnings -- Call libssh2_error for every knownhost API failure. +- SFTP: bufgix, move more sftp stuff to sftp.h - The libssh2 API calls should set the last error code and a message when - returning a failure by calling libssh2_error. This changeset adds these - calls to the libssh2_knownhost_* API as well as libssh2_base64_decode. + The sftp_write function shouldn't assume that the buffer pointer will be + the same in subsequent calls, even if it assumes that the data already + passed in before haven't changed. - This change also makes libssh2_error into a function rather than a macro. - Its implementation is moved to misc.c. This function returns the error - code passed to it allowing callers to return the error value directly - without duplicating the error code. + The sftp structs are now moved to sftp.h (which I forgot to add before) -- Fix LIBSSH2_ALLOC checks. +- SFTP: use multiple outgoing packets when writing - These appear to be cut-and paste errors where the wrong variable is checked - for NULLness after calling LIBSSH2_ALLOC. - -Simon Josefsson (23 Feb 2010) -- Silence compiler warning. + sftp_write was rewritten to split up outgoing data into multiple packets + and deal with the acks in a more asynchronous manner. This is meant to + help overcome latency and round-trip problems with the SFTP protocol. -- Make it portable; test uses = for string comparison (not ==). Indent. +- TODO: implemented a lot of the ideas now -Alexander Lamaison (22 Feb 2010) -- libssh2_knownhost_del: fix write to freed memory. - - When removing a known host, libssh2_knownhost_del would remove the node from the linked list, free its memory and then overwrite the struct parameter (which indicated which node to remove) with 0. However, this struct is actually allocated within the just-freed node meaning we're writing to freed memory. This made Windows very upset. +- _libssh2_channel_write: removed 32500 size limit - The fix is simply to overwrite the struct first before freeing the memory. - -Daniel Stenberg (21 Feb 2010) -- show more verbose error when SCP send fails - -- libssh2_socket_t is done, a library-free function is needed - -- clarify that this frees all data associated with a session - -- improved error handling + Neither _libssh2_channel_write nor sftp_write now have the 32500 size + limit anymore and instead the channel writing function now has its own + logic to send data in multiple calls until everything is sent. -- add missing libssh2_error() calls +- send_existing: don't tell parent to return when drained - To make sure the public API is functional and that the - BLOCK_ADJUST_ERRNO() macro works correctly we MUST make sure to - call libssh2_error() when we return errors. + That will just cause unnecessary code execution. -- fix memory leak in userauth_keyboard_interactive() +- _libssh2_channel_write: general code cleanup - Mr anonymous in bug #125 pointed out that the userauth_keyboard_interactive() - function does in fact assign the same pointer a second time to a new allocated - buffer without properly freeing the previous one, which caused a memory leak. + simplified the function and removed some unused struct fields -- added missing error codes +- _libssh2_transport_send: replaces _libssh2_transport_write - To allow the libssh2_session_last_error() function to work as - documented, userauth_password() now better makes sure to call - libssh2_error() everywhere before it returns error. + The new function takes two data areas, combines them and sends them as a + single SSH packet. This allows several functions to allocate and copy + less data. - Pointed out by mr anonymous in bug #128 + I also found and fixed a mixed up use of the compression function + arguments that I introduced in my rewrite in a recent commit. -Peter Stuge (16 Feb 2010) -- Fix resource and memory leaks in examples as reported by cppcheck +- scp_write_nonblock: use select() instead of busyloop - Thanks to Ettl Martin for the report and patch. This fixes #132 + Make this example nicer by not busylooping. -Daniel Stenberg (15 Feb 2010) -- mention the new man pages for macros +- send_existing: clear olen when the data is sent off -- added man pages for API macros - - all #defined macros in the public headers are considered to be part - of the API and I've generated individual man pages for each of them - to A) make it easier to figure out what each function/macro actually - is for so that automated lookups work better and for B) make sure we - have all public functions document (both macros and functions) to - make it easier for us to work away from all the macros in a future - release. +- _libssh2_transport_write: allow 256 extra bytes around the packet -- Committed the patch by Yoichi Iwaki in bug #2929647 - - Committed the patch by Yoichi Iwaki in bug #2929647, which fixed a memory - leak when an 'outbuf' was still allocated when a session was freed. +- _libssh2_transport_write: remade to send without malloc -- free "outbuf" when killing a session - - Fix memoary leak: if there was an "output" still allocated when a - session was torn down it needs to be freed in session_free() +- compress: compression disabled by default - Patch by Yoichi Iwaki in bug #2929647 + We now allow libssh2_session_flag() to enable compression with a new + flag and I added documentation for the previous LIBSSH2_FLAG_SIGPIPE + flag which I wasn't really aware of! -- the working version name is now 1.2.5_DEV +- comp: split the compress function + + It is now made into two separate compress and decompress functions. In + preparation for upcoming further modficications. -Version 1.2.4 (13 Feb 2010) +Dan Fandrich (20 Oct 2010) +- Added header file to allow compiling in older environments -Daniel Stenberg (13 Feb 2010) -- updated info for 1.2.4 +Daniel Stenberg (20 Oct 2010) +- TODO: add a possible new API for SFTP transfers -Dan Fandrich (10 Feb 2010) -- Allow compiling with OpenSSL when AES isn't available. +- TODO: "New Transport API" added -Peter Stuge (9 Feb 2010) -- [Dave McCaldon brought this change] +- TODO: add buffering plans - Fix Tru64 socklen_t compile issue with example/direct_tcpip.c - - Building libssh2-1.2.3 on Tru64 fails at line 48 and 166 because socklen_t - isn't defined on Tru64 unless _POSIX_PII_SOCKET is defined. - - This patch updates configure.ac to add -D_POSIX_PII_SOCKET when building - on Tru64 platform(s). +Simon Josefsson (13 Oct 2010) +- Mention libssh2_channel_get_exit_signal and give kudos. -- [Dave McCaldon brought this change] +- [Tommy Lindgren brought this change] - Resolve compile issues on Solaris x64 and UltraSPARC - - Solaris builds of libssh2-1.2.3 failed on both x64 and UltraSPARC - platforms because of two problems: + Add libssh2_channel_get_exit_signal man page. - 1) src/agent.c:145 sun is a reserved word when using the SUNWspro compiler - 2) example/direct_tcpip.c:84 INADDR_NONE is not defined - -Daniel Stenberg (3 Feb 2010) -- towards 1.2.4 now - -Version 1.2.3 (3 Feb 2010) + Signed-off-by: Simon Josefsson -Daniel Stenberg (3 Feb 2010) -- Version 1.2.3 (February 3, 2010) +- [Tommy Lindgren brought this change] -- fix building out of source tree by proving better include path + Add libssh2_channel_get_exit_signal. - when building out of source tree, we provide -I$(top_builddir)/example - since the libssh2_config.h gets generated in that dir - -Peter Stuge (1 Feb 2010) -- [Sofian Brabez brought this change] + Signed-off-by: Simon Josefsson - Replace : in hexdump with " " (two spaces) +- Add libssh2_free man page and fix typo. -- Detect when the forwarded connection is closed in example/direct_tcpip.c +- Add libssh2_free. -- Fix example/direct_tcpip.c to work also on WIN32 +Daniel Stenberg (11 Oct 2010) +- scp_recv: improved treatment of channel_read() returning zero - read() and write() are no good for WIN32 sockets, use recv() and send(). - -- Ignore libssh2_config.h.in and stamp-h2 in example/ and remove .cvsignore + As a zero return code from channel_read() is not an error we must make + sure that the SCP functions deal with that properly. channel_read() + always returns 0 if the channel is EOFed already so we check for EOF + after 0-reads to be able to return error properly. -- Simplify WIN32 ifdefs in example/direct_tcpip.c to allow standalone compile +- libssh2_session_methods.3: detail what can be asked for -- Always #define INVALID_SOCKET -1 in libssh2_priv.h when not on win32 +- compression: send zlib before none - Fix broken builds since commit abd9bd0bbe631efeada1f54552c70b54e1c490c1 - for all non-win32 platforms. - -- Include hmac-md5 and hmac-md5-96 only if crypto backend supports MD5 + As the list of algorithms in a preferred order we should send zlib + before none to increase the chances that the server will let us do + compression. -- Use LIBSSH2_HOSTKEY_HASH_SHA1 instead of _MD5 in examples and tests +- compress: faster check, better return codes - MD5 support is optional and may not always be available, while SHA1 is both - required and recommended. - -- Update mailing list address in configure.ac to @cool.haxx.se - -- Make example/direct_tcpip.c compile for win32 + In the transport functions we avoid a strcmp() now and just check a + boolean instead. - One warning from FD_SET() remains, it is also in some other examples. + The compress/decompress function's return code is now acknowledged and + used as actual return code in case of failures. -- Correctly check for an invalid socket in session_startup() +- libssh2_session_handshake: replaces libssh2_session_startup() + + The function libssh2_session_startup() is now considered deprecated due + to the portability issue with the socket argument. + libssh2_session_handshake() is the name of the replacement. -- Small documentation fix after Dave's _USERAUTH_FAILURE improvement +- libssh2_socket_t: now externally visible + + In preparation for upcominig changes, the libssh2_socket_t type is now + typedef'ed in the public header. -- [Dave McCaldon brought this change] +- _libssh2_transport_drain: removed + + This function proved not to be used nor useful. - Handle SSH_MSG_USERAUTH_FAILURE for password and kbd-int authentication +- _libssh2_channel_write: don't iterate over transport writes - Neither libssh2_userauth_password_ex() nor - libssh2_userauth_keyboard_interactive_ex() would return a login failure - error if the server responded with a SSH_MSG_USERAUTH_FAILURE, instead - you would see whatever previous error had occurred, typically - LIBSSH2_ERROR_EAGAIN. + When a call to _libssh2_transport_write() succeeds, we must return from + _libssh2_channel_write() to allow the caller to provide the next chunk + of data. - This patch changes error code -18 to LIBSSH2_ERROR_AUTHENTICATION_FAILED - and makes LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED an alias for - LIBSSH2_ERROR_AUTHENTICATION_FAILED. In addition, new logic in - userauth_password() properly handles SSH_MSG_USERAUTH_FAILURE and both - this function and userauth_keyboard_interactive() now properly return - LIBSSH2_ERROR_AUTHENTICATION_FAILED. - -Simon Josefsson (28 Jan 2010) -- Fix. - -- Also deal with GLOBAL_REQUEST keep-alives. - -- Make OpenSSH-style keepalive work against libssh2 clients. + We cannot move on to send the next piece of data that may already have + been provided in this same function call, as we risk getting EAGAIN for + that and we can't return information both about sent data as well as + EAGAIN. So, by returning short now, the caller will call this function + again with new data to send. -Daniel Stenberg (27 Jan 2010) -- clarified +- _libssh2_transport_write: updated documentation blurb -Peter Stuge (26 Jan 2010) -- [Dave McCaldon brought this change] +- _libssh2_transport_write: remove fprintf remainder + + Mistake from previous debugging - Fix trace context lookup in libssh2_debug() +- session: improved errors - The trace context is actually a bitmask so that tracing output can be - controlled by setting a bitmask using libssh2_trace(). However, the logic - in libssh2_debug() that converted the context to a string was using the - context value as an array index. Because the code used a bounds check on - the array, there was never a danger of a crash, but you would certainly - either get the wrong string, or "unknown". + Replaced -1/SOCKET_NONE errors with appropriate error defines instead. - This patch adds a lookup that iterates over the context strings and uses - it's index to check for the corresponding bit in the context. - -- Fix typo in RELEASE-NOTES - -Daniel Stenberg (20 Jan 2010) -- updated for 1.2.3 with all the stuff I found in the log - -- ignore more generated files + Made the verbose trace output during banner receiving less annoying for + non-blocking sessions. -- [Dave McCaldon brought this change] +- crypt_init: use correct error define - Pass user context through libssh2_trace_sethandler() to callback +- _libssh2_error: hide EAGAIN for non-blocking sessions - The libssh2_trace_sethandler() call allows the user to handle the output of libssh2 rather than having it written to stderr. This patch updates libssh2_trace_sethandler() to allow a user-defined void* context value to be passed back to the output handler. - -- [Dave McCaldon brought this change] - - Add libssh2_trace_sethandler() to the API (even more) + In an attempt to make the trace output less cluttered for non-blocking + sessions the error function now avoids calling the debug function if the + error is the EAGAIN and the session is non-blocking. -- [Dave McCaldon brought this change] +- agent: use better error defines - Add libssh2_trace_sethandler() to the API +- comp_method_zlib_init: use correct error defines -- cleanup includes +- transport: better error codes - We now produce a local libssh2_config.h file in this dir for the - examples to use so I cleaned up the include path at the same time. + LIBSSH2_SOCKET_NONE (-1) should no longer be used as error code as it is + (too) generic and we should instead use specific and dedicated error + codes to better describe the error. -- generate a libssh2_config.h in the example dir +- channel: return code and _libssh2_error cleanup - buildconf copies the template to example/ and configure makes sure - to generate a proper file from it and the direct_tcpip.c example - is the first one to use it - to make sure it builds fine on more - paltforms - -Simon Josefsson (13 Jan 2010) -- Remove redundant #includes and reorder sys/types.h include. - -Daniel Stenberg (10 Jan 2010) -- avoid a free(NULL) - -Simon Josefsson (7 Jan 2010) -- Make it simpler to get more debug info. - -Daiki Ueno (1 Jan 2010) -- Simplify the commit 63457dfa using type cast from size_t * to ulong *. + Made sure that all transport_write() call failures get _libssh2_error + called. -Alexander Lamaison (30 Dec 2009) -- Fixed memory leak in userauth_publickey(). - - userauth_publickey_fromfile() reads the key from a - file using file_read_publickey() which returns two - allocated strings, the decoded key and the key - method (such as "ssh-dss"). The latter can be - derived from the former but returning both avoids a - later allocation while doing so. - - Older versions of userauth_publickey_fromfile() used - this method string directly but when - userauth_publickey() was factored out of - userauth_publickey_fromfile() it derived the method - from the key itself. This resulted in the method - being allocated twice. +- _libssh2_channel_write: limit to 32700 bytes - This fix, which maintains the optimisation that - avoids an extra allocation, changes - userauth_publickey() so it doesn't allocate and - derive the method when userauth_pblc_method already - has a value. + The well known and used ssh server Dropbear has a maximum SSH packet + length at 32768 by default. Since the libssh2 design current have a + fixed one-to-one mapping from channel_write() to the packet size created + by transport_write() the previous limit of 32768 in the channel layer + caused the transport layer to create larger packets than 32768 at times + which Dropbear rejected forcibly (by closing the connection). - Signed-off-by: Alexander Lamaison - -Daiki Ueno (25 Dec 2009) -- Fix the return value description of libssh2_knownhost_free(). + The long term fix is of course to remove the hard relation between the + outgoing SSH packet size and what the input length argument is in the + transport_write() function call. -- Fix compiler warnings for size_t pointers on 32-bit Windows. +- libssh.h: add more dedicated error codes -- Define INVALID_SOCKET and use it instead of SOCKET_BAD. +- SCP: allow file names with bytes > 126 - Revert the part of previous commit that defines SOCKET_BAD library wide. - -- Use libssh2_socket_t in the ssh-agent stuff. - Define a portability macro SOCKET_BAD which means "invalid socket". - -- Mark/unmark connection to Pageant is open/close. - -- Add test to check if the socket is connected. - -Peter Stuge (24 Dec 2009) -- Add libssh2.pc to top-level .gitignore - -- Fix publickey authentication regression + When parsing the SCP protocol and verifying that the data looks like a + valid file name, byte values over 126 must not be consider illegal since + UTF-8 file names will use such codes. - Commit 70b199f47659a74b8778c528beccf893843e5ecb introduced a parsing - bug in file_read_publickey() which made the algorithm name contain an - extra trailing space character, breaking all publickey authentication. - -- Add a direct-tcpip example which shows local port forwarding - -- Add session parameter and LIBSSH2_TRACE_SOCKET to libssh2_trace(3) man page - -- Add TODO: Expose error messages sent by the server - -Daiki Ueno (23 Dec 2009) -- Fix doc comments. + Reported by: Uli Zappe + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2010-08/0112.shtml -- Add man pages for ssh-agent API. +Dan Fandrich (25 Aug 2010) +- Document the three sftp stat constants -- Don't request userauthlist after authentication. +Guenter Knauf (18 Aug 2010) +- Fixed Win32 makefile which was now broken at resource build. -Simon Josefsson (21 Dec 2009) -- Add. +- It is sufficient to pipe stderr to NUL to get rid of the nasty messages. -- [Daiki Ueno brought this change] +- [Author: Guenter Knauf brought this change] - Add an example to use ssh-agent API. + Removed Win32 ifdef completely for sys/uio.h. - Signed-off-by: Simon Josefsson - -- [Daiki Ueno brought this change] + No idea why we had this ifdef at all but MSVC, MingW32, Watcom + and Borland all have no sys/uio.h header; so if there's another + Win32 compiler which needs it then it should be added explicitely + instead of this negative list. - Add ssh-agent API. +- New files should also be added to Makefile.am. - Signed-off-by: Simon Josefsson + Otherwise they will never be included with release and snapshot tarballs ... -- [Daiki Ueno brought this change] +Daniel Stenberg (18 Aug 2010) +- version: bump to 1.2.8_DEV - Add callback-based API for publickey auth. - - Signed-off-by: Simon Josefsson +Version 1.2.7 (17 Aug 2010) -- Move examples from example/simple to example/. +Daniel Stenberg (17 Aug 2010) +- release: updated to hold 1.2.7 info -- Move examples from example/simple to example/. +Guenter Knauf (17 Aug 2010) +- Use the new libssh2.rc file. -Daniel Stenberg (17 Dec 2009) -- _libssh2_list_insert() fixed to work - - While this is code not currently in use, it is part of the generic linked - list code and since I found the error I thought I'd better fix it since we - might bring in this function into the code one day. +- Added resource file for libssh2.dll (shamelessly stolen from libcurl). -Simon Josefsson (16 Dec 2009) -- Silence compiler warnings. - - Based on patch by Kamil Dudka in - . +- Updated Win32 MSVC dependencies versions. -- [Kamil Dudka brought this change] +- Added include for sys/select.h to get fd.set on some platforms. - libgcrypt: simplify code of _libssh2_dsa_sha1_sign +- Added Watcom makefile borrowed from libcurl. - Signed-off-by: Simon Josefsson + This makefile compiles already all files fine for static lib, but needs + final touch when I have OpenSSL fully working with shared libs and Watcom. -- [Kamil Dudka brought this change] +- Added copyright define to libssh2.h and use it for binary builds. - libgcrypt: follow-up for ssh-dss padding fix +- Moved version defines up in order to include from .rc file. - Signed-off-by: Simon Josefsson + Blocked rest of header with ifndef so its possible to let + the rc compiler only use the version defines. -Dan Fandrich (15 Dec 2009) -- Check for the right environment variable in the test app +- Some minor makefile tweaks. -Simon Josefsson (14 Dec 2009) -- Silence warning about unused function parameter. +Daniel Stenberg (2 Aug 2010) +- example: treat the libssh2_channel_read() return code properly - Reported by Steven Van Ingelgem . + A short read is not an error. Only negative values are errors! -Daniel Stenberg (10 Dec 2009) -- avoid returning data to memory already freed +- libssh2_wait_socket: reset error code to "leak" EAGAIN less - In case of failure we must make sure that the data we return - doesn't point to a memory area already freed. Reported anonymously - in the bug report #2910103. - -Peter Stuge (8 Dec 2009) -- Use LIBSSH2_TRACE_* internally and remove redundant LIBSSH2_DBG_* + Since libssh2 often sets LIBSSH2_ERROR_EAGAIN internally before + _libssh2_wait_socket is called, we can decrease some amount of + confusion in user programs by resetting the error code in this function + to reduce the risk of EAGAIN being stored as error when a blocking + function returns. -- Add LIBSSH2_TRACE_SOCKET context for tracing send() and recv() +- _libssh2_wait_socket: poll needs milliseconds - Helpful in debugging the -39 errors. - -- Another transport layer fix for bogus -39 (LIBSSH2_ERROR_BAD_USE) errors + As reported on the mailing list, the code path using poll() should + multiple seconds with 1000 to get milliseconds, not divide! - Commit 683aa0f6b52fb1014873c961709102b5006372fc made send_existing() send - more than just the second part of a packet when the kernel did not accept - the full packet, but the function still overlooked the SSH protocol - overhead in each packet, often 48 bytes. + Reported by: Jan Van Boghout + +- typedef: make ssize_t get typedef without LIBSSH2_WIN32 - If only the last few bytes of a packet remained, then the packet would - erroneously be considered completely sent, and the next call to write - more data in the session would return a -39 error. + The condition around the ssize_t typedef depended on both LIBSSH2_WIN32 + *and* _MSC_VER being defined when it should be enough to depend on + _MSC_VER only. It also makes it nicer so libssh2-using code builds fine + without having custom defines. -Daniel Stenberg (6 Dec 2009) -- move local variable to be more localized +- [John Little brought this change] -- fixed some indent mistakes + session_free: free more data to avoid memory leaks -Peter Stuge (6 Dec 2009) -- Fix padding in ssh-dss signature blob encoding - - DSA signatures consist of two 160-bit integers called r and s. In ssh-dss - signature blobs r and s are stored directly after each other in binary - representation, making up a 320-bit (40 byte) string. (See RFC4253 p14.) +- channel_free: ignore problems with channel_close() - The crypto wrappers in libssh2 would either pack r and s incorrectly, or - fail, when at least one integer was small enough to be stored in 19 bytes - or less. + As was pointed out in bug #182, we must not return failure from + _libssh2_channel_free() when _libssh2_channel_close() returns an error + that isn't EAGAIN. It can effectively cause the function to never go + through, like it did now in the case where the socket was actually + closed but socket_state still said LIBSSH2_SOCKET_CONNECTED. - The patch ensures that r and s are always stored as two 160 bit numbers. + I consider this fix the right thing as it now also survives other + errors, even if making sure socket_state isn't lying is also a good + idea. -- Don't always clear write direction blocking flag - - When libssh2_transport_write() is called to continue sending a - partially sent packet the write direction flag must not be cleared - until the previous packet has been completely sent, or the app would - hang if the packet still isn't sent completely, since select() gets - called by the internal blocking emulation layer in libssh2 but would - then not be watching the socket for writability. +- publickey_list_free: no return value from a void function - Clear the flag only once processing of previous packet data is - complete and a new packet is about to be prepared. - -Alexander Lamaison (24 Nov 2009) -- Detabify. - -- [Daniel Stenberg brought this change] - - Fixed memory leak in sftp_fstat(). - -Simon Josefsson (17 Nov 2009) -- Mark date of 1.2.2 release. - -- Merge branch 'master' of ssh://git.stuge.se/var/lib/git/libssh2 - -Version 1.2.2 (16 Nov 2009) - -Daniel Stenberg (16 Nov 2009) -- prepared for 1.2.2 - -Simon Josefsson (16 Nov 2009) -- Improve NEWS items. + Fixed a compiler warning I introduced previously when checking input + arguments more. I also added a check for the other pointer to avoid NULL + pointer dereferences. -- Support AES-Counter ciphers. +- [Lars Nordin brought this change] -- Silence compiler warning. + openssl: make use of the EVP interface - Reported by Steven Van Ingelgem - in . + Make use of the EVP interface for the AES-funktion. Using this method + supports the use of different ENGINES in OpenSSL for the AES function + (and the direct call to the AES_encrypt should not be used according to + openssl.org) -- Mention libssh2-style.el. +Peter Stuge (23 Jun 2010) +- [Tor Arntsen brought this change] -- Use memmove instead of memcpy on overlapping memory areas. + Don't overflow MD5 server hostkey - Reported by Bob Alexander in - . - -- Add. + Use SHA_DIGEST_LENGTH and MD5_DIGEST_LENGTH in memcpy instead of hardcoded + values. An incorrect value was used for MD5. -- Protect against crash on too small SSH_MSG_IGNORE packets. +- Fix message length bugs in libssh2_debug() - Reported by Bob Alexander - in . - -- add copyright line - -- support arcfour128 cipher per RFC 4345 - -Daniel Stenberg (21 Oct 2009) -- [Cristian Rodríguez brought this change] - - add support for GCC visibility features - -Simon Josefsson (19 Oct 2009) -- less hard coding of cipher mode in libgcrypt backend - -Daniel Stenberg (18 Oct 2009) -- [Juzna brought this change] - - libssh2_channel_forward_accept() and listening fixes + There was a buffer overflow waiting to happen when a debug message was + longer than 1536 bytes. - The forward accepting was not done right before, and the - packet_queue_listener function didn't assign a necessary - variable. All fixed by Juzna. I (Daniel) modified the - forward_accept() change somewhat. - -- added man page for libssh2_knownhost_free - -- more CVS => DEV conversions + Thanks to Daniel who spotted that there was a problem with the message + length passed to a trace handler also after commit + 0f0652a3093111fc7dac0205fdcf8d02bf16e89f. -- remove references to "CVS" +- Make libssh2_debug() create a correctly terminated string + + Also use FILE *stderr rather than fd 2, which can very well be something + completely different. -- we are on the 1.2.2 track nowadays +Daniel Stenberg (23 Jun 2010) +- [TJ Saunders brought this change] -Peter Stuge (17 Oct 2009) -- Ensure that win32/libssh2.dsp will be generated with CRLF line endings + handshake: Compression enabled at the wrong time + + In KEXINIT messages, the client and server agree on, among other + things, whether to use compression. This method agreement occurs + in src/kex.c's kex_agree_methods() function. However, if + compression is enabled (either client->server, server->client, or + both), then the compression layer is initialized in + kex_agree_methods() -- before NEWKEYS has been received. - First, win32/msvcproj.{head,foot} are now committed with CRLF line endings, - and .gitattributes specifies that these should not be changed on checkout or - commit. These are win32 files so it makes sense to store them with native - line endings. + Instead, the initialization of the compression layer should + happen after NEWKEYS has been received. This looks to occur + insrc/kex.c's diffie_hellman_sha1(), which even has the comment: - Second, the rules for generating libssh2.dsp and libssh2.vcproj are changed - so that the full file contents passes through awk, which strips all CR and - then prints each line with one CRLF line ending. Stripping CR is important - to avoid CRCRLF in case the input already comes with CRLF. - -Dan Fandrich (29 Sep 2009) -- Make sure permissions on the private host key file is tight enough that - sshd doesn't complain. Quote $srcdir to try to cope with embedded spaces. - -Peter Stuge (30 Sep 2009) -- Clarify the scp_write examples slightly and use an octal mask for the mode - -Version 1.2.1 (29 Sep 2009) - -Daniel Stenberg (29 Sep 2009) -- 1.2.1 preparations - -- remove ChangeLog and win32/libssh2.dsp only at make distclean - -Simon Josefsson (23 Sep 2009) -- Fix shell usage. - -Daniel Stenberg (22 Sep 2009) -- clarify that the paths are the remote ones - -- let hpux systems build with _REENTRANT defined as well - -- updated to match reality + /* The first key exchange has been performed, - I went over the commit log and added what I believe is all notable - changes and bugfixes since the 1.2 release - -Peter Stuge (20 Sep 2009) -- Fix scp examples to loop correctly over libssh2_channel_write() - -- Fix transport layer bug causing invalid -39 (LIBSSH2_ERROR_BAD_USE) errors + switch to active crypt/comp/mac mode */ - The channel layer sends packets using the transport layer, possibly - calling _libssh2_transport_write() many times for each packet. + There, after NEWKEYS is received, the cipher and mac algorithms + are initialized, and that is where the compression should be + initialized as well. - The transport layer uses the send_existing() helper to send out any - remaining parts of previous packets before a new packet is started. + The current implementation fails if server->client compression is + enabled because most server implementations follow OpenSSH's + lead, where compression is initialized after NEWKEYS. Since the + server initializes compression after NEWKEYS, but libssh2 + initializes compression after KEXINIT (i.e. before NEWKEYS), they + are out of sync. - The bug made send_existing() consider the entire packet sent as soon as it - successfully sent the second part of a packet, even if the packet was not - completely done yet. + Reported in bug report #180 -Daniel Stenberg (19 Sep 2009) -- [Neil Gierman brought this change] +- [TJ Saunders brought this change] - Added gettimeofday() function for win32 + userauth_hostbased_fromfile: packet length too short - Neil Gierman's patch adds a gettimeofday() function for win32 - for the libssh2_trace() functionality. The code originates from - cygwin and was put in the public domain by the author - Danny Smith - -- libssh2_channel_read_ex() must return 0 when closed + The packet length calculated in src/userauth.c's + userauth_hostbased_fromfile() function is too short by 4 bytes; + it forgets to add four bytes for the length of the hostname. + This causes hostbased authentication to fail, since the server + will read junk data. - If the channel is already at EOF or even closed at the end of the - libssh2_channel_read_ex() function and there's no data to return, - we need to signal that back. We may have gotten that info while - draining the incoming transport layer until EAGAIN so we must not - be fooled by that return code. - -Dan Fandrich (16 Sep 2009) -- Ignore tags file - -- Some platforms need sys/socket.h included before netinet/in.h. - Fixed an unused variable compiler warning. + verified against proftpd's mod_sftp module -Daniel Stenberg (16 Sep 2009) -- libssh2_channel_wait_closed() could hang +- _libssh2_userauth_publickey: reject method names longer than the data - libssh2_channel_wait_closed() had a bad loop waiting for the - channel to close, as it could easily miss the info and then if - the socket would be silent from that moment the funtion would - hang if in blocking-mode or just return EAGAIN wrongly to the - app. The drain-transport loop now correctly checks if the close - has arrived. - -- make libssh2_scp_send/recv do blocking mode correctly + This functions get the method length by looking at the first 32 + bit of data, and I now made it not accept method lengths that are + longer than the whole data set is, as given in the dedicated + function argument. - Somehow I had completely missed to make the libssh2_scp_send/recv - functions support the blocking mode the correct way so when I - cleaned up things the other day blocking mode broke for them... - Fixed now. - -Guenter Knauf (8 Sep 2009) -- changed NetWare test makefile static link order - -- removed conditional sources from Makefile.inc - added ifdef blocks to libgcrypt.c, pem.c, openssl.c - -Simon Josefsson (7 Sep 2009) -- Fix compilation errors. + This was detected when the function was given bogus public key + data as an ascii string, which caused the first 32bits to create + a HUGE number. -Guenter Knauf (6 Sep 2009) -- some more NetWare build fixes. +- NULL resistance: make more public functions survive NULL pointer input + + Sending in NULL as the primary pointer is now dealt with by more + public functions. I also narrowed the userauth.c code somewhat to + stay within 80 columns better. -- some more NetWare makefile fixes. +- agent: make libssh2_agent_userauth() work blocking properly + + previously it would always work in a non-blocking manner -- added sys/select.h include to samples for fd_set on NetWare. +Peter Stuge (17 Jun 2010) +- Fix underscore typo for 64-bit printf format specifiers on Windows + + Commit 49ddf447ff4bd80285f926eac0115f4e595f9425 was missing underscores. -- accept CFLAGS from environment. +Daniel Stenberg (16 Jun 2010) +- libssh2_session_callback_set: extended the man page diff --git a/vendor/libssh2/README b/vendor/libssh2/README index 39abc202e8..8a148568cf 100644 --- a/vendor/libssh2/README +++ b/vendor/libssh2/README @@ -4,9 +4,9 @@ libssh2 - SSH2 library libssh2 is a library implementing the SSH2 protocol, available under the revised BSD license. -Web site: http://www.libssh2.org/ +Web site: https://www.libssh2.org/ -Mailing list: http://cool.haxx.se/mailman/listinfo/libssh2-devel +Mailing list: https://cool.haxx.se/mailman/listinfo/libssh2-devel License: see COPYING diff --git a/vendor/libssh2/RELEASE-NOTES b/vendor/libssh2/RELEASE-NOTES index 2b22288cec..62064a9fe6 100644 --- a/vendor/libssh2/RELEASE-NOTES +++ b/vendor/libssh2/RELEASE-NOTES @@ -1,56 +1,62 @@ -libssh2 1.7.0 +libssh2 1.10 + +This release includes the following enhancements and bugfixes: + + o adds agent forwarding support + o adds OpenSSH Agent support on Windows + o adds ECDSA key support using the Mbed TLS backend + o adds ECDSA cert authentication + o adds diffie-hellman-group14-sha256, diffie-hellman-group16-sha512, + diffie-hellman-group18-sha512 key exchanges + o adds support for PKIX key reading when using ed25519 with OpenSSL + o adds support for EWOULDBLOCK on VMS systems + o adds support for building with OpenSSL 3 + o adds support for using FIPS mode in OpenSSL + o adds debug symbols when building with MSVC + o adds support for building on the 3DS + o adds unicode build support on Windows + o restores os400 building + o increases min, max and opt Diffie Hellman group values + o improves portiablity of the make file + o improves timeout behavior with 2FA keyboard auth + o various improvements to the Wincng backend + o fixes reading parital packet replies when using an agent + o fixes Diffie Hellman key exchange on Windows 1903+ builds + o fixes building tests with older versions of OpenSSL + o fixes possible multiple definition warnings + o fixes potential cast issues _libssh2_ecdsa_key_get_curve_type() + o fixes potential use after free if libssh2_init() is called twice + o improved linking when using Mbed TLS + o fixes call to libssh2_crypto_exit() if crypto hasn't been initialized + o fixes crash when loading public keys with no id + o fixes possible out of bounds read when exchanging keys + o fixes possible out of bounds read when reading packets + o fixes possible out of bounds read when opening an X11 connection + o fixes possible out of bounds read when ecdh host keys + o fixes possible hang when trying to read a disconnected socket + o fixes a crash when using the delayed compression option + o fixes read error with large known host entries + o fixes various warnings + o fixes various small memory leaks + o improved error handling, various detailed errors will now be reported + o builds are now using OSS-Fuzz + o builds now use autoreconf instead of a custom build script + o cmake now respects install directory + o improved CI backend + o updated HACKING-CRYPTO documentation + o use markdown file extensions + o improved unit tests -This release includes the following changes: - - o libssh2_session_set_last_error: Add function - o mac: Add support for HMAC-SHA-256 and HMAC-SHA-512 - o WinCNG: support for SHA256/512 HMAC - o kex: Added diffie-hellman-group-exchange-sha256 support - o OS/400 crypto library QC3 support - -This release includes the following security advisory: - - o diffie_hellman_sha256: convert bytes to bits - CVE-2016-0787: http://www.libssh2.org/adv_20160223.html - -This release includes the following bugfixes: - - o SFTP: Increase speed and datasize in SFTP read - o openssl: make libssh2_sha1 return error code - o openssl: fix memleak in _libssh2_dsa_sha1_verify() - o cmake: include CMake files in the release tarballs - o Fix builds with Visual Studio 2015 - o hostkey.c: Fix compiling error when OPENSSL_NO_MD5 is defined - o GNUmakefile: add support for LIBSSH2_LDFLAG_EXTRAS - o GNUmakefile: add -m64 CFLAGS when targeting mingw64 - o kex: free server host key before allocating it (again) - o SCP: add libssh2_scp_recv2 to support large (> 2GB) files on windows - o channel: Detect bad usage of libssh2_channel_process_startup - o userauth: Fix off by one error when reading public key file - o kex: removed dupe entry from libssh2_kex_methods - o _libssh2_error: Support allocating the error message - o hostkey: fix invalid memory access if libssh2_dsa_new fails - o hostkey: align code path of ssh_rsa_init to ssh_dss_init - o libssh2.pc.in: fix the output of pkg-config --libs - o wincng: fixed possible memory leak in _libssh2_wincng_hash - o wincng: fixed _libssh2_wincng_hash_final return value - o add OpenSSL 1.1.0-pre2 compatibility - o agent_disconnect_unix: unset the agent fd after closing it - o sftp: stop reading when buffer is full - o sftp: Send at least one read request before reading - o sftp: Don't return EAGAIN if data was written to buffer - o sftp: Check read packet file offset - o configure: build "silent" if possible - o openssl: add OpenSSL 1.1.0-pre3-dev compatibility - o GNUmakefile: list system libs after user libs - This release would not have looked like this without help, code, reports and advice from friends like these: - Alexander Lamaison, Andreas Schneider, brian m. carlson, Daniel Stenberg, - David Byron, Jakob Egger, Kamil Dudka, Marc Hoersken, Mizunashi Mana, - Patrick Monnerat, Paul Howarth, Salvador Fandino, Salvador Fandiño, - Salvador Fandiño, Viktor Szakats, Will Cosgrove, - (16 contributors) + katzer, Orgad Shaneh, mark-i-m, Zenju, axjowa, Thilo Schulz, + Etienne Samson, hlefebvre, seba30, Panos, jethrogb, Fabrice Fontaine, + Will Cosgrove, Daniel Stenberg, Michael Buckley, Wallace Souza Silva, + Romain-Geissler-1A, meierha, Tseng Jun, Thomas Klausner, Brendan Shanks, + Harry Sintonen, monnerat, Koutheir Attouchi, Marc Hörsken, yann-morin-1998, + Wez Furlong, TDi-jonesds, David Benjamin, Max Dymond, Igor Klevanets, + Viktor Szakats, Laurent Stacul, Mstrodl, Gabriel Smith, MarcT512, + Paul Capron, teottin, Tor Erik Ottinsen, Brian Inglis - Thanks! (and sorry if I forgot to mention someone) + (40 contributors) diff --git a/vendor/libssh2/acinclude.m4 b/vendor/libssh2/acinclude.m4 index 71860d6182..2066f0ec9b 100644 --- a/vendor/libssh2/acinclude.m4 +++ b/vendor/libssh2/acinclude.m4 @@ -382,3 +382,131 @@ AC_DEFUN([CURL_CONFIGURE_REENTRANT], [ # ]) +dnl LIBSSH2_LIB_HAVE_LINKFLAGS +dnl -------------------------- +dnl Wrapper around AC_LIB_HAVE_LINKFLAGS to also check $prefix/lib, if set. +dnl +dnl autoconf only checks $prefix/lib64 if gcc -print-search-dirs output +dnl includes a directory named lib64. So, to find libraries in $prefix/lib +dnl we append -L$prefix/lib to LDFLAGS before checking. +dnl +dnl For conveniece, $4 is expanded if [lib]$1 is found. + +AC_DEFUN([LIBSSH2_LIB_HAVE_LINKFLAGS], [ + libssh2_save_CPPFLAGS="$CPPFLAGS" + libssh2_save_LDFLAGS="$LDFLAGS" + + if test "${with_lib$1_prefix+set}" = set; then + CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-I${with_lib$1_prefix}/include" + LDFLAGS="$LDFLAGS${LDFLAGS:+ }-L${with_lib$1_prefix}/lib" + fi + + AC_LIB_HAVE_LINKFLAGS([$1], [$2], [$3]) + + LDFLAGS="$libssh2_save_LDFLAGS" + + if test "$ac_cv_lib$1" = "yes"; then : + $4 + else + CPPFLAGS="$libssh2_save_CPPFLAGS" + fi +]) + +AC_DEFUN([LIBSSH2_CHECK_CRYPTO], [ +if test "$use_crypto" = "auto" && test "$found_crypto" = "none" || test "$use_crypto" = "$1"; then +m4_case([$1], +[openssl], [ + LIBSSH2_LIB_HAVE_LINKFLAGS([ssl], [crypto], [#include ], [ + AC_DEFINE(LIBSSH2_OPENSSL, 1, [Use $1]) + LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }libssl libcrypto" + + # Not all OpenSSL have AES-CTR functions. + libssh2_save_LIBS="$LIBS" + LIBS="$LIBS $LIBSSL" + AC_CHECK_FUNCS(EVP_aes_128_ctr) + LIBS="$libssh2_save_LIBS" + + found_crypto="$1" + found_crypto_str="OpenSSL (AES-CTR: ${ac_cv_func_EVP_aes_128_ctr:-N/A})" + ]) +], + +[libgcrypt], [ + LIBSSH2_LIB_HAVE_LINKFLAGS([gcrypt], [], [#include ], [ + AC_DEFINE(LIBSSH2_LIBGCRYPT, 1, [Use $1]) + found_crypto="$1" + ]) +], + +[mbedtls], [ + LIBSSH2_LIB_HAVE_LINKFLAGS([mbedcrypto], [], [#include ], [ + AC_DEFINE(LIBSSH2_MBEDTLS, 1, [Use $1]) + LIBS="$LIBS -lmbedcrypto" + found_crypto="$1" + support_clear_memory=yes + ]) +], + +[wincng], [ + # Look for Windows Cryptography API: Next Generation + + AC_CHECK_HEADERS([ntdef.h ntstatus.h], [], [], [#include ]) + AC_CHECK_DECLS([SecureZeroMemory], [], [], [#include ]) + + LIBSSH2_LIB_HAVE_LINKFLAGS([crypt32], [], [ + #include + #include + ]) + LIBSSH2_LIB_HAVE_LINKFLAGS([bcrypt], [], [ + #include + #include + ], [ + AC_DEFINE(LIBSSH2_WINCNG, 1, [Use $1]) + found_crypto="$1" + found_crypto_str="Windows Cryptography API: Next Generation" + support_clear_memory="$ac_cv_have_decl_SecureZeroMemory" + ]) +], +) + test "$found_crypto" = "none" && + crypto_errors="${crypto_errors}No $1 crypto library found! +" +fi +]) + + +dnl LIBSSH2_CHECK_OPTION_WERROR +dnl ------------------------------------------------- +dnl Verify if configure has been invoked with option +dnl --enable-werror or --disable-werror, and set +dnl shell variable want_werror as appropriate. + +AC_DEFUN([LIBSSH2_CHECK_OPTION_WERROR], [ + AC_BEFORE([$0],[LIBSSH2_CHECK_COMPILER])dnl + AC_MSG_CHECKING([whether to enable compiler warnings as errors]) + OPT_COMPILER_WERROR="default" + AC_ARG_ENABLE(werror, +AC_HELP_STRING([--enable-werror],[Enable compiler warnings as errors]) +AC_HELP_STRING([--disable-werror],[Disable compiler warnings as errors]), + OPT_COMPILER_WERROR=$enableval) + case "$OPT_COMPILER_WERROR" in + no) + dnl --disable-werror option used + want_werror="no" + ;; + default) + dnl configure option not specified + want_werror="no" + ;; + *) + dnl --enable-werror option used + want_werror="yes" + ;; + esac + AC_MSG_RESULT([$want_werror]) + + if test X"$want_werror" = Xyes; then + CFLAGS="$CFLAGS -Werror" + fi +]) + diff --git a/vendor/libssh2/aclocal.m4 b/vendor/libssh2/aclocal.m4 index 41ad8c694f..fc56a693e4 100644 --- a/vendor/libssh2/aclocal.m4 +++ b/vendor/libssh2/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- +# generated automatically by aclocal 1.16.4 -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,13 +14,13 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.15' +[am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.15], [], +m4_if([$1], [1.16.4], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.15])dnl +[AM_AUTOMAKE_VERSION([1.16.4])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -332,13 +332,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. - # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], @@ -346,49 +345,43 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -397,18 +390,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -472,7 +464,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl @@ -495,8 +487,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. @@ -524,6 +516,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -563,7 +569,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -605,7 +611,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -626,7 +632,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -648,7 +654,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -683,7 +689,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -691,49 +697,42 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # AM_MAKE_INCLUDE() # ----------------- -# Check to see how make treats includes. +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -754,12 +753,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -772,7 +766,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -801,7 +795,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -848,7 +842,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -867,7 +861,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -948,7 +942,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1008,7 +1002,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1036,7 +1030,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1055,7 +1049,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/vendor/libssh2/buildconf b/vendor/libssh2/buildconf deleted file mode 100755 index 558dcb660f..0000000000 --- a/vendor/libssh2/buildconf +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -LIBTOOLIZE="libtoolize" - -if [ "x`which $LIBTOOLIZE`" = "x" ]; then - LIBTOOLIZE="glibtoolize" -fi - -if [ "x`which $LIBTOOLIZE`" = "x" ]; then - echo "Neither libtoolize nor glibtoolize could be found!" - exit 1 -fi - -${LIBTOOLIZE} --copy --automake --force -${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS -${AUTOHEADER:-autoheader} -# copy the private libssh2_config.h.in to the examples dir so that -# it can be included without pointing the include path to the private -# source dir -cp src/libssh2_config.h.in example/libssh2_config.h.in -${AUTOCONF:-autoconf} -${AUTOMAKE:-automake} --add-missing --copy diff --git a/vendor/libssh2/cmake/FindmbedTLS.cmake b/vendor/libssh2/cmake/FindmbedTLS.cmake new file mode 100644 index 0000000000..2f4adbc519 --- /dev/null +++ b/vendor/libssh2/cmake/FindmbedTLS.cmake @@ -0,0 +1,64 @@ +# - Try to find mbedTLS +# Once done this will define +# +# Read-Only variables +# MBEDTLS_FOUND - system has mbedTLS +# MBEDTLS_INCLUDE_DIR - the mbedTLS include directory +# MBEDTLS_LIBRARY_DIR - the mbedTLS library directory +# MBEDTLS_LIBRARIES - Link these to use mbedTLS +# MBEDTLS_LIBRARY - path to mbedTLS library +# MBEDX509_LIBRARY - path to mbedTLS X.509 library +# MBEDCRYPTO_LIBRARY - path to mbedTLS Crypto library + +FIND_PATH(MBEDTLS_INCLUDE_DIR mbedtls/version.h) + +IF(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARIES) + # Already in cache, be silent + SET(MBEDTLS_FIND_QUIETLY TRUE) +ENDIF() + +FIND_LIBRARY(MBEDTLS_LIBRARY NAMES mbedtls libmbedtls libmbedx509) +FIND_LIBRARY(MBEDX509_LIBRARY NAMES mbedx509 libmbedx509) +FIND_LIBRARY(MBEDCRYPTO_LIBRARY NAMES mbedcrypto libmbedcrypto) + +IF(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARY AND MBEDX509_LIBRARY AND MBEDCRYPTO_LIBRARY) + SET(MBEDTLS_FOUND TRUE) +ENDIF() + +IF(MBEDTLS_FOUND) + # split mbedTLS into -L and -l linker options, so we can set them for pkg-config + GET_FILENAME_COMPONENT(MBEDTLS_LIBRARY_DIR ${MBEDTLS_LIBRARY} PATH) + GET_FILENAME_COMPONENT(MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY} NAME_WE) + GET_FILENAME_COMPONENT(MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY} NAME_WE) + GET_FILENAME_COMPONENT(MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY} NAME_WE) + STRING(REGEX REPLACE "^lib" "" MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY_FILE}) + STRING(REGEX REPLACE "^lib" "" MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY_FILE}) + STRING(REGEX REPLACE "^lib" "" MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY_FILE}) + SET(MBEDTLS_LIBRARIES "-L${MBEDTLS_LIBRARY_DIR} -l${MBEDTLS_LIBRARY_FILE} -l${MBEDX509_LIBRARY_FILE} -l${MBEDCRYPTO_LIBRARY_FILE}") + + IF(NOT MBEDTLS_FIND_QUIETLY) + MESSAGE(STATUS "Found mbedTLS:") + FILE(READ ${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h MBEDTLSCONTENT) + STRING(REGEX MATCH "MBEDTLS_VERSION_STRING +\"[0-9|.]+\"" MBEDTLSMATCH ${MBEDTLSCONTENT}) + IF (MBEDTLSMATCH) + STRING(REGEX REPLACE "MBEDTLS_VERSION_STRING +\"([0-9|.]+)\"" "\\1" MBEDTLS_VERSION ${MBEDTLSMATCH}) + MESSAGE(STATUS " version ${MBEDTLS_VERSION}") + ENDIF(MBEDTLSMATCH) + MESSAGE(STATUS " TLS: ${MBEDTLS_LIBRARY}") + MESSAGE(STATUS " X509: ${MBEDX509_LIBRARY}") + MESSAGE(STATUS " Crypto: ${MBEDCRYPTO_LIBRARY}") + ENDIF(NOT MBEDTLS_FIND_QUIETLY) +ELSE(MBEDTLS_FOUND) + IF(MBEDTLS_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find mbedTLS") + ENDIF(MBEDTLS_FIND_REQUIRED) +ENDIF(MBEDTLS_FOUND) + +MARK_AS_ADVANCED( + MBEDTLS_INCLUDE_DIR + MBEDTLS_LIBRARY_DIR + MBEDTLS_LIBRARIES + MBEDTLS_LIBRARY + MBEDX509_LIBRARY + MBEDCRYPTO_LIBRARY +) diff --git a/vendor/libssh2/compile b/vendor/libssh2/compile index 531136b068..23fcba0113 100755 --- a/vendor/libssh2/compile +++ b/vendor/libssh2/compile @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -53,7 +53,7 @@ func_file_conv () MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ func_file_conv () mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) @@ -255,7 +255,8 @@ EOF echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/vendor/libssh2/config.guess b/vendor/libssh2/config.guess index d622a44e55..f50dcdb6de 100755 --- a/vendor/libssh2/config.guess +++ b/vendor/libssh2/config.guess @@ -1,14 +1,12 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2018-02-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -17,24 +15,22 @@ timestamp='2012-02-10' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). # -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + me=`echo "$0" | sed -e 's,.*/,,'` @@ -43,7 +39,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -54,9 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -113,9 +107,9 @@ trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; + ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; @@ -138,9 +132,37 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "$UNAME_SYSTEM" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval "$set_cc_for_build" + cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi + ;; +esac + # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -153,21 +175,31 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)` + case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown + ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -182,40 +214,67 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in os=netbsd ;; esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "$machine-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -232,63 +291,54 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -300,9 +350,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -327,38 +377,38 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" + eval "$set_cc_for_build" + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in @@ -367,25 +417,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -396,44 +446,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -442,23 +492,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -484,17 +534,17 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -511,7 +561,7 @@ EOF echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id @@ -523,14 +573,14 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -541,7 +591,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else @@ -555,26 +605,27 @@ EOF exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -589,28 +640,28 @@ EOF echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if [ "$HP_ARCH" = "" ]; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -643,13 +694,13 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ "$HP_ARCH" = hppa2.0w ] then - eval $set_cc_for_build + eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -660,23 +711,23 @@ EOF # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -701,11 +752,11 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -714,7 +765,7 @@ EOF *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) @@ -722,9 +773,9 @@ EOF exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -749,124 +800,109 @@ EOF echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case "$UNAME_PROCESSOR" in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 + *:MINGW64*:*) + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; - i*:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys + *:MINGW*:*) + echo "$UNAME_MACHINE"-pc-mingw32 exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + *:MSYS*:*) + echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin + echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix + echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -879,63 +915,64 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - eval $set_cc_for_build + eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el @@ -949,55 +986,74 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; - or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-"$LIBC" + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-"$LIBC" + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-"$LIBC" + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + if objdump -f /bin/sh | grep -q elf32-x86-64; then + echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 + else + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + fi exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1011,34 +1067,34 @@ EOF # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx + echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable + echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} + echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) @@ -1048,12 +1104,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1063,9 +1119,9 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv32 + echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1073,7 +1129,7 @@ EOF # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1085,9 +1141,9 @@ EOF exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1107,9 +1163,9 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1118,28 +1174,28 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} + echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} + echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1150,7 +1206,7 @@ EOF *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1170,23 +1226,23 @@ EOF exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos + echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} + echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1201,66 +1257,97 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} + echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} + echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} + echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} + echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} + echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} + echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + eval "$set_cc_for_build" + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1269,18 +1356,18 @@ EOF echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1301,14 +1388,14 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in + case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1317,185 +1404,48 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos + echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros + echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs exit ;; esac -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif +echo "$0: unable to guess system type" >&2 -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 < -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} +NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize +the system type. Please install a C compiler and try again. EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi + ;; +esac cat >&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp @@ -1514,16 +1464,16 @@ hostinfo = `(hostinfo) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/vendor/libssh2/config.sub b/vendor/libssh2/config.sub index c894da4550..1d8e98bcee 100755 --- a/vendor/libssh2/config.sub +++ b/vendor/libssh2/config.sub @@ -1,36 +1,31 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2018-02-22' -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -38,7 +33,7 @@ timestamp='2012-02-10' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -58,12 +53,11 @@ timestamp='2012-02-10' me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -73,9 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -102,7 +94,7 @@ while test $# -gt 0 ; do *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -120,24 +112,24 @@ esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` + basic_machine=`echo "$1" | sed 's/-[^-]*$//'` + if [ "$basic_machine" != "$1" ] + then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac @@ -156,7 +148,7 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) + -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; @@ -186,53 +178,56 @@ case $os in ;; -sco6) os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos @@ -253,21 +248,25 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ - | i370 | i860 | i960 | ia64 \ + | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -281,26 +280,30 @@ case $basic_machine in | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nios | nios2 \ + | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -308,7 +311,8 @@ case $basic_machine in | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ + | visium \ + | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown @@ -322,11 +326,14 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown @@ -355,7 +362,7 @@ case $basic_machine in ;; # Object if more than one company name word. *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. @@ -364,26 +371,29 @@ case $basic_machine in | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -397,28 +407,34 @@ case $basic_machine in | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -426,6 +442,8 @@ case $basic_machine in | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ + | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -439,7 +457,7 @@ case $basic_machine in # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) - basic_machine=i386-unknown + basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) @@ -473,7 +491,7 @@ case $basic_machine in basic_machine=x86_64-pc ;; amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl @@ -502,6 +520,9 @@ case $basic_machine in basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -515,7 +536,7 @@ case $basic_machine in os=-linux ;; blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) @@ -523,13 +544,13 @@ case $basic_machine in os=-cnk ;; c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray @@ -618,10 +639,18 @@ case $basic_machine in basic_machine=rs6000-bull os=-bosx ;; - dpx2* | dpx2*-bull) + dpx2*) basic_machine=m68k-bull os=-sysv3 ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=$os"spe" + ;; ebmon29k) basic_machine=a29k-amd os=-ebmon @@ -711,9 +740,6 @@ case $basic_machine in hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; - hppa-next) - os=-nextstep3 - ;; hppaosf) basic_machine=hppa1.1-hp os=-osf @@ -726,26 +752,26 @@ case $basic_machine in basic_machine=i370-ibm ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; - i386-vsta | vsta) + vsta) basic_machine=i386-unknown os=-vsta ;; @@ -763,17 +789,17 @@ case $basic_machine in basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; - m88k-omron*) - basic_machine=m88k-omron - ;; magnum | m3230) basic_machine=mips-mips os=-sysv @@ -782,11 +808,15 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze*) basic_machine=microblaze-xilinx ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -801,10 +831,10 @@ case $basic_machine in os=-mint ;; mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k @@ -814,15 +844,19 @@ case $basic_machine in basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -861,7 +895,7 @@ case $basic_machine in basic_machine=v70-nec os=-sysv ;; - next | m*-next ) + next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) @@ -906,6 +940,12 @@ case $basic_machine in nsr-tandem) basic_machine=nsr-tandem ;; + nsv-tandem) + basic_machine=nsv-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf @@ -938,7 +978,7 @@ case $basic_machine in os=-linux ;; parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) @@ -954,7 +994,7 @@ case $basic_machine in basic_machine=i386-pc ;; pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc @@ -969,16 +1009,16 @@ case $basic_machine in basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould @@ -988,23 +1028,23 @@ case $basic_machine in ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle | ppc-le | powerpc-little) + ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) + ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm @@ -1013,7 +1053,11 @@ case $basic_machine in basic_machine=i586-unknown os=-pw32 ;; - rdos) + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) basic_machine=i386-pc os=-rdos ;; @@ -1054,17 +1098,10 @@ case $basic_machine in sequent) basic_machine=i386-sequent ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; sh5el) basic_machine=sh5le-unknown ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) + simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; @@ -1083,7 +1120,7 @@ case $basic_machine in os=-sysv4 ;; strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun @@ -1205,6 +1242,9 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; + x64) + basic_machine=x86_64-pc + ;; xbox) basic_machine=i686-pc os=-mingw32 @@ -1213,20 +1253,12 @@ case $basic_machine in basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; none) basic_machine=none-none os=-none @@ -1255,10 +1287,6 @@ case $basic_machine in vax) basic_machine=vax-dec ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; pdp11) basic_machine=pdp11-dec ;; @@ -1268,9 +1296,6 @@ case $basic_machine in sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; cydra) basic_machine=cydra-cydrome ;; @@ -1290,7 +1315,7 @@ case $basic_machine in # Make sure to match an already-canonicalized machine name. ;; *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac @@ -1298,10 +1323,10 @@ esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; @@ -1312,8 +1337,8 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases that might get confused + # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux @@ -1324,45 +1349,48 @@ case $os in -solaris) os=-solaris2 ;; - -svr4*) - os=-sysv4 - ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; - # First accept the basic system types. + # es1800 is here to avoid being matched by es* (a different OS) + -es1800*) + os=-ose + ;; + # Now accept the basic system types. # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. + # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ + | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ + | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ + | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1379,12 +1407,12 @@ case $os in -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + -sim | -xray | -os68k* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) - os=`echo $os | sed -e 's|mac|macos|'` + os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc @@ -1393,10 +1421,10 @@ case $os in os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition @@ -1407,12 +1435,6 @@ case $os in -wince*) os=-wince ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; -utek*) os=-bsd ;; @@ -1437,7 +1459,7 @@ case $os in -nova*) os=-rtmk-nova ;; - -ns2 ) + -ns2) os=-nextstep2 ;; -nsk*) @@ -1459,7 +1481,7 @@ case $os in -oss*) os=-sysv3 ;; - -svr4) + -svr4*) os=-sysv4 ;; -svr3) @@ -1474,35 +1496,38 @@ case $os in -ose*) os=-ose ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; + -pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $basic_machine in + arm*) + os=-eabi + ;; + *) + os=-elf + ;; + esac + ;; -nacl*) ;; + -ios) + ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac @@ -1537,6 +1562,12 @@ case $basic_machine in c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; tic54x-*) os=-coff ;; @@ -1586,12 +1617,12 @@ case $basic_machine in sparc-* | *-sun) os=-sunos4.1.1 ;; + pru-*) + os=-elf + ;; *-be) os=-beos ;; - *-haiku) - os=-haiku - ;; *-ibm) os=-aix ;; @@ -1631,7 +1662,7 @@ case $basic_machine in m88k-omron*) os=-luna ;; - *-next ) + *-next) os=-nextstep ;; *-sequent) @@ -1646,9 +1677,6 @@ case $basic_machine in i370-*) os=-mvs ;; - *-next) - os=-nextstep3 - ;; *-gould) os=-sysv ;; @@ -1758,15 +1786,15 @@ case $basic_machine in vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$basic_machine$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/vendor/libssh2/configure b/vendor/libssh2/configure index 8d323ac1a7..1cbf782b18 100755 --- a/vendor/libssh2/configure +++ b/vendor/libssh2/configure @@ -1,11 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libssh2 -. +# Generated by GNU Autoconf 2.71 for libssh2 -. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -16,14 +17,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -33,46 +36,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -81,13 +84,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -96,8 +92,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -109,30 +109,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -154,20 +134,22 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -187,18 +169,20 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' @@ -206,31 +190,40 @@ test \$(( 1 + 1 )) = 2 || exit 1 ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" - if (eval "$as_required") 2>/dev/null; then : + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -238,14 +231,21 @@ fi esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -263,18 +263,19 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: libssh2-devel@cool.haxx.se about your system, including $0: any error possibly output before this message. Then $0: install a modern shell, or manually run the script @@ -302,6 +303,7 @@ as_fn_unset () } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -319,6 +321,14 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -333,7 +343,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -342,7 +352,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -381,12 +391,13 @@ as_fn_executable_p () # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -398,18 +409,27 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -421,9 +441,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -450,7 +470,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -494,7 +514,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -508,6 +528,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -521,6 +545,13 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -598,40 +629,36 @@ PACKAGE_URL='' ac_unique_file="src" # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" +ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS @@ -639,37 +666,51 @@ LIBOBJS ALLOCA HAVE_SYS_UN_H_FALSE HAVE_SYS_UN_H_TRUE +USE_OSSFUZZ_STATIC_FALSE +USE_OSSFUZZ_STATIC_TRUE +USE_OSSFUZZ_FLAG_FALSE +USE_OSSFUZZ_FLAG_TRUE +LIB_FUZZING_ENGINE +USE_OSSFUZZERS_FALSE +USE_OSSFUZZERS_TRUE BUILD_EXAMPLES_FALSE BUILD_EXAMPLES_TRUE +CPP LIBSREQUIRED LIBZ_PREFIX LTLIBZ LIBZ HAVE_LIBZ -OS400QC3_FALSE -OS400QC3_TRUE WINCNG_FALSE WINCNG_TRUE -LIBCRYPT32_PREFIX -LTLIBCRYPT32 -LIBCRYPT32 -HAVE_LIBCRYPT32 +MBEDTLS_FALSE +MBEDTLS_TRUE +LIBGCRYPT_FALSE +LIBGCRYPT_TRUE +OPENSSL_FALSE +OPENSSL_TRUE LIBBCRYPT_PREFIX LTLIBBCRYPT LIBBCRYPT HAVE_LIBBCRYPT -LIBGCRYPT_FALSE -LIBGCRYPT_TRUE +LIBCRYPT32_PREFIX +LTLIBCRYPT32 +LIBCRYPT32 +HAVE_LIBCRYPT32 +LIBMBEDCRYPTO_PREFIX +LTLIBMBEDCRYPTO +LIBMBEDCRYPTO +HAVE_LIBMBEDCRYPTO LIBGCRYPT_PREFIX LTLIBGCRYPT LIBGCRYPT HAVE_LIBGCRYPT -OPENSSL_FALSE -OPENSSL_TRUE LIBSSL_PREFIX LTLIBSSL LIBSSL HAVE_LIBSSL +CXXCPP +LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO @@ -684,6 +725,8 @@ ac_ct_DUMPBIN DUMPBIN LD FGREP +EGREP +GREP LIBTOOL OBJDUMP DLLTOOL @@ -692,9 +735,12 @@ SSHD_FALSE SSHD_TRUE SSHD LN_S -EGREP -GREP -CPP +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -702,7 +748,6 @@ am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE -am__quote am__include DEPDIR OBJEXT @@ -721,6 +766,9 @@ build_vendor build_cpu build LIBSSH2VER +CSCOPE +ETAGS +CTAGS am__untar am__tar AMTAR @@ -790,7 +838,8 @@ PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR -SHELL' +SHELL +am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking @@ -801,19 +850,19 @@ enable_shared enable_static with_pic enable_fast_install +with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock enable_largefile -with_openssl -with_libgcrypt -with_wincng -with_libz +with_crypto enable_rpath with_libssl_prefix with_libgcrypt_prefix -with_libbcrypt_prefix +with_libmbedcrypto_prefix with_libcrypt32_prefix +with_libbcrypt_prefix +with_libz with_libz_prefix enable_crypt_none enable_mac_none @@ -822,6 +871,8 @@ enable_clear_memory enable_debug enable_hidden_symbols enable_examples_build +enable_ossfuzzers +enable_werror ' ac_precious_vars='build_alias host_alias @@ -831,6 +882,11 @@ CFLAGS LDFLAGS LIBS CPPFLAGS +CXX +CXXFLAGS +CCC +LT_SYS_LIBRARY_PATH +CXXCPP CPP' @@ -900,8 +956,6 @@ do *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -942,9 +996,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -968,9 +1022,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1181,9 +1235,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1197,9 +1251,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1243,9 +1297,9 @@ Try \`$0 --help' for more information" *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1261,7 +1315,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1325,7 +1379,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1490,28 +1544,35 @@ Optional Features: --enable-examples-build Build example applications (this is the default) --disable-examples-build Do not build example applications + --enable-ossfuzzers Whether to generate the fuzzers for OSS-Fuzz + --enable-werror Enable compiler warnings as errors + --disable-werror Disable compiler warnings as errors Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). - --with-openssl Use OpenSSL for crypto - --with-libgcrypt Use libgcrypt for crypto - --with-wincng Use Windows CNG for crypto - --with-libz Use zlib for compression + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). + --with-crypto=auto|openssl|libgcrypt|mbedtls|wincng + Select crypto backend (default: auto) --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libssl-prefix[=DIR] search for libssl in DIR/include and DIR/lib --without-libssl-prefix don't search for libssl in includedir and libdir --with-libgcrypt-prefix[=DIR] search for libgcrypt in DIR/include and DIR/lib --without-libgcrypt-prefix don't search for libgcrypt in includedir and libdir - --with-libbcrypt-prefix[=DIR] search for libbcrypt in DIR/include and DIR/lib - --without-libbcrypt-prefix don't search for libbcrypt in includedir and libdir + --with-libmbedcrypto-prefix[=DIR] search for libmbedcrypto in DIR/include and DIR/lib + --without-libmbedcrypto-prefix don't search for libmbedcrypto in includedir and libdir --with-libcrypt32-prefix[=DIR] search for libcrypt32 in DIR/include and DIR/lib --without-libcrypt32-prefix don't search for libcrypt32 in includedir and libdir + --with-libbcrypt-prefix[=DIR] search for libbcrypt in DIR/include and DIR/lib + --without-libbcrypt-prefix don't search for libbcrypt in includedir and libdir + --with-libz Use libz for compression --with-libz-prefix[=DIR] search for libz in DIR/include and DIR/lib --without-libz-prefix don't search for libz in includedir and libdir @@ -1523,6 +1584,11 @@ Some influential environment variables: LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. + CXXCPP C++ preprocessor CPP C preprocessor Use these variables to override the choices made by `configure' or to help @@ -1544,9 +1610,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1574,7 +1640,8 @@ esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1582,7 +1649,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1592,9 +1659,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF libssh2 configure - -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1611,14 +1678,14 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1626,14 +1693,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1650,17 +1718,18 @@ fi ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof ($2)) return 0; @@ -1668,12 +1737,13 @@ if (sizeof ($2)) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof (($2))) return 0; @@ -1681,101 +1751,23 @@ if (sizeof (($2))) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop eval "$3=yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in @@ -1783,26 +1775,28 @@ fi ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1813,14 +1807,14 @@ $as_echo "$ac_res" >&6; } ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1828,17 +1822,18 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1853,17 +1848,57 @@ fi } # ac_fn_c_try_link +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -1871,16 +1906,9 @@ else #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -1898,172 +1926,274 @@ choke me #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" + ac_retval=1 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -} # ac_fn_c_check_decl +} # ac_fn_cxx_try_link -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +int +main (void) +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> + ; + return 0; +} _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ----------------------------------------- ## -## Report this to libssh2-devel@cool.haxx.se ## -## ----------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_check_decl + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac -} # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libssh2 $as_me -, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -2096,8 +2226,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -2132,7 +2266,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2167,11 +2301,13 @@ done # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2182,8 +2318,8 @@ trap 'exit_status=$? case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2207,7 +2343,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2215,14 +2351,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2230,15 +2366,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2246,8 +2382,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2261,63 +2397,48 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2327,131 +2448,766 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' -ac_config_headers="$ac_config_headers src/libssh2_config.h example/libssh2_config.h" +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; - MAINT=$MAINTAINER_MODE_TRUE +struct incomplete_array +{ + int datasize; + double data[]; +}; +struct named_init { + int number; + const wchar_t *name; + double average; +}; -# Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi +typedef const char *ccp; -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} + +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; + +} // anonymous namespace +' + +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' + +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif + +namespace cxx11test +{ + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' +{ + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' + +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + + +# Auxiliary files required by this configure script. +ac_aux_files="config.rpath ltmain.sh compile config.guess config.sub missing install-sh" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +ac_config_headers="$ac_config_headers src/libssh2_config.h" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test ${enable_maintainer_mode+y} +then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else $as_nop + USE_MAINTAINER_MODE=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + +# Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -2463,8 +3219,8 @@ else am_cv_make_support_nested_variables=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' @@ -2477,11 +3233,12 @@ AM_BACKSLASH='\' # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $SED in [\\/]* | ?:[\\/]*) ac_cv_path_SED="$SED" # Let the user override the test with a path. @@ -2492,11 +3249,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_SED="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2509,54 +3270,27 @@ esac fi SED=$ac_cv_path_SED if test -n "$SED"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 -$as_echo "$SED" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 +printf "%s\n" "$SED" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$SED" = "xsed-was-not-found-by-configure"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: sed was not found, this may ruin your chances to build fine" >&5 -$as_echo "$as_me: WARNING: sed was not found, this may ruin your chances to build fine" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: sed was not found, this may ruin your chances to build fine" >&5 +printf "%s\n" "$as_me: WARNING: sed was not found, this may ruin your chances to build fine" >&2;} fi LIBSSH2VER=`$SED -ne 's/^#define LIBSSH2_VERSION *"\(.*\)"/\1/p' ${srcdir}/include/libssh2.h` -am__api_version='1.15' - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi +am__api_version='1.16' -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -# Find a good install program. We prefer a C program (faster), + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -2570,20 +3304,25 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -2593,13 +3332,13 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -2607,12 +3346,12 @@ case $as_dir/ in #(( echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -2628,7 +3367,7 @@ IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -2638,8 +3377,8 @@ fi INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2649,8 +3388,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2704,8 +3443,8 @@ else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= @@ -2724,26 +3463,23 @@ test "$program_suffix" != NONE && # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then @@ -2763,11 +3499,12 @@ if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else @@ -2775,11 +3512,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2790,11 +3531,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2803,11 +3544,12 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else @@ -2815,11 +3557,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2830,11 +3576,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -2842,8 +3588,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -2855,25 +3601,31 @@ fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done @@ -2884,7 +3636,7 @@ IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then + if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a @@ -2894,18 +3646,19 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else @@ -2913,11 +3666,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2928,24 +3685,25 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @@ -2961,12 +3719,12 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -3004,14 +3762,10 @@ fi VERSION='-' -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. @@ -3031,8 +3785,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The @@ -3051,6 +3805,20 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile @@ -3083,7 +3851,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -3094,35 +3862,38 @@ END fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking libssh2 version" >&5 -$as_echo_n "checking libssh2 version... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBSSH2VER" >&5 -$as_echo "$LIBSSH2VER" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking libssh2 version" >&5 +printf %s "checking libssh2 version... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSSH2VER" >&5 +printf "%s\n" "$LIBSSH2VER" >&6; } AB_VERSION=$LIBSSH2VER -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -3141,21 +3912,22 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -3181,19 +3953,19 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac if test -z "$AB_PACKAGE"; then AB_PACKAGE=${PACKAGE_NAME:-$PACKAGE} fi - { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild project... $AB_PACKAGE" >&5 -$as_echo "$as_me: autobuild project... $AB_PACKAGE" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: autobuild project... $AB_PACKAGE" >&5 +printf "%s\n" "$as_me: autobuild project... $AB_PACKAGE" >&6;} if test -z "$AB_VERSION"; then AB_VERSION=${PACKAGE_VERSION:-$VERSION} fi - { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild revision... $AB_VERSION" >&5 -$as_echo "$as_me: autobuild revision... $AB_VERSION" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: autobuild revision... $AB_VERSION" >&5 +printf "%s\n" "$as_me: autobuild revision... $AB_VERSION" >&6;} hostname=`hostname` if test "$hostname"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild hostname... $hostname" >&5 -$as_echo "$as_me: autobuild hostname... $hostname" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: autobuild hostname... $hostname" >&5 +printf "%s\n" "$as_me: autobuild hostname... $hostname" >&6;} fi @@ -3203,8 +3975,8 @@ $as_echo "$as_me: autobuild hostname... $hostname" >&6;} date=`date` fi if test "$date"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild timestamp... $date" >&5 -$as_echo "$as_me: autobuild timestamp... $date" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: autobuild timestamp... $date" >&5 +printf "%s\n" "$as_me: autobuild timestamp... $date" >&6;} fi @@ -3217,12 +3989,9 @@ case "$host" in CFLAGS="$CFLAGS -DLIBSSH2_WIN32" LIBS="$LIBS -lws2_32" ;; - *-cygwin) - CFLAGS="$CFLAGS -DLIBSSH2_WIN32" + *darwin*) + CFLAGS="$CFLAGS -DLIBSSH2_DARWIN" ;; - *darwin*) - CFLAGS="$CFLAGS -DLIBSSH2_DARWIN" - ;; *hpux*) ;; *osf*) @@ -3232,52 +4001,62 @@ case "$host" in ;; esac + + + + + + + + + DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" - -am_make=${MAKE-make} -cat > confinc << 'END' +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : +if test ${enable_dependency_tracking+y} +then : enableval=$enable_dependency_tracking; fi @@ -3303,11 +4082,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3315,11 +4095,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3330,11 +4114,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3343,11 +4127,12 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3355,11 +4140,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3370,11 +4159,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -3382,8 +4171,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3396,11 +4185,12 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3408,11 +4198,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3423,11 +4217,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3436,11 +4230,12 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3449,15 +4244,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3473,18 +4272,18 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3495,11 +4294,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3507,11 +4307,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3522,11 +4326,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3539,11 +4343,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3551,11 +4356,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3566,11 +4375,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3582,34 +4391,138 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -3619,7 +4532,7 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -3627,7 +4540,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3639,9 +4552,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -3662,11 +4575,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -3683,7 +4597,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -3699,44 +4613,46 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -3750,15 +4666,15 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -3767,7 +4683,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -3779,8 +4695,8 @@ _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -3788,10 +4704,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -3799,39 +4715,40 @@ $as_echo "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3845,11 +4762,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -3858,31 +4776,32 @@ $as_echo "$ac_try_echo"; } >&5 break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -3892,29 +4811,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -3923,57 +4846,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -3988,94 +4914,144 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -4084,21 +5060,23 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -4126,8 +5104,8 @@ _ACEOF rm -f core conftest* unset am_i fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. @@ -4145,11 +5123,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -4256,8 +5235,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if @@ -4272,562 +5251,200 @@ fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes +ac_header= ac_cache= +for ac_item in $ac_header_c_list do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" +ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" +if test "x$ac_cv_type_long_long" = xyes +then : +printf "%s\n" "#define HAVE_LONGLONG 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac + longlong="yes" - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is already defined" >&5 +printf %s "checking if _REENTRANT is already defined... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -#include + + int -main () +main (void) { +#ifdef _REENTRANT + int dummy=1; +#else + force compilation error +#endif + ; return 0; } + _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO" +then : -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tmp_reentrant_initially_defined="yes" -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : +else $as_nop -else - ac_cv_header_stdc=no -fi -rm -f conftest* + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tmp_reentrant_initially_defined="no" fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + # + if test "$tmp_reentrant_initially_defined" = "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is actually needed" >&5 +printf %s "checking if _REENTRANT is actually needed... " >&6; } -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + case $host in + *-*-solaris* | *-*-hpux*) + tmp_need_reentrant="yes" + ;; + *) + tmp_need_reentrant="no" + ;; + esac -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : -else - ac_cv_header_stdc=no -fi -rm -f conftest* + if test "$tmp_need_reentrant" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + fi + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is onwards defined" >&5 +printf %s "checking if _REENTRANT is onwards defined... " >&6; } + if test "$tmp_reentrant_initially_defined" = "yes" || + test "$tmp_need_reentrant" = "yes"; then -fi -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +printf "%s\n" "#define NEED_REENTRANT 1" >>confdefs.h + +cat >>confdefs.h <<_EOF +#ifndef _REENTRANT +# define _REENTRANT #endif +_EOF + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + # + + +# Some systems (Solaris?) have socket() in -lsocket. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 +printf %s "checking for library containing socket... " >&6; } +if test ${ac_cv_search_socket+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char socket (); int -main () +main (void) { - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; +return socket (); + ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" -if test "x$ac_cv_type_long_long" = xyes; then : - -$as_echo "#define HAVE_LONGLONG 1" >>confdefs.h - - longlong="yes" - -fi - - - - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is already defined" >&5 -$as_echo_n "checking if _REENTRANT is already defined... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - -int -main () -{ - -#ifdef _REENTRANT - int dummy=1; -#else - force compilation error -#endif - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tmp_reentrant_initially_defined="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tmp_reentrant_initially_defined="no" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - # - if test "$tmp_reentrant_initially_defined" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is actually needed" >&5 -$as_echo_n "checking if _REENTRANT is actually needed... " >&6; } - - case $host in - *-*-solaris* | *-*-hpux*) - tmp_need_reentrant="yes" - ;; - *) - tmp_need_reentrant="no" - ;; - esac - - - if test "$tmp_need_reentrant" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is onwards defined" >&5 -$as_echo_n "checking if _REENTRANT is onwards defined... " >&6; } - if test "$tmp_reentrant_initially_defined" = "yes" || - test "$tmp_need_reentrant" = "yes"; then - - -$as_echo "#define NEED_REENTRANT 1" >>confdefs.h - -cat >>confdefs.h <<_EOF -#ifndef _REENTRANT -# define _REENTRANT -#endif -_EOF - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - # - - -# Some systems (Solaris?) have socket() in -lsocket. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 -$as_echo_n "checking for library containing socket... " >&6; } -if ${ac_cv_search_socket+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char socket (); -int -main () -{ -return socket (); - ; - return 0; -} -_ACEOF -for ac_lib in '' socket; do +for ac_lib in '' socket +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_socket=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_socket+:} false; then : + if test ${ac_cv_search_socket+y} +then : break fi done -if ${ac_cv_search_socket+:} false; then : +if test ${ac_cv_search_socket+y} +then : -else +else $as_nop ac_cv_search_socket=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 -$as_echo "$ac_cv_search_socket" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 +printf "%s\n" "$ac_cv_search_socket" >&6; } ac_res=$ac_cv_search_socket -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # Solaris has inet_addr() in -lnsl. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_addr" >&5 -$as_echo_n "checking for library containing inet_addr... " >&6; } -if ${ac_cv_search_inet_addr+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing inet_addr" >&5 +printf %s "checking for library containing inet_addr... " >&6; } +if test ${ac_cv_search_inet_addr+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4835,46 +5452,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char inet_addr (); int -main () +main (void) { return inet_addr (); ; return 0; } _ACEOF -for ac_lib in '' nsl; do +for ac_lib in '' nsl +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_inet_addr=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_inet_addr+:} false; then : + if test ${ac_cv_search_inet_addr+y} +then : break fi done -if ${ac_cv_search_inet_addr+:} false; then : +if test ${ac_cv_search_inet_addr+y} +then : -else +else $as_nop ac_cv_search_inet_addr=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_addr" >&5 -$as_echo "$ac_cv_search_inet_addr" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_addr" >&5 +printf "%s\n" "$ac_cv_search_inet_addr" >&6; } ac_res=$ac_cv_search_inet_addr -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -4890,11 +5509,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4902,11 +5522,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4917,11 +5541,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4930,11 +5554,12 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -4942,11 +5567,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4957,11 +5586,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -4969,8 +5598,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -4983,11 +5612,12 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4995,11 +5625,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5010,11 +5644,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5023,11 +5657,12 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -5036,15 +5671,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5060,18 +5699,18 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5082,11 +5721,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -5094,11 +5734,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5109,11 +5753,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5126,11 +5770,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -5138,11 +5783,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5153,11 +5802,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5169,34 +5818,138 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -5206,20 +5959,21 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -5229,29 +5983,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -5260,57 +6018,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -5325,117 +6086,169 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +$ac_c_conftest_c11_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -5463,8 +6276,8 @@ _ACEOF rm -f core conftest* unset am_i fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. @@ -5482,11 +6295,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -5593,8 +6407,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if @@ -5609,125 +6423,47 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -for ac_prog in sshd -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SSHD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SSHD in - [\\/]* | ?:[\\/]*) - ac_cv_path_SSHD="$SSHD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/libexec$PATH_SEPARATOR /usr/sbin$PATH_SEPARATOR/usr/etc$PATH_SEPARATOR/etc -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SSHD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -SSHD=$ac_cv_path_SSHD -if test -n "$SSHD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SSHD" >&5 -$as_echo "$SSHD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - test -n "$SSHD" && break -done - if test -n "$SSHD"; then - SSHD_TRUE= - SSHD_FALSE='#' -else - SSHD_TRUE='#' - SSHD_FALSE= -fi -enable_win32_dll=yes -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. -set dummy ${ac_tool_prefix}as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AS"; then - ac_cv_prog_AS="$AS" # Let the user override the test. +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AS="${ac_tool_prefix}as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5736,38 +6472,47 @@ IFS=$as_save_IFS fi fi -AS=$ac_cv_prog_AS -if test -n "$AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -$as_echo "$AS" >&6; } +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi + test -n "$CXX" && break + done fi -if test -z "$ac_cv_prog_AS"; then - ac_ct_AS=$AS - # Extract the first word of "as", so it can be a program name with args. -set dummy as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AS"; then - ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AS="as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5776,142 +6521,542 @@ IFS=$as_save_IFS fi fi -ac_ct_AS=$ac_cv_prog_ac_ct_AS -if test -n "$ac_ct_AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 -$as_echo "$ac_ct_AS" >&6; } +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - if test "x$ac_ct_AS" = x; then - AS="false" + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - AS=$ac_ct_AS + CXX=$ac_ct_CXX fi -else - AS="$ac_cv_prog_AS" fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 fi +fi +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } done - done -IFS=$as_save_IFS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+y} +ac_save_CXXFLAGS=$CXXFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main (void) +{ -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +else $as_nop + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + +else $as_nop + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL + CXXFLAGS="-g" fi else - DLLTOOL="$ac_cv_prog_DLLTOOL" + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CXX_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +for ac_prog in sshd +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_SSHD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $SSHD in + [\\/]* | ?:[\\/]*) + ac_cv_path_SSHD="$SSHD" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/libexec$PATH_SEPARATOR /usr/sbin$PATH_SEPARATOR/usr/etc$PATH_SEPARATOR/etc +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_SSHD="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +SSHD=$ac_cv_path_SSHD +if test -n "$SSHD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SSHD" >&5 +printf "%s\n" "$SSHD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$SSHD" && break +done + + if test -n "$SSHD"; then + SSHD_TRUE= + SSHD_FALSE='#' +else + SSHD_TRUE='#' + SSHD_FALSE= +fi + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5920,38 +7065,43 @@ IFS=$as_save_IFS fi fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +printf "%s\n" "$AS" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5960,34 +7110,238 @@ IFS=$as_save_IFS fi fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +printf "%s\n" "$ac_ct_AS" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" + if test "x$ac_ct_AS" = x; then + AS="false" else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OBJDUMP=$ac_ct_OBJDUMP + AS=$ac_ct_AS fi else - OBJDUMP="$ac_cv_prog_OBJDUMP" + AS="$ac_cv_prog_AS" fi - ;; -esac - -test -z "$AS" && AS=as + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as @@ -6009,14 +7363,14 @@ test -z "$OBJDUMP" && OBJDUMP=objdump case `pwd` in *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac -macro_version='2.4.2' -macro_revision='1.3337' +macro_version='2.4.6' +macro_revision='2.4.6' @@ -6030,7 +7384,8 @@ macro_revision='1.3337' -ltmain="$ac_aux_dir/ltmain.sh" + +ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. @@ -6053,8 +7408,8 @@ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then @@ -6079,13 +7434,13 @@ func_echo_all () $ECHO "" } -case "$ECHO" in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; +case $ECHO in + printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +printf "%s\n" "printf" >&6; } ;; + print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +printf "%s\n" "print -r" >&6; } ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +printf "%s\n" "cat" >&6; } ;; esac @@ -6101,11 +7456,12 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" @@ -6119,10 +7475,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED @@ -6131,13 +7492,13 @@ case `"$ac_path_SED" --version 2>&1` in ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" + printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -6165,8 +7526,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed @@ -6183,11 +7544,154 @@ Xsed="$SED -e 1s/^X//" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +printf %s "checking for fgrep... " >&6; } +if test ${ac_cv_path_FGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else @@ -6198,10 +7702,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in fgrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP @@ -6210,13 +7719,13 @@ case `"$ac_path_FGREP" --version 2>&1` in ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" + printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -6245,8 +7754,8 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" @@ -6271,20 +7780,21 @@ test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else $as_nop with_gnu_ld=no fi ac_prog=ld -if test "$GCC" = yes; then +if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw + # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; @@ -6298,7 +7808,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; } while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done - test -z "$LD" && LD="$ac_prog" + test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. @@ -6309,56 +7819,58 @@ $as_echo_n "checking for ld used by $CC... " >&6; } with_gnu_ld=unknown ;; esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } +elif test yes = "$with_gnu_ld"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" + lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$LD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -6381,40 +7893,46 @@ with_gnu_ld=$lt_cv_prog_gnu_ld -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test ${lt_cv_path_NM+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM="$NM" + lt_cv_path_NM=$NM else - lt_nm_to_check="${ac_tool_prefix}nm" + lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" - break + break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" - break + break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but @@ -6425,15 +7943,15 @@ else esac fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +printf "%s\n" "$lt_cv_path_NM" >&6; } +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : @@ -6444,11 +7962,12 @@ else do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else @@ -6456,11 +7975,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6471,11 +7994,11 @@ fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +printf "%s\n" "$DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6488,11 +8011,12 @@ if test -z "$DUMPBIN"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else @@ -6500,11 +8024,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6515,11 +8043,11 @@ fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6531,17 +8059,17 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) - DUMPBIN="$DUMPBIN -symbols" + DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: @@ -6549,8 +8077,8 @@ fi esac fi - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" + if test : != "$DUMPBIN"; then + NM=$DUMPBIN fi fi test -z "$NM" && NM=nm @@ -6560,11 +8088,12 @@ test -z "$NM" && NM=nm -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +printf %s "checking the name lister ($NM) interface... " >&6; } +if test ${lt_cv_nm_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) @@ -6580,17 +8109,18 @@ else fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +printf "%s\n" "$lt_cv_nm_interface" >&6; } # find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +printf %s "checking the maximum length of command line arguments... " >&6; } +if test ${lt_cv_sys_max_cmd_len+y} +then : + printf %s "(cached) " >&6 +else $as_nop i=0 - teststring="ABCD" + teststring=ABCD case $build_os in msdosdjgpp*) @@ -6630,7 +8160,7 @@ else lt_cv_sys_max_cmd_len=8192; ;; - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -6681,22 +8211,22 @@ else *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do + for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough + test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring @@ -6714,12 +8244,12 @@ else fi -if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +if test -n "$lt_cv_sys_max_cmd_len"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len @@ -6732,30 +8262,6 @@ max_cmd_len=$lt_cv_sys_max_cmd_len : ${MV="mv -f"} : ${RM="rm -f"} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } - - if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else @@ -6787,11 +8293,12 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +printf %s "checking how to convert $build file names to $host format... " >&6; } +if test ${lt_cv_to_host_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $host in *-*-mingw* ) case $build in @@ -6827,18 +8334,19 @@ esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +printf %s "checking how to convert $build file names to toolchain format... " >&6; } +if test ${lt_cv_to_tool_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in @@ -6854,22 +8362,23 @@ esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +printf %s "checking for $LD option to reload object files... " >&6; } +if test ${lt_cv_ld_reload_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_reload_flag='-r' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; @@ -6878,13 +8387,13 @@ esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then + if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi @@ -6902,11 +8411,12 @@ esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else @@ -6914,11 +8424,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6929,11 +8443,11 @@ fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6942,11 +8456,12 @@ if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else @@ -6954,11 +8469,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6969,11 +8488,11 @@ fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then @@ -6981,8 +8500,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP @@ -6998,24 +8517,25 @@ test -z "$OBJDUMP" && OBJDUMP=objdump -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +printf %s "checking how to recognize dependent libraries... " >&6; } +if test ${lt_cv_deplibs_check_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. +# 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) @@ -7042,8 +8562,7 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else @@ -7139,8 +8658,8 @@ newos6*) lt_cv_deplibs_check_method=pass_all ;; -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' @@ -7193,11 +8712,14 @@ sysv4 | sysv4.3*) tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no @@ -7241,11 +8763,12 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else @@ -7253,11 +8776,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7268,11 +8795,11 @@ fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7281,11 +8808,12 @@ if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else @@ -7293,11 +8821,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7308,11 +8840,11 @@ fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then @@ -7320,8 +8852,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL @@ -7338,17 +8870,18 @@ test -z "$DLLTOOL" && DLLTOOL=dlltool -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +printf %s "checking how to associate runtime and link libraries... " >&6; } +if test ${lt_cv_sharedlib_from_linklib_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib @@ -7360,13 +8893,13 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" + lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -7381,11 +8914,12 @@ if test -n "$ac_tool_prefix"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -7393,11 +8927,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7408,11 +8946,11 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7425,11 +8963,12 @@ if test -z "$AR"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -7437,11 +8976,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7452,11 +8995,11 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7468,8 +9011,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -7477,7 +9020,7 @@ esac fi : ${AR=ar} -: ${AR_FLAGS=cru} +: ${AR_FLAGS=cr} @@ -7489,53 +9032,55 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +printf %s "checking for archiver @FILE support... " >&6; } +if test ${lt_cv_ar_at_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - if test "$ac_status" -eq 0; then + if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - if test "$ac_status" -ne 0; then + if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +printf "%s\n" "$lt_cv_ar_at_file" >&6; } -if test "x$lt_cv_ar_at_file" = xno; then +if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file @@ -7550,11 +9095,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else @@ -7562,11 +9108,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7577,11 +9127,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7590,11 +9140,12 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else @@ -7602,11 +9153,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7617,11 +9172,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -7629,8 +9184,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -7649,11 +9204,12 @@ test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else @@ -7661,11 +9217,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7676,11 +9236,11 @@ fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7689,11 +9249,12 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else @@ -7701,11 +9262,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7716,11 +9281,11 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -7728,8 +9293,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -7752,7 +9317,7 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in - openbsd*) + bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) @@ -7818,11 +9383,12 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +printf %s "checking command to parse $NM output from $compiler object... " >&6; } +if test ${lt_cv_sys_global_symbol_pipe+y} +then : + printf %s "(cached) " >&6 +else $as_nop # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] @@ -7842,7 +9408,7 @@ cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; @@ -7875,14 +9441,44 @@ case `$NM -V 2>&1` in symcode='[ABCDGIRSTW]' ;; esac +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -7900,21 +9496,24 @@ for ac_symprfx in "" "_"; do # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" @@ -7941,15 +9540,12 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -7962,11 +9558,11 @@ _LT_EOF if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST -#elif defined(__osf__) +#elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else @@ -7992,7 +9588,7 @@ lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; @@ -8012,13 +9608,13 @@ _LT_EOF mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" + LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext}; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS @@ -8039,7 +9635,7 @@ _LT_EOF rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then + if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= @@ -8052,11 +9648,11 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; } fi # Response file support. @@ -8092,21 +9688,32 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : +if test ${with_sysroot+y} +then : withval=$with_sysroot; -else +else $as_nop with_sysroot=no fi lt_sysroot= -case ${with_sysroot} in #( +case $with_sysroot in #( yes) - if test "$GCC" = yes; then + if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( @@ -8116,57 +9723,147 @@ case ${with_sysroot} in #( no|'') ;; #( *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +printf "%s\n" "${lt_sysroot:-no}" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +printf %s "checking for a working dd... " >&6; } +if test ${ac_cv_path_lt_DD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in dd + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +printf "%s\n" "$ac_cv_path_lt_DD" >&6; } + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +printf %s "checking how to truncate binary pipes... " >&6; } +if test ${lt_cv_truncate_bin+y} +then : + printf %s "(cached) " >&6 +else $as_nop + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +printf "%s\n" "$lt_cv_truncate_bin" >&6; } + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + # Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : +if test ${enable_libtool_lock+y} +then : enableval=$enable_libtool_lock; fi -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) - HPUX_IA64_MODE="32" + HPUX_IA64_MODE=32 ;; *ELF-64*) - HPUX_IA64_MODE="64" + HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" @@ -8195,14 +9892,55 @@ ia64-*-hpux*) rm -rf conftest* ;; +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) @@ -8220,10 +9958,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) ;; esac ;; - powerpc64le-*) + powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; - powerpc64-*) + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -8242,10 +9980,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - powerpcle-*) + powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; - powerpc-*) + powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -8263,13 +10001,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" + SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +printf %s "checking whether the C compiler needs -belf... " >&6; } +if test ${lt_cv_cc_needs_belf+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -8280,19 +10019,20 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_cc_needs_belf=yes -else +else $as_nop lt_cv_cc_needs_belf=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -8301,27 +10041,28 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } + if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" + CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in - i?86-*-solaris*) + i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) @@ -8330,7 +10071,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" + LD=${LD-ld}_sol2 fi ;; *) @@ -8346,16 +10087,17 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } ;; esac -need_locks="$enable_libtool_lock" +need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else @@ -8363,11 +10105,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8378,11 +10124,11 @@ fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +printf "%s\n" "$MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8391,11 +10137,12 @@ if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else @@ -8403,11 +10150,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8418,11 +10169,11 @@ fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then @@ -8430,8 +10181,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL @@ -8441,11 +10192,12 @@ else fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test ${lt_cv_path_mainfest_tool+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out @@ -8455,9 +10207,9 @@ else fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } +if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi @@ -8471,11 +10223,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else @@ -8483,11 +10236,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8498,11 +10255,11 @@ fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +printf "%s\n" "$DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8511,11 +10268,12 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else @@ -8523,11 +10281,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8538,11 +10300,11 @@ fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then @@ -8550,8 +10312,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL @@ -8563,11 +10325,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else @@ -8575,11 +10338,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8590,11 +10357,11 @@ fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +printf "%s\n" "$NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8603,11 +10370,12 @@ if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else @@ -8615,11 +10383,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8630,11 +10402,11 @@ fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +printf "%s\n" "$ac_ct_NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then @@ -8642,8 +10414,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT @@ -8655,11 +10427,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else @@ -8667,11 +10440,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8682,11 +10459,11 @@ fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +printf "%s\n" "$LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8695,11 +10472,12 @@ if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else @@ -8707,11 +10485,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8722,11 +10504,11 @@ fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +printf "%s\n" "$ac_ct_LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then @@ -8734,8 +10516,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO @@ -8747,11 +10529,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else @@ -8759,11 +10542,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8774,11 +10561,11 @@ fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +printf "%s\n" "$OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8787,11 +10574,12 @@ if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else @@ -8799,11 +10587,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8814,11 +10606,11 @@ fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +printf "%s\n" "$ac_ct_OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then @@ -8826,8 +10618,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL @@ -8839,11 +10631,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else @@ -8851,11 +10644,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8866,11 +10663,11 @@ fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +printf "%s\n" "$OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8879,11 +10676,12 @@ if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else @@ -8891,11 +10689,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8906,11 +10708,11 @@ fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +printf "%s\n" "$ac_ct_OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then @@ -8918,8 +10720,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 @@ -8954,13 +10756,14 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +printf %s "checking for -single_module linker flag... " >&6; } +if test ${lt_cv_apple_cc_single_mod+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then + if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the @@ -8978,7 +10781,7 @@ else cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -8987,14 +10790,15 @@ else rm -f conftest.* fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +printf %s "checking for -exported_symbols_list linker flag... " >&6; } +if test ${lt_cv_ld_exported_symbols_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym @@ -9003,39 +10807,41 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_ld_exported_symbols_list=yes -else +else $as_nop lt_cv_ld_exported_symbols_list=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +printf %s "checking for -force_load linker flag... " >&6; } +if test ${lt_cv_ld_force_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 + echo "$AR cr libconftest.a conftest.o" >&5 + $AR cr libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF @@ -9046,7 +10852,7 @@ _LT_EOF _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 @@ -9055,36 +10861,36 @@ _LT_EOF rm -rf conftest.dSYM fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.0,*86*-darwin8*|10.0,*-darwin[912]*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012][,.]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*|11.*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then + if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -9092,18 +10898,59 @@ $as_echo "$lt_cv_ld_force_load" >&6; } ;; esac -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi -done + + + +func_stripname_cnf () +{ + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; + esac +} # func_stripname_cnf @@ -9118,7 +10965,8 @@ done # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : +if test ${enable_shared+y} +then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; @@ -9126,17 +10974,17 @@ if test "${enable_shared+set}" = set; then : *) enable_shared=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_shared=yes fi @@ -9149,7 +10997,8 @@ fi # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : +if test ${enable_static+y} +then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; @@ -9157,17 +11006,17 @@ if test "${enable_static+set}" = set; then : *) enable_static=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_static=yes fi @@ -9181,30 +11030,29 @@ fi # Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : +if test ${with_pic+y} +then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac -else +else $as_nop pic_mode=default fi -test -z "$pic_mode" && pic_mode=default - @@ -9212,7 +11060,8 @@ test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : +if test ${enable_fast_install+y} +then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; @@ -9220,17 +11069,17 @@ if test "${enable_fast_install+set}" = set; then : *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_fast_install=yes fi @@ -9241,11 +11090,65 @@ fi + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +printf %s "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test ${with_aix_soname+y} +then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else $as_nop + if test ${lt_cv_with_aix_soname+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +printf "%s\n" "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" +LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -9294,15 +11197,16 @@ test -z "$LN_S" && LN_S="ln -s" -if test -n "${ZSH_VERSION+set}" ; then +if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +printf %s "checking for objdir... " >&6; } +if test ${lt_cv_objdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then @@ -9313,17 +11217,15 @@ else fi rmdir .libs 2>/dev/null fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF +printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h @@ -9333,7 +11235,7 @@ aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then + if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -9344,14 +11246,14 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except MSVC, +# All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a -with_gnu_ld="$lt_cv_prog_gnu_ld" +with_gnu_ld=$lt_cv_prog_gnu_ld -old_CC="$CC" -old_CFLAGS="$CFLAGS" +old_CC=$CC +old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc @@ -9360,15 +11262,8 @@ test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +func_cc_basename $compiler +cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it @@ -9376,29 +11271,30 @@ test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +printf %s "checking for ${ac_tool_prefix}file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -9421,19 +11317,19 @@ _LT_EOF break fi done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9442,29 +11338,30 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +printf %s "checking for file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -9487,19 +11384,19 @@ _LT_EOF break fi done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9514,7 +11411,7 @@ esac # Use C for the default configuration in the libtool script -lt_save_CC="$CC" +lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -9576,7 +11473,7 @@ if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; @@ -9584,15 +11481,16 @@ if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test ${lt_cv_prog_compiler_rtti_exceptions+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -9619,10 +11517,10 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : @@ -9640,17 +11538,18 @@ lt_prog_compiler_pic= lt_prog_compiler_static= - if test "$GCC" = yes; then + if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi + lt_prog_compiler_pic='-fPIC' ;; amigaos*) @@ -9661,8 +11560,8 @@ lt_prog_compiler_static= ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -9678,6 +11577,11 @@ lt_prog_compiler_static= # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac ;; darwin* | rhapsody*) @@ -9748,7 +11652,7 @@ lt_prog_compiler_static= case $host_os in aix*) lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else @@ -9756,10 +11660,29 @@ lt_prog_compiler_static= fi ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac ;; hpux9* | hpux10* | hpux11*) @@ -9775,7 +11698,7 @@ lt_prog_compiler_static= ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' + lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) @@ -9786,12 +11709,18 @@ lt_prog_compiler_static= linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. + # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) @@ -9811,6 +11740,12 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -9908,7 +11843,7 @@ lt_prog_compiler_static= ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi @@ -9937,7 +11872,7 @@ lt_prog_compiler_static= fi case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: + # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; @@ -9946,30 +11881,32 @@ case $host_os in ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -9996,10 +11933,10 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then +if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; @@ -10025,13 +11962,14 @@ fi # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -10050,13 +11988,13 @@ else fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } -if test x"$lt_cv_prog_compiler_static_works" = xyes; then +if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= @@ -10068,11 +12006,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -10115,19 +12054,20 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -10170,28 +12110,28 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } + if test no = "$hard_links"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -10203,8 +12143,8 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= @@ -10234,9 +12174,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if @@ -10251,7 +12191,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. - if test "$GCC" != yes; then + if test yes != "$GCC"; then with_gnu_ld=no fi ;; @@ -10259,7 +12199,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; - openbsd*) + openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) @@ -10272,7 +12212,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility @@ -10294,24 +12234,24 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie esac fi - if test "$lt_use_gnu_ld_interface" = yes; then + if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' + wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v 2>&1` in + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -10324,7 +12264,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then + if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 @@ -10343,7 +12283,7 @@ _LT_EOF case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) @@ -10359,7 +12299,7 @@ _LT_EOF allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi @@ -10369,7 +12309,7 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' + export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes @@ -10377,61 +12317,89 @@ _LT_EOF exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no - if test "$host_os" = linux-dietlibc; then + if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no + && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -10442,42 +12410,47 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -10491,8 +12464,8 @@ _LT_EOF archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -10510,8 +12483,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -10523,7 +12496,7 @@ _LT_EOF ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify @@ -10538,9 +12511,9 @@ _LT_EOF # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -10557,15 +12530,15 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac - if test "$ld_shlibs" = no; then + if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= @@ -10581,7 +12554,7 @@ _LT_EOF # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported @@ -10589,34 +12562,57 @@ _LT_EOF ;; aix[4-9]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -10635,13 +12631,21 @@ _LT_EOF hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes - file_list_spec='${wl}-f,' + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac - if test "$GCC" = yes; then + if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -10660,53 +12664,61 @@ _LT_EOF ;; esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' fi - link_all_deplibs=no + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - export_dynamic_flag_spec='${wl}-bexpall' + export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then + if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -10721,10 +12733,10 @@ if ac_fn_c_try_link "$LINENO"; then : lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" + lt_cv_aix_libpath_=/usr/lib:/lib fi fi @@ -10732,34 +12744,36 @@ fi aix_libpath=$lt_cv_aix_libpath_ fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then + if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -10774,10 +12788,10 @@ if ac_fn_c_try_link "$LINENO"; then : lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" + lt_cv_aix_libpath_=/usr/lib:/lib fi fi @@ -10785,21 +12799,33 @@ fi aix_libpath=$lt_cv_aix_libpath_ fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -10808,7 +12834,7 @@ fi case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) @@ -10838,16 +12864,17 @@ fi # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes @@ -10856,18 +12883,18 @@ fi # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # Assume MSVC wrapper @@ -10876,7 +12903,7 @@ fi # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. @@ -10895,24 +12922,24 @@ fi hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" + allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; + ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test "$_lt_dar_can_shared" = "yes"; then + if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no @@ -10954,33 +12981,33 @@ fi ;; hpux9*) - if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' + export_dynamic_flag_spec='$wl-E' ;; hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' + export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes @@ -10988,37 +13015,38 @@ fi ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +printf %s "checking if $CC understands -b... " >&6; } +if test ${lt_cv_prog_compiler__b+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -11037,14 +13065,14 @@ else fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -11052,8 +13080,8 @@ fi ;; esac fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in @@ -11064,7 +13092,7 @@ fi *) hardcode_direct=yes hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' + export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. @@ -11075,48 +13103,61 @@ fi ;; irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test ${lt_cv_irix_exported_symbol+y} +then : + printf %s "(cached) " >&6 +else $as_nop + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_irix_exported_symbol=yes -else +else $as_nop lt_cv_irix_exported_symbol=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi + link_all_deplibs=no else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out @@ -11131,7 +13172,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; @@ -11139,27 +13180,19 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } *nto* | *qnx*) ;; - openbsd*) + openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no @@ -11170,33 +13203,53 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes ;; osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -11207,24 +13260,24 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } solaris*) no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) - wlarc='${wl}' - archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + wlarc='$wl' + archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi @@ -11234,11 +13287,11 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', + # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + if test yes = "$GCC"; then + whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi @@ -11248,10 +13301,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } ;; sunos4*) - if test "x$host_vendor" = xsequent; then + if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi @@ -11300,43 +13353,43 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' + no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' + no_undefined_flag='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' + export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; @@ -11351,18 +13404,18 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } ;; esac - if test x$host_vendor = xsni; then + if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' + export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +printf "%s\n" "$ld_shlibs" >&6; } +test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -11388,7 +13441,7 @@ x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then + if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -11397,18 +13450,19 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc+y} +then : + printf %s "(cached) " >&6 +else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest @@ -11426,7 +13480,7 @@ else if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no @@ -11440,8 +13494,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac @@ -11600,17 +13654,17 @@ esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; + mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in @@ -11626,28 +13680,35 @@ if test "$GCC" = yes; then ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. + # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; + lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } @@ -11661,7 +13722,7 @@ BEGIN {RS=" "; FS="/|\n";} { # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else @@ -11670,7 +13731,7 @@ fi library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=".so" +shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -11687,14 +13748,16 @@ hardcode_into_libs=no # flags to be left without arguments need_version=unknown + + case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' + soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) @@ -11702,41 +13765,91 @@ aix[4-9]*) need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac shlibpath_var=LIBPATH fi ;; @@ -11746,18 +13859,18 @@ amigaos*) powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='${libname}${shared_ext}' + library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -11765,8 +13878,8 @@ beos*) bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" @@ -11778,7 +13891,7 @@ bsdi[45]*) cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=".dll" + shrext_cmds=.dll need_version=no need_lib_prefix=no @@ -11787,8 +13900,8 @@ cygwin* | mingw* | pw32* | cegcc*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ @@ -11804,17 +13917,17 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' @@ -11823,8 +13936,8 @@ cygwin* | mingw* | pw32* | cegcc*) *,cl*) # Native MSVC libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' case $build_os in mingw*) @@ -11851,7 +13964,7 @@ cygwin* | mingw* | pw32* | cegcc*) sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` @@ -11864,8 +13977,8 @@ cygwin* | mingw* | pw32* | cegcc*) esac # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' @@ -11878,7 +13991,7 @@ cygwin* | mingw* | pw32* | cegcc*) *) # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -11891,8 +14004,8 @@ darwin* | rhapsody*) version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' @@ -11905,8 +14018,8 @@ dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -11924,12 +14037,13 @@ freebsd* | dragonfly*) version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac @@ -11959,10 +14073,10 @@ haiku*) need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -11980,14 +14094,15 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' @@ -11995,8 +14110,8 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; @@ -12005,8 +14120,8 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... @@ -12019,8 +14134,8 @@ interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -12031,7 +14146,7 @@ irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -12039,8 +14154,8 @@ irix5* | irix6* | nonstopux*) esac need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= @@ -12059,8 +14174,8 @@ irix5* | irix6* | nonstopux*) esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; @@ -12069,21 +14184,42 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir @@ -12093,19 +14229,21 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : +if ac_fn_c_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : lt_cv_shlibpath_overrides_runpath=yes fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir @@ -12119,7 +14257,12 @@ fi # before this can be enabled. hardcode_into_libs=yes - # Append ld.so.conf contents to the search path + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" @@ -12151,12 +14294,12 @@ netbsd*) need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -12166,7 +14309,7 @@ netbsd*) newsos6) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -12175,58 +14318,68 @@ newsos6) version_type=qnx need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; -openbsd*) +openbsd* | bitrig*) version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" + sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no else - shlibpath_overrides_runpath=yes + need_version=yes fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' - shrext_cmds=".dll" + version_type=windows + shrext_cmds=.dll + need_version=no need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) @@ -12237,8 +14390,8 @@ solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -12248,11 +14401,11 @@ solaris*) sunos4*) version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes @@ -12260,8 +14413,8 @@ sunos4*) sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) @@ -12282,24 +14435,24 @@ sysv4 | sysv4.3*) ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf + version_type=sco need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -12317,7 +14470,7 @@ tpf*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -12325,8 +14478,8 @@ tpf*) uts4*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -12334,22 +14487,33 @@ uts4*) dynamic_linker=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then +if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + @@ -12441,20 +14605,24 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then + test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && + if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else @@ -12466,15 +14634,15 @@ else # directories. hardcode_action=unsupported fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +printf "%s\n" "$hardcode_action" >&6; } -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi @@ -12484,7 +14652,7 @@ fi - if test "x$enable_dlopen" != xyes; then + if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown @@ -12494,28 +14662,29 @@ else case $host_os in beos*) - lt_cv_dlopen="load_add_on" + lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) - lt_cv_dlopen="dlopen" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) - # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else + # if libdl is installed we need to link against it + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12524,34 +14693,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else $as_nop - lt_cv_dlopen="dyld" + lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes @@ -12559,16 +14727,26 @@ fi ;; + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "x$ac_cv_func_shl_load" = xyes +then : + lt_cv_dlopen=shl_load +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +printf %s "checking for shl_load in -ldld... " >&6; } +if test ${ac_cv_lib_dld_shl_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12577,41 +14755,42 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char shl_load (); int -main () +main (void) { return shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_shl_load=yes -else +else $as_nop ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes +then : + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld +else $as_nop ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "x$ac_cv_func_dlopen" = xyes +then : + lt_cv_dlopen=dlopen +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12620,37 +14799,37 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +printf %s "checking for dlopen in -lsvld... " >&6; } +if test ${ac_cv_lib_svld_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12659,37 +14838,37 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_svld_dlopen=yes -else +else $as_nop ac_cv_lib_svld_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +printf %s "checking for dld_link in -ldld... " >&6; } +if test ${ac_cv_lib_dld_dld_link+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12698,31 +14877,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dld_link (); int -main () +main (void) { return dld_link (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_dld_link=yes -else +else $as_nop ac_cv_lib_dld_dld_link=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes +then : + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi @@ -12743,29 +14921,30 @@ fi ;; esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else + if test no = "$lt_cv_dlopen"; then enable_dlopen=no + else + enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS="$LIBS" + save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +printf %s "checking whether a program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -12812,9 +14991,9 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -12843,8 +15022,8 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in @@ -12861,17 +15040,18 @@ rm -fr conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +printf "%s\n" "$lt_cv_dlopen_self" >&6; } - if test "x$lt_cv_dlopen_self" = xyes; then + if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +printf %s "checking whether a statically linked program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self_static+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -12918,9 +15098,9 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -12949,8 +15129,8 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in @@ -12967,13 +15147,13 @@ rm -fr conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS ;; esac @@ -13006,30 +15186,30 @@ fi striplib= old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +printf %s "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) - if test -n "$STRIP" ; then + if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; esac fi @@ -13045,21 +15225,21 @@ fi - # Report which library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } + # Report what library types will actually be built + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +printf %s "checking if libtool supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +printf "%s\n" "$can_build_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +printf %s "checking whether to build shared libraries... " >&6; } + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' @@ -13067,20 +15247,24 @@ $as_echo_n "checking whether to build shared libraries... " >&6; } ;; aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf "%s\n" "$enable_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } + test yes = "$enable_shared" || enable_static=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +printf "%s\n" "$enable_static" >&6; } @@ -13092,675 +15276,4592 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -CC="$lt_save_CC" +CC=$lt_save_CC + + if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +printf %s "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if test ${ac_cv_prog_CXXCPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CXX needs to be expanded + for CXXCPP in "$CXX -E" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + done + ac_cv_prog_CXXCPP=$CXXCPP +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +printf "%s\n" "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +else + _lt_caught_CXX_error=yes +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + # ltmain only uses $CC for tagged configurations so make sure $CC is set. - ac_config_commands="$ac_config_commands libtool" -# Only expand once: +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +# Allow CC to be a program name with arguments. +compiler=$CC - # Check for potential -arch flags. It is not universal unless - # there are at least two -arch flags with different values. - ac_arch= - ac_prev= - for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do - if test -n "$ac_prev"; then - case $ac_word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then - ac_arch=$ac_word - else - ac_cv_c_bigendian=universal - break - fi - ;; - esac - ac_prev= - elif test "x$ac_word" = "x-arch"; then - ac_prev=arch - fi - done -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + + if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + + +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } else - ac_cv_c_bigendian=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif + # PORTME: fill in a description of your system's C++ link characteristics + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct_CXX=no + hardcode_direct_absolute_CXX=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec_CXX='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + no_undefined_flag_CXX='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include int -main () +main (void) { -#ifndef _BIG_ENDIAN - not big endian - #endif ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no +if ac_fn_cxx_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then : - # Try to guess by grepping values from an object file. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi + aix_libpath=$lt_cv_aix_libpath__CXX fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath else + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default + int -main () +main (void) { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_bigendian=no -else - ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h -;; #( - no) - ;; #( - universal) - -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h - - ;; #( - *) - as_fn_error $? "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac +if ac_fn_cxx_try_link "$LINENO" +then : + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then : - enableval=$enable_largefile; fi -if test "$enable_largefile" != no; then + aix_libpath=$lt_cv_aix_libpath__CXX +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if ${ac_cv_sys_largefile_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' $wl-bernotok' + allow_undefined_flag_CXX=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; - ; - return 0; -} -_ACEOF - if ac_fn_c_try_compile "$LINENO"; then : - break -fi -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_largefile_CC=' -n32'; break -fi -rm -f core conftest.err conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if ${ac_cv_sys_file_offset_bits+:} false; then : - $as_echo_n "(cached) " >&6 -else - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_file_offset_bits=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='$wl--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_file_offset_bits=64; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF -;; -esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if ${ac_cv_sys_large_files+:} false; then : - $as_echo_n "(cached) " >&6 -else - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_large_files=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_large_files=1; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF -;; -esac -rm -rf conftest* + else + whole_archive_flag_spec_CXX='' fi + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + if test yes != "$lt_cv_apple_cc_single_mod"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi + else + ld_shlibs_CXX=no + fi -fi + ;; + os2*) + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_minus_L_CXX=yes + allow_undefined_flag_CXX=unsupported + shrext_cmds=.dll + archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes_CXX=yes + ;; -# Configure parameters + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; -# Check whether --with-openssl was given. -if test "${with_openssl+set}" = set; then : - withval=$with_openssl; use_openssl=$withval -else - use_openssl=auto -fi + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; -# Check whether --with-libgcrypt was given. -if test "${with_libgcrypt+set}" = set; then : - withval=$with_libgcrypt; use_libgcrypt=$withval -else - use_libgcrypt=auto -fi + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; -# Check whether --with-wincng was given. -if test "${with_wincng+set}" = set; then : - withval=$with_wincng; use_wincng=$withval -else - use_wincng=auto -fi + hpux9*) + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='$wl-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: -# Check whether --with-libz was given. -if test "${with_libz+set}" = set; then : - withval=$with_libz; use_libz=$withval -else - use_libz=auto -fi + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; -found_crypto=none -support_clear_memory=no + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; -# Look for OpenSSL -if test "$found_crypto" = "none" && test "$use_openssl" != "no"; then + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' + hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object_CXX=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='$wl-E' + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac + + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + no_undefined_flag_CXX=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + fi + + hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='$wl-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='$wl-z,text' + allow_undefined_flag_CXX='$wl-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } + test no = "$ld_shlibs_CXX" && can_build_shared=no + + GCC_CXX=$GXX + LD_CXX=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF + + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test x-L = "$p" || + test x-R = "$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX=$prev$p + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX=$prev$p + else + postdeps_CXX="${postdeps_CXX} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX=$p + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX=$p + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + lt_prog_compiler_pic_CXX='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static_CXX='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac else - acl_final_exec_prefix="$exec_prefix" - fi + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } + if test no = "$hard_links"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs_CXX=no + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } +test no = "$ld_shlibs_CXX" && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec_CXX='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test yes = "$hardcode_automatic_CXX"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct_CXX" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && + test no != "$hardcode_minus_L_CXX"; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +printf "%s\n" "$hardcode_action_CXX" >&6; } + +if test relink = "$hardcode_action_CXX" || + test yes = "$inherit_rpath_CXX"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else $as_nop + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else $as_nop + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + unsigned short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + unsigned short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + unsigned short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main (void) +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else $as_nop + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + +# Check whether --enable-largefile was given. +if test ${enable_largefile+y} +then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO" +then : + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test ${ac_cv_sys_file_offset_bits+y} +then : + printf %s "(cached) " >&6 +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } +if test ${ac_cv_sys_large_files+y} +then : + printf %s "(cached) " >&6 +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +printf "%s\n" "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h +;; +esac +rm -rf conftest* + fi +fi + + +# Crypto backends + +found_crypto=none +found_crypto_str="" +support_clear_memory=no +crypto_errors="" + + + + + + + +# Check whether --with-crypto was given. +if test ${with_crypto+y} +then : + withval=$with_crypto; use_crypto=$withval +else $as_nop + use_crypto=auto + +fi + + +case "${use_crypto}" in + auto|openssl|libgcrypt|mbedtls|wincng) + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 +printf %s "checking for ld used by GCC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test ${acl_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$acl_cv_path_LD" +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${acl_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +printf %s "checking for shared library run path origin... " >&6; } +if test ${acl_cv_rpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +printf "%s\n" "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath was given. +if test ${enable_rpath+y} +then : + enableval=$enable_rpath; : +else $as_nop + enable_rpath=yes +fi + + + + acl_libdirstem=lib + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + + +if test "$use_crypto" = "auto" && test "$found_crypto" = "none" || test "$use_crypto" = "openssl"; then + + + libssh2_save_CPPFLAGS="$CPPFLAGS" + libssh2_save_LDFLAGS="$LDFLAGS" + + if test "${with_libssl_prefix+set}" = set; then + CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-I${with_libssl_prefix}/include" + LDFLAGS="$LDFLAGS${LDFLAGS:+ }-L${with_libssl_prefix}/lib" + fi + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libssl-prefix was given. +if test ${with_libssl_prefix+y} +then : + withval=$with_libssl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi + +fi + + LIBSSL= + LTLIBSSL= + INCSSL= + LIBSSL_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='ssl crypto' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBSSL="${LIBSSL}${LIBSSL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBSSL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBSSL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBSSL="${LIBSSL}${LIBSSL:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + else + LIBSSL="${LIBSSL}${LIBSSL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBSSL="${LIBSSL}${LIBSSL:+ }$found_a" + else + LIBSSL="${LIBSSL}${LIBSSL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + LIBSSL_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCSSL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCSSL="${INCSSL}${INCSSL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBSSL; do + acl_save_prefix="$prefix" prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBSSL="${LIBSSL}${LIBSSL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBSSL; do -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 -$as_echo_n "checking for ld used by GCC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBSSL="${LIBSSL}${LIBSSL:+ }$dep" + LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }$dep" + ;; + esac + done + fi + else + LIBSSL="${LIBSSL}${LIBSSL:+ }-l$name" + LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${acl_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; - *) - test "$with_gnu_ld" != yes && break ;; - esac + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSSL="${LIBSSL}${LIBSSL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSSL="${LIBSSL}${LIBSSL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }-R$found_dir" + done + fi + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCSSL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi -fi -LD="$acl_cv_path_LD" -if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${acl_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 &5 +printf %s "checking for libssl... " >&6; } +if test ${ac_cv_libssl+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIBSSL" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libssl=yes +else $as_nop + ac_cv_libssl=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5 -$as_echo "$acl_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$acl_cv_prog_gnu_ld +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libssl" >&5 +printf "%s\n" "$ac_cv_libssl" >&6; } + if test "$ac_cv_libssl" = yes; then + HAVE_LIBSSL=yes +printf "%s\n" "#define HAVE_LIBSSL 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libssl" >&5 +printf %s "checking how to link with libssl... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSSL" >&5 +printf "%s\n" "$LIBSSL" >&6; } + else + HAVE_LIBSSL=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBSSL= + LTLIBSSL= + LIBSSL_PREFIX= + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 -$as_echo_n "checking for shared library run path origin... " >&6; } -if ${acl_cv_rpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done + + + + + + + LDFLAGS="$libssh2_save_LDFLAGS" + + if test "$ac_cv_libssl" = "yes"; then : + + +printf "%s\n" "#define LIBSSH2_OPENSSL 1" >>confdefs.h + + LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }libssl libcrypto" + + # Not all OpenSSL have AES-CTR functions. + libssh2_save_LIBS="$LIBS" + LIBS="$LIBS $LIBSSL" + ac_fn_c_check_func "$LINENO" "EVP_aes_128_ctr" "ac_cv_func_EVP_aes_128_ctr" +if test "x$ac_cv_func_EVP_aes_128_ctr" = xyes +then : + printf "%s\n" "#define HAVE_EVP_AES_128_CTR 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 -$as_echo "$acl_cv_rpath" >&6; } - wl="$acl_cv_wl" - acl_libext="$acl_cv_libext" - acl_shlibext="$acl_cv_shlibext" - acl_libname_spec="$acl_cv_libname_spec" - acl_library_names_spec="$acl_cv_library_names_spec" - acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - acl_hardcode_direct="$acl_cv_hardcode_direct" - acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" - # Check whether --enable-rpath was given. -if test "${enable_rpath+set}" = set; then : - enableval=$enable_rpath; : -else - enable_rpath=yes + + LIBS="$libssh2_save_LIBS" + + found_crypto="openssl" + found_crypto_str="OpenSSL (AES-CTR: ${ac_cv_func_EVP_aes_128_ctr:-N/A})" + + else + CPPFLAGS="$libssh2_save_CPPFLAGS" + fi + + + test "$found_crypto" = "none" && + crypto_errors="${crypto_errors}No openssl crypto library found! +" fi +if test "$use_crypto" = "auto" && test "$found_crypto" = "none" || test "$use_crypto" = "libgcrypt"; then - acl_libdirstem=lib - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; - esac - fi - done - IFS="$acl_save_IFS" + libssh2_save_CPPFLAGS="$CPPFLAGS" + libssh2_save_LDFLAGS="$LDFLAGS" + + if test "${with_libgcrypt_prefix+set}" = set; then + CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-I${with_libgcrypt_prefix}/include" + LDFLAGS="$LDFLAGS${LDFLAGS:+ }-L${with_libgcrypt_prefix}/lib" fi @@ -13787,9 +19888,10 @@ fi prefix="$acl_save_prefix" -# Check whether --with-libssl-prefix was given. -if test "${with_libssl_prefix+set}" = set; then : - withval=$with_libssl_prefix; +# Check whether --with-libgcrypt-prefix was given. +if test ${with_libgcrypt_prefix+y} +then : + withval=$with_libgcrypt_prefix; if test "X$withval" = "Xno"; then use_additional=no else @@ -13814,14 +19916,14 @@ if test "${with_libssl_prefix+set}" = set; then : fi - LIBSSL= - LTLIBSSL= - INCSSL= - LIBSSL_PREFIX= + LIBGCRYPT= + LTLIBGCRYPT= + INCGCRYPT= + LIBGCRYPT_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= - names_next_round='ssl crypto' + names_next_round='gcrypt ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= @@ -13840,9 +19942,9 @@ fi if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" - test -z "$value" || LIBSSL="${LIBSSL}${LIBSSL:+ }$value" + test -z "$value" || LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$value" eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }$value" + test -z "$value" || LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }$value" else : fi @@ -13899,7 +20001,7 @@ fi fi fi if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIBSSL; do + for x in $LDFLAGS $LTLIBGCRYPT; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -13958,10 +20060,10 @@ fi done fi if test "X$found_dir" != "X"; then - LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }-L$found_dir -l$name" + LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then - LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$found_so" else haveit= for x in $ltrpathdirs; do @@ -13974,10 +20076,10 @@ fi ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then - LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then @@ -13990,7 +20092,7 @@ fi fi else haveit= - for x in $LDFLAGS $LIBSSL; do + for x in $LDFLAGS $LIBGCRYPT; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -14006,28 +20108,28 @@ fi fi done if test -z "$haveit"; then - LIBSSL="${LIBSSL}${LIBSSL:+ }-L$found_dir" + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then - LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$found_so" else - LIBSSL="${LIBSSL}${LIBSSL:+ }-l$name" + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then - LIBSSL="${LIBSSL}${LIBSSL:+ }$found_a" + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$found_a" else - LIBSSL="${LIBSSL}${LIBSSL:+ }-L$found_dir -l$name" + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIBSSL_PREFIX="$basedir" + LIBGCRYPT_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac @@ -14042,7 +20144,7 @@ fi fi fi if test -z "$haveit"; then - for x in $CPPFLAGS $INCSSL; do + for x in $CPPFLAGS $INCGCRYPT; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -14059,7 +20161,7 @@ fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then - INCSSL="${INCSSL}${INCSSL:+ }-I$additional_includedir" + INCGCRYPT="${INCGCRYPT}${INCGCRYPT:+ }-I$additional_includedir" fi fi fi @@ -14087,7 +20189,7 @@ fi fi if test -z "$haveit"; then haveit= - for x in $LDFLAGS $LIBSSL; do + for x in $LDFLAGS $LIBGCRYPT; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -14104,11 +20206,11 @@ fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then - LIBSSL="${LIBSSL}${LIBSSL:+ }-L$additional_libdir" + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }-L$additional_libdir" fi fi haveit= - for x in $LDFLAGS $LTLIBSSL; do + for x in $LDFLAGS $LTLIBGCRYPT; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -14125,7 +20227,7 @@ fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then - LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }-L$additional_libdir" + LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }-L$additional_libdir" fi fi fi @@ -14163,15 +20265,15 @@ fi names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) - LIBSSL="${LIBSSL}${LIBSSL:+ }$dep" - LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }$dep" + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$dep" + LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }$dep" ;; esac done fi else - LIBSSL="${LIBSSL}${LIBSSL:+ }-l$name" - LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }-l$name" + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }-l$name" + LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }-l$name" fi fi fi @@ -14187,27 +20289,27 @@ fi libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" - LIBSSL="${LIBSSL}${LIBSSL:+ }$flag" + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" - LIBSSL="${LIBSSL}${LIBSSL:+ }$flag" + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do - LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }-R$found_dir" + LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }-R$found_dir" done fi ac_save_CPPFLAGS="$CPPFLAGS" - for element in $INCSSL; do + for element in $INCGCRYPT; do haveit= for x in $CPPFLAGS; do @@ -14230,52 +20332,54 @@ fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libssl" >&5 -$as_echo_n "checking for libssl... " >&6; } -if ${ac_cv_libssl+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libgcrypt" >&5 +printf %s "checking for libgcrypt... " >&6; } +if test ${ac_cv_libgcrypt+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_LIBS="$LIBS" - LIBS="$LIBS $LIBSSL" + LIBS="$LIBS $LIBGCRYPT" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_libssl=yes -else - ac_cv_libssl=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libgcrypt=yes +else $as_nop + ac_cv_libgcrypt=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libssl" >&5 -$as_echo "$ac_cv_libssl" >&6; } - if test "$ac_cv_libssl" = yes; then - HAVE_LIBSSL=yes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libgcrypt" >&5 +printf "%s\n" "$ac_cv_libgcrypt" >&6; } + if test "$ac_cv_libgcrypt" = yes; then + HAVE_LIBGCRYPT=yes -$as_echo "#define HAVE_LIBSSL 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBGCRYPT 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libssl" >&5 -$as_echo_n "checking how to link with libssl... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBSSL" >&5 -$as_echo "$LIBSSL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libgcrypt" >&5 +printf %s "checking how to link with libgcrypt... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBGCRYPT" >&5 +printf "%s\n" "$LIBGCRYPT" >&6; } else - HAVE_LIBSSL=no + HAVE_LIBGCRYPT=no CPPFLAGS="$ac_save_CPPFLAGS" - LIBSSL= - LTLIBSSL= - LIBSSL_PREFIX= + LIBGCRYPT= + LTLIBGCRYPT= + LIBGCRYPT_PREFIX= fi @@ -14284,42 +20388,37 @@ $as_echo "$LIBSSL" >&6; } -fi -if test "$ac_cv_libssl" = "yes"; then -$as_echo "#define LIBSSH2_OPENSSL 1" >>confdefs.h + LDFLAGS="$libssh2_save_LDFLAGS" - LIBSREQUIRED=libssl,libcrypto + if test "$ac_cv_libgcrypt" = "yes"; then : - # Not all OpenSSL have AES-CTR functions. - save_LIBS="$LIBS" - LIBS="$LIBS $LIBSSL" - for ac_func in EVP_aes_128_ctr -do : - ac_fn_c_check_func "$LINENO" "EVP_aes_128_ctr" "ac_cv_func_EVP_aes_128_ctr" -if test "x$ac_cv_func_EVP_aes_128_ctr" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_EVP_AES_128_CTR 1 -_ACEOF -fi -done +printf "%s\n" "#define LIBSSH2_LIBGCRYPT 1" >>confdefs.h - LIBS="$save_LIBS" + found_crypto="libgcrypt" - found_crypto="OpenSSL (AES-CTR: ${ac_cv_func_EVP_aes_128_ctr:-N/A})" -fi - if test "$ac_cv_libssl" = "yes"; then - OPENSSL_TRUE= - OPENSSL_FALSE='#' -else - OPENSSL_TRUE='#' - OPENSSL_FALSE= + else + CPPFLAGS="$libssh2_save_CPPFLAGS" + fi + + + test "$found_crypto" = "none" && + crypto_errors="${crypto_errors}No libgcrypt crypto library found! +" fi +if test "$use_crypto" = "auto" && test "$found_crypto" = "none" || test "$use_crypto" = "mbedtls"; then + + + libssh2_save_CPPFLAGS="$CPPFLAGS" + libssh2_save_LDFLAGS="$LDFLAGS" + + if test "${with_libmbedcrypto_prefix+set}" = set; then + CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-I${with_libmbedcrypto_prefix}/include" + LDFLAGS="$LDFLAGS${LDFLAGS:+ }-L${with_libmbedcrypto_prefix}/lib" + fi -# Look for libgcrypt -if test "$found_crypto" = "none" && test "$use_libgcrypt" != "no"; then @@ -14344,9 +20443,10 @@ if test "$found_crypto" = "none" && test "$use_libgcrypt" != "no"; then prefix="$acl_save_prefix" -# Check whether --with-libgcrypt-prefix was given. -if test "${with_libgcrypt_prefix+set}" = set; then : - withval=$with_libgcrypt_prefix; +# Check whether --with-libmbedcrypto-prefix was given. +if test ${with_libmbedcrypto_prefix+y} +then : + withval=$with_libmbedcrypto_prefix; if test "X$withval" = "Xno"; then use_additional=no else @@ -14371,14 +20471,14 @@ if test "${with_libgcrypt_prefix+set}" = set; then : fi - LIBGCRYPT= - LTLIBGCRYPT= - INCGCRYPT= - LIBGCRYPT_PREFIX= + LIBMBEDCRYPTO= + LTLIBMBEDCRYPTO= + INCMBEDCRYPTO= + LIBMBEDCRYPTO_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= - names_next_round='gcrypt ' + names_next_round='mbedcrypto ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= @@ -14397,9 +20497,9 @@ fi if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" - test -z "$value" || LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$value" + test -z "$value" || LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$value" eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }$value" + test -z "$value" || LTLIBMBEDCRYPTO="${LTLIBMBEDCRYPTO}${LTLIBMBEDCRYPTO:+ }$value" else : fi @@ -14456,7 +20556,7 @@ fi fi fi if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIBGCRYPT; do + for x in $LDFLAGS $LTLIBMBEDCRYPTO; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -14515,10 +20615,10 @@ fi done fi if test "X$found_dir" != "X"; then - LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }-L$found_dir -l$name" + LTLIBMBEDCRYPTO="${LTLIBMBEDCRYPTO}${LTLIBMBEDCRYPTO:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then - LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$found_so" + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$found_so" else haveit= for x in $ltrpathdirs; do @@ -14531,10 +20631,10 @@ fi ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then - LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$found_so" + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$found_so" + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then @@ -14547,7 +20647,7 @@ fi fi else haveit= - for x in $LDFLAGS $LIBGCRYPT; do + for x in $LDFLAGS $LIBMBEDCRYPTO; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -14563,28 +20663,28 @@ fi fi done if test -z "$haveit"; then - LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }-L$found_dir" + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then - LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$found_so" + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$found_so" else - LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }-l$name" + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then - LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$found_a" + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$found_a" else - LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }-L$found_dir -l$name" + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIBGCRYPT_PREFIX="$basedir" + LIBMBEDCRYPTO_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac @@ -14599,7 +20699,7 @@ fi fi fi if test -z "$haveit"; then - for x in $CPPFLAGS $INCGCRYPT; do + for x in $CPPFLAGS $INCMBEDCRYPTO; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -14616,7 +20716,7 @@ fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then - INCGCRYPT="${INCGCRYPT}${INCGCRYPT:+ }-I$additional_includedir" + INCMBEDCRYPTO="${INCMBEDCRYPTO}${INCMBEDCRYPTO:+ }-I$additional_includedir" fi fi fi @@ -14644,7 +20744,7 @@ fi fi if test -z "$haveit"; then haveit= - for x in $LDFLAGS $LIBGCRYPT; do + for x in $LDFLAGS $LIBMBEDCRYPTO; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -14661,11 +20761,11 @@ fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then - LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }-L$additional_libdir" + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }-L$additional_libdir" fi fi haveit= - for x in $LDFLAGS $LTLIBGCRYPT; do + for x in $LDFLAGS $LTLIBMBEDCRYPTO; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -14682,7 +20782,7 @@ fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then - LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }-L$additional_libdir" + LTLIBMBEDCRYPTO="${LTLIBMBEDCRYPTO}${LTLIBMBEDCRYPTO:+ }-L$additional_libdir" fi fi fi @@ -14720,15 +20820,15 @@ fi names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) - LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$dep" - LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }$dep" + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$dep" + LTLIBMBEDCRYPTO="${LTLIBMBEDCRYPTO}${LTLIBMBEDCRYPTO:+ }$dep" ;; esac done fi else - LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }-l$name" - LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }-l$name" + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }-l$name" + LTLIBMBEDCRYPTO="${LTLIBMBEDCRYPTO}${LTLIBMBEDCRYPTO:+ }-l$name" fi fi fi @@ -14744,27 +20844,27 @@ fi libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" - LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$flag" + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" - LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$flag" + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do - LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }-R$found_dir" + LTLIBMBEDCRYPTO="${LTLIBMBEDCRYPTO}${LTLIBMBEDCRYPTO:+ }-R$found_dir" done fi ac_save_CPPFLAGS="$CPPFLAGS" - for element in $INCGCRYPT; do + for element in $INCMBEDCRYPTO; do haveit= for x in $CPPFLAGS; do @@ -14787,80 +20887,203 @@ fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgcrypt" >&5 -$as_echo_n "checking for libgcrypt... " >&6; } -if ${ac_cv_libgcrypt+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libmbedcrypto" >&5 +printf %s "checking for libmbedcrypto... " >&6; } +if test ${ac_cv_libmbedcrypto+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIBMBEDCRYPTO" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libmbedcrypto=yes +else $as_nop + ac_cv_libmbedcrypto=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libmbedcrypto" >&5 +printf "%s\n" "$ac_cv_libmbedcrypto" >&6; } + if test "$ac_cv_libmbedcrypto" = yes; then + HAVE_LIBMBEDCRYPTO=yes + +printf "%s\n" "#define HAVE_LIBMBEDCRYPTO 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libmbedcrypto" >&5 +printf %s "checking how to link with libmbedcrypto... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBMBEDCRYPTO" >&5 +printf "%s\n" "$LIBMBEDCRYPTO" >&6; } + else + HAVE_LIBMBEDCRYPTO=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBMBEDCRYPTO= + LTLIBMBEDCRYPTO= + LIBMBEDCRYPTO_PREFIX= + fi + + + + + + + + + LDFLAGS="$libssh2_save_LDFLAGS" + + if test "$ac_cv_libmbedcrypto" = "yes"; then : + + +printf "%s\n" "#define LIBSSH2_MBEDTLS 1" >>confdefs.h + + LIBS="$LIBS -lmbedcrypto" + found_crypto="mbedtls" + support_clear_memory=yes + + else + CPPFLAGS="$libssh2_save_CPPFLAGS" + fi + + + test "$found_crypto" = "none" && + crypto_errors="${crypto_errors}No mbedtls crypto library found! +" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - ac_save_LIBS="$LIBS" - LIBS="$LIBS $LIBGCRYPT" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include +#include +#include +#include +extern void ac_decl (int, char *); + int -main () +main (void) { +(void) ac_decl (0, (char *) 0); + (void) ac_decl; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_libgcrypt=yes -else - ac_cv_libgcrypt=no +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else $as_nop + ac_cv_c_undeclared_builtin_options=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$ac_save_LIBS" - + break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libgcrypt" >&5 -$as_echo "$ac_cv_libgcrypt" >&6; } - if test "$ac_cv_libgcrypt" = yes; then - HAVE_LIBGCRYPT=yes - -$as_echo "#define HAVE_LIBGCRYPT 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libgcrypt" >&5 -$as_echo_n "checking how to link with libgcrypt... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBGCRYPT" >&5 -$as_echo "$LIBGCRYPT" >&6; } - else - HAVE_LIBGCRYPT=no - CPPFLAGS="$ac_save_CPPFLAGS" - LIBGCRYPT= - LTLIBGCRYPT= - LIBGCRYPT_PREFIX= - fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac +if test "$use_crypto" = "auto" && test "$found_crypto" = "none" || test "$use_crypto" = "wincng"; then + # Look for Windows Cryptography API: Next Generation + ac_fn_c_check_header_compile "$LINENO" "ntdef.h" "ac_cv_header_ntdef_h" "#include +" +if test "x$ac_cv_header_ntdef_h" = xyes +then : + printf "%s\n" "#define HAVE_NTDEF_H 1" >>confdefs.h +fi +ac_fn_c_check_header_compile "$LINENO" "ntstatus.h" "ac_cv_header_ntstatus_h" "#include +" +if test "x$ac_cv_header_ntstatus_h" = xyes +then : + printf "%s\n" "#define HAVE_NTSTATUS_H 1" >>confdefs.h +fi + ac_fn_check_decl "$LINENO" "SecureZeroMemory" "ac_cv_have_decl_SecureZeroMemory" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_SecureZeroMemory" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 fi -if test "$ac_cv_libgcrypt" = "yes"; then +printf "%s\n" "#define HAVE_DECL_SECUREZEROMEMORY $ac_have_decl" >>confdefs.h -$as_echo "#define LIBSSH2_LIBGCRYPT 1" >>confdefs.h - LIBSREQUIRED= # libgcrypt doesn't provide a .pc file. sad face. - LIBS="$LIBS -lgcrypt" - found_crypto=libgcrypt -fi - if test "$ac_cv_libgcrypt" = "yes"; then - LIBGCRYPT_TRUE= - LIBGCRYPT_FALSE='#' -else - LIBGCRYPT_TRUE='#' - LIBGCRYPT_FALSE= -fi + libssh2_save_CPPFLAGS="$CPPFLAGS" + libssh2_save_LDFLAGS="$LDFLAGS" + + if test "${with_libcrypt32_prefix+set}" = set; then + CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-I${with_libcrypt32_prefix}/include" + LDFLAGS="$LDFLAGS${LDFLAGS:+ }-L${with_libcrypt32_prefix}/lib" + fi -# Look for Windows Cryptography API: Next Generation -if test "$found_crypto" = "none" && test "$use_wincng" != "no"; then @@ -14885,9 +21108,10 @@ if test "$found_crypto" = "none" && test "$use_wincng" != "no"; then prefix="$acl_save_prefix" -# Check whether --with-libbcrypt-prefix was given. -if test "${with_libbcrypt_prefix+set}" = set; then : - withval=$with_libbcrypt_prefix; +# Check whether --with-libcrypt32-prefix was given. +if test ${with_libcrypt32_prefix+y} +then : + withval=$with_libcrypt32_prefix; if test "X$withval" = "Xno"; then use_additional=no else @@ -14912,14 +21136,14 @@ if test "${with_libbcrypt_prefix+set}" = set; then : fi - LIBBCRYPT= - LTLIBBCRYPT= - INCBCRYPT= - LIBBCRYPT_PREFIX= + LIBCRYPT32= + LTLIBCRYPT32= + INCCRYPT32= + LIBCRYPT32_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= - names_next_round='bcrypt ' + names_next_round='crypt32 ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= @@ -14938,9 +21162,9 @@ fi if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" - test -z "$value" || LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$value" + test -z "$value" || LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$value" eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }$value" + test -z "$value" || LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }$value" else : fi @@ -14997,7 +21221,7 @@ fi fi fi if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIBBCRYPT; do + for x in $LDFLAGS $LTLIBCRYPT32; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -15056,10 +21280,10 @@ fi done fi if test "X$found_dir" != "X"; then - LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }-L$found_dir -l$name" + LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then - LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$found_so" + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$found_so" else haveit= for x in $ltrpathdirs; do @@ -15072,10 +21296,10 @@ fi ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then - LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$found_so" + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$found_so" + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then @@ -15088,7 +21312,7 @@ fi fi else haveit= - for x in $LDFLAGS $LIBBCRYPT; do + for x in $LDFLAGS $LIBCRYPT32; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -15104,28 +21328,28 @@ fi fi done if test -z "$haveit"; then - LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }-L$found_dir" + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then - LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$found_so" + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$found_so" else - LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }-l$name" + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then - LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$found_a" + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$found_a" else - LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }-L$found_dir -l$name" + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIBBCRYPT_PREFIX="$basedir" + LIBCRYPT32_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac @@ -15140,7 +21364,7 @@ fi fi fi if test -z "$haveit"; then - for x in $CPPFLAGS $INCBCRYPT; do + for x in $CPPFLAGS $INCCRYPT32; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -15157,7 +21381,7 @@ fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then - INCBCRYPT="${INCBCRYPT}${INCBCRYPT:+ }-I$additional_includedir" + INCCRYPT32="${INCCRYPT32}${INCCRYPT32:+ }-I$additional_includedir" fi fi fi @@ -15185,7 +21409,7 @@ fi fi if test -z "$haveit"; then haveit= - for x in $LDFLAGS $LIBBCRYPT; do + for x in $LDFLAGS $LIBCRYPT32; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -15202,11 +21426,11 @@ fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then - LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }-L$additional_libdir" + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }-L$additional_libdir" fi fi haveit= - for x in $LDFLAGS $LTLIBBCRYPT; do + for x in $LDFLAGS $LTLIBCRYPT32; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -15223,7 +21447,7 @@ fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then - LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }-L$additional_libdir" + LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }-L$additional_libdir" fi fi fi @@ -15261,15 +21485,15 @@ fi names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) - LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$dep" - LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }$dep" + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$dep" + LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }$dep" ;; esac done fi else - LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }-l$name" - LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }-l$name" + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }-l$name" + LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }-l$name" fi fi fi @@ -15285,27 +21509,27 @@ fi libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" - LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$flag" + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" - LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$flag" + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do - LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }-R$found_dir" + LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }-R$found_dir" done fi ac_save_CPPFLAGS="$CPPFLAGS" - for element in $INCBCRYPT; do + for element in $INCCRYPT32; do haveit= for x in $CPPFLAGS; do @@ -15328,55 +21552,57 @@ fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbcrypt" >&5 -$as_echo_n "checking for libbcrypt... " >&6; } -if ${ac_cv_libbcrypt+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcrypt32" >&5 +printf %s "checking for libcrypt32... " >&6; } +if test ${ac_cv_libcrypt32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_LIBS="$LIBS" - LIBS="$LIBS $LIBBCRYPT" + LIBS="$LIBS $LIBCRYPT32" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #include + #include int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_libbcrypt=yes -else - ac_cv_libbcrypt=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libcrypt32=yes +else $as_nop + ac_cv_libcrypt32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libbcrypt" >&5 -$as_echo "$ac_cv_libbcrypt" >&6; } - if test "$ac_cv_libbcrypt" = yes; then - HAVE_LIBBCRYPT=yes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libcrypt32" >&5 +printf "%s\n" "$ac_cv_libcrypt32" >&6; } + if test "$ac_cv_libcrypt32" = yes; then + HAVE_LIBCRYPT32=yes -$as_echo "#define HAVE_LIBBCRYPT 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBCRYPT32 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libbcrypt" >&5 -$as_echo_n "checking how to link with libbcrypt... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBBCRYPT" >&5 -$as_echo "$LIBBCRYPT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libcrypt32" >&5 +printf %s "checking how to link with libcrypt32... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBCRYPT32" >&5 +printf "%s\n" "$LIBCRYPT32" >&6; } else - HAVE_LIBBCRYPT=no + HAVE_LIBCRYPT32=no CPPFLAGS="$ac_save_CPPFLAGS" - LIBBCRYPT= - LTLIBBCRYPT= - LIBBCRYPT_PREFIX= + LIBCRYPT32= + LTLIBCRYPT32= + LIBCRYPT32_PREFIX= fi @@ -15386,6 +21612,24 @@ $as_echo "$LIBBCRYPT" >&6; } + LDFLAGS="$libssh2_save_LDFLAGS" + + if test "$ac_cv_libcrypt32" = "yes"; then : + + else + CPPFLAGS="$libssh2_save_CPPFLAGS" + fi + + + libssh2_save_CPPFLAGS="$CPPFLAGS" + libssh2_save_LDFLAGS="$LDFLAGS" + + if test "${with_libbcrypt_prefix+set}" = set; then + CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-I${with_libbcrypt_prefix}/include" + LDFLAGS="$LDFLAGS${LDFLAGS:+ }-L${with_libbcrypt_prefix}/lib" + fi + + @@ -15409,9 +21653,10 @@ $as_echo "$LIBBCRYPT" >&6; } prefix="$acl_save_prefix" -# Check whether --with-libcrypt32-prefix was given. -if test "${with_libcrypt32_prefix+set}" = set; then : - withval=$with_libcrypt32_prefix; +# Check whether --with-libbcrypt-prefix was given. +if test ${with_libbcrypt_prefix+y} +then : + withval=$with_libbcrypt_prefix; if test "X$withval" = "Xno"; then use_additional=no else @@ -15436,14 +21681,14 @@ if test "${with_libcrypt32_prefix+set}" = set; then : fi - LIBCRYPT32= - LTLIBCRYPT32= - INCCRYPT32= - LIBCRYPT32_PREFIX= + LIBBCRYPT= + LTLIBBCRYPT= + INCBCRYPT= + LIBBCRYPT_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= - names_next_round='crypt32 ' + names_next_round='bcrypt ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= @@ -15462,9 +21707,9 @@ fi if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" - test -z "$value" || LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$value" + test -z "$value" || LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$value" eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }$value" + test -z "$value" || LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }$value" else : fi @@ -15521,7 +21766,7 @@ fi fi fi if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIBCRYPT32; do + for x in $LDFLAGS $LTLIBBCRYPT; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -15580,10 +21825,10 @@ fi done fi if test "X$found_dir" != "X"; then - LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }-L$found_dir -l$name" + LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then - LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$found_so" + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$found_so" else haveit= for x in $ltrpathdirs; do @@ -15596,10 +21841,10 @@ fi ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then - LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$found_so" + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$found_so" + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then @@ -15612,7 +21857,7 @@ fi fi else haveit= - for x in $LDFLAGS $LIBCRYPT32; do + for x in $LDFLAGS $LIBBCRYPT; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -15628,28 +21873,28 @@ fi fi done if test -z "$haveit"; then - LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }-L$found_dir" + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then - LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$found_so" + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$found_so" else - LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }-l$name" + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then - LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$found_a" + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$found_a" else - LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }-L$found_dir -l$name" + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIBCRYPT32_PREFIX="$basedir" + LIBBCRYPT_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac @@ -15664,7 +21909,7 @@ fi fi fi if test -z "$haveit"; then - for x in $CPPFLAGS $INCCRYPT32; do + for x in $CPPFLAGS $INCBCRYPT; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -15681,7 +21926,7 @@ fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then - INCCRYPT32="${INCCRYPT32}${INCCRYPT32:+ }-I$additional_includedir" + INCBCRYPT="${INCBCRYPT}${INCBCRYPT:+ }-I$additional_includedir" fi fi fi @@ -15709,7 +21954,7 @@ fi fi if test -z "$haveit"; then haveit= - for x in $LDFLAGS $LIBCRYPT32; do + for x in $LDFLAGS $LIBBCRYPT; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -15726,11 +21971,11 @@ fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then - LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }-L$additional_libdir" + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }-L$additional_libdir" fi fi haveit= - for x in $LDFLAGS $LTLIBCRYPT32; do + for x in $LDFLAGS $LTLIBBCRYPT; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -15747,7 +21992,7 @@ fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then - LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }-L$additional_libdir" + LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }-L$additional_libdir" fi fi fi @@ -15785,15 +22030,15 @@ fi names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) - LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$dep" - LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }$dep" + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$dep" + LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }$dep" ;; esac done fi else - LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }-l$name" - LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }-l$name" + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }-l$name" + LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }-l$name" fi fi fi @@ -15809,27 +22054,27 @@ fi libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" - LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$flag" + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" - LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$flag" + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do - LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }-R$found_dir" + LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }-R$found_dir" done fi ac_save_CPPFLAGS="$CPPFLAGS" - for element in $INCCRYPT32; do + for element in $INCBCRYPT; do haveit= for x in $CPPFLAGS; do @@ -15852,55 +22097,57 @@ fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcrypt32" >&5 -$as_echo_n "checking for libcrypt32... " >&6; } -if ${ac_cv_libcrypt32+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbcrypt" >&5 +printf %s "checking for libbcrypt... " >&6; } +if test ${ac_cv_libbcrypt+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_LIBS="$LIBS" - LIBS="$LIBS $LIBCRYPT32" + LIBS="$LIBS $LIBBCRYPT" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #include + #include int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_libcrypt32=yes -else - ac_cv_libcrypt32=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libbcrypt=yes +else $as_nop + ac_cv_libbcrypt=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libcrypt32" >&5 -$as_echo "$ac_cv_libcrypt32" >&6; } - if test "$ac_cv_libcrypt32" = yes; then - HAVE_LIBCRYPT32=yes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libbcrypt" >&5 +printf "%s\n" "$ac_cv_libbcrypt" >&6; } + if test "$ac_cv_libbcrypt" = yes; then + HAVE_LIBBCRYPT=yes -$as_echo "#define HAVE_LIBCRYPT32 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBBCRYPT 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libcrypt32" >&5 -$as_echo_n "checking how to link with libcrypt32... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBCRYPT32" >&5 -$as_echo "$LIBCRYPT32" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libbcrypt" >&5 +printf %s "checking how to link with libbcrypt... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBBCRYPT" >&5 +printf "%s\n" "$LIBBCRYPT" >&6; } else - HAVE_LIBCRYPT32=no + HAVE_LIBBCRYPT=no CPPFLAGS="$ac_save_CPPFLAGS" - LIBCRYPT32= - LTLIBCRYPT32= - LIBCRYPT32_PREFIX= + LIBBCRYPT= + LTLIBBCRYPT= + LIBBCRYPT_PREFIX= fi @@ -15909,52 +22156,73 @@ $as_echo "$LIBCRYPT32" >&6; } - for ac_header in ntdef.h ntstatus.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " - #include -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + LDFLAGS="$libssh2_save_LDFLAGS" + + if test "$ac_cv_libbcrypt" = "yes"; then : + + +printf "%s\n" "#define LIBSSH2_WINCNG 1" >>confdefs.h + + found_crypto="wincng" + found_crypto_str="Windows Cryptography API: Next Generation" + support_clear_memory="$ac_cv_have_decl_SecureZeroMemory" + + else + CPPFLAGS="$libssh2_save_CPPFLAGS" + fi + + test "$found_crypto" = "none" && + crypto_errors="${crypto_errors}No wincng crypto library found! +" fi -done + ;; + yes|"") + crypto_errors="No crypto backend specified!" + ;; + *) + crypto_errors="Unknown crypto backend '${use_crypto}' specified!" + ;; +esac - ac_fn_c_check_decl "$LINENO" "SecureZeroMemory" "ac_cv_have_decl_SecureZeroMemory" " - #include +if test "$found_crypto" = "none"; then + crypto_errors="${crypto_errors} +Specify --with-crypto=\$backend and/or the neccessary library search prefix. -" -if test "x$ac_cv_have_decl_SecureZeroMemory" = xyes; then : - ac_have_decl=1 +Known crypto backends: auto, openssl, libgcrypt, mbedtls, wincng" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ERROR: ${crypto_errors}" >&5 +printf "%s\n" "$as_me: ERROR: ${crypto_errors}" >&6;} else - ac_have_decl=0 + test "$found_crypto_str" = "" && found_crypto_str="$found_crypto" fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SECUREZEROMEMORY $ac_have_decl -_ACEOF - + if test "$found_crypto" = "openssl"; then + OPENSSL_TRUE= + OPENSSL_FALSE='#' +else + OPENSSL_TRUE='#' + OPENSSL_FALSE= fi -if test "$ac_cv_libbcrypt" = "yes"; then -$as_echo "#define LIBSSH2_WINCNG 1" >>confdefs.h + if test "$found_crypto" = "libgcrypt"; then + LIBGCRYPT_TRUE= + LIBGCRYPT_FALSE='#' +else + LIBGCRYPT_TRUE='#' + LIBGCRYPT_FALSE= +fi - LIBSREQUIRED= # wincng doesn't provide a .pc file. sad face. - LIBS="$LIBS -lbcrypt" - if test "$ac_cv_libcrypt32" = "yes"; then - LIBS="$LIBS -lcrypt32" - fi - found_crypto="Windows Cryptography API: Next Generation" - if test "$ac_cv_have_decl_SecureZeroMemory" = "yes"; then - support_clear_memory=yes - fi + if test "$found_crypto" = "mbedtls"; then + MBEDTLS_TRUE= + MBEDTLS_FALSE='#' +else + MBEDTLS_TRUE='#' + MBEDTLS_FALSE= fi - if test "$ac_cv_libbcrypt" = "yes"; then + + if test "$found_crypto" = "wincng"; then WINCNG_TRUE= WINCNG_FALSE='#' else @@ -15963,26 +22231,23 @@ else fi - if false; then - OS400QC3_TRUE= - OS400QC3_FALSE='#' -else - OS400QC3_TRUE='#' - OS400QC3_FALSE= -fi +# libz -# Check if crypto library was found -if test "$found_crypto" = "none"; then - as_fn_error $? "No crypto library found! -Try --with-libssl-prefix=PATH - or --with-libgcrypt-prefix=PATH - or --with-wincng on Windows\ -" "$LINENO" 5 + +# Check whether --with-libz was given. +if test ${with_libz+y} +then : + withval=$with_libz; use_libz=$withval +else $as_nop + use_libz=auto fi -# Look for Libz -if test "$use_libz" != "no"; then + +found_libz=no +libz_errors="" + +if test "$use_libz" != no; then @@ -16008,7 +22273,8 @@ if test "$use_libz" != "no"; then # Check whether --with-libz-prefix was given. -if test "${with_libz_prefix+set}" = set; then : +if test ${with_libz_prefix+y} +then : withval=$with_libz_prefix; if test "X$withval" = "Xno"; then use_additional=no @@ -16450,11 +22716,12 @@ fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libz" >&5 -$as_echo_n "checking for libz... " >&6; } -if ${ac_cv_libz+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libz" >&5 +printf %s "checking for libz... " >&6; } +if test ${ac_cv_libz+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_LIBS="$LIBS" LIBS="$LIBS $LIBZ" @@ -16462,34 +22729,35 @@ else /* end confdefs.h. */ #include int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_libz=yes -else +else $as_nop ac_cv_libz=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libz" >&5 -$as_echo "$ac_cv_libz" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libz" >&5 +printf "%s\n" "$ac_cv_libz" >&6; } if test "$ac_cv_libz" = yes; then HAVE_LIBZ=yes -$as_echo "#define HAVE_LIBZ 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBZ 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libz" >&5 -$as_echo_n "checking how to link with libz... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBZ" >&5 -$as_echo "$LIBZ" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libz" >&5 +printf %s "checking how to link with libz... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBZ" >&5 +printf "%s\n" "$LIBZ" >&6; } else HAVE_LIBZ=no CPPFLAGS="$ac_save_CPPFLAGS" @@ -16505,18 +22773,22 @@ $as_echo "$LIBZ" >&6; } if test "$ac_cv_libz" != yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot find zlib, disabling compression" >&5 -$as_echo "$as_me: Cannot find zlib, disabling compression" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Try --with-libz-prefix=PATH if you know you have it" >&5 -$as_echo "$as_me: Try --with-libz-prefix=PATH if you know you have it" >&6;} + if test "$use_libz" = auto; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Cannot find libz, disabling compression" >&5 +printf "%s\n" "$as_me: Cannot find libz, disabling compression" >&6;} + found_libz="disabled; no libz found" + else + libz_errors="No libz found! +Try --with-libz-prefix=PATH if you know that you have it." + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ERROR: $libz_errors" >&5 +printf "%s\n" "$as_me: ERROR: $libz_errors" >&6;} + fi else -$as_echo "#define LIBSSH2_HAVE_ZLIB 1" >>confdefs.h +printf "%s\n" "#define LIBSSH2_HAVE_ZLIB 1" >>confdefs.h - if test "${LIBSREQUIRED}" != ""; then - LIBSREQUIRED="${LIBSREQUIRED}," - fi - LIBSREQUIRED="${LIBSREQUIRED}zlib" + LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }zlib" + found_libz="yes" fi fi @@ -16526,49 +22798,53 @@ fi # Optional Settings # # Check whether --enable-crypt-none was given. -if test "${enable_crypt_none+set}" = set; then : +if test ${enable_crypt_none+y} +then : enableval=$enable_crypt_none; -$as_echo "#define LIBSSH2_CRYPT_NONE 1" >>confdefs.h +printf "%s\n" "#define LIBSSH2_CRYPT_NONE 1" >>confdefs.h fi # Check whether --enable-mac-none was given. -if test "${enable_mac_none+set}" = set; then : +if test ${enable_mac_none+y} +then : enableval=$enable_mac_none; -$as_echo "#define LIBSSH2_MAC_NONE 1" >>confdefs.h +printf "%s\n" "#define LIBSSH2_MAC_NONE 1" >>confdefs.h fi # Check whether --enable-gex-new was given. -if test "${enable_gex_new+set}" = set; then : +if test ${enable_gex_new+y} +then : enableval=$enable_gex_new; GEX_NEW=$enableval fi if test "$GEX_NEW" != "no"; then -$as_echo "#define LIBSSH2_DH_GEX_NEW 1" >>confdefs.h +printf "%s\n" "#define LIBSSH2_DH_GEX_NEW 1" >>confdefs.h fi # Check whether --enable-clear-memory was given. -if test "${enable_clear_memory+set}" = set; then : +if test ${enable_clear_memory+y} +then : enableval=$enable_clear_memory; CLEAR_MEMORY=$enableval fi if test "$CLEAR_MEMORY" != "no"; then if test "$support_clear_memory" = "yes"; then -$as_echo "#define LIBSSH2_CLEAR_MEMORY 1" >>confdefs.h +printf "%s\n" "#define LIBSSH2_CLEAR_MEMORY 1" >>confdefs.h enable_clear_memory=yes else if test "$CLEAR_MEMORY" = "yes"; then as_fn_error $? "secure clearing/zeroing of memory is not supported by the selected crypto backend" "$LINENO" 5 else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: secure clearing/zeroing of memory is not supported by the selected crypto backend" >&5 -$as_echo "$as_me: WARNING: secure clearing/zeroing of memory is not supported by the selected crypto backend" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: secure clearing/zeroing of memory is not supported by the selected crypto backend" >&5 +printf "%s\n" "$as_me: WARNING: secure clearing/zeroing of memory is not supported by the selected crypto backend" >&2;} fi enable_clear_memory=unsupported fi @@ -16576,23 +22852,158 @@ else if test "$support_clear_memory" = "yes"; then enable_clear_memory=no else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: secure clearing/zeroing of memory is not supported by the selected crypto backend" >&5 -$as_echo "$as_me: WARNING: secure clearing/zeroing of memory is not supported by the selected crypto backend" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: secure clearing/zeroing of memory is not supported by the selected crypto backend" >&5 +printf "%s\n" "$as_me: WARNING: secure clearing/zeroing of memory is not supported by the selected crypto backend" >&2;} enable_clear_memory=unsupported fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable pedantic and debug compiler options" >&5 -$as_echo_n "checking whether to enable pedantic and debug compiler options... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable pedantic and debug compiler options" >&5 +printf %s "checking whether to enable pedantic and debug compiler options... " >&6; } +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + # Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : +if test ${enable_debug+y} +then : enableval=$enable_debug; case "$enable_debug" in no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CPPFLAGS="$CPPFLAGS -DNDEBUG" ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } enable_debug=yes CPPFLAGS="$CPPFLAGS -DLIBSSH2DEBUG" CFLAGS="$CFLAGS -g" @@ -16601,44 +23012,45 @@ $as_echo "yes" >&6; } if test "z$ICC" = "z"; then ICC="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icc in use" >&5 -$as_echo_n "checking for icc in use... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for icc in use" >&5 +printf %s "checking for icc in use... " >&6; } if test "$GCC" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ __INTEL_COMPILER _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "^__INTEL_COMPILER" >/dev/null 2>&1; then : + $EGREP "^__INTEL_COMPILER" >/dev/null 2>&1 +then : ICC="no" -else +else $as_nop ICC="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi -rm -f conftest* +rm -rf conftest* fi if test "$ICC" = "no"; then # this is not ICC - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi fi if test "$GCC" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking gcc version" >&5 -$as_echo_n "checking gcc version... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gcc version" >&5 +printf %s "checking gcc version... " >&6; } gccver=`$CC -dumpversion` num1=`echo $gccver | cut -d . -f1` num2=`echo $gccver | cut -d . -f2` gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gccver" >&5 -$as_echo "$gccver" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gccver" >&5 +printf "%s\n" "$gccver" >&6; } if test "$ICC" = "yes"; then @@ -16689,12 +23101,12 @@ $as_echo "$gccver" >&6; } fi CFLAGS="$CFLAGS $WARN" - { $as_echo "$as_me:${as_lineno-$LINENO}: Added this set of compiler options: $WARN" >&5 -$as_echo "$as_me: Added this set of compiler options: $WARN" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added this set of compiler options: $WARN" >&5 +printf "%s\n" "$as_me: Added this set of compiler options: $WARN" >&6;} else - { $as_echo "$as_me:${as_lineno-$LINENO}: Added no extra compiler options" >&5 -$as_echo "$as_me: Added no extra compiler options" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added no extra compiler options" >&5 +printf "%s\n" "$as_me: Added no extra compiler options" >&6;} fi NEWFLAGS="" @@ -16713,66 +23125,68 @@ $as_echo "$as_me: Added no extra compiler options" >&6;} ;; esac -else +else $as_nop enable_debug=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable hidden symbols in the library" >&5 -$as_echo_n "checking whether to enable hidden symbols in the library... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable hidden symbols in the library" >&5 +printf %s "checking whether to enable hidden symbols in the library... " >&6; } # Check whether --enable-hidden-symbols was given. -if test "${enable_hidden_symbols+set}" = set; then : +if test ${enable_hidden_symbols+y} +then : enableval=$enable_hidden_symbols; case "$enableval" in no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports it" >&5 -$as_echo_n "checking whether $CC supports it... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports it" >&5 +printf %s "checking whether $CC supports it... " >&6; } if test "$GCC" = yes ; then if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define LIBSSH2_API __attribute__ ((visibility (\"default\")))" >>confdefs.h +printf "%s\n" "#define LIBSSH2_API __attribute__ ((visibility (\"default\")))" >>confdefs.h CFLAGS="$CFLAGS -fvisibility=hidden" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi else if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define LIBSSH2_API __global" >>confdefs.h +printf "%s\n" "#define LIBSSH2_API __global" >>confdefs.h CFLAGS="$CFLAGS -xldscope=hidden" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi fi ;; esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Build example applications? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build example applications" >&5 -$as_echo_n "checking whether to build example applications... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build example applications" >&5 +printf %s "checking whether to build example applications... " >&6; } # Check whether --enable-examples-build was given. -if test "${enable_examples_build+set}" = set; then : +if test ${enable_examples_build+y} +then : enableval=$enable_examples_build; case "$enableval" in no | false) build_examples='no' @@ -16781,12 +23195,12 @@ if test "${enable_examples_build+set}" = set; then : build_examples='yes' ;; esac -else +else $as_nop build_examples='yes' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $build_examples" >&5 -$as_echo "$build_examples" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $build_examples" >&5 +printf "%s\n" "$build_examples" >&6; } if test "x$build_examples" != "xno"; then BUILD_EXAMPLES_TRUE= BUILD_EXAMPLES_FALSE='#' @@ -16796,61 +23210,135 @@ else fi + +# Build OSS fuzzing targets? +# Check whether --enable-ossfuzzers was given. +if test ${enable_ossfuzzers+y} +then : + enableval=$enable_ossfuzzers; have_ossfuzzers=yes +else $as_nop + have_ossfuzzers=no +fi + + if test "x$have_ossfuzzers" = "xyes"; then + USE_OSSFUZZERS_TRUE= + USE_OSSFUZZERS_FALSE='#' +else + USE_OSSFUZZERS_TRUE='#' + USE_OSSFUZZERS_FALSE= +fi + + + +# Set the correct flags for the given fuzzing engine. + + if test "x$LIB_FUZZING_ENGINE" = "x-fsanitize=fuzzer"; then + USE_OSSFUZZ_FLAG_TRUE= + USE_OSSFUZZ_FLAG_FALSE='#' +else + USE_OSSFUZZ_FLAG_TRUE='#' + USE_OSSFUZZ_FLAG_FALSE= +fi + + if test -f "$LIB_FUZZING_ENGINE"; then + USE_OSSFUZZ_STATIC_TRUE= + USE_OSSFUZZ_STATIC_FALSE='#' +else + USE_OSSFUZZ_STATIC_TRUE='#' + USE_OSSFUZZ_STATIC_FALSE= +fi + + + # Checks for header files. # AC_HEADER_STDC -for ac_header in errno.h fcntl.h stdio.h stdlib.h unistd.h sys/uio.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = xyes +then : + printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = xyes +then : + printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" +if test "x$ac_cv_header_stdio_h" = xyes +then : + printf "%s\n" "#define HAVE_STDIO_H 1" >>confdefs.h -for ac_header in sys/select.h sys/socket.h sys/ioctl.h sys/time.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes +then : + printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_uio_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_UIO_H 1" >>confdefs.h -for ac_header in arpa/inet.h netinet/in.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +fi + +ac_fn_c_check_header_compile "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_select_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h -for ac_header in sys/un.h +fi +ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h + +fi + +ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" +if test "x$ac_cv_header_arpa_inet_h" = xyes +then : + printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h + +fi + + for ac_header in sys/un.h do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_un_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_UN_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_un_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_UN_H 1" >>confdefs.h have_sys_un_h=yes -else +else $as_nop have_sys_un_h=no fi done - if test "x$have_sys_un_h" = xyes; then HAVE_SYS_UN_H_TRUE= HAVE_SYS_UN_H_FALSE='#' @@ -16865,58 +23353,73 @@ case $host in # These are POSIX-like systems using BSD-like sockets API. ;; *) - for ac_header in windows.h winsock2.h ws2tcpip.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" +if test "x$ac_cv_header_windows_h" = xyes +then : + printf "%s\n" "#define HAVE_WINDOWS_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" +if test "x$ac_cv_header_ws2tcpip_h" = xyes +then : + printf "%s\n" "#define HAVE_WS2TCPIP_H 1" >>confdefs.h + +fi ;; esac case $host in *darwin*|*interix*) - { $as_echo "$as_me:${as_lineno-$LINENO}: poll use is disabled on this platform" >&5 -$as_echo "$as_me: poll use is disabled on this platform" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: poll use is disabled on this platform" >&5 +printf "%s\n" "$as_me: poll use is disabled on this platform" >&6;} ;; *) - for ac_func in poll -do : - ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll" -if test "x$ac_cv_func_poll" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_POLL 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll" +if test "x$ac_cv_func_poll" = xyes +then : + printf "%s\n" "#define HAVE_POLL 1" >>confdefs.h fi -done ;; esac -for ac_func in gettimeofday select strtoll -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" +if test "x$ac_cv_func_gettimeofday" = xyes +then : + printf "%s\n" "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select" +if test "x$ac_cv_func_select" = xyes +then : + printf "%s\n" "#define HAVE_SELECT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll" +if test "x$ac_cv_func_strtoll" = xyes +then : + printf "%s\n" "#define HAVE_STRTOLL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "memset_s" "ac_cv_func_memset_s" +if test "x$ac_cv_func_memset_s" = xyes +then : + printf "%s\n" "#define HAVE_MEMSET_S 1" >>confdefs.h fi -done if test "$ac_cv_func_select" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for select in ws2_32" >&5 -$as_echo_n "checking for select in ws2_32... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for select in ws2_32" >&5 +printf %s "checking for select in ws2_32... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16928,7 +23431,7 @@ $as_echo_n "checking for select in ws2_32... " >&6; } #endif int -main () +main (void) { select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL,(struct timeval *)NULL); @@ -16937,50 +23440,49 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } HAVE_SELECT="1" -cat >>confdefs.h <<_ACEOF -#define HAVE_SELECT 1 -_ACEOF +printf "%s\n" "#define HAVE_SELECT 1" >>confdefs.h -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : +if test "x$ac_cv_type_size_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF +printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 -$as_echo_n "checking for working alloca.h... " >&6; } -if ${ac_cv_working_alloca_h+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +printf %s "checking for working alloca.h... " >&6; } +if test ${ac_cv_working_alloca_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; @@ -16988,52 +23490,52 @@ char *p = (char *) alloca (2 * sizeof (int)); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_working_alloca_h=yes -else +else $as_nop ac_cv_working_alloca_h=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 -$as_echo "$ac_cv_working_alloca_h" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +printf "%s\n" "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then -$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 -$as_echo_n "checking for alloca... " >&6; } -if ${ac_cv_func_alloca_works+:} false; then : - $as_echo_n "(cached) " >&6 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +printf %s "checking for alloca... " >&6; } +if test ${ac_cv_func_alloca_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test $ac_cv_working_alloca_h = yes; then + ac_cv_func_alloca_works=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER +#include +#include +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _MSC_VER # include # define alloca _alloca # else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -void *alloca (size_t); -# endif -# endif +# ifdef __cplusplus +extern "C" # endif +void *alloca (size_t); # endif #endif int -main () +main (void) { char *p = (char *) alloca (1); if (p) return 0; @@ -17041,20 +23543,22 @@ char *p = (char *) alloca (1); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_func_alloca_works=yes -else +else $as_nop ac_cv_func_alloca_works=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 -$as_echo "$ac_cv_func_alloca_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +printf "%s\n" "$ac_cv_func_alloca_works" >&6; } +fi if test $ac_cv_func_alloca_works = yes; then -$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions @@ -17062,60 +23566,21 @@ else # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. -ALLOCA=\${LIBOBJDIR}alloca.$ac_objext - -$as_echo "#define C_ALLOCA 1" >>confdefs.h - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 -$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } -if ${ac_cv_os_cray+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then : - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 -$as_echo "$ac_cv_os_cray" >&6; } -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext - break -fi +printf "%s\n" "#define C_ALLOCA 1" >>confdefs.h - done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 -$as_echo_n "checking stack direction for C alloca... " >&6; } -if ${ac_cv_c_stack_direction+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +printf %s "checking stack direction for C alloca... " >&6; } +if test ${ac_cv_c_stack_direction+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_c_stack_direction=0 -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -17136,9 +23601,10 @@ main (int argc, char **argv) return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_c_stack_direction=1 -else +else $as_nop ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17146,27 +23612,26 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 -$as_echo "$ac_cv_c_stack_direction" >&6; } -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +printf "%s\n" "$ac_cv_c_stack_direction" >&6; } +printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h fi # Checks for typedefs, structures, and compiler characteristics. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __cplusplus @@ -17179,7 +23644,7 @@ main () /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. + /* IBM XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ @@ -17207,7 +23672,7 @@ main () iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; @@ -17223,47 +23688,50 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_const=yes -else +else $as_nop ac_cv_c_const=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then -$as_echo "#define const /**/" >>confdefs.h +printf "%s\n" "#define const /**/" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } #endif _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_inline=$ac_kw fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; @@ -17282,8 +23750,8 @@ esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking non-blocking sockets style" >&5 -$as_echo_n "checking non-blocking sockets style... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking non-blocking sockets style" >&5 +printf %s "checking non-blocking sockets style... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17294,7 +23762,7 @@ $as_echo_n "checking non-blocking sockets style... " >&6; } #include int -main () +main (void) { /* try to compile O_NONBLOCK */ @@ -17320,14 +23788,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : nonblock="O_NONBLOCK" -$as_echo "#define HAVE_O_NONBLOCK 1" >>confdefs.h +printf "%s\n" "#define HAVE_O_NONBLOCK 1" >>confdefs.h -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17338,7 +23807,7 @@ else #include int -main () +main (void) { /* FIONBIO source test (old-style unix) */ @@ -17349,14 +23818,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : nonblock="FIONBIO" -$as_echo "#define HAVE_FIONBIO 1" >>confdefs.h +printf "%s\n" "#define HAVE_FIONBIO 1" >>confdefs.h -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17379,7 +23849,7 @@ else #endif int -main () +main (void) { /* ioctlsocket source code */ @@ -17392,14 +23862,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : nonblock="ioctlsocket" -$as_echo "#define HAVE_IOCTLSOCKET 1" >>confdefs.h +printf "%s\n" "#define HAVE_IOCTLSOCKET 1" >>confdefs.h -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17409,7 +23880,7 @@ else #include int -main () +main (void) { /* IoctlSocket source code */ @@ -17420,14 +23891,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : nonblock="IoctlSocket" -$as_echo "#define HAVE_IOCTLSOCKET_CASE 1" >>confdefs.h +printf "%s\n" "#define HAVE_IOCTLSOCKET_CASE 1" >>confdefs.h -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17436,7 +23908,7 @@ else #include int -main () +main (void) { /* SO_NONBLOCK source code */ @@ -17448,49 +23920,98 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : nonblock="SO_NONBLOCK" -$as_echo "#define HAVE_SO_NONBLOCK 1" >>confdefs.h +printf "%s\n" "#define HAVE_SO_NONBLOCK 1" >>confdefs.h -else +else $as_nop nonblock="nada" -$as_echo "#define HAVE_DISABLED_NONBLOCKING 1" >>confdefs.h +printf "%s\n" "#define HAVE_DISABLED_NONBLOCKING 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $nonblock" >&5 -$as_echo "$nonblock" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $nonblock" >&5 +printf "%s\n" "$nonblock" >&6; } if test "$nonblock" = "nada"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: non-block sockets disabled" >&5 -$as_echo "$as_me: WARNING: non-block sockets disabled" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: non-block sockets disabled" >&5 +printf "%s\n" "$as_me: WARNING: non-block sockets disabled" >&2;} + fi + + +missing_required_deps=0 + +if test "${libz_errors}" != ""; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ERROR: ${libz_errors}" >&5 +printf "%s\n" "$as_me: ERROR: ${libz_errors}" >&6;} + missing_required_deps=1 +fi + +if test "$found_crypto" = "none"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ERROR: ${crypto_errors}" >&5 +printf "%s\n" "$as_me: ERROR: ${crypto_errors}" >&6;} + missing_required_deps=1 +fi + +if test $missing_required_deps = 1; then + as_fn_error $? "Required dependencies are missing!" "$LINENO" 5 +fi + +# Configure parameters + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable compiler warnings as errors" >&5 +printf %s "checking whether to enable compiler warnings as errors... " >&6; } + OPT_COMPILER_WERROR="default" + # Check whether --enable-werror was given. +if test ${enable_werror+y} +then : + enableval=$enable_werror; OPT_COMPILER_WERROR=$enableval +fi + + case "$OPT_COMPILER_WERROR" in + no) + want_werror="no" + ;; + default) + want_werror="no" + ;; + *) + want_werror="yes" + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $want_werror" >&5 +printf "%s\n" "$want_werror" >&6; } + + if test X"$want_werror" = Xyes; then + CFLAGS="$CFLAGS -Werror" fi -ac_config_files="$ac_config_files Makefile src/Makefile tests/Makefile example/Makefile docs/Makefile libssh2.pc" +ac_config_files="$ac_config_files Makefile src/Makefile tests/Makefile tests/ossfuzz/Makefile example/Makefile docs/Makefile libssh2.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -17519,8 +24040,8 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -17550,15 +24071,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -17572,8 +24093,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;} fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -17590,7 +24111,7 @@ U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -17605,14 +24126,14 @@ if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -17633,6 +24154,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${SSHD_TRUE}" && test -z "${SSHD_FALSE}"; then as_fn_error $? "conditional \"SSHD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -17646,18 +24171,30 @@ if test -z "${LIBGCRYPT_TRUE}" && test -z "${LIBGCRYPT_FALSE}"; then as_fn_error $? "conditional \"LIBGCRYPT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${WINCNG_TRUE}" && test -z "${WINCNG_FALSE}"; then - as_fn_error $? "conditional \"WINCNG\" was never defined. +if test -z "${MBEDTLS_TRUE}" && test -z "${MBEDTLS_FALSE}"; then + as_fn_error $? "conditional \"MBEDTLS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${OS400QC3_TRUE}" && test -z "${OS400QC3_FALSE}"; then - as_fn_error $? "conditional \"OS400QC3\" was never defined. +if test -z "${WINCNG_TRUE}" && test -z "${WINCNG_FALSE}"; then + as_fn_error $? "conditional \"WINCNG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_EXAMPLES_TRUE}" && test -z "${BUILD_EXAMPLES_FALSE}"; then as_fn_error $? "conditional \"BUILD_EXAMPLES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${USE_OSSFUZZERS_TRUE}" && test -z "${USE_OSSFUZZERS_FALSE}"; then + as_fn_error $? "conditional \"USE_OSSFUZZERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_OSSFUZZ_FLAG_TRUE}" && test -z "${USE_OSSFUZZ_FLAG_FALSE}"; then + as_fn_error $? "conditional \"USE_OSSFUZZ_FLAG\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_OSSFUZZ_STATIC_TRUE}" && test -z "${USE_OSSFUZZ_STATIC_FALSE}"; then + as_fn_error $? "conditional \"USE_OSSFUZZ_STATIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_SYS_UN_H_TRUE}" && test -z "${HAVE_SYS_UN_H_FALSE}"; then as_fn_error $? "conditional \"HAVE_SYS_UN_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -17667,8 +24204,8 @@ fi ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -17691,14 +24228,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -17708,46 +24247,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -17756,13 +24295,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -17771,8 +24303,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -17784,30 +24320,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -17820,13 +24336,14 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -17853,18 +24370,20 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -17876,12 +24395,13 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -17912,7 +24432,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -17934,6 +24454,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -17947,6 +24471,12 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -17988,7 +24518,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -17997,7 +24527,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -18060,7 +24590,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by libssh2 $as_me -, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -18122,14 +24652,16 @@ $config_commands Report bugs to ." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ libssh2 config.status - -configured by $0, generated by GNU Autoconf 2.69, +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -18169,15 +24701,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -18185,7 +24717,7 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -18194,7 +24726,7 @@ do as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -18222,7 +24754,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -18236,7 +24768,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -18244,7 +24776,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout @@ -18263,6 +24795,7 @@ enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' @@ -18310,10 +24843,13 @@ compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' @@ -18378,13 +24914,68 @@ finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' @@ -18430,9 +25021,12 @@ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ nm_file_list_spec \ +lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ @@ -18464,10 +25058,41 @@ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ -striplib; do +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -18494,10 +25119,22 @@ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec; do +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -18506,25 +25143,24 @@ sys_lib_dlsearch_path_spec; do done ac_aux_dir='$ac_aux_dir' -xsi_shell='$xsi_shell' -lt_shell_append='$lt_shell_append' -# See if we are running on zsh, and set the options which allow our +# See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then +if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' + + _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 @@ -18534,12 +25170,12 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in "src/libssh2_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/libssh2_config.h" ;; - "example/libssh2_config.h") CONFIG_HEADERS="$CONFIG_HEADERS example/libssh2_config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "tests/ossfuzz/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ossfuzz/Makefile" ;; "example/Makefile") CONFIG_FILES="$CONFIG_FILES example/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "libssh2.pc") CONFIG_FILES="$CONFIG_FILES libssh2.pc" ;; @@ -18554,9 +25190,9 @@ done # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -18892,7 +25528,7 @@ do esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -18900,17 +25536,17 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -18927,7 +25563,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -18951,9 +25587,9 @@ $as_echo X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -19015,8 +25651,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -19060,9 +25696,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -19078,20 +25714,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -19111,7 +25747,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | +printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -19131,8 +25767,8 @@ $as_echo X"$_am_arg" | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -19142,29 +25778,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -19182,106 +25824,100 @@ $as_echo X"$mf" | q } s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } - /^X\(\/\/\)$/{ + /^X\/\(\/\/\)$/{ s//\1/ q } - /^X\(\/\).*/{ + /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? done + if test $am_rc -ne 0; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk } ;; "libtool":C) - # See if we are running on zsh, and set the options which allow our + # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then + if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi - cfgfile="${ofile}T" + cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . # The names of the tagged configurations supported by this script. -available_tags="" +available_tags='CXX ' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG @@ -19310,6 +25946,9 @@ pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + # Shell to use when invoking shell scripts. SHELL=$lt_SHELL @@ -19421,18 +26060,27 @@ global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec -# The root where to search for dependent libraries,and in which our libraries should be installed. +# The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + # The name of the directory that contains temporary libtool files. objdir=$objdir @@ -19523,8 +26171,11 @@ hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen @@ -19617,13 +26268,13 @@ hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute @@ -19671,8 +26322,81 @@ file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + # ### END LIBTOOL CONFIG +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + _LT_EOF case $host_os in @@ -19681,7 +26405,7 @@ _LT_EOF # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then +if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -19690,7 +26414,8 @@ _LT_EOF esac -ltmain="$ac_aux_dir/ltmain.sh" + +ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if @@ -19700,169 +26425,163 @@ ltmain="$ac_aux_dir/ltmain.sh" sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) - if test x"$xsi_shell" = xyes; then - sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ -func_dirname ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_basename ()$/,/^} # func_basename /c\ -func_basename ()\ -{\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ -func_dirname_and_basename ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ -func_stripname ()\ -{\ -\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ -\ # positional parameters, so assign one to ordinary parameter first.\ -\ func_stripname_result=${3}\ -\ func_stripname_result=${func_stripname_result#"${1}"}\ -\ func_stripname_result=${func_stripname_result%"${2}"}\ -} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ -func_split_long_opt ()\ -{\ -\ func_split_long_opt_name=${1%%=*}\ -\ func_split_long_opt_arg=${1#*=}\ -} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ -func_split_short_opt ()\ -{\ -\ func_split_short_opt_arg=${1#??}\ -\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ -} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ -func_lo2o ()\ -{\ -\ case ${1} in\ -\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ -\ *) func_lo2o_result=${1} ;;\ -\ esac\ -} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_xform ()$/,/^} # func_xform /c\ -func_xform ()\ -{\ - func_xform_result=${1%.*}.lo\ -} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_arith ()$/,/^} # func_arith /c\ -func_arith ()\ -{\ - func_arith_result=$(( $* ))\ -} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_len ()$/,/^} # func_len /c\ -func_len ()\ -{\ - func_len_result=${#1}\ -} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - -fi - -if test x"$lt_shell_append" = xyes; then - sed -e '/^func_append ()$/,/^} # func_append /c\ -func_append ()\ -{\ - eval "${1}+=\\${2}"\ -} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ -func_append_quoted ()\ -{\ -\ func_quote_for_eval "${2}"\ -\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ -} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 -$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} -fi - - mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + ;; esac @@ -19898,12 +26617,12 @@ if test "$no_create" != yes; then $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: summary of build options: +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: summary of build options: version: ${LIBSSH2VER} Host type: ${host} @@ -19911,14 +26630,14 @@ fi Compiler: ${CC} Compiler flags: ${CFLAGS} Library types: Shared=${enable_shared}, Static=${enable_static} - Crypto library: ${found_crypto} + Crypto library: ${found_crypto_str} Clear memory: $enable_clear_memory Debug build: $enable_debug Build examples: $build_examples Path to sshd: $ac_cv_path_SSHD (only for self-tests) - zlib compression: $ac_cv_libz + zlib compression: ${found_libz} " >&5 -$as_echo "$as_me: summary of build options: +printf "%s\n" "$as_me: summary of build options: version: ${LIBSSH2VER} Host type: ${host} @@ -19926,10 +26645,11 @@ $as_echo "$as_me: summary of build options: Compiler: ${CC} Compiler flags: ${CFLAGS} Library types: Shared=${enable_shared}, Static=${enable_static} - Crypto library: ${found_crypto} + Crypto library: ${found_crypto_str} Clear memory: $enable_clear_memory Debug build: $enable_debug Build examples: $build_examples Path to sshd: $ac_cv_path_SSHD (only for self-tests) - zlib compression: $ac_cv_libz + zlib compression: ${found_libz} " >&6;} + diff --git a/vendor/libssh2/configure.ac b/vendor/libssh2/configure.ac index d6bdab4a9c..c4fc3e4e30 100644 --- a/vendor/libssh2/configure.ac +++ b/vendor/libssh2/configure.ac @@ -2,7 +2,7 @@ AC_INIT(libssh2, [-], libssh2-devel@cool.haxx.se) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([src]) -AC_CONFIG_HEADERS([src/libssh2_config.h example/libssh2_config.h]) +AC_CONFIG_HEADERS([src/libssh2_config.h]) AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -36,12 +36,9 @@ case "$host" in CFLAGS="$CFLAGS -DLIBSSH2_WIN32" LIBS="$LIBS -lws2_32" ;; - *-cygwin) - CFLAGS="$CFLAGS -DLIBSSH2_WIN32" + *darwin*) + CFLAGS="$CFLAGS -DLIBSSH2_DARWIN" ;; - *darwin*) - CFLAGS="$CFLAGS -DLIBSSH2_DARWIN" - ;; *hpux*) ;; *osf*) @@ -69,6 +66,7 @@ AC_SEARCH_LIBS(inet_addr, nsl) AC_SUBST(LIBS) AC_PROG_CC +AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET @@ -83,107 +81,76 @@ AC_C_BIGENDIAN dnl check for how to do large files AC_SYS_LARGEFILE -# Configure parameters -AC_ARG_WITH(openssl, - AC_HELP_STRING([--with-openssl],[Use OpenSSL for crypto]), - use_openssl=$withval,use_openssl=auto) -AC_ARG_WITH(libgcrypt, - AC_HELP_STRING([--with-libgcrypt],[Use libgcrypt for crypto]), - use_libgcrypt=$withval,use_libgcrypt=auto) -AC_ARG_WITH(wincng, - AC_HELP_STRING([--with-wincng],[Use Windows CNG for crypto]), - use_wincng=$withval,use_wincng=auto) -AC_ARG_WITH(libz, - AC_HELP_STRING([--with-libz],[Use zlib for compression]), - use_libz=$withval,use_libz=auto) +# Crypto backends found_crypto=none +found_crypto_str="" support_clear_memory=no +crypto_errors="" + +m4_set_add([crypto_backends], [openssl]) +m4_set_add([crypto_backends], [libgcrypt]) +m4_set_add([crypto_backends], [mbedtls]) +m4_set_add([crypto_backends], [wincng]) + +AC_ARG_WITH([crypto], + AC_HELP_STRING([--with-crypto=auto|]m4_set_contents([crypto_backends], [|]), + [Select crypto backend (default: auto)]), + use_crypto=$withval, + use_crypto=auto +) -# Look for OpenSSL -if test "$found_crypto" = "none" && test "$use_openssl" != "no"; then - AC_LIB_HAVE_LINKFLAGS([ssl], [crypto], [#include ]) -fi -if test "$ac_cv_libssl" = "yes"; then - AC_DEFINE(LIBSSH2_OPENSSL, 1, [Use OpenSSL]) - LIBSREQUIRED=libssl,libcrypto +case "${use_crypto}" in + auto|m4_set_contents([crypto_backends], [|])) + m4_set_map([crypto_backends], [LIBSSH2_CHECK_CRYPTO]) + ;; + yes|"") + crypto_errors="No crypto backend specified!" + ;; + *) + crypto_errors="Unknown crypto backend '${use_crypto}' specified!" + ;; +esac - # Not all OpenSSL have AES-CTR functions. - save_LIBS="$LIBS" - LIBS="$LIBS $LIBSSL" - AC_CHECK_FUNCS(EVP_aes_128_ctr) - LIBS="$save_LIBS" +if test "$found_crypto" = "none"; then + crypto_errors="${crypto_errors} +Specify --with-crypto=\$backend and/or the neccessary library search prefix. - found_crypto="OpenSSL (AES-CTR: ${ac_cv_func_EVP_aes_128_ctr:-N/A})" +Known crypto backends: auto, m4_set_contents([crypto_backends], [, ])" + AS_MESSAGE([ERROR: ${crypto_errors}]) +else + test "$found_crypto_str" = "" && found_crypto_str="$found_crypto" fi -AM_CONDITIONAL(OPENSSL, test "$ac_cv_libssl" = "yes") -# Look for libgcrypt -if test "$found_crypto" = "none" && test "$use_libgcrypt" != "no"; then - AC_LIB_HAVE_LINKFLAGS([gcrypt], [], [#include ]) -fi -if test "$ac_cv_libgcrypt" = "yes"; then - AC_DEFINE(LIBSSH2_LIBGCRYPT, 1, [Use libgcrypt]) - LIBSREQUIRED= # libgcrypt doesn't provide a .pc file. sad face. - LIBS="$LIBS -lgcrypt" - found_crypto=libgcrypt -fi -AM_CONDITIONAL(LIBGCRYPT, test "$ac_cv_libgcrypt" = "yes") +m4_set_foreach([crypto_backends], [backend], + [AM_CONDITIONAL(m4_toupper(backend), test "$found_crypto" = "backend")] +) -# Look for Windows Cryptography API: Next Generation -if test "$found_crypto" = "none" && test "$use_wincng" != "no"; then - AC_LIB_HAVE_LINKFLAGS([bcrypt], [], [ - #include - #include - ]) - AC_LIB_HAVE_LINKFLAGS([crypt32], [], [ - #include - #include - ]) - AC_CHECK_HEADERS([ntdef.h ntstatus.h], [], [], [ - #include - ]) - AC_CHECK_DECLS([SecureZeroMemory], [], [], [ - #include - ]) -fi -if test "$ac_cv_libbcrypt" = "yes"; then - AC_DEFINE(LIBSSH2_WINCNG, 1, [Use Windows CNG]) - LIBSREQUIRED= # wincng doesn't provide a .pc file. sad face. - LIBS="$LIBS -lbcrypt" - if test "$ac_cv_libcrypt32" = "yes"; then - LIBS="$LIBS -lcrypt32" - fi - found_crypto="Windows Cryptography API: Next Generation" - if test "$ac_cv_have_decl_SecureZeroMemory" = "yes"; then - support_clear_memory=yes - fi -fi -AM_CONDITIONAL(WINCNG, test "$ac_cv_libbcrypt" = "yes") +# libz -AM_CONDITIONAL(OS400QC3, false) +AC_ARG_WITH([libz], + AC_HELP_STRING([--with-libz],[Use libz for compression]), + use_libz=$withval, + use_libz=auto) -# Check if crypto library was found -if test "$found_crypto" = "none"; then - AC_MSG_ERROR([No crypto library found! -Try --with-libssl-prefix=PATH - or --with-libgcrypt-prefix=PATH - or --with-wincng on Windows\ -]) -fi +found_libz=no +libz_errors="" -# Look for Libz -if test "$use_libz" != "no"; then +if test "$use_libz" != no; then AC_LIB_HAVE_LINKFLAGS([z], [], [#include ]) if test "$ac_cv_libz" != yes; then - AC_MSG_NOTICE([Cannot find zlib, disabling compression]) - AC_MSG_NOTICE([Try --with-libz-prefix=PATH if you know you have it]) + if test "$use_libz" = auto; then + AC_MSG_NOTICE([Cannot find libz, disabling compression]) + found_libz="disabled; no libz found" + else + libz_errors="No libz found! +Try --with-libz-prefix=PATH if you know that you have it." + AS_MESSAGE([ERROR: $libz_errors]) + fi else AC_DEFINE(LIBSSH2_HAVE_ZLIB, 1, [Compile in zlib support]) - if test "${LIBSREQUIRED}" != ""; then - LIBSREQUIRED="${LIBSREQUIRED}," - fi - LIBSREQUIRED="${LIBSREQUIRED}zlib" + LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }zlib" + found_libz="yes" fi fi @@ -241,6 +208,7 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]), [ case "$enable_debug" in no) AC_MSG_RESULT(no) + CPPFLAGS="$CPPFLAGS -DNDEBUG" ;; *) AC_MSG_RESULT(yes) enable_debug=yes @@ -312,6 +280,21 @@ esac], [build_examples='yes']) AC_MSG_RESULT($build_examples) AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"]) + +# Build OSS fuzzing targets? +AC_ARG_ENABLE([ossfuzzers], + [AS_HELP_STRING([--enable-ossfuzzers], + [Whether to generate the fuzzers for OSS-Fuzz])], + [have_ossfuzzers=yes], [have_ossfuzzers=no]) +AM_CONDITIONAL([USE_OSSFUZZERS], [test "x$have_ossfuzzers" = "xyes"]) + + +# Set the correct flags for the given fuzzing engine. +AC_SUBST([LIB_FUZZING_ENGINE]) +AM_CONDITIONAL([USE_OSSFUZZ_FLAG], [test "x$LIB_FUZZING_ENGINE" = "x-fsanitize=fuzzer"]) +AM_CONDITIONAL([USE_OSSFUZZ_STATIC], [test -f "$LIB_FUZZING_ENGINE"]) + + # Checks for header files. # AC_HEADER_STDC AC_CHECK_HEADERS([errno.h fcntl.h stdio.h stdlib.h unistd.h sys/uio.h]) @@ -347,7 +330,7 @@ case $host in ;; esac -AC_CHECK_FUNCS(gettimeofday select strtoll) +AC_CHECK_FUNCS(gettimeofday select strtoll memset_s) dnl Check for select() into ws2_32 for Msys/Mingw if test "$ac_cv_func_select" != "yes"; then @@ -379,9 +362,29 @@ AC_C_INLINE CURL_CHECK_NONBLOCKING_SOCKET +missing_required_deps=0 + +if test "${libz_errors}" != ""; then + AS_MESSAGE([ERROR: ${libz_errors}]) + missing_required_deps=1 +fi + +if test "$found_crypto" = "none"; then + AS_MESSAGE([ERROR: ${crypto_errors}]) + missing_required_deps=1 +fi + +if test $missing_required_deps = 1; then + AC_MSG_ERROR([Required dependencies are missing!]) +fi + +# Configure parameters +LIBSSH2_CHECK_OPTION_WERROR + AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile + tests/ossfuzz/Makefile example/Makefile docs/Makefile libssh2.pc]) @@ -395,10 +398,10 @@ AC_MSG_NOTICE([summary of build options: Compiler: ${CC} Compiler flags: ${CFLAGS} Library types: Shared=${enable_shared}, Static=${enable_static} - Crypto library: ${found_crypto} + Crypto library: ${found_crypto_str} Clear memory: $enable_clear_memory Debug build: $enable_debug Build examples: $build_examples Path to sshd: $ac_cv_path_SSHD (only for self-tests) - zlib compression: $ac_cv_libz + zlib compression: ${found_libz} ]) diff --git a/vendor/libssh2/depcomp b/vendor/libssh2/depcomp index 04701da536..6b391623c4 100755 --- a/vendor/libssh2/depcomp +++ b/vendor/libssh2/depcomp @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2005-07-09.11 +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,9 +16,7 @@ scriptversion=2005-07-09.11 # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -29,9 +27,9 @@ scriptversion=2005-07-09.11 case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] @@ -41,11 +39,11 @@ as side-effects. Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. + tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . @@ -58,6 +56,66 @@ EOF ;; esac +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -70,6 +128,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" +# Avoid interferences from the environment. +gccflag= dashmflag= + # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case @@ -81,9 +142,32 @@ if test "$depmode" = hp; then fi if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc fi case "$depmode" in @@ -91,10 +175,22 @@ gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. - "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -102,13 +198,17 @@ gcc3) ;; gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then @@ -116,31 +216,31 @@ gcc) fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. + # The second -e expression handles DOS-style file names with drive + # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. +## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory +## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as -## well. +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -158,8 +258,7 @@ sgi) "$@" -MDupdate "$tmpdepfile" fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -167,99 +266,156 @@ sgi) if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> $depfile - echo >> $depfile - + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> $depfile + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" ;; +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the + # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. - stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` - tmpdepfile="$stripped.u" + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u "$@" -M fi stat=$? - - if test -f "$tmpdepfile"; then : - else - stripped=`echo "$stripped" | sed 's,^.*/,,'` - tmpdepfile="$stripped.u" + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat fi - if test $stat -eq 0; then : - else + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi - - if test -f "$tmpdepfile"; then - outname="$stripped.o" - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" - sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : + # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -271,68 +427,141 @@ icc) sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mecanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; #nosideeffect) # This comment above is used by automake to tell side-effect @@ -345,13 +574,13 @@ dashmstdout) # Remove the call to Libtool. if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do + while test "X$1" != 'X--mode=compile'; do shift done shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -371,18 +600,18 @@ dashmstdout) done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' + # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -396,41 +625,51 @@ makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do + while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift - cleared=no - for arg in "$@"; do + cleared=no eat=no + for arg + do case $cleared in no) set ""; shift cleared=yes ;; esac + if test $eat = yes; then + eat=no + continue + fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done - obj_suffix="`echo $object | sed 's/^.*\././'`" + obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; @@ -441,13 +680,13 @@ cpp) # Remove the call to Libtool. if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do + while test "X$1" != 'X--mode=compile'; do shift done shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -466,10 +705,10 @@ cpp) esac done - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" @@ -479,35 +718,56 @@ cpp) msvisualcpp) # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. + # always write the preprocessed file to stdout. "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + IFS=" " for arg do case "$arg" in + -o) + shift + ;; + $object) + shift + ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; + set fnord "$@" + shift + shift + ;; *) - set fnord "$@" "$arg" - shift - shift - ;; + set fnord "$@" "$arg" + shift + shift + ;; esac done - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + none) exec "$@" ;; @@ -523,8 +783,9 @@ exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" # End: diff --git a/vendor/libssh2/docs/BINDINGS b/vendor/libssh2/docs/BINDINGS index b97758fd9c..471f9be8c9 100644 --- a/vendor/libssh2/docs/BINDINGS +++ b/vendor/libssh2/docs/BINDINGS @@ -10,16 +10,16 @@ Cocoa/Objective-C https://github.com/karelia/libssh2_sftp-Cocoa-wrapper Haskell - FFI bindings - http://hackage.haskell.org/package/libssh2 + FFI bindings - https://hackage.haskell.org/package/libssh2 Perl - Net::SSH2 - http://search.cpan.org/~rkitover/Net-SSH2-0.45/lib/Net/SSH2.pm + Net::SSH2 - https://metacpan.org/pod/Net::SSH2 PHP - ssh2 - http://pecl.php.net/package/ssh2 + ssh2 - https://pecl.php.net/package/ssh2 Python - pylibssh2 - http://www.wallix.org/pylibssh2-project/ + pylibssh2 - https://pypi.python.org/pypi/pylibssh2 Python-ctypes diff --git a/vendor/libssh2/docs/CMakeLists.txt b/vendor/libssh2/docs/CMakeLists.txt index 3e9d165ef8..b69ccced5c 100644 --- a/vendor/libssh2/docs/CMakeLists.txt +++ b/vendor/libssh2/docs/CMakeLists.txt @@ -38,8 +38,10 @@ set(MAN_PAGES libssh2_agent_disconnect.3 libssh2_agent_free.3 libssh2_agent_get_identity.3 + libssh2_agent_get_identity_path.3 libssh2_agent_init.3 libssh2_agent_list_identities.3 + libssh2_agent_set_identity_path.3 libssh2_agent_userauth.3 libssh2_banner_set.3 libssh2_base64_decode.3 @@ -134,6 +136,7 @@ set(MAN_PAGES libssh2_session_free.3 libssh2_session_get_blocking.3 libssh2_session_get_timeout.3 + libssh2_session_handshake.3 libssh2_session_hostkey.3 libssh2_session_init.3 libssh2_session_init_ex.3 @@ -190,6 +193,7 @@ set(MAN_PAGES libssh2_trace.3 libssh2_trace_sethandler.3 libssh2_userauth_authenticated.3 + libssh2_userauth_banner.3 libssh2_userauth_hostbased_fromfile.3 libssh2_userauth_hostbased_fromfile_ex.3 libssh2_userauth_keyboard_interactive.3 @@ -200,6 +204,7 @@ set(MAN_PAGES libssh2_userauth_publickey.3 libssh2_userauth_publickey_fromfile.3 libssh2_userauth_publickey_fromfile_ex.3 + libssh2_userauth_publickey_frommemory.3 libssh2_version.3) include(GNUInstallDirs) diff --git a/vendor/libssh2/docs/HACKING-CRYPTO b/vendor/libssh2/docs/HACKING-CRYPTO new file mode 100644 index 0000000000..85d813aa62 --- /dev/null +++ b/vendor/libssh2/docs/HACKING-CRYPTO @@ -0,0 +1,939 @@ + Definitions needed to implement a specific crypto library + +This document offers some hints about implementing a new crypto library +interface. + +A crypto library interface consists of at least a header file, defining +entities referenced from the libssh2 core modules. +Real code implementation (if needed), is left at the implementor's choice. + +This document lists the entities that must/may be defined in the header file. + +Procedures listed as "void" may indeed have a result type: the void indication +indicates the libssh2 core modules never use the function result. + + +0) Build system. + +Adding a crypto backend to the autotools build system (./configure) is easy: + +0.1) Add one new line in configure.ac + +m4_set_add([crypto_backends], [newname]) + +This automatically creates a --with-crypto=newname option. + +0.2) Add an m4_case stanza to LIBSSH2_CRYPTO_CHECK in acinclude.m4 + +This must check for all required libraries, and if found set and AC_SUBST a +variable with the library linking flags. The recommended method is to use +LIBSSH2_LIB_HAVE_LINKFLAGS from LIBSSH2_CRYPTO_CHECK, which automatically +creates and handles a --with-$newname-prefix option and sets an +LTLIBNEWNAME variable on success. + +0.3) Create Makefile.newname.inc in the top-level directory + +This must set CRYPTO_CSOURCES, CRYPTO_HHEADERS and CRYPTO_LTLIBS. +Set CRYPTO_CSOURCES and CRYPTO_HHEADERS to the new backend source files +and set CRYPTO_LTLIBS to the required library linking parameters, e.g. +$(LTLIBNEWNAME) as generated by by LIBSSH2_LIB_HAVE_LINKFLAGS. + +0.4) Add a new block in src/Makefile.am + +if NEWNAME +include ../Makefile.newname.inc +endif + + +1) Crypto library initialization/termination. + +void libssh2_crypto_init(void); +Initializes the crypto library. May be an empty macro if not needed. + +void libssh2_crypto_exit(void); +Terminates the crypto library use. May be an empty macro if not needed. + + +2) HMAC + +libssh2_hmac_ctx +Type of an HMAC computation context. Generally a struct. +Used for all hash algorithms. + +void libssh2_hmac_ctx_init(libssh2_hmac_ctx ctx); +Initializes the HMAC computation context ctx. +Called before setting-up the hash algorithm. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_hmac_update(libssh2_hmac_ctx ctx, + const unsigned char *data, + int datalen); +Continue computation of an HMAC on datalen bytes at data using context ctx. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_hmac_final(libssh2_hmac_ctx ctx, + unsigned char output[]); +Get the computed HMAC from context ctx into the output buffer. The +minimum data buffer size depends on the HMAC hash algorithm. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_hmac_cleanup(libssh2_hmac_ctx *ctx); +Releases the HMAC computation context at ctx. + + +3) Hash algorithms. + +3.1) SHA-1 +Must always be implemented. + +SHA_DIGEST_LENGTH +#define to 20, the SHA-1 digest length. + +libssh2_sha1_ctx +Type of an SHA-1 computation context. Generally a struct. + +int libssh2_sha1_init(libssh2_sha1_ctx *x); +Initializes the SHA-1 computation context at x. +Returns 1 for success and 0 for failure + +void libssh2_sha1_update(libssh2_sha1_ctx ctx, + const unsigned char *data, + size_t len); +Continue computation of SHA-1 on len bytes at data using context ctx. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_sha1_final(libssh2_sha1_ctx ctx, + unsigned char output[SHA_DIGEST_LEN]); +Get the computed SHA-1 signature from context ctx and store it into the +output buffer. +Release the context. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_hmac_sha1_init(libssh2_hmac_ctx *ctx, + const void *key, + int keylen); +Setup the HMAC computation context ctx for an HMAC-SHA-1 computation using the +keylen-byte key. Is invoked just after libssh2_hmac_ctx_init(). + +3.2) SHA-256 +Must always be implemented. + +SHA256_DIGEST_LENGTH +#define to 32, the SHA-256 digest length. + +libssh2_sha256_ctx +Type of an SHA-256 computation context. Generally a struct. + +int libssh2_sha256_init(libssh2_sha256_ctx *x); +Initializes the SHA-256 computation context at x. +Returns 1 for success and 0 for failure + +void libssh2_sha256_update(libssh2_sha256_ctx ctx, + const unsigned char *data, + size_t len); +Continue computation of SHA-256 on len bytes at data using context ctx. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_sha256_final(libssh2_sha256_ctx ctx, + unsigned char output[SHA256_DIGEST_LENGTH]); +Gets the computed SHA-256 signature from context ctx into the output buffer. +Release the context. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +int libssh2_sha256(const unsigned char *message, + unsigned long len, + unsigned char output[SHA256_DIGEST_LENGTH]); +Computes the SHA-256 signature over the given message of length len and +store the result into the output buffer. +Return 1 if error, else 0. +Note: Seems unused in current code, but defined in each crypto library backend. + +LIBSSH2_HMAC_SHA256 +#define as 1 if the crypto library supports HMAC-SHA-256, else 0. +If defined as 0, the rest of this section can be omitted. + +void libssh2_hmac_sha256_init(libssh2_hmac_ctx *ctx, + const void *key, + int keylen); +Setup the HMAC computation context ctx for an HMAC-256 computation using the +keylen-byte key. Is invoked just after libssh2_hmac_ctx_init(). + +3.3) SHA-384 +Mandatory if ECDSA is implemented. Can be omitted otherwise. + +SHA384_DIGEST_LENGTH +#define to 48, the SHA-384 digest length. + +libssh2_sha384_ctx +Type of an SHA-384 computation context. Generally a struct. + +int libssh2_sha384_init(libssh2_sha384_ctx *x); +Initializes the SHA-384 computation context at x. +Returns 1 for success and 0 for failure + +void libssh2_sha384_update(libssh2_sha384_ctx ctx, + const unsigned char *data, + size_t len); +Continue computation of SHA-384 on len bytes at data using context ctx. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_sha384_final(libssh2_sha384_ctx ctx, + unsigned char output[SHA384_DIGEST_LENGTH]); +Gets the computed SHA-384 signature from context ctx into the output buffer. +Release the context. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +int libssh2_sha384(const unsigned char *message, + unsigned long len, + unsigned char output[SHA384_DIGEST_LENGTH]); +Computes the SHA-384 signature over the given message of length len and +store the result into the output buffer. +Return 1 if error, else 0. + +3.4) SHA-512 +Must always be implemented. + +SHA512_DIGEST_LENGTH +#define to 64, the SHA-512 digest length. + +libssh2_sha512_ctx +Type of an SHA-512 computation context. Generally a struct. + +int libssh2_sha512_init(libssh2_sha512_ctx *x); +Initializes the SHA-512 computation context at x. +Returns 1 for success and 0 for failure + +void libssh2_sha512_update(libssh2_sha512_ctx ctx, + const unsigned char *data, + size_t len); +Continue computation of SHA-512 on len bytes at data using context ctx. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_sha512_final(libssh2_sha512_ctx ctx, + unsigned char output[SHA512_DIGEST_LENGTH]); +Gets the computed SHA-512 signature from context ctx into the output buffer. +Release the context. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +int libssh2_sha512(const unsigned char *message, + unsigned long len, + unsigned char output[SHA512_DIGEST_LENGTH]); +Computes the SHA-512 signature over the given message of length len and +store the result into the output buffer. +Return 1 if error, else 0. +Note: Seems unused in current code, but defined in each crypto library backend. + +LIBSSH2_HMAC_SHA512 +#define as 1 if the crypto library supports HMAC-SHA-512, else 0. +If defined as 0, the rest of this section can be omitted. + +void libssh2_hmac_sha512_init(libssh2_hmac_ctx *ctx, + const void *key, + int keylen); +Setup the HMAC computation context ctx for an HMAC-512 computation using the +keylen-byte key. Is invoked just after libssh2_hmac_ctx_init(). + +3.5) MD5 +LIBSSH2_MD5 +#define to 1 if the crypto library supports MD5, else 0. +If defined as 0, the rest of this section can be omitted. + +MD5_DIGEST_LENGTH +#define to 16, the MD5 digest length. + +libssh2_md5_ctx +Type of an MD5 computation context. Generally a struct. + +int libssh2_md5_init(libssh2_md5_ctx *x); +Initializes the MD5 computation context at x. +Returns 1 for success and 0 for failure + +void libssh2_md5_update(libssh2_md5_ctx ctx, + const unsigned char *data, + size_t len); +Continues computation of MD5 on len bytes at data using context ctx. +Returns 1 for success and 0 for failure. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_md5_final(libssh2_md5_ctx ctx, + unsigned char output[MD5_DIGEST_LENGTH]); +Gets the computed MD5 signature from context ctx into the output buffer. +Release the context. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_hmac_md5_init(libssh2_hmac_ctx *ctx, + const void *key, + int keylen); +Setup the HMAC computation context ctx for an HMAC-MD5 computation using the +keylen-byte key. Is invoked just after libssh2_hmac_ctx_init(). + +3.6) RIPEMD-160 +LIBSSH2_HMAC_RIPEMD +#define as 1 if the crypto library supports HMAC-RIPEMD-160, else 0. +If defined as 0, the rest of this section can be omitted. + +void libssh2_hmac_ripemd160_init(libssh2_hmac_ctx *ctx, + const void *key, + int keylen); +Setup the HMAC computation context ctx for an HMAC-RIPEMD-160 computation using +the keylen-byte key. Is invoked just after libssh2_hmac_ctx_init(). +Returns 1 for success and 0 for failure. + + +4) Bidirectional key ciphers. + +_libssh2_cipher_ctx +Type of a cipher computation context. + +_libssh2_cipher_type(name); +Macro defining name as storage identifying a cipher algorithm for +the crypto library interface. No trailing semicolon. + +int _libssh2_cipher_init(_libssh2_cipher_ctx *h, + _libssh2_cipher_type(algo), + unsigned char *iv, + unsigned char *secret, + int encrypt); +Creates a cipher context for the given algorithm with the initialization vector +iv and the secret key secret. Prepare for encryption or decryption depending on +encrypt. +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_cipher_crypt(_libssh2_cipher_ctx *ctx, + _libssh2_cipher_type(algo), + int encrypt, + unsigned char *block, + size_t blocksize); +Encrypt or decrypt in-place data at (block, blocksize) using the given +context and/or algorithm. +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +void _libssh2_cipher_dtor(_libssh2_cipher_ctx *ctx); +Release cipher context at ctx. + +4.1) AES +4.1.1) AES in CBC block mode. +LIBSSH2_AES +#define as 1 if the crypto library supports AES in CBC mode, else 0. +If defined as 0, the rest of this section can be omitted. + +_libssh2_cipher_aes128 +AES-128-CBC algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +_libssh2_cipher_aes192 +AES-192-CBC algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +_libssh2_cipher_aes256 +AES-256-CBC algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +4.1.2) AES in CTR block mode. +LIBSSH2_AES_CTR +#define as 1 if the crypto library supports AES in CTR mode, else 0. +If defined as 0, the rest of this section can be omitted. + +_libssh2_cipher_aes128ctr +AES-128-CTR algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +_libssh2_cipher_aes192ctr +AES-192-CTR algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +_libssh2_cipher_aes256ctr +AES-256-CTR algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +4.2) Blowfish in CBC block mode. +LIBSSH2_BLOWFISH +#define as 1 if the crypto library supports blowfish in CBC mode, else 0. +If defined as 0, the rest of this section can be omitted. + +_libssh2_cipher_blowfish +Blowfish-CBC algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +4.3) RC4. +LIBSSH2_RC4 +#define as 1 if the crypto library supports RC4 (arcfour), else 0. +If defined as 0, the rest of this section can be omitted. + +_libssh2_cipher_arcfour +RC4 algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +4.4) CAST5 in CBC block mode. +LIBSSH2_CAST +#define 1 if the crypto library supports cast, else 0. +If defined as 0, the rest of this section can be omitted. + +_libssh2_cipher_cast5 +CAST5-CBC algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +4.5) Tripple DES in CBC block mode. +LIBSSH2_3DES +#define as 1 if the crypto library supports TripleDES in CBC mode, else 0. +If defined as 0, the rest of this section can be omitted. + +_libssh2_cipher_3des +TripleDES-CBC algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + + +5) Diffie-Hellman support. + +5.1) Diffie-Hellman context. +_libssh2_dh_ctx +Type of a Diffie-Hellman computation context. +Must always be defined. + +5.2) Diffie-Hellman computation procedures. +void libssh2_dh_init(_libssh2_dh_ctx *dhctx); +Initializes the Diffie-Hellman context at `dhctx'. No effective context +creation needed here. + +int libssh2_dh_key_pair(_libssh2_dh_ctx *dhctx, _libssh2_bn *public, + _libssh2_bn *g, _libssh2_bn *p, int group_order, + _libssh2_bn_ctx *bnctx); +Generates a Diffie-Hellman key pair using base `g', prime `p' and the given +`group_order'. Can use the given big number context `bnctx' if needed. +The private key is stored as opaque in the Diffie-Hellman context `*dhctx' and +the public key is returned in `public'. +0 is returned upon success, else -1. + +int libssh2_dh_secret(_libssh2_dh_ctx *dhctx, _libssh2_bn *secret, + _libssh2_bn *f, _libssh2_bn *p, _libssh2_bn_ctx * bnctx) +Computes the Diffie-Hellman secret from the previously created context `*dhctx', +the public key `f' from the other party and the same prime `p' used at +context creation. The result is stored in `secret'. +0 is returned upon success, else -1. + +void libssh2_dh_dtor(_libssh2_dh_ctx *dhctx) +Destroys Diffie-Hellman context at `dhctx' and resets its storage. + + +6) Big numbers. +Positive multi-byte integers support is sufficient. + +6.1) Computation contexts. +This has a real meaning if the big numbers computations need some context +storage. If not, use a dummy type and functions (macros). + +_libssh2_bn_ctx +Type of multiple precision computation context. May not be empty. if not used, +#define as char, for example. + +_libssh2_bn_ctx _libssh2_bn_ctx_new(void); +Returns a new multiple precision computation context. + +void _libssh2_bn_ctx_free(_libssh2_bn_ctx ctx); +Releases a multiple precision computation context. + +6.2) Computation support. +_libssh2_bn +Type of multiple precision numbers (aka bignumbers or huge integers) for the +crypto library. + +_libssh2_bn * _libssh2_bn_init(void); +Creates a multiple precision number (preset to zero). + +_libssh2_bn * _libssh2_bn_init_from_bin(void); +Create a multiple precision number intended to be set by the +_libssh2_bn_from_bin() function (see below). Unlike _libssh2_bn_init(), this +code may be a dummy initializer if the _libssh2_bn_from_bin() actually +allocates the number. Returns a value of type _libssh2_bn *. + +void _libssh2_bn_free(_libssh2_bn *bn); +Destroys the multiple precision number at bn. + +unsigned long _libssh2_bn_bytes(_libssh2_bn *bn); +Get the number of bytes needed to store the bits of the multiple precision +number at bn. + +unsigned long _libssh2_bn_bits(_libssh2_bn *bn); +Returns the number of bits of multiple precision number at bn. + +int _libssh2_bn_set_word(_libssh2_bn *bn, unsigned long val); +Sets the value of bn to val. +Returns 1 on success, 0 otherwise. + +_libssh2_bn * _libssh2_bn_from_bin(_libssh2_bn *bn, int len, + const unsigned char *val); +Converts the positive integer in big-endian form of length len at val +into a _libssh2_bn and place it in bn. If bn is NULL, a new _libssh2_bn is +created. +Returns a pointer to target _libssh2_bn or NULL if error. + +int _libssh2_bn_to_bin(_libssh2_bn *bn, unsigned char *val); +Converts the absolute value of bn into big-endian form and store it at +val. val must point to _libssh2_bn_bytes(bn) bytes of memory. +Returns the length of the big-endian number. + + +7) Private key algorithms. +Format of an RSA public key: +a) "ssh-rsa". +b) RSA exponent, MSB first, with high order bit = 0. +c) RSA modulus, MSB first, with high order bit = 0. +Each item is preceded by its 32-bit byte length, MSB first. + +Format of a DSA public key: +a) "ssh-dss". +b) p, MSB first, with high order bit = 0. +c) q, MSB first, with high order bit = 0. +d) g, MSB first, with high order bit = 0. +e) pub_key, MSB first, with high order bit = 0. +Each item is preceded by its 32-bit byte length, MSB first. + +Format of an ECDSA public key: +a) "ecdsa-sha2-nistp256" or "ecdsa-sha2-nistp384" or "ecdsa-sha2-nistp521". +b) domain: "nistp256", "nistp384" or "nistp521" matching a). +c) raw public key ("octal"). +Each item is preceded by its 32-bit byte length, MSB first. + +Format of an ED25519 public key: +a) "ssh-ed25519". +b) raw key (32 bytes). +Each item is preceded by its 32-bit byte length, MSB first. + +int _libssh2_pub_priv_keyfile(LIBSSH2_SESSION *session, + unsigned char **method, + size_t *method_len, + unsigned char **pubkeydata, + size_t *pubkeydata_len, + const char *privatekey, + const char *passphrase); +Reads a private key from file privatekey and extract the public key --> +(pubkeydata, pubkeydata_len). Store the associated method (ssh-rsa or ssh-dss) +into (method, method_len). +Both buffers have to be allocated using LIBSSH2_ALLOC(). +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_pub_priv_keyfilememory(LIBSSH2_SESSION *session, + unsigned char **method, + size_t *method_len, + unsigned char **pubkeydata, + size_t *pubkeydata_len, + const char *privatekeydata, + size_t privatekeydata_len, + const char *passphrase); +Gets a private key from bytes at (privatekeydata, privatekeydata_len) and +extract the public key --> (pubkeydata, pubkeydata_len). Store the associated +method (ssh-rsa or ssh-dss) into (method, method_len). +Both buffers have to be allocated using LIBSSH2_ALLOC(). +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + + +7.1) RSA +LIBSSH2_RSA +#define as 1 if the crypto library supports RSA, else 0. +If defined as 0, the rest of this section can be omitted. + +libssh2_rsa_ctx +Type of an RSA computation context. Generally a struct. + +int _libssh2_rsa_new(libssh2_rsa_ctx **rsa, + const unsigned char *edata, + unsigned long elen, + const unsigned char *ndata, + unsigned long nlen, + const unsigned char *ddata, + unsigned long dlen, + const unsigned char *pdata, + unsigned long plen, + const unsigned char *qdata, + unsigned long qlen, + const unsigned char *e1data, + unsigned long e1len, + const unsigned char *e2data, + unsigned long e2len, + const unsigned char *coeffdata, unsigned long coefflen); +Creates a new context for RSA computations from key source values: + pdata, plen Prime number p. Only used if private key known (ddata). + qdata, qlen Prime number q. Only used if private key known (ddata). + ndata, nlen Modulus n. + edata, elen Exponent e. + ddata, dlen e^-1 % phi(n) = private key. May be NULL if unknown. + e1data, e1len dp = d % (p-1). Only used if private key known (dtata). + e2data, e2len dq = d % (q-1). Only used if private key known (dtata). + coeffdata, coefflen q^-1 % p. Only used if private key known. +Returns 0 if OK. +This procedure is already prototyped in crypto.h. +Note: the current generic code only calls this function with e and n (public +key parameters): unless used internally by the backend, it is not needed to +support the private key and the other parameters here. + +int _libssh2_rsa_new_private(libssh2_rsa_ctx **rsa, + LIBSSH2_SESSION *session, + const char *filename, + unsigned const char *passphrase); +Reads an RSA private key from file filename into a new RSA context. +Must call _libssh2_init_if_needed(). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_rsa_new_private_frommemory(libssh2_rsa_ctx **rsa, + LIBSSH2_SESSION *session, + const char *data, + size_t data_len, + unsigned const char *passphrase); +Gets an RSA private key from data into a new RSA context. +Must call _libssh2_init_if_needed(). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_rsa_sha1_verify(libssh2_rsa_ctx *rsa, + const unsigned char *sig, + unsigned long sig_len, + const unsigned char *m, unsigned long m_len); +Verify (sig, sig_len) signature of (m, m_len) using an SHA-1 hash and the +RSA context. +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_rsa_sha1_signv(LIBSSH2_SESSION *session, + unsigned char **sig, size_t *siglen, + int count, const struct iovec vector[], + libssh2_rsa_ctx *ctx); +RSA signs the SHA-1 hash computed over the count data chunks in vector. +Signature is stored at (sig, siglen). +Signature buffer must be allocated from the given session. +Returns 0 if OK, else -1. +Note: this procedure is optional: if provided, it MUST be defined as a macro. + +int _libssh2_rsa_sha1_sign(LIBSSH2_SESSION *session, + libssh2_rsa_ctx *rsactx, + const unsigned char *hash, + size_t hash_len, + unsigned char **signature, + size_t *signature_len); +RSA signs the (hash, hashlen) SHA-1 hash bytes and stores the allocated +signature at (signature, signature_len). +Signature buffer must be allocated from the given session. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. +Note: this procedure is not used if macro _libssh2_rsa_sha1_signv() is defined. + +void _libssh2_rsa_free(libssh2_rsa_ctx *rsactx); +Releases the RSA computation context at rsactx. + +LIBSSH2_RSA_SHA2 +#define as 1 if the crypto library supports RSA SHA2 256/512, else 0. +If defined as 0, the rest of this section can be omitted. + +int _libssh2_rsa_sha2_sign(LIBSSH2_SESSION * session, + libssh2_rsa_ctx * rsactx, + const unsigned char *hash, + size_t hash_len, + unsigned char **signature, + size_t *signature_len); +RSA signs the (hash, hashlen) SHA-2 hash bytes based on hash length and stores +the allocated signature at (signature, signature_len). +Signature buffer must be allocated from the given session. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. +Note: this procedure is not used if macro _libssh2_rsa_sha1_signv() is defined. + +int _libssh2_rsa_sha2_verify(libssh2_rsa_ctx * rsa, + size_t hash_len, + const unsigned char *sig, + unsigned long sig_len, + const unsigned char *m, unsigned long m_len); +Verify (sig, sig_len) signature of (m, m_len) using an SHA-2 hash based on +hash length and the RSA context. +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +7.2) DSA +LIBSSH2_DSA +#define as 1 if the crypto library supports DSA, else 0. +If defined as 0, the rest of this section can be omitted. + + +libssh2_dsa_ctx +Type of a DSA computation context. Generally a struct. + +int _libssh2_dsa_new(libssh2_dsa_ctx **dsa, + const unsigned char *pdata, + unsigned long plen, + const unsigned char *qdata, + unsigned long qlen, + const unsigned char *gdata, + unsigned long glen, + const unsigned char *ydata, + unsigned long ylen, + const unsigned char *x, unsigned long x_len); +Creates a new context for DSA computations from source key values: + pdata, plen Prime number p. Only used if private key known (ddata). + qdata, qlen Prime number q. Only used if private key known (ddata). + gdata, glen G number. + ydata, ylen Public key. + xdata, xlen Private key. Only taken if xlen non-zero. +Returns 0 if OK. +This procedure is already prototyped in crypto.h. + +int _libssh2_dsa_new_private(libssh2_dsa_ctx **dsa, + LIBSSH2_SESSION *session, + const char *filename, + unsigned const char *passphrase); +Gets a DSA private key from file filename into a new DSA context. +Must call _libssh2_init_if_needed(). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_dsa_new_private_frommemory(libssh2_dsa_ctx **dsa, + LIBSSH2_SESSION *session, + const char *data, + size_t data_len, + unsigned const char *passphrase); +Gets a DSA private key from the data_len-bytes data into a new DSA context. +Must call _libssh2_init_if_needed(). +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_dsa_sha1_verify(libssh2_dsa_ctx *dsactx, + const unsigned char *sig, + const unsigned char *m, unsigned long m_len); +Verify (sig, siglen) signature of (m, m_len) using an SHA-1 hash and the +DSA context. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_dsa_sha1_sign(libssh2_dsa_ctx *dsactx, + const unsigned char *hash, + unsigned long hash_len, unsigned char *sig); +DSA signs the (hash, hash_len) data using SHA-1 and store the signature at sig. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +void _libssh2_dsa_free(libssh2_dsa_ctx *dsactx); +Releases the DSA computation context at dsactx. + + +7.3) ECDSA +LIBSSH2_ECDSA +#define as 1 if the crypto library supports ECDSA, else 0. +If defined as 0, _libssh2_ec_key should be defined as void and the rest of +this section can be omitted. + +EC_MAX_POINT_LEN +Maximum point length. Usually defined as ((528 * 2 / 8) + 1) (= 133). + +libssh2_ecdsa_ctx +Type of an ECDSA computation context. Generally a struct. + +_libssh2_ec_key +Type of an elliptic curve key. + +libssh2_curve_type +An enum type defining curve types. Current supported identifiers are: + LIBSSH2_EC_CURVE_NISTP256 + LIBSSH2_EC_CURVE_NISTP384 + LIBSSH2_EC_CURVE_NISTP521 + +int _libssh2_ecdsa_create_key(_libssh2_ec_key **out_private_key, + unsigned char **out_public_key_octal, + size_t *out_public_key_octal_len, + libssh2_curve_type curve_type); +Create a new ECDSA private key of type curve_type and return it at +out_private_key. If out_public_key_octal is not NULL, store an allocated +pointer to the associated public key in "octal" form in it and its length +at out_public_key_octal_len. +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ecdsa_new_private(libssh2_ecdsa_ctx **ec_ctx, + LIBSSH2_SESSION * session, + const char *filename, + unsigned const char *passphrase); +Reads an ECDSA private key from PEM file filename into a new ECDSA context. +Must call _libssh2_init_if_needed(). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ecdsa_new_private_frommemory(libssh2_ecdsa_ctx ** ec_ctx, + LIBSSH2_SESSION * session, + const char *filedata, + size_t filedata_len, + unsigned const char *passphrase); +Builds an ECDSA private key from PEM data at filedata of length filedata_len +into a new ECDSA context stored at ec_ctx. +Must call _libssh2_init_if_needed(). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ecdsa_curve_name_with_octal_new(libssh2_ecdsa_ctx **ecdsactx, + const unsigned char *k, + size_t k_len, + libssh2_curve_type type); +Stores at ecdsactx a new ECDSA context associated with the given curve type +and with "octal" form public key (k, k_len). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ecdsa_new_openssh_private(libssh2_ecdsa_ctx **ec_ctx, + LIBSSH2_SESSION * session, + const char *filename, + unsigned const char *passphrase); +Reads a PEM-encoded ECDSA private key from file filename encrypted with +passphrase and stores at ec_ctx a new ECDSA context for it. +Return 0 if OK, else -1. +Currently used only from openssl backend (ought to be private). +This procedure is already prototyped in crypto.h. + +int _libssh2_ecdsa_sign(LIBSSH2_SESSION *session, libssh2_ecdsa_ctx *ec_ctx, + const unsigned char *hash, unsigned long hash_len, + unsigned char **signature, size_t *signature_len); +ECDSA signs the (hash, hashlen) hash bytes and stores the allocated +signature at (signature, signature_len). Hash algorithm used should be +SHA-256, SHA-384 or SHA-512 depending on type stored in ECDSA context at ec_ctx. +Signature buffer must be allocated from the given session. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ecdsa_verify(libssh2_ecdsa_ctx *ctx, + const unsigned char *r, size_t r_len, + const unsigned char *s, size_t s_len, + const unsigned char *m, size_t m_len); +Verify the ECDSA signature made of (r, r_len) and (s, s_len) of (m, m_len) +using the hash algorithm configured in the ECDSA context ctx. +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +libssh2_curve_type _libssh2_ecdsa_get_curve_type(libssh2_ecdsa_ctx *ecdsactx); +Returns the curve type associated with given context. +This procedure is already prototyped in crypto.h. + +int _libssh2_ecdsa_curve_type_from_name(const char *name, + libssh2_curve_type *out_type); +Stores in out_type the curve type matching string name of the form +"ecdsa-sha2-nistpxxx". +Return 0 if OK, else -1. +Currently used only from openssl backend (ought to be private). +This procedure is already prototyped in crypto.h. + +void _libssh2_ecdsa_free(libssh2_ecdsa_ctx *ecdsactx); +Releases the ECDSA computation context at ecdsactx. + + +7.4) ED25519 +LIBSSH2_ED25519 +#define as 1 if the crypto library supports ED25519, else 0. +If defined as 0, the rest of this section can be omitted. + + +libssh2_ed25519_ctx +Type of an ED25519 computation context. Generally a struct. + +int _libssh2_curve25519_new(LIBSSH2_SESSION *session, libssh2_ed25519_ctx **ctx, + uint8_t **out_public_key, + uint8_t **out_private_key); +Generates an ED25519 key pair, stores a pointer to them at out_private_key +and out_public_key respectively and stores at ctx a new ED25519 context for +this key. +Argument ctx, out_private_key and out_public key may be NULL to disable storing +the corresponding value. +Length of each key is LIBSSH2_ED25519_KEY_LEN (32 bytes). +Key buffers are allocated and should be released by caller after use. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ed25519_new_private(libssh2_ed25519_ctx **ed_ctx, + LIBSSH2_SESSION *session, + const char *filename, + const uint8_t *passphrase); +Reads an ED25519 private key from PEM file filename into a new ED25519 context. +Must call _libssh2_init_if_needed(). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ed25519_new_public(libssh2_ed25519_ctx **ed_ctx, + LIBSSH2_SESSION *session, + const unsigned char *raw_pub_key, + const uint8_t key_len); +Stores at ed_ctx a new ED25519 key context for raw public key (raw_pub_key, +key_len). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ed25519_new_private_frommemory(libssh2_ed25519_ctx **ed_ctx, + LIBSSH2_SESSION *session, + const char *filedata, + size_t filedata_len, + unsigned const char *passphrase); +Builds an ED25519 private key from PEM data at filedata of length filedata_len +into a new ED25519 context stored at ed_ctx. +Must call _libssh2_init_if_needed(). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ed25519_sign(libssh2_ed25519_ctx *ctx, LIBSSH2_SESSION *session, + uint8_t **out_sig, size_t *out_sig_len, + const uint8_t *message, size_t message_len); +ED25519 signs the (message, message_len) bytes and stores the allocated +signature at (sig, sig_len). +Signature buffer is allocated from the given session. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ed25519_verify(libssh2_ed25519_ctx *ctx, const uint8_t *s, + size_t s_len, const uint8_t *m, size_t m_len); +Verify (s, s_len) signature of (m, m_len) using the given ED25519 context. +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_curve25519_gen_k(_libssh2_bn **k, + uint8_t private_key[LIBSSH2_ED25519_KEY_LEN], + uint8_t srvr_public_key[LIBSSH2_ED25519_KEY_LEN]); +Computes a shared ED25519 secret key from the given raw server public key and +raw client public key and stores it as a big number in *k. Big number should +have been initialized before calling this function. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +void _libssh2_ed25519_free(libssh2_ed25519_ctx *ed25519ctx); +Releases the ED25519 computation context at ed25519ctx. + + +8) Miscellaneous + +void libssh2_prepare_iovec(struct iovec *vector, unsigned int len); +Prepare len consecutive iovec slots before using them. +In example, this is needed to preset unused structure slacks on platforms +requiring it. +If this is not needed, it should be defined as an empty macro. + +int _libssh2_random(unsigned char *buf, int len); +Store len random bytes at buf. +Returns 0 if OK, else -1. + +const char * _libssh2_supported_key_sign_algorithms(LIBSSH2_SESSION *session, + unsigned char *key_method, + size_t key_method_len); + +This function is for implementing key hash upgrading as defined in RFC 8332. + +Based on the incoming key_method value, this function will return a +list of supported algorithms that can upgrade the original key method algorithm +as a comma seperated list, if there is no upgrade option this function should +return NULL. diff --git a/vendor/libssh2/docs/HACKING.CRYPTO b/vendor/libssh2/docs/HACKING.CRYPTO deleted file mode 100644 index a8a6a0618b..0000000000 --- a/vendor/libssh2/docs/HACKING.CRYPTO +++ /dev/null @@ -1,593 +0,0 @@ - Definitions needed to implement a specific crypto library - -This document offers some hints about implementing a new crypto library -interface. - -A crypto library interface consists of at least a header file, defining -entities referenced from the libssh2 core modules. -Real code implementation (if needed), is left at the implementor's choice. - -This document lists the entities that must/may be defined in the header file. - -Procedures listed as "void" may indeed have a result type: the void indication -indicates the libssh2 core modules never use the function result. - - -1) Crypto library initialization/termination. - -void libssh2_crypto_init(void); -Initializes the crypto library. May be an empty macro if not needed. - -void libssh2_crypto_exit(void); -Terminates the crypto library use. May be an empty macro if not needed. - - -2) HMAC - -libssh2_hmac_ctx -Type of an HMAC computation context. Generally a struct. -Used for all hash algorithms. - -void libssh2_hmac_ctx_init(libssh2_hmac_ctx ctx); -Initializes the HMAC computation context ctx. -Called before setting-up the hash algorithm. -Note: if the ctx parameter is modified by the underlying code, -this procedure must be implemented as a macro to map ctx --> &ctx. - -void libssh2_hmac_update(libssh2_hmac_ctx ctx, - const unsigned char *data, - int datalen); -Continue computation of an HMAC on datalen bytes at data using context ctx. -Note: if the ctx parameter is modified by the underlying code, -this procedure must be implemented as a macro to map ctx --> &ctx. - -void libssh2_hmac_final(libssh2_hmac_ctx ctx, - unsigned char output[]); -Get the computed HMAC from context ctx into the output buffer. The -minimum data buffer size depends on the HMAC hash algorithm. -Note: if the ctx parameter is modified by the underlying code, -this procedure must be implemented as a macro to map ctx --> &ctx. - -void libssh2_hmac_cleanup(libssh2_hmac_ctx *ctx); -Releases the HMAC computation context at ctx. - - -3) Hash algorithms. - -3.1) SHA-1 -Must always be implemented. - -SHA_DIGEST_LENGTH -#define to 20, the SHA-1 digest length. - -libssh2_sha1_ctx -Type of an SHA1 computation context. Generally a struct. - -int libssh2_sha1_init(libssh2_sha1_ctx *x); -Initializes the SHA-1 computation context at x. -Returns 1 for success and 0 for failure - -void libssh2_sha1_update(libssh2_sha1_ctx ctx, - const unsigned char *data, - size_t len); -Continue computation of SHA-1 on len bytes at data using context ctx. -Note: if the ctx parameter is modified by the underlying code, -this procedure must be implemented as a macro to map ctx --> &ctx. - -void libssh2_sha1_final(libssh2_sha1_ctx ctx, - unsigned char output[SHA1_DIGEST_LEN]); -Get the computed SHA-1 signature from context ctx and store it into the -output buffer. -Release the context. -Note: if the ctx parameter is modified by the underlying code, -this procedure must be implemented as a macro to map ctx --> &ctx. - -void libssh2_hmac_sha1_init(libssh2_hmac_ctx *ctx, - const void *key, - int keylen); -Setup the HMAC computation context ctx for an HMAC-SHA-1 computation using the -keylen-byte key. Is invoked just after libssh2_hmac_ctx_init(). - -3.2) SHA-256 -Must always be implemented. - -SHA256_DIGEST_LENGTH -#define to 32, the SHA-256 digest length. - -libssh2_sha256_ctx -Type of an SHA-256 computation context. Generally a struct. - -int libssh2_sha256_init(libssh2_sha256_ctx *x); -Initializes the SHA-256 computation context at x. -Returns 1 for success and 0 for failure - -void libssh2_sha256_update(libssh2_sha256_ctx ctx, - const unsigned char *data, - size_t len); -Continue computation of SHA-256 on len bytes at data using context ctx. -Note: if the ctx parameter is modified by the underlying code, -this procedure must be implemented as a macro to map ctx --> &ctx. - -void libssh2_sha256_final(libssh2_sha256_ctx ctx, - unsigned char output[SHA256_DIGEST_LENGTH]); -Gets the computed SHA-256 signature from context ctx into the output buffer. -Release the context. -Note: if the ctx parameter is modified by the underlying code, -this procedure must be implemented as a macro to map ctx --> &ctx. - -int libssh2_sha256(const unsigned char *message, - unsigned long len, - unsigned char output[SHA256_DIGEST_LENGTH]); -Computes the SHA-256 signature over the given message of length len and -store the result into the output buffer. -Return 1 if error, else 0. -Note: Seems unused in current code, but defined in each crypto library backend. - -LIBSSH2_HMAC_SHA256 -#define as 1 if the crypto library supports HMAC-SHA-256, else 0. -If defined as 0, the rest of this section can be omitted. - -void libssh2_hmac_sha256_init(libssh2_hmac_ctx *ctx, - const void *key, - int keylen); -Setup the HMAC computation context ctx for an HMAC-256 computation using the -keylen-byte key. Is invoked just after libssh2_hmac_ctx_init(). - -3.3) SHA-512 -LIBSSH2_HMAC_SHA512 -#define as 1 if the crypto library supports HMAC-SHA-512, else 0. -If defined as 0, the rest of this section can be omitted. - -SHA512_DIGEST_LENGTH -#define to 64, the SHA-512 digest length. - -void libssh2_hmac_sha512_init(libssh2_hmac_ctx *ctx, - const void *key, - int keylen); -Setup the HMAC computation context ctx for an HMAC-512 computation using the -keylen-byte key. Is invoked just after libssh2_hmac_ctx_init(). - -3.4) MD5 -LIBSSH2_MD5 -#define to 1 if the crypto library supports MD5, else 0. -If defined as 0, the rest of this section can be omitted. - -MD5_DIGEST_LENGTH -#define to 16, the MD5 digest length. - -libssh2_md5_ctx -Type of an MD5 computation context. Generally a struct. - -int libssh2_md5_init(libssh2_md5_ctx *x); -Initializes the MD5 computation context at x. -Returns 1 for success and 0 for failure - -void libssh2_md5_update(libssh2_md5_ctx ctx, - const unsigned char *data, - size_t len); -Continues computation of MD5 on len bytes at data using context ctx. -Returns 1 for success and 0 for failure. -Note: if the ctx parameter is modified by the underlying code, -this procedure must be implemented as a macro to map ctx --> &ctx. - -void libssh2_md5_final(libssh2_md5_ctx ctx, - unsigned char output[MD5_DIGEST_LENGTH]); -Gets the computed MD5 signature from context ctx into the output buffer. -Release the context. -Note: if the ctx parameter is modified by the underlying code, -this procedure must be implemented as a macro to map ctx --> &ctx. - -void libssh2_hmac_md5_init(libssh2_hmac_ctx *ctx, - const void *key, - int keylen); -Setup the HMAC computation context ctx for an HMAC-MD5 computation using the -keylen-byte key. Is invoked just after libssh2_hmac_ctx_init(). - -3.5) RIPEMD-160 -LIBSSH2_HMAC_RIPEMD -#define as 1 if the crypto library supports HMAC-RIPEMD-160, else 0. -If defined as 0, the rest of this section can be omitted. - -void libssh2_hmac_ripemd160_init(libssh2_hmac_ctx *ctx, - const void *key, - int keylen); -Setup the HMAC computation context ctx for an HMAC-RIPEMD-160 computation using -the keylen-byte key. Is invoked just after libssh2_hmac_ctx_init(). -Returns 1 for success and 0 for failure. - - -4) Bidirectional Key ciphers. - -_libssh2_cipher_ctx -Type of a cipher computation context. - -_libssh2_cipher_type(name); -Macro defining name as storage identifying a cipher algorithm for -the crypto library interface. No trailing semicolon. - -int _libssh2_cipher_init(_libssh2_cipher_ctx *h, - _libssh2_cipher_type(algo), - unsigned char *iv, - unsigned char *secret, - int encrypt); -Creates a cipher context for the given algorithm with the initialization vector -iv and the secret key secret. Prepare for encryption or decryption depending on -encrypt. -Return 0 if OK, else -1. -This procedure is already prototyped in crypto.h. - -int _libssh2_cipher_crypt(_libssh2_cipher_ctx *ctx, - _libssh2_cipher_type(algo), - int encrypt, - unsigned char *block, - size_t blocksize); -Encrypt or decrypt in-place data at (block, blocksize) using the given -context and/or algorithm. -Return 0 if OK, else -1. -This procedure is already prototyped in crypto.h. - -void _libssh2_cipher_dtor(_libssh2_cipher_ctx *ctx); -Release cipher context at ctx. - -4.1) AES -4.1.1) AES in CBC block mode. -LIBSSH2_AES -#define as 1 if the crypto library supports AES in CBC mode, else 0. -If defined as 0, the rest of this section can be omitted. - -_libssh2_cipher_aes128 -AES-128-CBC algorithm identifier initializer. -#define with constant value of type _libssh2_cipher_type(). - -_libssh2_cipher_aes192 -AES-192-CBC algorithm identifier initializer. -#define with constant value of type _libssh2_cipher_type(). - -_libssh2_cipher_aes256 -AES-256-CBC algorithm identifier initializer. -#define with constant value of type _libssh2_cipher_type(). - -4.1.2) AES in CTR block mode. -LIBSSH2_AES_CTR -#define as 1 if the crypto library supports AES in CTR mode, else 0. -If defined as 0, the rest of this section can be omitted. - -void _libssh2_init_aes_ctr(void); -Initialize static AES CTR ciphers. -This procedure is already prototyped in crypto.h. - -_libssh2_cipher_aes128ctr -AES-128-CTR algorithm identifier initializer. -#define with constant value of type _libssh2_cipher_type(). - -_libssh2_cipher_aes192ctr -AES-192-CTR algorithm identifier initializer. -#define with constant value of type _libssh2_cipher_type(). - -_libssh2_cipher_aes256ctr -AES-256-CTR algorithm identifier initializer. -#define with constant value of type _libssh2_cipher_type(). - -4.2) Blowfish in CBC block mode. -LIBSSH2_BLOWFISH -#define as 1 if the crypto library supports blowfish in CBC mode, else 0. -If defined as 0, the rest of this section can be omitted. - -_libssh2_cipher_blowfish -Blowfish-CBC algorithm identifier initializer. -#define with constant value of type _libssh2_cipher_type(). - -4.3) RC4. -LIBSSH2_RC4 -#define as 1 if the crypto library supports RC4 (arcfour), else 0. -If defined as 0, the rest of this section can be omitted. - -_libssh2_cipher_arcfour -RC4 algorithm identifier initializer. -#define with constant value of type _libssh2_cipher_type(). - -4.4) CAST5 in CBC block mode. -LIBSSH2_CAST -#define 1 if the crypto library supports cast, else 0. -If defined as 0, the rest of this section can be omitted. - -_libssh2_cipher_cast5 -CAST5-CBC algorithm identifier initializer. -#define with constant value of type _libssh2_cipher_type(). - -4.5) Tripple DES in CBC block mode. -LIBSSH2_3DES -#define as 1 if the crypto library supports TripleDES in CBC mode, else 0. -If defined as 0, the rest of this section can be omitted. - -_libssh2_cipher_3des -TripleDES-CBC algorithm identifier initializer. -#define with constant value of type _libssh2_cipher_type(). - - -5) Big numbers. -Positive multi-byte integers support is sufficient. - -5.1) Computation contexts. -This has a real meaning if the big numbers computations need some context -storage. If not, use a dummy type and functions (macros). - -_libssh2_bn_ctx -Type of multiple precision computation context. May not be empty. if not used, -#define as char, for example. - -libssh2_bn_ctx _libssh2_bn_ctx_new(void); -Returns a new multiple precision computation context. - -void _libssh2_bn_ctx_free(_libssh2_bn_ctx ctx); -Releases a multiple precision computation context. - -5.2) Computation support. -_libssh2_bn -Type of multiple precision numbers (aka bignumbers or huge integers) for the -crypto library. - -_libssh2_bn * _libssh2_bn_init(void); -Creates a multiple precision number (preset to zero). - -_libssh2_bn * _libssh2_bn_init_from_bin(void); -Create a multiple precision number intended to be set by the -_libssh2_bn_from_bin() function (see below). Unlike _libssh2_bn_init(), this -code may be a dummy initializer if the _libssh2_bn_from_bin() actually -allocates the number. Returns a value of type _libssh2_bn *. - -void _libssh2_bn_free(_libssh2_bn *bn); -Destroys the multiple precision number at bn. - -unsigned long _libssh2_bn_bytes(libssh2_bn *bn); -Get the number of bytes needed to store the bits of the multiple precision -number at bn. - -unsigned long _libssh2_bn_bits(_libssh2_bn *bn); -Returns the number of bits of multiple precision number at bn. - -int _libssh2_bn_set_word(_libssh2_bn *bn, unsigned long val); -Sets the value of bn to val. -Returns 1 on success, 0 otherwise. - -_libssh2_bn * _libssh2_bn_from_bin(_libssh2_bn *bn, int len, - const unsigned char *val); -Converts the positive integer in big-endian form of length len at val -into a _libssh2_bn and place it in bn. If bn is NULL, a new _libssh2_bn is -created. -Returns a pointer to target _libssh2_bn or NULL if error. - -int _libssh2_bn_to_bin(_libssh2_bn *bn, unsigned char *val); -Converts the absolute value of bn into big-endian form and store it at -val. val must point to _libssh2_bn_bytes(bn) bytes of memory. -Returns the length of the big-endian number. - -void _libssh2_bn_rand(_libssh2_bn *bn, int bits, int top, int bottom); -Generates a cryptographically strong pseudo-random number of bits in -length and stores it in bn. If top is -1, the most significant bit of the -random number can be zero. If top is 0, it is set to 1, and if top is 1, the -two most significant bits of the number will be set to 1, so that the product -of two such random numbers will always have 2*bits length. If bottom is true, -the number will be odd. - -void _libssh2_bn_mod_exp(_libssh2_bn *r, _libssh2_bn *a, - _libssh2_bn *p, _libssh2_bn *m, - _libssh2_bn_ctx *ctx); -Computes a to the p-th power modulo m and stores the result into r (r=a^p % m). -May use the given context. - - -6) Private key algorithms. -Format of an RSA public key: -a) "ssh-rsa". -b) RSA exponent, MSB first, with high order bit = 0. -c) RSA modulus, MSB first, with high order bit = 0. -Each item is preceded by its 32-bit byte length, MSB first. - -Format of a DSA public key: -a) "ssh-dss". -b) p, MSB first, with high order bit = 0. -c) q, MSB first, with high order bit = 0. -d) g, MSB first, with high order bit = 0. -e) pub_key, MSB first, with high order bit = 0. -Each item is preceded by its 32-bit byte length, MSB first. - -int _libssh2_pub_priv_keyfile(LIBSSH2_SESSION *session, - unsigned char **method, - size_t *method_len, - unsigned char **pubkeydata, - size_t *pubkeydata_len, - const char *privatekey, - const char *passphrase); -Reads a private key from file privatekey and extract the public key --> -(pubkeydata, pubkeydata_len). Store the associated method (ssh-rsa or ssh-dss) -into (method, method_len). -Both buffers have to be allocated using LIBSSH2_ALLOC(). -Returns 0 if OK, else -1. -This procedure is already prototyped in crypto.h. - -int _libssh2_pub_priv_keyfilememory(LIBSSH2_SESSION *session, - unsigned char **method, - size_t *method_len, - unsigned char **pubkeydata, - size_t *pubkeydata_len, - const char *privatekeydata, - size_t privatekeydata_len, - const char *passphrase); -Gets a private key from bytes at (privatekeydata, privatekeydata_len) and -extract the public key --> (pubkeydata, pubkeydata_len). Store the associated -method (ssh-rsa or ssh-dss) into (method, method_len). -Both buffers have to be allocated using LIBSSH2_ALLOC(). -Returns 0 if OK, else -1. -This procedure is already prototyped in crypto.h. - -6.1) RSA -LIBSSH2_RSA -#define as 1 if the crypto library supports RSA, else 0. -If defined as 0, the rest of this section can be omitted. - -libssh2_rsa_ctx -Type of an RSA computation context. Generally a struct. - -int _libssh2_rsa_new(libssh2_rsa_ctx **rsa, - const unsigned char *edata, - unsigned long elen, - const unsigned char *ndata, - unsigned long nlen, - const unsigned char *ddata, - unsigned long dlen, - const unsigned char *pdata, - unsigned long plen, - const unsigned char *qdata, - unsigned long qlen, - const unsigned char *e1data, - unsigned long e1len, - const unsigned char *e2data, - unsigned long e2len, - const unsigned char *coeffdata, unsigned long coefflen); -Creates a new context for RSA computations from key source values: - pdata, plen Prime number p. Only used if private key known (ddata). - qdata, qlen Prime number q. Only used if private key known (ddata). - ndata, nlen Modulus n. - edata, elen Exponent e. - ddata, dlen e^-1 % phi(n) = private key. May be NULL if unknown. - e1data, e1len dp = d % (p-1). Only used if private key known (dtata). - e2data, e2len dq = d % (q-1). Only used if private key known (dtata). - coeffdata, coefflen q^-1 % p. Only used if private key known. -Returns 0 if OK. -This procedure is already prototyped in crypto.h. -Note: the current generic code only calls this function with e and n (public -key parameters): unless used internally by the backend, it is not needed to -support the private key and the other parameters here. - -int _libssh2_rsa_new_private(libssh2_rsa_ctx **rsa, - LIBSSH2_SESSION *session, - const char *filename, - unsigned const char *passphrase); -Reads an RSA private key from file filename into a new RSA context. -Must call _libssh2_init_if_needed(). -Return 0 if OK, else -1. -This procedure is already prototyped in crypto.h. - -int _libssh2_rsa_new_private_frommemory(libssh2_rsa_ctx **rsa, - LIBSSH2_SESSION *session, - const char *data, - size_t data_len, - unsigned const char *passphrase); -Gets an RSA private key from data into a new RSA context. -Must call _libssh2_init_if_needed(). -Return 0 if OK, else -1. -This procedure is already prototyped in crypto.h. - -int _libssh2_rsa_sha1_verify(libssh2_rsa_ctx *rsa, - const unsigned char *sig, - unsigned long sig_len, - const unsigned char *m, unsigned long m_len); -Verify (sig, siglen) signature of (m, m_len) using an SHA-1 hash and the -RSA context. -Return 0 if OK, else -1. -This procedure is already prototyped in crypto.h. - -int _libssh2_rsa_sha1_signv(LIBSSH2_SESSION *session, - unsigned char **sig, size_t *siglen, - int count, const struct iovec vector[], - libssh2_rsa_ctx *ctx); -RSA signs the SHA-1 hash computed over the count data chunks in vector. -Signature is stored at (sig, siglen). -Signature buffer must be allocated from the given session. -Returns 0 if OK, else -1. -Note: this procedure is optional: if provided, it MUST be defined as a macro. - -int _libssh2_rsa_sha1_sign(LIBSSH2_SESSION *session, - libssh2_rsa_ctx *rsactx, - const unsigned char *hash, - size_t hash_len, - unsigned char **signature, - size_t *signature_len); -RSA signs the (hash, hashlen) SHA-1 hash bytes and stores the allocated -signature at (signature, signature_len). -Signature buffer must be allocated from the given session. -Returns 0 if OK, else -1. -This procedure is already prototyped in crypto.h. -Note: this procedure is not used if macro _libssh2_rsa_sha1_signv() is defined. - -void _libssh2_rsa_free(libssh2_rsa_ctx *rsactx); -Releases the RSA computation context at rsactx. - - -6.2) DSA -LIBSSH2_DSA -#define as 1 if the crypto library supports DSA, else 0. -If defined as 0, the rest of this section can be omitted. - - -libssh2_dsa_ctx -Type of a DSA computation context. Generally a struct. - -int _libssh2_dsa_new(libssh2_dsa_ctx **dsa, - const unsigned char *pdata, - unsigned long plen, - const unsigned char *qdata, - unsigned long qlen, - const unsigned char *gdata, - unsigned long glen, - const unsigned char *ydata, - unsigned long ylen, - const unsigned char *x, unsigned long x_len); -Creates a new context for DSA computations from source key values: - pdata, plen Prime number p. Only used if private key known (ddata). - qdata, qlen Prime number q. Only used if private key known (ddata). - gdata, glen G number. - ydata, ylen Public key. - xdata, xlen Private key. Only taken if xlen non-zero. -Returns 0 if OK. -This procedure is already prototyped in crypto.h. - -int _libssh2_dsa_new_private(libssh2_dsa_ctx **dsa, - LIBSSH2_SESSION *session, - const char *filename, - unsigned const char *passphrase); -Gets a DSA private key from file filename into a new DSA context. -Must call _libssh2_init_if_needed(). -Return 0 if OK, else -1. -This procedure is already prototyped in crypto.h. - -int _libssh2_dsa_new_private_frommemory(libssh2_dsa_ctx **dsa, - LIBSSH2_SESSION *session, - const char *data, - size_t data_len, - unsigned const char *passphrase); -Gets a DSA private key from the data_len-bytes data into a new DSA context. -Must call _libssh2_init_if_needed(). -Returns 0 if OK, else -1. -This procedure is already prototyped in crypto.h. - -int _libssh2_dsa_sha1_verify(libssh2_dsa_ctx *dsactx, - const unsigned char *sig, - const unsigned char *m, unsigned long m_len); -Verify (sig, siglen) signature of (m, m_len) using an SHA1 hash and the -DSA context. -Returns 0 if OK, else -1. -This procedure is already prototyped in crypto.h. - -int _libssh2_dsa_sha1_sign(libssh2_dsa_ctx *dsactx, - const unsigned char *hash, - unsigned long hash_len, unsigned char *sig); -DSA signs the (hash, hash_len) data using SHA-1 and store the signature at sig. -Returns 0 if OK, else -1. -This procedure is already prototyped in crypto.h. - -void _libssh2_dsa_free(libssh2_dsa_ctx *dsactx); -Releases the DSA computation context at dsactx. - - -7) Miscellaneous - -void libssh2_prepare_iovec(struct iovec *vector, unsigned int len); -Prepare len consecutive iovec slots before using them. -In example, this is needed to preset unused structure slacks on platforms -requiring it. -If this is not needed, it should be defined as an empty macro. - -void _libssh2_random(unsigned char *buf, int len); -Store len random bytes at buf. diff --git a/vendor/libssh2/docs/INSTALL_AUTOTOOLS b/vendor/libssh2/docs/INSTALL_AUTOTOOLS index bc5a0eb25a..a75b51814d 100644 --- a/vendor/libssh2/docs/INSTALL_AUTOTOOLS +++ b/vendor/libssh2/docs/INSTALL_AUTOTOOLS @@ -7,6 +7,22 @@ Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. +When Building directly from Master +================================== + +If you want to build directly from the git repository, you must first +generate the configure script and Makefile using autotools. There is +a convenience script that calls all tools in the correct order. Make +sure that autoconf, automake and libtool are installed on your system, +then execute: + + autoreconf -fi + +After executing this script, you can build the project as usual: + + ./configure + make + Basic Installation ================== @@ -284,8 +300,8 @@ Some ./configure options deserve additional comments: * --with-libgcrypt-prefix=DIR libssh2 can use the Libgcrypt library - (http://www.gnupg.org/) for cryptographic operations. - Either Libgcrypt or OpenSSL is required. + (https://www.gnupg.org/) for cryptographic operations. + One of the cryptographic libraries is required. Configure will attempt to locate Libgcrypt automatically. @@ -298,8 +314,8 @@ Some ./configure options deserve additional comments: * --with-libssl-prefix=[DIR] libssh2 can use the OpenSSL library - (http://www.openssl.org) for cryptographic operations. - Either Libgcrypt or OpenSSL is required. + (https://www.openssl.org) for cryptographic operations. + One of the cryptographic libraries is required. Configure will attempt to locate OpenSSL in the default location. @@ -307,6 +323,20 @@ Some ./configure options deserve additional comments: If your installation of OpenSSL is in another location, specify it using --with-libssl-prefix. + * --with-mbedtls + * --without-mbedtls + * --with-libmbedtls-prefix=[DIR] + + libssh2 can use the mbedTLS library + (https://tls.mbed.org) for cryptographic operations. + One of the cryptographic libraries is required. + + Configure will attempt to locate mbedTLS in the + default location. + + If your installation of mbedTLS is in another + location, specify it using --with-libmbedtls-prefix. + * --with-libz * --without-libz * --with-libz-prefix=[DIR] diff --git a/vendor/libssh2/docs/INSTALL_CMAKE b/vendor/libssh2/docs/INSTALL_CMAKE deleted file mode 100644 index 7040370590..0000000000 --- a/vendor/libssh2/docs/INSTALL_CMAKE +++ /dev/null @@ -1,174 +0,0 @@ -License: see COPYING - -Source code: https://github.com/libssh2/libssh2 - -Web site source code: https://github.com/libssh2/www - -Installation instructions are in docs/INSTALL -======= -To build libssh2 you will need CMake v2.8 or later [1] and one of the -following cryptography libraries: - -* OpenSSL -* Libgcrypt -* WinCNG - -Getting started ---------------- - -If you are happy with the default options, make a new build directory, -change to it, configure the build environment and build the project: - - mkdir bin - cd bin - cmake .. - cmake --build . - -libssh2 will be built as a static library and will use any -cryptography library available. The library binary will be put in -`bin/src`, with the examples in `bin/example` and the tests in -`bin/tests`. - -Customising the build ---------------------- - -Of course, you might want to customise the build options. You can -pass the options to CMake on the command line: - - cmake -D