├── bindings ├── bindings-linux-aarch64.rs ├── bindings-linux-x86_64.rs ├── bindings-macos-aarch64.rs ├── bindings-macos-x86_64.rs ├── bindings-windows-x86_64.rs └── bindings-windows-x86_64-R4.2.rs ├── .gitignore ├── Cargo.toml ├── LICENSE ├── MAINTAINERS_GUIDE.md ├── .github └── workflows │ ├── doc.yml │ ├── non-api-call.yml │ └── test.yml ├── wrapper.h ├── ci-cargo.ps1 ├── CHANGELOG.md ├── CONTRIBUTING.md ├── nonAPI.txt ├── CODE-OF-CONDUCT.md ├── src └── lib.rs └── README.md /bindings/bindings-linux-aarch64.rs: -------------------------------------------------------------------------------- 1 | ./bindings-linux-aarch64-R4.4.rs -------------------------------------------------------------------------------- /bindings/bindings-linux-x86_64.rs: -------------------------------------------------------------------------------- 1 | ./bindings-linux-x86_64-R4.4.rs -------------------------------------------------------------------------------- /bindings/bindings-macos-aarch64.rs: -------------------------------------------------------------------------------- 1 | ./bindings-macos-aarch64-R4.4.rs -------------------------------------------------------------------------------- /bindings/bindings-macos-x86_64.rs: -------------------------------------------------------------------------------- 1 | ./bindings-macos-x86_64-R4.4.rs -------------------------------------------------------------------------------- /bindings/bindings-windows-x86_64.rs: -------------------------------------------------------------------------------- 1 | ./bindings-windows-x86_64-R4.4.rs -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | 5 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 6 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 7 | Cargo.lock 8 | 9 | # These are backup files generated by rustfmt 10 | **/*.rs.bk 11 | 12 | # Windows users need to add some settings to let rust-analyzer work. 13 | /.vscode/settings.json 14 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "libR-sys" 3 | version = "0.7.1" 4 | authors = [ 5 | "andy-thomason ", 6 | "Thomas Down", 7 | "Mossa Merhi Reimert ", 8 | "Claus O. Wilke ", 9 | "Ilia A. Kosenkov ", 10 | "Hiroaki Yutani", 11 | ] 12 | edition = "2021" 13 | description = "Low level bindings to the R programming language." 14 | license = "MIT" 15 | links = "R" 16 | documentation = "https://docs.rs/libR-sys/latest/libR_sys/" 17 | repository = "https://github.com/extendr/libR-sys" 18 | 19 | [lib] 20 | # Some code comments on R's source code might be accidentally treated as Rust's 21 | # doc test. See https://github.com/extendr/libR-sys/issues/194 for the details. 22 | doctest = false 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Andy Thomason 2 | Copyright (c) 2020 Genomics PLC 3 | Copyright (c) 2020 Thomas Down 4 | Copyright (c) 2020 Mossa Merhi Reimert 5 | Copyright (c) 2020 Claus O. Wilke 6 | Copyright (c) 2020 Ilia Kosenkov 7 | 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | 27 | -------------------------------------------------------------------------------- /MAINTAINERS_GUIDE.md: -------------------------------------------------------------------------------- 1 | # GUIDE 2 | 3 | ## Commit newly generated bindings 4 | 5 | You last commit must contain `[generate bindings]`. You can make an empty 6 | commit with this message: 7 | 8 | ```sh 9 | git commit -m "[generate bindings]" --allow-empty 10 | ``` 11 | 12 | Then after successfully running workflows, GitHub Actions will push a commit 13 | with the updated bindings onto your PR branch. 14 | 15 | # GUIDE 16 | 17 | ## Commit newly generated bindings 18 | 19 | Your last commit must contain `[generate bindings]`. You can make an empty 20 | commit with this message: 21 | 22 | ```sh 23 | git commit -m "[generate bindings]" --allow-empty 24 | ``` 25 | 26 | Then after successfully running workflows, GitHub Actions will push a commit 27 | with the updated bindings onto your PR branch. 28 | 29 | ## Precomputed bindings 30 | 31 | ### How to update the precomputed bindings? 32 | 33 | The precomputed bindings are continuously updated on `generated_bindings` branch, 34 | but it doesn't propagate into `master` branch automatically; when we need to 35 | reflect the recent changes, create a pull request from `generated_bindings` branch. 36 | This link is the shortcut for this: 37 | 38 | 39 | 40 | ### How to address conflicts in `generated_bindings`? 41 | 42 | You can just delete the branch. Since the GitHub Actions CI runs periodically, 43 | it will be created again from the latest `master` in a few days (or you can 44 | retrigger the build manually). 45 | -------------------------------------------------------------------------------- /.github/workflows/doc.yml: -------------------------------------------------------------------------------- 1 | name: Documents 2 | 3 | on: 4 | # Runs on pushes targeting the default branch 5 | push: 6 | branches: ["master"] 7 | 8 | # Allows you to run this workflow manually from the Actions tab 9 | workflow_dispatch: 10 | 11 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 12 | permissions: 13 | contents: read 14 | pages: write 15 | id-token: write 16 | 17 | # Allow one concurrent deployment 18 | concurrency: 19 | group: "pages" 20 | cancel-in-progress: true 21 | 22 | jobs: 23 | # Single deploy job since we're just deploying 24 | deploy: 25 | environment: 26 | name: github-pages 27 | url: ${{ steps.deployment.outputs.page_url }} 28 | runs-on: ubuntu-latest 29 | steps: 30 | - name: Checkout 31 | uses: actions/checkout@v4 32 | 33 | - uses: dtolnay/rust-toolchain@master 34 | with: 35 | toolchain: nightly 36 | 37 | - name: Docs 38 | run: cargo doc --no-deps 39 | env: 40 | RUSTDOCFLAGS: "--enable-index-page -Zunstable-options" 41 | 42 | - name: Setup Pages 43 | uses: actions/configure-pages@v3 44 | 45 | # As of v1.0.9, upload-pages-artifact action rejects files with incorrect permissions. 46 | # In Rust doc's case, .lock is such a file. 47 | # 48 | # cf. https://github.com/actions/deploy-pages/issues/188#issuecomment-1597651901 49 | - name: Remove unnecessary files 50 | run: rm -f ./target/doc/.lock 51 | 52 | - name: Upload artifact 53 | uses: actions/upload-pages-artifact@v1 54 | with: 55 | path: './target/doc' 56 | 57 | - name: Deploy to GitHub Pages 58 | id: deployment 59 | uses: actions/deploy-pages@v2 60 | -------------------------------------------------------------------------------- /wrapper.h: -------------------------------------------------------------------------------- 1 | #include // for ptrdiff_t 2 | 3 | // R_xlen_t is defined as int on 32-bit platforms, and 4 | // that confuses Rust. Keeping it always as ptrdiff_t works 5 | // fine even on 32-bit. 6 | ///
7 | typedef ptrdiff_t R_xlen_t_rust; 8 | 9 | // Define this for R_CStackLimit 10 | // #define HAVE_UINTPTR_T 11 | #define CSTACK_DEFNS 12 | 13 | // From r83513 (R 4.3), R defines the `NORET` macro differently depending on the 14 | // C/C++ standard the compiler uses. It matters when the header is used in C/C++ 15 | // libraries, but all we want to do here is to make bindgen interpret `NOREP` to 16 | // `!`. However, for some reason, bindgen doesn't handle other no-return 17 | // attributes like `_Noreturn` (for C11) and `[[noreturn]]` (for C++ and C23), 18 | // so we define it here. 19 | #define NORET __attribute__((__noreturn__)) 20 | 21 | // Currently, I'm adding these on as-needed basis 22 | // but we may simply throw the whole lot in in the future. 23 | #include 24 | 25 | #ifndef _WIN32 26 | #define R_INTERFACE_PTRS 27 | #include 28 | #else 29 | extern uintptr_t R_CStackLimit; /* C stack limit */ 30 | #endif 31 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | // R 4.3 redefined `Rcomplex` to a union for compatibility with Fortran. 45 | // But the old definition is compatible both the union version 46 | // and the struct version. 47 | // See: 48 | ///
49 | typedef struct 50 | { 51 | double r; 52 | double i; 53 | } R_complex_impl; 54 | -------------------------------------------------------------------------------- /ci-cargo.ps1: -------------------------------------------------------------------------------- 1 | function ci-cargo { 2 | 3 | param( 4 | [Parameter(Position = 0, ValueFromRemainingArguments)] 5 | [String[]] 6 | $CargoArgs, 7 | [String] 8 | $ActionName 9 | ) 10 | 11 | 12 | try { 13 | Write-Output "::group::$ActionName" 14 | $CargoArgs = $CargoArgs | Where-Object { -not [string]::IsNullOrWhiteSpace($_) } 15 | Write-Output "Running cargo $CargoArgs" 16 | cargo $CargoArgs 17 | if ($LASTEXITCODE -ne 0) { 18 | throw $LASTEXITCODE 19 | } 20 | } 21 | catch { 22 | if ($ActionName -ne $null -and $ActionName -ne "") { 23 | $ActionName = "'$ActionName': " 24 | } 25 | $errMsg = "$($ActionName)cargo failed with code $LASTEXITCODE (args: $CargoArgs)" 26 | Write-Output "::error::$errMsg" 27 | Write-Error -Message "$errMsg" -ErrorAction Stop 28 | } 29 | finally { 30 | Write-Output "::endgroup::" 31 | } 32 | 33 | <# 34 | .SYNOPSIS 35 | Runs cargo with specified args, adapting error handling and output to CI. 36 | 37 | .DESCRIPTION 38 | Runs cargo in a `try` block, catches exceptions and non-zero exit codes. 39 | Explicitly logs the beginning and the end of cargo execution, as well as the error message. 40 | 41 | .PARAMETER CargoArgs 42 | Arguments passed to cargo, as-is. 43 | Note that `--` separator is handled by powershell itself, 44 | so it should be wrapped in quotes `'--'` and passed as string. 45 | 46 | .PARAMETER ActionName 47 | Optional string that is used to format logs and error messages. 48 | 49 | .INPUTS 50 | None. You cannot pipe objects. 51 | 52 | .OUTPUTS 53 | No explicit output. 54 | 55 | .EXAMPLE 56 | PS> ci-cargo --version 57 | ::group:: 58 | Running cargo --version 59 | cargo 1.49.0 (d00d64df9 2020-12-05) 60 | ::endgroup:: 61 | 62 | .EXAMPLE 63 | PS> ci-cargo -ActioName "Build" build 64 | 65 | .EXAMPLE 66 | PS> ci-cargo +stable-x86_64-pc-windows-gnu test --features tests-all --target i686-pc-windows-gnu '--' --nocapture -ActionName "Called from documentation" 67 | 68 | .LINK 69 | Used by: https://github.com/extendr/extendr 70 | #> 71 | 72 | } 73 | -------------------------------------------------------------------------------- /.github/workflows/non-api-call.yml: -------------------------------------------------------------------------------- 1 | name: Update nonAPI.txt 2 | 3 | on: 4 | # Run this weekly 5 | schedule: 6 | - cron: '42 12 * * 1' 7 | # This can also manually run 8 | workflow_dispatch: {} 9 | 10 | jobs: 11 | update_nonAPI_txt: 12 | runs-on: ${{ matrix.config.os }} 13 | name: Update nonAPI.txt on ${{ matrix.config.os }} 14 | strategy: 15 | fail-fast: false 16 | matrix: 17 | config: 18 | - {os: windows-latest} 19 | - {os: macOS-latest} 20 | - {os: ubuntu-latest} 21 | 22 | steps: 23 | - name: Set up R 24 | uses: r-lib/actions/setup-r@v2 25 | with: 26 | r-version: 'devel' 27 | 28 | - name: Update nonAPI.txt 29 | run: | 30 | # Update the non-API list first 31 | Rscript -e 'cat(tools:::nonAPI, sep = "\n")' | tr -d '\r' | sort -u | tee ./nonAPI.txt 32 | shell: bash 33 | 34 | - name: Upload nonAPI.txt 35 | uses: actions/upload-artifact@v4 36 | with: 37 | name: nonAPI-${{ matrix.config.os }} 38 | path: nonAPI.txt 39 | 40 | commit_nonAPI_txt: 41 | needs: update_nonAPI_txt 42 | runs-on: ubuntu-latest 43 | if: github.ref == 'refs/heads/master' 44 | steps: 45 | - uses: actions/checkout@v4 46 | 47 | - uses: actions/download-artifact@v4 48 | 49 | - name: Switch branch 50 | run: | 51 | # 1) If there's already update_nonAPI_txt branch, checkout it. 52 | # 2) If update_nonAPI_txt branch is not created, create it from the default branch. 53 | if git ls-remote --exit-code --heads origin update_nonAPI_txt 2>&1 >/dev/null; then 54 | git fetch origin --no-tags --prune --depth=1 update_nonAPI_txt 55 | git checkout update_nonAPI_txt 56 | else 57 | git switch -c update_nonAPI_txt 58 | fi 59 | 60 | - name: Commit and create a pull request 61 | run: | 62 | # Merge all nonAPI.txt 63 | cat nonAPI-*/nonAPI.txt | tr -d '\r' | sort -u | tee nonAPI.txt 64 | 65 | # detect changes (the code is derived from https://stackoverflow.com/a/3879077) 66 | git add nonAPI.txt 67 | git update-index --refresh 68 | if ! git diff-index --quiet HEAD -- nonAPI.txt; then 69 | # commit 70 | git config --local user.name "${GITHUB_ACTOR}" 71 | git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com" 72 | git commit -m "nonAPI.txt [skip ci]" 73 | 74 | # push to the origin 75 | git push origin update_nonAPI_txt 76 | 77 | # create the pull request 78 | gh pr create --title "Update nonAPI.txt" --body "Please review the diff and run /bindings command manually." 79 | else 80 | echo "No changes" 81 | fi 82 | env: 83 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 84 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## libR-sys 0.6.0 4 | 5 | - Drop support for 32-bit Windows, which virtually means dropping support for R < 4.2. 6 | - Fix failures with R installation that doesn't provide shared libraries. 7 | 8 | ## libR-sys 0.5.0 9 | 10 | - Update the default precomputed bindings to R 4.3.0. 11 | - Remove deprecated API `VECTOR_PTR` from bindings. [[#165]](https://github.com/extendr/libR-sys/pull/165) 12 | - Use Rust types such as `u32` and `i16` instead of C types such as `c_uint` and `c_short` for `enum`s. [[#160]](https://github.com/extendr/libR-sys/pull/160) 13 | - Remove mathematical constants (e.g., `M_PI`), which are also provided by Rust's `std` (e.g., `std::f64::consts::PI`). [[#160]](https://github.com/extendr/libR-sys/pull/160) 14 | - Exclude "non-API" calls. [[#135]](https://github.com/extendr/libR-sys/pull/135) 15 | - Refactor version logging in generated bindings. [[#159]](https://github.com/extendr/libR-sys/pull/159) 16 | - Redefine R-devel's `Rcomplex`. [[#156]](https://github.com/extendr/libR-sys/pull/156) 17 | 18 | ## libR-sys 0.4.0 19 | 20 | - Update the default precomuted bindings to R 4.2.0. 21 | - [`Windows`] Dropped build-time dependency on `winapi`. 22 | - Remove bindings for the symbols that are not part of R API. [[#96]](https://github.com/extendr/libR-sys/pull/96) 23 | - Add bindings for the following header files: 24 | - `R_ext/Applic.h`: optimisation functions [[#117]](https://github.com/extendr/libR-sys/pull/117) 25 | - `R_ext/Random.h`: random number generator state wrappers [[#123]](https://github.com/extendr/libR-sys/pull/123) 26 | - `Rmath.h`: distribution functions [[#124]](https://github.com/extendr/libR-sys/pull/124) 27 | - [`Linux`] Provide precomuted bindings for linux-aarch64 (aka ARM64). [[#133]](https://github.com/extendr/libR-sys/pull/133) 28 | 29 | ## libR-sys 0.3.0 30 | 31 | - Drop support for 32-bit Windows with R >= 4.2. As 32 | [the release note of R 4.1.0](https://stat.ethz.ch/pipermail/r-announce/2021/000670.html) 33 | announced "the 4.1.x series will be the last to support 32-bit Windows," 34 | there will be no 32-bit version of R as of R 4.2.0. 35 | To be clear, libR-sys (and extendr) crate will keep supporting 32-bit on R < 36 | 4.2 for a year or so. 37 | - libR-sys no longer sets `DEP_R_R_VERSION_STRING` environmental variable. 38 | 39 | ## libR-sys 0.2.2 40 | 41 | - Update the default precomuted bindings to R 4.1.0. 42 | - Provide bindings for `R_ext/Altrep.h` and `R_ext/GraphicsEngine.h`. 43 | 44 | ## libR-sys 0.2.1 45 | 46 | - Output R version info to downstream crates using variables `R_VERSION_MAJOR`, 47 | `R_VERSION_MINOR`, `R_VERSION_PATCH`, `R_VERSION_DEVEL`, and `R_VERSION_STRING`. 48 | 49 | - Added precomputed bindings for Apple Silicon. 50 | 51 | - Added contributing guidelines and code of conduct. 52 | 53 | ## libR-sys 0.2.0 54 | 55 | - Provide precomputed bindings. Computations of bindings on the fly now only 56 | happens when the `use-bindgen` feature is enabled. 57 | 58 | ## libR-sys 0.1.10 59 | 60 | - Minor fixes. 61 | 62 | ## libR-sys 0.1.9 63 | 64 | - Remove need for pkg-config. 65 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We welcome contributions to the extendr project. Contributions come in many forms. Please carefully read and follow these guidelines. This will help us make the contribution process easy and effective for everyone involved. It also communicates that you agree to respect the time of the developers managing and developing this project. 4 | 5 | 6 | ## Quicklinks 7 | 8 | * [Code of Conduct](#code-of-conduct) 9 | * [Getting Started](#getting-started) 10 | * [Issues](#issues) 11 | * [Pull Requests](#pull-requests) 12 | * [Getting Help](#getting-help) 13 | * [Authorship](#authorship) 14 | * [Attribution](#attribution) 15 | 16 | ## Code of Conduct 17 | 18 | We take our open source community seriously and hold ourselves and other contributors to high standards of communication. By participating and contributing to this project, you agree to uphold our [Code of Conduct.](https://github.com/extendr/libR-sys/blob/master/CODE-OF-CONDUCT.md) 19 | 20 | ## Getting Started 21 | 22 | Contributions can be made via Issues and Pull Requests (PRs). A few general guidelines cover both: 23 | 24 | - Please search for existing Issues and PRs before creating your own. 25 | - We work hard to makes sure issues are handled in a timely manner but, depending on the problem and maintainer availability, it could take a while to investigate the problem. A friendly ping in the comment thread can help draw attention if an issue has not received any attention for a while. Please keep in mind that all contributors to this project are volunteers and may have other commitments they need to attend to. 26 | 27 | ### Issues 28 | 29 | Issues should be used to report problems with the library, request a new feature, or to discuss potential changes before a PR is created. Please **do not** use Issues to request user support. 30 | 31 | Whenever possible, please provide a minimal reproducible example (reprex) to any bug report that you are filing. The more minimal your example, the more likely that somebody else can figure out what the problem is, so please remove any code that isn't relevant to the problem you are reporting. 32 | 33 | Please keep issues focused on one particular problem. Don't feel shy about opening multiple issues if you're encountering more than one problem. 34 | 35 | If you find an Issue that addresses the problem you're having, please add your own reproduction information to the existing issue rather than creating a new one. Adding a [reaction](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) can also help be indicating to our maintainers that a particular problem is affecting more than just the reporter. 36 | 37 | ### Pull Requests 38 | 39 | PRs are always welcome and can be a quick way to get your fix or improvement slated for the next release. However, please always open an Issue before submitting a PR. 40 | 41 | In general, PRs should: 42 | 43 | - Address a single concern in the least number of changed lines as possible. 44 | - Only fix/add the functionality in question **OR** address wide-spread whitespace/style issues, not both. 45 | - Add unit or integration tests for fixed or changed functionality. 46 | - Include documentation. 47 | - Indicate which Issue they address by using the words `Closes #` or `Fixes #` in the body of the PR and/or the git commit message. (See the [GitHub Documentation](https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) for details about linking PRs to Issues and automatically closing Issues when merging PRs.) 48 | 49 | 50 | In general, we follow the [GitHub flow](https://guides.github.com/introduction/flow/index.html) development model: 51 | 52 | 1. Fork the repository to your own Github account 53 | 2. Clone the project to your machine 54 | 3. Create a branch locally with a succinct but descriptive name 55 | 4. Commit changes to the branch 56 | 5. Push changes to your fork 57 | 6. Open a PR in our repository and follow the PR template so that we can efficiently review the changes. 58 | 59 | ## Getting Help 60 | 61 | Please join us on our [Discord server](https://discord.gg/7hmApuc) for general conversations and questions that don't belong into a GitHub issue. 62 | 63 | ## Authorship 64 | 65 | Contributors who have made multiple, sustained, and/or non-trivial contributions to the project may be added to the author list. New author names will always be added at the end of the list, so that author order reflects chronological order of joining the project. All authorship decisions are at the discretion of the current maintainers of the project. 66 | 67 | ## Attribution 68 | 69 | This document was adapted from the [General Contributing Guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md) of the auth0 project. 70 | -------------------------------------------------------------------------------- /nonAPI.txt: -------------------------------------------------------------------------------- 1 | AllDevicesKilled 2 | Brent_fmin 3 | COMPLEX0 4 | DDVAL 5 | ENSURE_NAMEDMAX 6 | ENVFLAGS 7 | FRAME 8 | HASHTAB 9 | INTERNAL 10 | IS_ASCII 11 | IS_GROWABLE 12 | IS_UTF8 13 | LEVELS 14 | NAMED 15 | OutDec 16 | PRCODE 17 | PRENV 18 | PRIMOFFSET 19 | PRSEEN 20 | PRVALUE 21 | RC_fopen 22 | RDEBUG 23 | REAL0 24 | R_CStackLimit 25 | R_CStackStart 26 | R_CleanTempDir 27 | R_ClearerrConsole 28 | R_CollectFromIndex 29 | R_CompiledFileName 30 | R_Consolefile 31 | R_DefCallbacks 32 | R_DefParams 33 | R_DefParamsEx 34 | R_DirtyImage 35 | R_FileExists 36 | R_FreeStringBuffer 37 | R_FunTab 38 | R_GE_setVFontRoutines 39 | R_GUIType 40 | R_GetConnection 41 | R_GetVarLocMISSING 42 | R_GlobalContext 43 | R_HistoryFile 44 | R_HistorySize 45 | R_Home 46 | R_HomeDir 47 | R_InputHandlers 48 | R_Interactive 49 | R_MethodsNamespace 50 | R_NewHashedEnv 51 | R_NoEcho 52 | R_OpenCompiledFile 53 | R_Outputfile 54 | R_PV 55 | R_ParseContext 56 | R_ParseContextLast 57 | R_ParseContextLine 58 | R_ParseError 59 | R_ParseErrorMsg 60 | R_PolledEvents 61 | R_Pretty 62 | R_PromiseExpr 63 | R_ReadConnection 64 | R_ReplDLLdo1 65 | R_ReplDLLinit 66 | R_RestoreGlobalEnv 67 | R_RestoreGlobalEnvFromFile 68 | R_RestoreHistory 69 | R_RunExitFinalizers 70 | R_SaveGlobalEnv 71 | R_SaveGlobalEnvToFile 72 | R_SelectEx 73 | R_SetParams 74 | R_SetWin32 75 | R_SignalHandlers 76 | R_SizeFromEnv 77 | R_SrcfileSymbol 78 | R_SrcrefSymbol 79 | R_Suicide 80 | R_TempDir 81 | R_Visible 82 | R_WriteConnection 83 | R_addTaskCallback 84 | R_cairoCdynload 85 | R_checkActivity 86 | R_checkActivityEx 87 | R_closedir 88 | R_curErrorBuf 89 | R_data_class 90 | R_deferred_default_method 91 | R_execMethod 92 | R_findVarLocInFrame 93 | R_fopen 94 | R_gc_torture 95 | R_getTaskCallbackNames 96 | R_get_arith_function 97 | R_gzclose 98 | R_gzgets 99 | R_gzopen 100 | R_ignore_SIGPIPE 101 | R_isForkedChild 102 | R_isMethodsDispatchOn 103 | R_moduleCdynload 104 | R_nchar 105 | R_new_custom_connection 106 | R_opendir 107 | R_primitive_generic 108 | R_primitive_methods 109 | R_print 110 | R_readdir 111 | R_removeTaskCallback 112 | R_runHandlers 113 | R_running_as_main_program 114 | R_setInternetRoutines 115 | R_setLapackRoutines 116 | R_setStartTime 117 | R_setX11Routines 118 | R_set_command_line_arguments 119 | R_set_prim_method 120 | R_set_quick_method_check 121 | R_set_standardGeneric_ptr 122 | R_setupHistory 123 | R_strtod4 124 | R_subassign3_dflt 125 | R_taskCallbackRoutine 126 | R_timeout_handler 127 | R_timeout_val 128 | R_tryWrap 129 | R_wait_usec 130 | Rconn_fgetc 131 | Rconn_printf 132 | Rdownload 133 | RestoreAction 134 | Rf_CleanEd 135 | Rf_EncodeComplex 136 | Rf_EncodeElement 137 | Rf_EncodeEnvironment 138 | Rf_EncodeInteger 139 | Rf_EncodeLogical 140 | Rf_EncodeReal 141 | Rf_GPretty 142 | Rf_KillAllDevices 143 | Rf_NewEnvironment 144 | Rf_NonNullStringMatch 145 | Rf_PrintDefaults 146 | Rf_ReplIteration 147 | Rf_Seql 148 | Rf_addTaskCallback 149 | Rf_begincontext 150 | Rf_callToplevelHandlers 151 | Rf_checkArityCall 152 | Rf_con_pushback 153 | Rf_copyMostAttribNoTs 154 | Rf_deparse1 155 | Rf_deparse1line 156 | Rf_dpptr 157 | Rf_endEmbeddedR 158 | Rf_endcontext 159 | Rf_envlength 160 | Rf_findVarInFrame3 161 | Rf_formatComplex 162 | Rf_formatInteger 163 | Rf_formatLogical 164 | Rf_formatReal 165 | Rf_initEmbeddedR 166 | Rf_init_con 167 | Rf_initialize_R 168 | Rf_isProtected 169 | Rf_jump_to_toplevel 170 | Rf_mainloop 171 | Rf_mbrtowc 172 | Rf_mkFalse 173 | Rf_printNamedVector 174 | Rf_printRealVector 175 | Rf_printVector 176 | Rf_removeTaskCallbackByIndex 177 | Rf_removeTaskCallbackByName 178 | Rf_setSVector 179 | Rf_set_iconv 180 | Rf_sortVector 181 | Rf_strIsASCII 182 | Rf_strchr 183 | Rf_strrchr 184 | Rf_ucstomb 185 | Rf_utf8towcs 186 | Rf_wait_usec 187 | Rf_wcstoutf8 188 | Rg_PolledEvents 189 | Rg_set_col_ptrs 190 | Ri18n_iswctype 191 | Ri18n_wcswidth 192 | Ri18n_wctype 193 | Ri18n_wcwidth 194 | Rsockclose 195 | Rsockconnect 196 | Rsocklisten 197 | Rsockopen 198 | Rsockread 199 | Rsockwrite 200 | Runzip 201 | SETLENGTH 202 | SETLEVELS 203 | SET_BODY 204 | SET_CLOENV 205 | SET_ENCLOS 206 | SET_ENVFLAGS 207 | SET_FORMALS 208 | SET_FRAME 209 | SET_GROWABLE_BIT 210 | SET_HASHTAB 211 | SET_NAMED 212 | SET_PRCODE 213 | SET_PRENV 214 | SET_PRSEEN 215 | SET_PRVALUE 216 | SET_RDEBUG 217 | SET_S4_OBJECT 218 | SET_TRUELENGTH 219 | SET_TYPEOF 220 | STDVEC_DATAPTR 221 | STRING_PTR 222 | SYMVALUE 223 | SaveAction 224 | TRUELENGTH 225 | UNIMPLEMENTED_TYPE 226 | UNSET_S4_OBJECT 227 | VECTOR_PTR 228 | XLENGTH_EX 229 | XTRUELENGTH 230 | baseRegisterIndex 231 | call_R 232 | cg_ 233 | ch_ 234 | chol2inv_ 235 | chol_ 236 | csduplicated 237 | currentTime 238 | dcar 239 | dcdr 240 | ddfind 241 | do_Rprof 242 | do_Rprofmem 243 | do_X11 244 | do_contourLines 245 | do_edit 246 | do_getGraphicsEventEnv 247 | do_getSnapshot 248 | do_playSnapshot 249 | do_saveplot 250 | do_set_prim_method 251 | dqrrsd_ 252 | dqrxb_ 253 | dtype 254 | dummy_fgetc 255 | dummy_ii 256 | dummy_vfprintf 257 | editorcleanall 258 | epslon_ 259 | extR_HTTPDCreate 260 | extR_HTTPDStop 261 | fdhess 262 | fft_factor 263 | fft_work 264 | fpu_setup 265 | freeRUser 266 | free_R_HOME 267 | getConnection 268 | getDLLVersion 269 | getPRIMNAME 270 | getRUser 271 | getSelectedHandler 272 | get_R_HOME 273 | initStdinHandler 274 | known_to_be_latin1 275 | locale2charset 276 | match5 277 | matherr 278 | max_contour_segments 279 | mbcsToUcs2 280 | memtrace_report 281 | optif0 282 | parseError 283 | process_site_Renviron 284 | process_system_Renviron 285 | process_user_Renviron 286 | ptr_R_Busy 287 | ptr_R_ChooseFile 288 | ptr_R_CleanUp 289 | ptr_R_ClearerrConsole 290 | ptr_R_EditFile 291 | ptr_R_EditFiles 292 | ptr_R_FlushConsole 293 | ptr_R_ProcessEvents 294 | ptr_R_ReadConsole 295 | ptr_R_ResetConsole 296 | ptr_R_ShowFiles 297 | ptr_R_ShowMessage 298 | ptr_R_Suicide 299 | ptr_R_WriteConsole 300 | ptr_R_WriteConsoleEx 301 | ptr_R_addhistory 302 | ptr_R_loadhistory 303 | ptr_R_savehistory 304 | ptr_do_dataentry 305 | ptr_do_dataviewer 306 | ptr_do_selectlist 307 | pythag_ 308 | readconsolecfg 309 | rg_ 310 | rs_ 311 | run_Rmainloop 312 | rwarnc_ 313 | setup_Rmainloop 314 | tql2_ 315 | tqlrat_ 316 | tred1_ 317 | tred2_ 318 | utf8locale 319 | yylloc 320 | -------------------------------------------------------------------------------- /CODE-OF-CONDUCT.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributor Covenant Code of Conduct 3 | 4 | ## Our Pledge 5 | 6 | As contributors to and maintainers of this project, we pledge to make participation 7 | in our community a harassment-free experience for everyone, regardless of age, body 8 | size, visible or invisible disability, ethnicity, sex characteristics, gender 9 | identity and expression, level of experience, education, socio-economic status, 10 | nationality, personal appearance, race, religion, or sexual identity 11 | and orientation. 12 | 13 | We pledge to act and interact in ways that contribute to an open, welcoming, 14 | diverse, inclusive, and healthy community. 15 | 16 | ## Our Standards 17 | 18 | Examples of behavior that contributes to a positive environment for our 19 | community include: 20 | 21 | * Demonstrating empathy and kindness toward other people 22 | * Being respectful of differing opinions, viewpoints, and experiences 23 | * Giving and gracefully accepting constructive feedback 24 | * Accepting responsibility and apologizing to those affected by our mistakes, 25 | and learning from the experience 26 | * Focusing on what is best not just for us as individuals, but for the 27 | overall community 28 | 29 | Examples of unacceptable behavior include: 30 | 31 | * The use of sexualized language or imagery, and sexual attention or 32 | advances of any kind 33 | * Trolling, insulting or derogatory comments, and personal or political attacks 34 | * Public or private harassment 35 | * Publishing others' private information, such as a physical or email 36 | address, without their explicit permission 37 | * Other conduct which could reasonably be considered inappropriate in a 38 | professional setting 39 | 40 | ## Enforcement Responsibilities 41 | 42 | Project leaders are responsible for clarifying and enforcing our standards of 43 | acceptable behavior and will take appropriate and fair corrective action in 44 | response to any behavior that they deem inappropriate, threatening, offensive, 45 | or harmful. 46 | 47 | Project leaders have the right and responsibility to remove, edit, or reject 48 | comments, commits, code, wiki edits, issues, and other contributions that are 49 | not aligned to this Code of Conduct, and will communicate reasons for moderation 50 | decisions when appropriate. 51 | 52 | ## Scope 53 | 54 | This Code of Conduct applies within all community spaces, and also applies when 55 | an individual is officially representing the community in public spaces. 56 | Examples of representing our community include using an official e-mail address, 57 | posting via an official social media account, or acting as an appointed 58 | representative at an online or offline event. 59 | 60 | ## Enforcement 61 | 62 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 63 | reported to the current maintainers of the project via email. Maintainers are 64 | identified as Owners on [crates.io](https://crates.io/crates/libR-sys); email 65 | addresses are provided in `Cargo.toml`. All complaints will be reviewed and 66 | investigated promptly and fairly. 67 | 68 | All community leaders are obligated to respect the privacy and security of the 69 | reporter of any incident. 70 | 71 | ## Enforcement Guidelines 72 | 73 | Community leaders will follow these Community Impact Guidelines in determining 74 | the consequences for any action they deem in violation of this Code of Conduct: 75 | 76 | ### 1. Correction 77 | 78 | **Community Impact**: Use of inappropriate language or other behavior deemed 79 | unprofessional or unwelcome in the community. 80 | 81 | **Consequence**: A private, written warning from community leaders, providing 82 | clarity around the nature of the violation and an explanation of why the 83 | behavior was inappropriate. A public apology may be requested. 84 | 85 | ### 2. Warning 86 | 87 | **Community Impact**: A violation through a single incident or series 88 | of actions. 89 | 90 | **Consequence**: A warning with consequences for continued behavior. No 91 | interaction with the people involved, including unsolicited interaction with 92 | those enforcing the Code of Conduct, for a specified period of time. This 93 | includes avoiding interactions in community spaces as well as external channels 94 | like social media. Violating these terms may lead to a temporary or 95 | permanent ban. 96 | 97 | ### 3. Temporary Ban 98 | 99 | **Community Impact**: A serious violation of community standards, including 100 | sustained inappropriate behavior. 101 | 102 | **Consequence**: A temporary ban from any sort of interaction or public 103 | communication with the community for a specified period of time. No public or 104 | private interaction with the people involved, including unsolicited interaction 105 | with those enforcing the Code of Conduct, is allowed during this period. 106 | Violating these terms may lead to a permanent ban. 107 | 108 | ### 4. Permanent Ban 109 | 110 | **Community Impact**: Demonstrating a pattern of violation of community 111 | standards, including sustained inappropriate behavior, harassment of an 112 | individual, or aggression toward or disparagement of classes of individuals. 113 | 114 | **Consequence**: A permanent ban from any sort of public interaction within 115 | the community. 116 | 117 | ## Attribution 118 | 119 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 120 | version 2.0, available at 121 | [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. 122 | 123 | Community Impact Guidelines were inspired by 124 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available 128 | at [https://www.contributor-covenant.org/translations][translations]. 129 | 130 | [homepage]: https://www.contributor-covenant.org 131 | [v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html 132 | [Mozilla CoC]: https://github.com/mozilla/diversity 133 | [FAQ]: https://www.contributor-covenant.org/faq 134 | [translations]: https://www.contributor-covenant.org/translations 135 | 136 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | //! A low-level libR binding library which is kept deliberately 2 | //! minimal. 3 | //! 4 | //! In particular, it has no external dependencies other that libR 5 | //! installed on the target. 6 | //! 7 | //! ## Synopsis 8 | //! 9 | //! The `libR-sys` crate is a low level bindgen wrapper for the R 10 | //! programming language. The intention is to allow one or more extension 11 | //! mechanisms to be implemented for rust. 12 | //! 13 | //! Effort to make the extension libraries platform-independent can be 14 | //! concentrated here. 15 | //! 16 | //! # Examples 17 | //! 18 | //! ```no_run 19 | //! use libR_sys::{Rf_initialize_R, R_CStackLimit, setup_Rmainloop}; 20 | //! use std::os::raw; 21 | //! 22 | //! unsafe { 23 | //! std::env::set_var("R_HOME", "/usr/lib/R"); 24 | //! let arg0 = "R\0".as_ptr() as *mut raw::c_char; 25 | //! Rf_initialize_R(1, [arg0].as_mut_ptr()); 26 | //! R_CStackLimit = usize::max_value(); 27 | //! setup_Rmainloop(); 28 | //! } 29 | //! ``` 30 | //! 31 | //! # Conditional compilation depending on R installation 32 | //! 33 | //! The libR-sys crate provides these environmental variables that you can use in `build.rs`: 34 | //! 35 | //! - `DEP_R_R_VERSION_MAJOR`: The major part of the R version (e.g. `4` in version `4.1.0`) 36 | //! - `DEP_R_R_VERSION_MINOR`: The minor part of the R version (e.g. `1` in version `4.1.0`) 37 | //! - `DEP_R_R_VERSION_PATCH`: The patch part of the R version (e.g. `0` in version `4.1.0`) 38 | //! - `DEP_R_R_VERSION_DEVEL`: `true` if the R is a development version, otherwise `false` 39 | //! - `DEP_R_R_VERSION_STRING`: The full version string (e.g. `R version 4.1.0 (2021-05-18)`) 40 | //! - `DEP_R_R_HOME`: The R home directory 41 | //! 42 | //! ## Example `build.rs` 43 | //! 44 | //! ```ignore 45 | //! use std::env; 46 | //! 47 | //! fn main() { 48 | //! // Set R_HOME envvar, and refer to it on compile time by env!("R_HOME") 49 | //! let r_home = env::var("DEP_R_R_HOME").unwrap(); 50 | //! println!("cargo:rustc-env=R_HOME={}", r_home); 51 | //! 52 | //! // Enable cfg setting to conditionally compile a code using a feature 53 | //! // available only on newer versions of R 54 | //! let major = env::var("DEP_R_R_VERSION_MAJOR").unwrap(); 55 | //! let minor = env::var("DEP_R_R_VERSION_MINOR").unwrap(); 56 | //! if &*major >= "4" && &*minor >= "1" { 57 | //! println!("cargo:rustc-cfg=use_a_feature"); 58 | //! } 59 | //! } 60 | //! ``` 61 | 62 | #![allow(non_upper_case_globals)] 63 | #![allow(non_camel_case_types)] 64 | #![allow(non_snake_case)] 65 | #![allow(improper_ctypes)] 66 | 67 | include!(concat!(env!("OUT_DIR"), "/bindings.rs")); 68 | 69 | #[non_exhaustive] 70 | #[repr(transparent)] 71 | #[derive(Debug)] 72 | pub struct SEXPREC(std::ffi::c_void); 73 | 74 | extern "C" { 75 | // Return type should match `SEXPTYPE` 76 | pub fn TYPEOF(x: SEXP) -> SEXPTYPE; 77 | } 78 | 79 | #[allow(non_camel_case_types)] 80 | pub type R_altrep_Coerce_method_t = 81 | ::std::option::Option SEXP>; 82 | 83 | pub unsafe fn Rf_isS4(arg1: SEXP) -> Rboolean { 84 | unsafe { 85 | if secret::Rf_isS4_original(arg1) == 0 { 86 | Rboolean::FALSE 87 | } else { 88 | Rboolean::TRUE 89 | } 90 | } 91 | } 92 | 93 | mod secret { 94 | use super::*; 95 | extern "C" { 96 | #[link_name = "Rf_isS4"] 97 | pub fn Rf_isS4_original(arg1: SEXP) -> u32; 98 | } 99 | } 100 | 101 | impl From for bool { 102 | fn from(value: Rboolean) -> Self { 103 | match value { 104 | Rboolean::FALSE => false, 105 | Rboolean::TRUE => true, 106 | } 107 | } 108 | } 109 | 110 | impl From for Rboolean { 111 | fn from(value: bool) -> Self { 112 | match value { 113 | true => Rboolean::TRUE, 114 | false => Rboolean::FALSE, 115 | } 116 | } 117 | } 118 | 119 | #[cfg(test)] 120 | mod tests { 121 | use super::*; 122 | use std::os::raw; 123 | 124 | // Generate constant static strings. 125 | // Much more efficient than CString. 126 | // Generates asciiz. 127 | macro_rules! cstr { 128 | ($s: expr) => { 129 | concat!($s, "\0").as_ptr() as *const raw::c_char 130 | }; 131 | } 132 | 133 | // Generate mutable static strings. 134 | // Much more efficient than CString. 135 | // Generates asciiz. 136 | macro_rules! cstr_mut { 137 | ($s: expr) => { 138 | concat!($s, "\0").as_ptr() as *mut raw::c_char 139 | }; 140 | } 141 | 142 | // Thanks to @qinwf and @scottmmjackson for showing the way here. 143 | fn start_R() { 144 | unsafe { 145 | if std::env::var("R_HOME").is_err() { 146 | // env! gets the build-time R_HOME made in build.rs 147 | std::env::set_var("R_HOME", env!("R_HOME")); 148 | } 149 | 150 | // Due to Rf_initEmbeddedR using __libc_stack_end 151 | // We can't call Rf_initEmbeddedR. 152 | // Instead we must follow rustr's example and call the parts. 153 | 154 | //let res = unsafe { Rf_initEmbeddedR(1, args.as_mut_ptr()) }; 155 | if cfg!(target_os = "windows") && cfg!(target_arch = "x86") { 156 | Rf_initialize_R( 157 | 4, 158 | [ 159 | cstr_mut!("R"), 160 | cstr_mut!("--arch=i386"), 161 | cstr_mut!("--slave"), 162 | cstr_mut!("--no-save"), 163 | ] 164 | .as_mut_ptr(), 165 | ); 166 | } else { 167 | Rf_initialize_R( 168 | 3, 169 | [cstr_mut!("R"), cstr_mut!("--slave"), cstr_mut!("--no-save")].as_mut_ptr(), 170 | ); 171 | } 172 | 173 | // In case you are curious. 174 | // Maybe 8MB is a bit small. 175 | // eprintln!("R_CStackLimit={:016x}", R_CStackLimit); 176 | 177 | if cfg!(not(target_os = "windows")) { 178 | R_CStackLimit = usize::max_value(); 179 | } 180 | 181 | setup_Rmainloop(); 182 | } 183 | } 184 | 185 | // Run some R code. Check the result. 186 | #[test] 187 | fn test_eval() { 188 | start_R(); 189 | unsafe { 190 | let val = Rf_protect(R_ParseEvalString(cstr!("1"), R_NilValue)); 191 | Rf_PrintValue(val); 192 | assert_eq!(TYPEOF(val), SEXPTYPE::REALSXP); 193 | assert_eq!(*REAL(val), 1.); 194 | Rf_unprotect(1); 195 | } 196 | // There is one pathological example of `Rf_is*` where `TRUE` is not 1, 197 | // but 16. We show here that the casting is done as intended 198 | unsafe { 199 | let sexp = R_ParseEvalString(cstr!(r#"new("factor")"#), R_GlobalEnv); 200 | Rf_protect(sexp); 201 | Rf_PrintValue(sexp); 202 | 203 | assert_eq!( 204 | std::mem::discriminant(&Rf_isS4(sexp)), 205 | std::mem::discriminant(&Rboolean::TRUE), 206 | ); 207 | assert!(>::into(Rf_isS4(sexp))); 208 | assert!( 209 | (Rboolean::FALSE == Rf_isS4(sexp)) || (Rboolean::TRUE == Rf_isS4(sexp)), 210 | "PartialEq implementation is broken" 211 | ); 212 | assert!(Rboolean::TRUE == Rf_isS4(sexp)); 213 | assert_eq!(Rf_isS4(sexp), Rboolean::TRUE); 214 | Rf_unprotect(1); 215 | } 216 | } 217 | } 218 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # libR-sys 2 | 3 | Low-level R library bindings 4 | 5 | [![Github Actions Build Status](https://github.com/extendr/libR-sys/workflows/Tests/badge.svg)](https://github.com/extendr/libR-sys/actions) 6 | [![crates.io](https://img.shields.io/crates/v/libR-sys.svg)](https://crates.io/crates/libR-sys) 7 | [![Documentation](https://docs.rs/libR-sys/badge.svg)](https://docs.rs/libR-sys) 8 | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) 9 | 10 | ## Installation 11 | 12 | The recommended way to build this library is to use precompiled bindings, which are available for `Linux`, `macOS`, and `Windows`. 13 | 14 | Alternatively, the library can be built from source, in which case it invokes `bindgen` crate, which has extra platform-specific dependencies (including `msys2` for `Windows`). 15 | 16 | ## Configuration 17 | 18 | `libR-sys` recognizes the following environment variables: 19 | 20 | - `LIBRSYS_R_VERSION` If set, it is used to determine the version of R, for which bindings should be generated. `LIBRSYS_R_VERSION` should be set to one of the supported values, e.g. `4.2.0` or `4.3.0-devel` (the pattern is `major.minor.patch[-devel]`). Malformed `LIBRSYS_R_VERSION` results in compilation error. If `LIBRSYS_R_VERSION` is unset, `R` is invoked and its `R.version` is used. 21 | 22 | ## Using precompiled bindings (recommended) 23 | 24 | Two components are required to build the library: 25 | 26 | 1. [`R`](https://cran.r-project.org/): It needs to be installed and available in the search path. 27 | 2. [`Rust`](https://www.rust-lang.org/learn/get-started): It is recommended to install `Rust` using `rustup`; search path should include `Rust` binaries. 28 | 29 | **Note: On Windows, only R >= 4.2 is supported** 30 | 31 | Once `R` and `Rust` are configured, the library can be easily built: 32 | 33 | ```bash 34 | # macOS & Linux 35 | cargo build 36 | 37 | # Windows 38 | cargo build --target x86_64-pc-windows-gnu 39 | ``` 40 | 41 | To test the build, run `cargo test`. 42 | 43 | ```bash 44 | # macOS & Linux 45 | cargo test 46 | 47 | # Windows 48 | cargo test --target x86_64-pc-windows-gnu 49 | ``` 50 | 51 | ## Building bindings from source (advanced) 52 | 53 | **Note: On Windows, only R >= 4.2 is supported** 54 | 55 | The bindings can be generated using [`bindgen`](https://github.com/rust-lang/rust-bindgen), special `Rust` crate. 56 | `bindgen` usage is enabled via `use-bindgen` feature flag. 57 | 58 | `bindgen` requires [`libclang`](https://clang.llvm.org/docs/Tooling.html), which should be installed first. 59 | This library relies on `LIBCLANG_PATH` environment variable to determine path to the appropriate version of `libclang`. 60 | 61 | The output folder for bindings can be configured using `LIBRSYS_BINDINGS_OUTPUT_PATH` environment variable, thus make sure it is set to e.g `bindings`. 62 | 63 | - **Linux** 64 | 65 | Set `LIBCLANG_PATH` to the `lib` directory of your `llvm` installation, e.g., 66 | `LIBCLANG_PATH=/usr/lib/llvm-3.9/lib`. Build & test using 67 | 68 | ```shell 69 | cargo build --features use-bindgen 70 | cargo test --features use-bindgen 71 | ``` 72 | 73 | - **macOS** 74 | 75 | Install `llvm-config` via [homebrew](https://brew.sh/) with: 76 | 77 | ```bash 78 | brew install llvm 79 | ``` 80 | 81 | Add it to your search path via: 82 | 83 | ```bash 84 | echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile 85 | ``` 86 | 87 | If you want to compile `libR-sys` from within RStudio, you may also have to add the following line to your `.Renviron` file: 88 | 89 | ```bash 90 | PATH=/usr/local/opt/llvm/bin:$PATH 91 | ``` 92 | 93 | Build & test using 94 | 95 | ```shell 96 | cargo build --features use-bindgen 97 | cargo test --features use-bindgen 98 | ``` 99 | 100 | - **Windows** 101 | On Windows, bindings can be generated using native `LLVM` installation and `Rtools` distribution. 102 | 103 | Install LLVM: 104 | 105 | ```powershell 106 | choco install llvm -y 107 | ``` 108 | 109 | `LLVM` can be also installed using `winget`, `scoop`, or manually. 110 | 111 | To ensure LLVM is successfully installed and configured, run `clang --version`. If `clang` is not on the `PATH`, manually add path to `clang` installation to the `PATH` environement variable. 112 | 113 | Install `Rtools` if it is misisng: 114 | 115 | ```powershell 116 | choco install rtools -y 117 | ``` 118 | 119 | Installing `Rtools` this way automatically sets `RTOOLS42_HOME` (or `RTOOLS43_HOME`) environment variable. 120 | 121 | Ensure that `R_HOME` environment variable is set to the `R` installation directory. 122 | 123 | Finally, point `libR-sys` to the include directory of `Rtools`: 124 | 125 | ```powershell 126 | $env:LIBRSYS_LIBCLANG_INCLUDE_PATH="$env:RTOOLS42_HOME\x86_64-w64-mingw32.static.posix\include" 127 | ``` 128 | 129 | Now, the bindings can be build using the following command: 130 | 131 | ```powershell 132 | cargo build --target x86_64-pc-windows-gnu --features use-bindgen 133 | ``` 134 | 135 | ## Running bindgen tests on Windows 136 | 137 | Running bindgen tests on Windows requires a bit more setup. 138 | 139 | First, add `Rtools` `bin` directory to the `PATH` (replace `RTOOLS42_HOME` with `RTOOLS43_HOME` if you are using `Rtools` 4.3): 140 | 141 | ```powershell 142 | $env:PATH += ";$env:RTOOLS42_HOME\x86_64-w64-mingw32.static.posix\bin" 143 | ``` 144 | 145 | Second, patch `Rtools` version `4.2` and higher since there is a `gcc` static linking issue. `rustc` adds `-lgcc_eh` flag 146 | to the compiler, but Rtools' GCC doesn't have `libgcc_eh` due to 147 | the compilation settings. So, in order to please the compiler, `libgcc_eh` should be mocked and added to the library search paths. For more details, please refer to [r-windows/rtools-packages]. 148 | 149 | [r-windows/rtools-packages]: https://github.com/r-windows/rtools-packages/blob/2407b23f1e0925bbb20a4162c963600105236318/mingw-w64-gcc/PKGBUILD#L313-L316 150 | 151 | Create a directory for missing library file and an empty file there: 152 | 153 | ``` powershell 154 | # create a directory in an arbitrary location (e.g. libgcc_mock) 155 | New-Item -Path libgcc_mock -Type Directory 156 | 157 | # create empty libgcc_eh.a and libgcc_s.a 158 | New-Item -Path libgcc_mock\libgcc_eh.a -Type File 159 | ``` 160 | 161 | Finally, configure `Rust` compiler and select appropriate linker (see [The Cargo Book]): 162 | 163 | [The Cargo Book]: https://doc.rust-lang.org/cargo/reference/config.html#environment-variables 164 | 165 | ```powershell 166 | $env:CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER="x86_64-w64-mingw32.static.posix-gcc.exe" 167 | $env:LIBRARY_PATH="libgcc_mock" # Replace it with the path to the directory created above 168 | ``` 169 | 170 | Alternatively, linker can be configured in `.cargo/config.toml`: 171 | 172 | ``` toml 173 | [target.x86_64-pc-windows-gnu] 174 | linker = "x86_64-w64-mingw32.static.posix-gcc.exe" 175 | ``` 176 | 177 | Now, the tests can be run: 178 | 179 | ```powershell 180 | cargo test --target x86_64-pc-windows-gnu --features use-bindgen 181 | ``` 182 | 183 | ### Editor settings 184 | 185 |
186 | 187 | Rust-analyzer might need some settings. For example, if you are using VS Code, you probably need to add the following options to `.vscode/settings.json`. 188 | 189 | ``` json 190 | { 191 | // The target needs to be GNU 192 | "rust-analyzer.cargo.target": "x86_64-pc-windows-gnu", 193 | // Specify "use-bindgen" for developing R-devel. 194 | "rust-analyzer.cargo.features": [], 195 | "terminal.integrated.env.windows": { 196 | "R_HOME": "C:/Program Files/R/R-4.2.2", 197 | "PATH": "${env:R_HOME}/bin/x64;C:/rtools42/x86_64-w64-mingw32.static.posix/bin;C:/rtools42/usr/bin;${env:PATH}" 198 | } 199 | } 200 | ``` 201 | 202 |
203 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - master 8 | pull_request: 9 | branches: 10 | - main 11 | - master 12 | issue_comment: 13 | types: 14 | - created 15 | # This can also manually run 16 | workflow_dispatch: {} 17 | 18 | jobs: 19 | 20 | test_with_bindgen: 21 | # When the event is not issue_comment, always run the tests. When it is, 22 | # check if (1) the comment is on pull request, (2) the comment author is the 23 | # member of the organization, and (3) the comment starts with '/bindings'. 24 | # 25 | # ref. 26 | # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment 27 | if: | 28 | github.event_name != 'issue_comment' 29 | || (github.event.issue.pull_request && github.event.comment.author_association == 'MEMBER' && startsWith(github.event.comment.body, '/bindings')) 30 | 31 | runs-on: ${{ matrix.config.os }} 32 | 33 | name: ${{ matrix.config.os }} (R-${{ matrix.config.r }} rust-${{ matrix.config.rust-version }}-${{ matrix.config.target || 'default' }}) 34 | 35 | strategy: 36 | fail-fast: false 37 | matrix: 38 | config: 39 | # On Windows, 40 | # 41 | # * for R >= 4.2, both the MSVC toolchain and the GNU toolchain should 42 | # work. Since we primarily support MSVC, we focus on testing MSVC 43 | # here. Also, at least one GNU case should be included so that we 44 | # can detect when something gets broken. 45 | # * for R < 4.2, the MSVC toolchain must be used to support 46 | # cross-compilation to 32-bit. 47 | # 48 | # options: 49 | # - targets: Targets to build and run tests against. If not 50 | # specified, 'default' will be used. 51 | # - no-test-targets: Targets to skip tests. 52 | # - emit-bindings: If 'true', emit bindings. In principle, we choose 53 | # only one stable Rust toolchain per combination of a platform and 54 | # an R version (e.g. Windows and R-release) to emit bindings. 55 | - {os: windows-latest, r: 'release', rust-version: 'stable-msvc', target: 'x86_64-pc-windows-gnu', emit-bindings: 'true'} 56 | - {os: windows-latest, r: 'release', rust-version: 'nightly-msvc', target: 'x86_64-pc-windows-gnu'} 57 | - {os: windows-latest, r: 'devel', rust-version: 'stable-msvc', target: 'x86_64-pc-windows-gnu', emit-bindings: 'true'} 58 | - {os: windows-latest, r: 'release', rust-version: 'stable-gnu', target: 'x86_64-pc-windows-gnu'} 59 | - {os: windows-latest, r: 'oldrel', rust-version: 'stable-msvc', target: 'x86_64-pc-windows-gnu', emit-bindings: 'true'} 60 | - {os: windows-latest, r: '4.2', rust-version: 'stable-msvc', target: 'x86_64-pc-windows-gnu', emit-bindings: 'true' } 61 | 62 | - {os: macOS-latest, r: 'release', rust-version: 'nightly'} 63 | - {os: macOS-latest, r: 'devel', rust-version: 'stable', emit-bindings: 'true'} 64 | - {os: macOS-latest, r: 'oldrel', rust-version: 'stable', emit-bindings: 'true'} 65 | - {os: macOS-latest, r: 'release', rust-version: 'stable', emit-bindings: 'true'} 66 | - {os: macOS-latest, r: 'release', rust-version: 'stable', target: 'x86_64-apple-darwin', skip-tests: 'true', emit-bindings: 'true'} 67 | - {os: macOS-latest, r: '4.2', rust-version: 'stable', emit-bindings: 'true' } 68 | - {os: macOS-latest, r: '4.2', rust-version: 'stable', target: 'x86_64-apple-darwin', skip-tests: 'true', emit-bindings: 'true'} 69 | 70 | - {os: ubuntu-latest, r: 'release', rust-version: 'nightly'} 71 | - {os: ubuntu-latest, r: 'release', rust-version: 'stable', emit-bindings: 'true'} 72 | - {os: ubuntu-latest, r: 'release', rust-version: 'stable', target: 'aarch64-unknown-linux-gnu', skip-tests: 'true', emit-bindings: 'true'} 73 | 74 | - {os: ubuntu-latest, r: 'devel', rust-version: 'stable', emit-bindings: 'true'} 75 | - {os: ubuntu-latest, r: 'devel', rust-version: 'stable', target: 'aarch64-unknown-linux-gnu', skip-tests: 'true', emit-bindings: 'true'} 76 | 77 | - {os: ubuntu-latest, r: 'oldrel', rust-version: 'stable', emit-bindings: 'true'} 78 | - {os: ubuntu-latest, r: 'oldrel', rust-version: 'stable', target: 'aarch64-unknown-linux-gnu', skip-tests: 'true', emit-bindings: 'true'} 79 | 80 | - {os: ubuntu-latest, r: '4.2', rust-version: 'stable', emit-bindings: 'true' } 81 | - {os: ubuntu-latest, r: '4.2', rust-version: 'stable', target: 'aarch64-unknown-linux-gnu', skip-tests: 'true', emit-bindings: 'true'} 82 | env: 83 | RSPM: ${{ matrix.config.rspm }} 84 | 85 | # PowerShell core is available on all platforms and can be used to unify scripts 86 | defaults: 87 | run: 88 | shell: pwsh 89 | 90 | steps: 91 | 92 | - uses: actions/checkout@v4 93 | 94 | # When invoked by an issue comment event, the GitHub Actions runner runs 95 | # on the default branch, so we need to switch the branch of the pull 96 | # request. Since the branch name is not easily accessible via variables 97 | # provided GitHub Actions, we use r-lib/actions, which is well-maintained. 98 | - name: Switch branch (/bindings command) 99 | if: github.event_name == 'issue_comment' 100 | uses: r-lib/actions/pr-fetch@v2 101 | with: 102 | repo-token: ${{ secrets.GITHUB_TOKEN }} 103 | 104 | - name: Set up R 105 | uses: r-lib/actions/setup-r@v2 106 | with: 107 | r-version: ${{ matrix.config.r }} 108 | use-public-rspm: true 109 | 110 | - name: Set up Rust 111 | uses: dtolnay/rust-toolchain@master 112 | with: 113 | toolchain: ${{ matrix.config.rust-version }} 114 | components: rustfmt, clippy 115 | targets: ${{ matrix.config.target }} 116 | 117 | # All configurations for Windows go here 118 | # 1. Configure linker 119 | # 2. Create libgcc_eh mock 120 | # 3. Add R bin path to PATH 121 | # 4. Add Rtools' GCC to PATH (required to find linker) 122 | # 5. Add include path (required to resolve standard headers like stdio.h) 123 | - name: Configure Windows 124 | if: runner.os == 'Windows' 125 | run: | 126 | # Configure linker 127 | echo "RUSTFLAGS=-C linker=x86_64-w64-mingw32.static.posix-gcc.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append 128 | 129 | # Create libgcc_eh mock 130 | New-Item -Path libgcc_mock -Type Directory 131 | New-Item -Path libgcc_mock\libgcc_eh.a -Type File 132 | New-Item -Path libgcc_mock\libgcc_s.a -Type File 133 | $pwd_slash = echo "${PWD}" | % {$_ -replace '\\','/'} 134 | echo "LIBRARY_PATH=${pwd_slash}/libgcc_mock" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append 135 | 136 | # Add R bin path to PATH 137 | echo "$(Rscript.exe --vanilla -e 'cat(normalizePath(R.home()))')\bin\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append ; 138 | 139 | # Add Rtools' GCC to PATH 140 | # Source: https://github.com/r-lib/actions/blob/b7e68d63e51bdf225997973e2add36d551f60f02/setup-r/lib/installer.js#L471 141 | $directories = @( 142 | "C:\rtools44-aarch64\aarch64-w64-mingw32.static.posix", 143 | "C:\rtools44\x86_64-w64-mingw32.static.posix", 144 | "C:\rtools43\x86_64-w64-mingw32.static.posix", 145 | "C:\rtools42\x86_64-w64-mingw32.static.posix", 146 | "C:\rtools40\ucrt64", 147 | "C:\Rtools\mingw_64" 148 | ) 149 | 150 | $mingw_root = $null 151 | foreach ($dir in $directories) { 152 | if (Test-Path $dir) { 153 | $mingw_root = $dir 154 | Write-Host "Found Rtools directory at: $mingw_root" 155 | break 156 | } 157 | } 158 | echo "MINGW_ROOT=$mingw_root" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append 159 | 160 | if ($null -eq $mingw_root) { 161 | Write-Host "No Rtools directory found." 162 | } else { 163 | Write-Host "Mingw root set to: $mingw_root" 164 | } 165 | echo "$mingw_root\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append 166 | 167 | # Add include path 168 | echo "LIBRSYS_LIBCLANG_INCLUDE_PATH=$mingw_root\include" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append 169 | env: 170 | RUST_TARGET: ${{ matrix.config.target }} 171 | 172 | # macOS configurations, mainly llvm and path to libclang 173 | # Because of this R installation issue on macOS-11.0 174 | # https://github.com/r-lib/actions/issues/200 175 | # Symlinks to R/Rscript are not properly set up, so we do it by hand, using this trick 176 | # https://github.com/r-lib/ps/commit/a24f2c4d1bdba63be14e7729b9ab81d0ed9f719e 177 | # Environment variables are required fir Mac-OS-11.0, see 178 | # https://github.com/extendr/libR-sys/issues/35 179 | - name: Configure macOS 180 | if: runner.os == 'macOS' 181 | run: | 182 | brew install llvm 183 | echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append 184 | $env:LLVM_CONFIG_PATH = "$(brew --prefix llvm)/bin/llvm-config" 185 | echo "LLVM_CONFIG_PATH=$env:LLVM_CONFIG_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append 186 | echo "LIBRSYS_LIBCLANG_INCLUDE_PATH=$(. $env:LLVM_CONFIG_PATH --libdir)/clang/$(. $env:LLVM_CONFIG_PATH --version)/include" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append 187 | 188 | if ((Get-ChildItem -Path /usr/local/bin -Filter R | Measure-Object).Count -eq 0) { 189 | echo "::warning:: Found no R symlink in /usr/local/bin, setting up manually..." 190 | ln -s /Library/Frameworks/R.framework/Versions/Current/Resources/bin/R /usr/local/bin/ 191 | } 192 | if ((Get-ChildItem -Path /usr/local/bin -Filter Rscript | Measure-Object).Count -eq 0) { 193 | echo "::warning:: Found no Rscript symlink in /usr/local/bin, setting up manually..." 194 | ln -s /Library/Frameworks/R.framework/Versions/Current/Resources/bin/Rscript /usr/local/bin/ 195 | } 196 | 197 | # This is required for ubuntu r-devel 198 | # 'Del alias:R' removes R alias which prevents running R 199 | - name: Configure Linux 200 | if: runner.os == 'linux' 201 | run: | 202 | Del alias:R 203 | echo "LD_LIBRARY_PATH=$(R -s -e 'cat(normalizePath(R.home()))')/lib" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append 204 | 205 | if($env:RUST_TARGET -eq 'aarch64-unknown-linux-gnu') { 206 | sudo apt-get update 207 | sudo apt-get install gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu 208 | # https://github.com/rust-lang/rust-bindgen/issues/1229 209 | echo 'BINDGEN_EXTRA_CLANG_ARGS=--sysroot=/usr/aarch64-linux-gnu' >> $GITHUB_ENV 210 | # https://github.com/rust-lang/rust/issues/28924 211 | echo 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc' >> $GITHUB_ENV 212 | } 213 | env: 214 | RUST_TARGET: ${{ matrix.config.target }} 215 | 216 | 217 | # Build & run bindings with layout tests 218 | - name: Run tests 219 | id: test 220 | if: matrix.config.skip-tests != 'true' 221 | run: | 222 | . ./ci-cargo.ps1 223 | # ci-cargo test -vv --features use-bindgen,layout_tests $(if ($env:RUST_TARGET -ne '') {"--target=$env:RUST_TARGET"} ) '--' --nocapture -ActionName "Running bindgen tests for target: $env:RUST_TARGET" 224 | # ci-cargo test -vv --features use-bindgen,non-api,layout_tests $(if ($env:RUST_TARGET -ne '') {"--target=$env:RUST_TARGET"} ) '--' --nocapture -ActionName "Running bindgen tests for target: $env:RUST_TARGET (with non-API)" 225 | ci-cargo test -vv $(if ($env:RUST_TARGET -ne '') {"--target=$env:RUST_TARGET"} ) '--' --nocapture -ActionName "Running bindgen tests for target: $env:RUST_TARGET" 226 | env: 227 | RUST_TARGET: ${{ matrix.config.target }} 228 | 229 | check_generate_bindings_flag: 230 | name: Check if [generate bindings] is in latest commit message 231 | runs-on: ubuntu-latest 232 | outputs: 233 | head_commit_message: ${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }} 234 | # generate_bindings: ${{ contains(steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE, '[generate bindings]') }} 235 | steps: 236 | - uses: actions/checkout@v4 237 | with: 238 | ref: ${{ github.event.pull_request.head.sha }} 239 | - name: Get Head Commit Message 240 | id: get_head_commit_message 241 | run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT" 242 | - name: Show commit message 243 | run: | 244 | echo "${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }}" 245 | echo "${{ contains(steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE, '[generate bindings]') }}" 246 | 247 | pr_generated_bindings: 248 | name: Make PR with generated bindings 249 | needs: [test_with_bindgen, check_generate_bindings_flag] 250 | if: ${{ contains(needs.check_generate_bindings_flag.outputs.head_commit_message, '[generate bindings]') }} 251 | runs-on: ubuntu-latest 252 | steps: 253 | - uses: actions/checkout@v4 254 | with: 255 | ref: ${{ github.event.pull_request.head.ref }} 256 | - uses: actions/download-artifact@v4 257 | 258 | - name: Update bindings 259 | run: | 260 | # Update or add the bindings 261 | cp generated_binding-*/*.rs bindings/ 262 | 263 | # Replace the default bindings 264 | cd bindings 265 | for x in linux-aarch64 linux-x86_64 macos-aarch64 macos-x86_64 windows-x86_64; do 266 | # Choose the newest version except for devel 267 | ln --force -s "$(ls -1 ./bindings-${x}-*.rs | grep -v devel | sort | tail -1)" ./bindings-${x}.rs 268 | done 269 | cd .. 270 | - name: Add generated bindings 271 | run: | 272 | git add bindings/ 273 | git config --local user.name "${GITHUB_ACTOR}" 274 | git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com" 275 | git commit -m "Update bindings [skip ci]" 276 | - name: Push to PR branch 277 | run: git push 278 | 279 | # Gather the generated bindings and push them to generated_bindings branch. 280 | # If we need to update the bindings, create a pull request from that branch. 281 | commit_generated_bindings: 282 | needs: test_with_bindgen 283 | runs-on: ubuntu-latest 284 | # In the case of /bindings command, we don't need to check anything else 285 | # because it should have checked in test_with_bindings job. In the other 286 | # cases, we only want to invoke this on the master branch. 287 | if: github.event_name == 'issue_comment' || github.ref == 'refs/heads/master' 288 | steps: 289 | - uses: actions/checkout@v4 290 | 291 | - uses: actions/download-artifact@v4 292 | 293 | - name: Switch branch 294 | if: github.event_name != 'issue_comment' 295 | run: | 296 | # 1) If there's already generated_bindings branch, checkout it. 297 | # 2) If generated_binding branch is not created, create it from the default branch. 298 | if git ls-remote --exit-code --heads origin generated_bindings 2>&1 >/dev/null; then 299 | git fetch origin --no-tags --prune --depth=1 generated_bindings 300 | git checkout generated_bindings 301 | else 302 | git switch -c generated_bindings 303 | fi 304 | 305 | - name: Switch branch (/bindings command) 306 | if: github.event_name == 'issue_comment' 307 | uses: r-lib/actions/pr-fetch@v2 308 | with: 309 | repo-token: ${{ secrets.GITHUB_TOKEN }} 310 | 311 | - name: Commit the generated bindings 312 | run: | 313 | # Update or add the bindings 314 | cp generated_binding-*/*.rs bindings/ 315 | 316 | # Replace the default bindings 317 | cd bindings 318 | for x in linux-aarch64 linux-x86_64 macos-aarch64 macos-x86_64 windows-x86_64; do 319 | # Choose the newest version except for devel 320 | ln --force -s "$(ls -1 ./bindings-${x}-*.rs | grep -v devel | sort | tail -1)" ./bindings-${x}.rs 321 | done 322 | cd .. 323 | 324 | # detect changes (the code is derived from https://stackoverflow.com/a/3879077) 325 | git add bindings/ 326 | git update-index --refresh 327 | if ! git diff-index --quiet HEAD -- bindings/; then 328 | git config --local user.name "${GITHUB_ACTOR}" 329 | git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com" 330 | git commit -m "Update bindings [skip ci]" 331 | else 332 | echo "No changes" 333 | fi 334 | 335 | - name: Push 336 | if: github.event_name != 'issue_comment' 337 | run: git push origin generated_bindings 338 | 339 | - name: Push (/bindings command) 340 | if: github.event_name == 'issue_comment' 341 | uses: r-lib/actions/pr-push@v2 342 | with: 343 | repo-token: ${{ secrets.GITHUB_TOKEN }} 344 | -------------------------------------------------------------------------------- /bindings/bindings-windows-x86_64-R4.2.rs: -------------------------------------------------------------------------------- 1 | /* automatically generated by rust-bindgen 0.69.4 */ 2 | 3 | /* libR-sys version: 0.7.0 */ 4 | /* bindgen clang version: clang version 18.1.6 */ 5 | /* r version: 4.2.3 */ 6 | 7 | pub const SINGLESXP: u32 = 302; 8 | pub const R_LEN_T_MAX: u32 = 2147483647; 9 | pub const HAVE_F77_UNDERSCORE: u32 = 1; 10 | pub const IEEE_754: u32 = 1; 11 | pub const SUPPORT_UTF8: u32 = 1; 12 | pub const SUPPORT_MBCS: u32 = 1; 13 | pub const ENABLE_NLS: u32 = 1; 14 | pub const SIZEOF_SIZE_T: u32 = 8; 15 | pub const HAVE_UINTPTR_T: u32 = 1; 16 | pub const R_XLEN_T_MAX: u64 = 4503599627370496; 17 | pub const R_SHORT_LEN_MAX: u32 = 2147483647; 18 | pub const TYPE_BITS: u32 = 5; 19 | pub const MAX_NUM_SEXPTYPE: u32 = 32; 20 | pub const NAMEDMAX: u32 = 7; 21 | pub const R_XDR_DOUBLE_SIZE: u32 = 8; 22 | pub const R_XDR_INTEGER_SIZE: u32 = 4; 23 | pub const R_CODESET_MAX: u32 = 63; 24 | pub const IDENT_NUM_AS_BITS: u32 = 1; 25 | pub const IDENT_NA_AS_BITS: u32 = 2; 26 | pub const IDENT_ATTR_BY_ORDER: u32 = 4; 27 | pub const IDENT_USE_BYTECODE: u32 = 8; 28 | pub const IDENT_USE_CLOENV: u32 = 16; 29 | pub const IDENT_USE_SRCREF: u32 = 32; 30 | pub const IDENT_EXTPTR_AS_REF: u32 = 64; 31 | pub const HT_TYPE_IDENTICAL: u32 = 0; 32 | pub const HT_TYPE_ADDRESS: u32 = 1; 33 | pub const __STDC_WANT_IEC_60559_FUNCS_EXT__: u32 = 1; 34 | pub const R_VERSION_STRING: &[u8; 6] = b"4.2.3\0"; 35 | pub const HAVE_EXPM1: u32 = 1; 36 | pub const HAVE_HYPOT: u32 = 1; 37 | pub const HAVE_LOG1P: u32 = 1; 38 | pub const HAVE_WORKING_LOG1P: u32 = 1; 39 | pub const M_SQRT_3: f64 = 1.7320508075688772; 40 | pub const M_SQRT_32: f64 = 5.656854249492381; 41 | pub const M_SQRT_PI: f64 = 1.772453850905516; 42 | pub const M_1_SQRT_2PI: f64 = 0.3989422804014327; 43 | pub const M_SQRT_2dPI: f64 = 0.7978845608028654; 44 | pub const M_LN_2PI: f64 = 1.8378770664093456; 45 | pub const M_LN_SQRT_PI: f64 = 0.5723649429247001; 46 | pub const M_LN_SQRT_2PI: f64 = 0.9189385332046728; 47 | pub const M_LN_SQRT_PId2: f64 = 0.22579135264472744; 48 | pub const R_VERSION: u32 = 262659; 49 | pub const R_NICK: &[u8; 17] = b"Shortstop Beagle\0"; 50 | pub const R_MAJOR: &[u8; 2] = b"4\0"; 51 | pub const R_MINOR: &[u8; 4] = b"2.3\0"; 52 | pub const R_STATUS: &[u8; 1] = b"\0"; 53 | pub const R_YEAR: &[u8; 5] = b"2023\0"; 54 | pub const R_MONTH: &[u8; 3] = b"03\0"; 55 | pub const R_DAY: &[u8; 3] = b"15\0"; 56 | pub const R_SVN_REVISION: u32 = 83980; 57 | pub const R_GE_definitions: u32 = 13; 58 | pub const R_GE_deviceClip: u32 = 14; 59 | pub const R_GE_group: u32 = 15; 60 | pub const R_GE_version: u32 = 15; 61 | pub const MAX_GRAPHICS_SYSTEMS: u32 = 24; 62 | pub const R_USE_PROTOTYPES: u32 = 1; 63 | pub const leftButton: u32 = 1; 64 | pub const middleButton: u32 = 2; 65 | pub const rightButton: u32 = 4; 66 | pub const LTY_BLANK: i32 = -1; 67 | pub const LTY_SOLID: u32 = 0; 68 | pub const LTY_DASHED: u32 = 68; 69 | pub const LTY_DOTTED: u32 = 49; 70 | pub const LTY_DOTDASH: u32 = 13361; 71 | pub const LTY_LONGDASH: u32 = 55; 72 | pub const LTY_TWODASH: u32 = 9762; 73 | pub const DEG2RAD: f64 = 0.017453292519943295; 74 | pub const R_GE_linearGradientPattern: u32 = 1; 75 | pub const R_GE_radialGradientPattern: u32 = 2; 76 | pub const R_GE_tilingPattern: u32 = 3; 77 | pub const R_GE_patternExtendPad: u32 = 1; 78 | pub const R_GE_patternExtendRepeat: u32 = 2; 79 | pub const R_GE_patternExtendReflect: u32 = 3; 80 | pub const R_GE_patternExtendNone: u32 = 4; 81 | pub const R_GE_compositeClear: u32 = 1; 82 | pub const R_GE_compositeSource: u32 = 2; 83 | pub const R_GE_compositeOver: u32 = 3; 84 | pub const R_GE_compositeIn: u32 = 4; 85 | pub const R_GE_compositeOut: u32 = 5; 86 | pub const R_GE_compositeAtop: u32 = 6; 87 | pub const R_GE_compositeDest: u32 = 7; 88 | pub const R_GE_compositeDestOver: u32 = 8; 89 | pub const R_GE_compositeDestIn: u32 = 9; 90 | pub const R_GE_compositeDestOut: u32 = 10; 91 | pub const R_GE_compositeDestAtop: u32 = 11; 92 | pub const R_GE_compositeXor: u32 = 12; 93 | pub const R_GE_compositeAdd: u32 = 13; 94 | pub const R_GE_compositeSaturate: u32 = 14; 95 | pub const R_GE_compositeMultiply: u32 = 15; 96 | pub const R_GE_compositeScreen: u32 = 16; 97 | pub const R_GE_compositeOverlay: u32 = 17; 98 | pub const R_GE_compositeDarken: u32 = 18; 99 | pub const R_GE_compositeLighten: u32 = 19; 100 | pub const R_GE_compositeColorDodge: u32 = 20; 101 | pub const R_GE_compositeColorBurn: u32 = 21; 102 | pub const R_GE_compositeHardLight: u32 = 22; 103 | pub const R_GE_compositeSoftLight: u32 = 23; 104 | pub const R_GE_compositeDifference: u32 = 24; 105 | pub const R_GE_compositeExclusion: u32 = 25; 106 | pub const R_GE_nonZeroWindingRule: u32 = 1; 107 | pub const R_GE_evenOddRule: u32 = 2; 108 | pub const R_GE_alphaMask: u32 = 1; 109 | pub const R_GE_luminanceMask: u32 = 2; 110 | pub const R_GE_capability_semiTransparency: u32 = 0; 111 | pub const R_GE_capability_transparentBackground: u32 = 1; 112 | pub const R_GE_capability_rasterImage: u32 = 2; 113 | pub const R_GE_capability_capture: u32 = 3; 114 | pub const R_GE_capability_locator: u32 = 4; 115 | pub const R_GE_capability_events: u32 = 5; 116 | pub const R_GE_capability_patterns: u32 = 6; 117 | pub const R_GE_capability_clippingPaths: u32 = 7; 118 | pub const R_GE_capability_masks: u32 = 8; 119 | pub const R_GE_capability_compositing: u32 = 9; 120 | pub const R_GE_capability_transformations: u32 = 10; 121 | pub const R_GE_capability_paths: u32 = 11; 122 | pub type __gnuc_va_list = __builtin_va_list; 123 | pub type va_list = __gnuc_va_list; 124 | #[doc = "R_xlen_t is defined as int on 32-bit platforms, and\n that confuses Rust. Keeping it always as ptrdiff_t works\n fine even on 32-bit.\n
"] 125 | pub type R_xlen_t = isize; 126 | #[repr(C)] 127 | #[derive(Debug, Copy, Clone)] 128 | pub struct _iobuf { 129 | pub _Placeholder: *mut ::std::os::raw::c_void, 130 | } 131 | pub type FILE = _iobuf; 132 | #[repr(u32)] 133 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 134 | pub enum Rboolean { 135 | #[doc = ", MAYBE"] 136 | FALSE = 0, 137 | #[doc = ", MAYBE"] 138 | TRUE = 1, 139 | } 140 | #[doc = "Called with a variable argument set after casting to a compatible\nfunction pointer."] 141 | pub type DL_FUNC = ::std::option::Option *mut ::std::os::raw::c_void>; 142 | pub type R_NativePrimitiveArgType = ::std::os::raw::c_uint; 143 | #[doc = "These are very similar to those in Rdynpriv.h,\nbut we maintain them separately to give us more freedom to do\nsome computations on the internal versions that are derived from\nthese definitions."] 144 | #[repr(C)] 145 | #[derive(Debug, Copy, Clone)] 146 | pub struct R_CMethodDef { 147 | pub name: *const ::std::os::raw::c_char, 148 | pub fun: DL_FUNC, 149 | pub numArgs: ::std::os::raw::c_int, 150 | pub types: *mut R_NativePrimitiveArgType, 151 | } 152 | #[doc = "These are very similar to those in Rdynpriv.h,\nbut we maintain them separately to give us more freedom to do\nsome computations on the internal versions that are derived from\nthese definitions."] 153 | pub type R_FortranMethodDef = R_CMethodDef; 154 | #[repr(C)] 155 | #[derive(Debug, Copy, Clone)] 156 | pub struct R_CallMethodDef { 157 | pub name: *const ::std::os::raw::c_char, 158 | pub fun: DL_FUNC, 159 | pub numArgs: ::std::os::raw::c_int, 160 | } 161 | pub type R_ExternalMethodDef = R_CallMethodDef; 162 | #[repr(C)] 163 | #[derive(Debug, Copy, Clone)] 164 | pub struct _DllInfo { 165 | _unused: [u8; 0], 166 | } 167 | pub type DllInfo = _DllInfo; 168 | #[repr(C)] 169 | #[derive(Debug, Copy, Clone)] 170 | pub struct Rf_RegisteredNativeSymbol { 171 | _unused: [u8; 0], 172 | } 173 | pub type R_RegisteredNativeSymbol = Rf_RegisteredNativeSymbol; 174 | #[repr(u32)] 175 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 176 | pub enum NativeSymbolType { 177 | R_ANY_SYM = 0, 178 | R_C_SYM = 1, 179 | R_CALL_SYM = 2, 180 | R_FORTRAN_SYM = 3, 181 | R_EXTERNAL_SYM = 4, 182 | } 183 | pub type Rbyte = ::std::os::raw::c_uchar; 184 | #[doc = "type for length of (standard, not long) vectors etc"] 185 | pub type R_len_t = ::std::os::raw::c_int; 186 | #[repr(u32)] 187 | #[doc = "------ enum_SEXPTYPE -----"] 188 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 189 | pub enum SEXPTYPE { 190 | #[doc = "nil = NULL"] 191 | NILSXP = 0, 192 | #[doc = "symbols"] 193 | SYMSXP = 1, 194 | #[doc = "lists of dotted pairs"] 195 | LISTSXP = 2, 196 | #[doc = "closures"] 197 | CLOSXP = 3, 198 | #[doc = "environments"] 199 | ENVSXP = 4, 200 | #[doc = "promises: \\[un\\]evaluated closure arguments"] 201 | PROMSXP = 5, 202 | #[doc = "language constructs (special lists)"] 203 | LANGSXP = 6, 204 | #[doc = "special forms"] 205 | SPECIALSXP = 7, 206 | #[doc = "builtin non-special forms"] 207 | BUILTINSXP = 8, 208 | #[doc = "\"scalar\" string type (internal only)"] 209 | CHARSXP = 9, 210 | #[doc = "logical vectors"] 211 | LGLSXP = 10, 212 | #[doc = "integer vectors"] 213 | INTSXP = 13, 214 | #[doc = "real variables"] 215 | REALSXP = 14, 216 | #[doc = "complex variables"] 217 | CPLXSXP = 15, 218 | #[doc = "string vectors"] 219 | STRSXP = 16, 220 | #[doc = "dot-dot-dot object"] 221 | DOTSXP = 17, 222 | #[doc = "make \"any\" args work"] 223 | ANYSXP = 18, 224 | #[doc = "generic vectors"] 225 | VECSXP = 19, 226 | #[doc = "expressions vectors"] 227 | EXPRSXP = 20, 228 | #[doc = "byte code"] 229 | BCODESXP = 21, 230 | #[doc = "external pointer"] 231 | EXTPTRSXP = 22, 232 | #[doc = "weak reference"] 233 | WEAKREFSXP = 23, 234 | #[doc = "raw bytes"] 235 | RAWSXP = 24, 236 | #[doc = "S4 non-vector"] 237 | S4SXP = 25, 238 | #[doc = "fresh node creaed in new page"] 239 | NEWSXP = 30, 240 | #[doc = "node released by GC"] 241 | FREESXP = 31, 242 | #[doc = "Closure or Builtin"] 243 | FUNSXP = 99, 244 | } 245 | pub type SEXP = *mut SEXPREC; 246 | #[doc = "We sometimes need to coerce a protected value and place the new\ncoerced value under protection. For these cases PROTECT_WITH_INDEX\nsaves an index of the protection location that can be used to\nreplace the protected value using REPROTECT."] 247 | pub type PROTECT_INDEX = ::std::os::raw::c_int; 248 | #[repr(C)] 249 | #[derive(Debug, Copy, Clone)] 250 | pub struct R_allocator { 251 | _unused: [u8; 0], 252 | } 253 | pub type R_allocator_t = R_allocator; 254 | #[repr(u32)] 255 | #[doc = "../main/character.c :"] 256 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 257 | pub enum nchar_type { 258 | Bytes = 0, 259 | Chars = 1, 260 | Width = 2, 261 | } 262 | #[repr(u32)] 263 | #[doc = "cetype_t is an identifier reseved by POSIX, but it is\nwell established as public. Could remap by a #define though"] 264 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 265 | pub enum cetype_t { 266 | CE_NATIVE = 0, 267 | CE_UTF8 = 1, 268 | CE_LATIN1 = 2, 269 | CE_BYTES = 3, 270 | CE_SYMBOL = 5, 271 | CE_ANY = 99, 272 | } 273 | #[doc = "Finalization interface"] 274 | pub type R_CFinalizer_t = ::std::option::Option; 275 | pub type R_pstream_data_t = *mut ::std::os::raw::c_void; 276 | #[repr(u32)] 277 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 278 | pub enum R_pstream_format_t { 279 | R_pstream_any_format = 0, 280 | R_pstream_ascii_format = 1, 281 | R_pstream_binary_format = 2, 282 | R_pstream_xdr_format = 3, 283 | R_pstream_asciihex_format = 4, 284 | } 285 | pub type R_outpstream_t = *mut R_outpstream_st; 286 | #[repr(C)] 287 | #[derive(Debug, Copy, Clone)] 288 | pub struct R_outpstream_st { 289 | pub data: R_pstream_data_t, 290 | pub type_: R_pstream_format_t, 291 | pub version: ::std::os::raw::c_int, 292 | pub OutChar: ::std::option::Option< 293 | unsafe extern "C" fn(arg1: R_outpstream_t, arg2: ::std::os::raw::c_int), 294 | >, 295 | pub OutBytes: ::std::option::Option< 296 | unsafe extern "C" fn( 297 | arg1: R_outpstream_t, 298 | arg2: *mut ::std::os::raw::c_void, 299 | arg3: ::std::os::raw::c_int, 300 | ), 301 | >, 302 | pub OutPersistHookFunc: 303 | ::std::option::Option SEXP>, 304 | pub OutPersistHookData: SEXP, 305 | } 306 | pub type R_inpstream_t = *mut R_inpstream_st; 307 | #[repr(C)] 308 | #[derive(Debug, Copy, Clone)] 309 | pub struct R_inpstream_st { 310 | pub data: R_pstream_data_t, 311 | pub type_: R_pstream_format_t, 312 | pub InChar: 313 | ::std::option::Option ::std::os::raw::c_int>, 314 | pub InBytes: ::std::option::Option< 315 | unsafe extern "C" fn( 316 | arg1: R_inpstream_t, 317 | arg2: *mut ::std::os::raw::c_void, 318 | arg3: ::std::os::raw::c_int, 319 | ), 320 | >, 321 | pub InPersistHookFunc: 322 | ::std::option::Option SEXP>, 323 | pub InPersistHookData: SEXP, 324 | pub native_encoding: [::std::os::raw::c_char; 64usize], 325 | pub nat2nat_obj: *mut ::std::os::raw::c_void, 326 | pub nat2utf8_obj: *mut ::std::os::raw::c_void, 327 | } 328 | pub const SORTED_DECR_NA_1ST: _bindgen_ty_1 = _bindgen_ty_1::SORTED_DECR_NA_1ST; 329 | pub const SORTED_DECR: _bindgen_ty_1 = _bindgen_ty_1::SORTED_DECR; 330 | pub const UNKNOWN_SORTEDNESS: _bindgen_ty_1 = _bindgen_ty_1::UNKNOWN_SORTEDNESS; 331 | pub const SORTED_INCR: _bindgen_ty_1 = _bindgen_ty_1::SORTED_INCR; 332 | pub const SORTED_INCR_NA_1ST: _bindgen_ty_1 = _bindgen_ty_1::SORTED_INCR_NA_1ST; 333 | pub const KNOWN_UNSORTED: _bindgen_ty_1 = _bindgen_ty_1::KNOWN_UNSORTED; 334 | #[repr(i32)] 335 | #[doc = "ALTREP sorting support"] 336 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 337 | pub enum _bindgen_ty_1 { 338 | SORTED_DECR_NA_1ST = -2, 339 | SORTED_DECR = -1, 340 | #[doc = "INT_MIN is NA_INTEGER!"] 341 | UNKNOWN_SORTEDNESS = -2147483648, 342 | SORTED_INCR = 1, 343 | SORTED_INCR_NA_1ST = 2, 344 | KNOWN_UNSORTED = 0, 345 | } 346 | #[doc = "try to allow some type checking"] 347 | #[repr(C)] 348 | #[derive(Debug, Copy, Clone)] 349 | pub struct R_hashtab_type { 350 | pub cell: SEXP, 351 | } 352 | #[repr(u32)] 353 | #[doc = "PARSE_NULL will not be returned by R_ParseVector"] 354 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 355 | pub enum ParseStatus { 356 | PARSE_NULL = 0, 357 | PARSE_OK = 1, 358 | PARSE_INCOMPLETE = 2, 359 | PARSE_ERROR = 3, 360 | PARSE_EOF = 4, 361 | } 362 | #[repr(C)] 363 | #[derive(Debug, Copy, Clone)] 364 | pub struct R_altrep_class_t { 365 | pub ptr: SEXP, 366 | } 367 | pub type R_altrep_UnserializeEX_method_t = ::std::option::Option< 368 | unsafe extern "C" fn( 369 | arg1: SEXP, 370 | arg2: SEXP, 371 | arg3: SEXP, 372 | arg4: ::std::os::raw::c_int, 373 | arg5: ::std::os::raw::c_int, 374 | ) -> SEXP, 375 | >; 376 | pub type R_altrep_Unserialize_method_t = 377 | ::std::option::Option SEXP>; 378 | pub type R_altrep_Serialized_state_method_t = 379 | ::std::option::Option SEXP>; 380 | pub type R_altrep_DuplicateEX_method_t = 381 | ::std::option::Option SEXP>; 382 | pub type R_altrep_Duplicate_method_t = 383 | ::std::option::Option SEXP>; 384 | pub type R_altrep_Inspect_method_t = ::std::option::Option< 385 | unsafe extern "C" fn( 386 | arg1: SEXP, 387 | arg2: ::std::os::raw::c_int, 388 | arg3: ::std::os::raw::c_int, 389 | arg4: ::std::os::raw::c_int, 390 | arg5: ::std::option::Option< 391 | unsafe extern "C" fn( 392 | arg1: SEXP, 393 | arg2: ::std::os::raw::c_int, 394 | arg3: ::std::os::raw::c_int, 395 | arg4: ::std::os::raw::c_int, 396 | ), 397 | >, 398 | ) -> Rboolean, 399 | >; 400 | pub type R_altrep_Length_method_t = 401 | ::std::option::Option R_xlen_t>; 402 | pub type R_altvec_Dataptr_method_t = ::std::option::Option< 403 | unsafe extern "C" fn(arg1: SEXP, arg2: Rboolean) -> *mut ::std::os::raw::c_void, 404 | >; 405 | pub type R_altvec_Dataptr_or_null_method_t = 406 | ::std::option::Option *const ::std::os::raw::c_void>; 407 | pub type R_altvec_Extract_subset_method_t = 408 | ::std::option::Option SEXP>; 409 | pub type R_altinteger_Elt_method_t = ::std::option::Option< 410 | unsafe extern "C" fn(arg1: SEXP, arg2: R_xlen_t) -> ::std::os::raw::c_int, 411 | >; 412 | pub type R_altinteger_Get_region_method_t = ::std::option::Option< 413 | unsafe extern "C" fn( 414 | arg1: SEXP, 415 | arg2: R_xlen_t, 416 | arg3: R_xlen_t, 417 | arg4: *mut ::std::os::raw::c_int, 418 | ) -> R_xlen_t, 419 | >; 420 | pub type R_altinteger_Is_sorted_method_t = 421 | ::std::option::Option ::std::os::raw::c_int>; 422 | pub type R_altinteger_No_NA_method_t = 423 | ::std::option::Option ::std::os::raw::c_int>; 424 | pub type R_altinteger_Sum_method_t = 425 | ::std::option::Option SEXP>; 426 | pub type R_altinteger_Min_method_t = 427 | ::std::option::Option SEXP>; 428 | pub type R_altinteger_Max_method_t = 429 | ::std::option::Option SEXP>; 430 | pub type R_altreal_Elt_method_t = 431 | ::std::option::Option f64>; 432 | pub type R_altreal_Get_region_method_t = ::std::option::Option< 433 | unsafe extern "C" fn(arg1: SEXP, arg2: R_xlen_t, arg3: R_xlen_t, arg4: *mut f64) -> R_xlen_t, 434 | >; 435 | pub type R_altreal_Is_sorted_method_t = 436 | ::std::option::Option ::std::os::raw::c_int>; 437 | pub type R_altreal_No_NA_method_t = 438 | ::std::option::Option ::std::os::raw::c_int>; 439 | pub type R_altreal_Sum_method_t = 440 | ::std::option::Option SEXP>; 441 | pub type R_altreal_Min_method_t = 442 | ::std::option::Option SEXP>; 443 | pub type R_altreal_Max_method_t = 444 | ::std::option::Option SEXP>; 445 | pub type R_altlogical_Elt_method_t = ::std::option::Option< 446 | unsafe extern "C" fn(arg1: SEXP, arg2: R_xlen_t) -> ::std::os::raw::c_int, 447 | >; 448 | pub type R_altlogical_Get_region_method_t = ::std::option::Option< 449 | unsafe extern "C" fn( 450 | arg1: SEXP, 451 | arg2: R_xlen_t, 452 | arg3: R_xlen_t, 453 | arg4: *mut ::std::os::raw::c_int, 454 | ) -> R_xlen_t, 455 | >; 456 | pub type R_altlogical_Is_sorted_method_t = 457 | ::std::option::Option ::std::os::raw::c_int>; 458 | pub type R_altlogical_No_NA_method_t = 459 | ::std::option::Option ::std::os::raw::c_int>; 460 | pub type R_altlogical_Sum_method_t = 461 | ::std::option::Option SEXP>; 462 | pub type R_altraw_Elt_method_t = 463 | ::std::option::Option Rbyte>; 464 | pub type R_altraw_Get_region_method_t = ::std::option::Option< 465 | unsafe extern "C" fn(arg1: SEXP, arg2: R_xlen_t, arg3: R_xlen_t, arg4: *mut Rbyte) -> R_xlen_t, 466 | >; 467 | pub type R_altcomplex_Elt_method_t = 468 | ::std::option::Option Rcomplex>; 469 | pub type R_altcomplex_Get_region_method_t = ::std::option::Option< 470 | unsafe extern "C" fn( 471 | arg1: SEXP, 472 | arg2: R_xlen_t, 473 | arg3: R_xlen_t, 474 | arg4: *mut Rcomplex, 475 | ) -> R_xlen_t, 476 | >; 477 | pub type R_altstring_Elt_method_t = 478 | ::std::option::Option SEXP>; 479 | pub type R_altstring_Set_elt_method_t = 480 | ::std::option::Option; 481 | pub type R_altstring_Is_sorted_method_t = 482 | ::std::option::Option ::std::os::raw::c_int>; 483 | pub type R_altstring_No_NA_method_t = 484 | ::std::option::Option ::std::os::raw::c_int>; 485 | #[repr(u32)] 486 | #[doc = "The graphics engine will only accept locations and dimensions\n in native device coordinates, but it provides the following functions\n for converting between a couple of simple alternative coordinate\n systems and device coordinates:\n DEVICE = native units of the device\n NDC = Normalised device coordinates\n INCHES = inches (!)\n CM = centimetres (!!)"] 487 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 488 | pub enum GEUnit { 489 | #[doc = "native device coordinates (rasters)"] 490 | GE_DEVICE = 0, 491 | #[doc = "normalised device coordinates x=(0,1), y=(0,1)"] 492 | GE_NDC = 1, 493 | GE_INCHES = 2, 494 | GE_CM = 3, 495 | } 496 | #[repr(u32)] 497 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 498 | pub enum GEevent { 499 | #[doc = "In response to this event, the registered graphics system\n should allocate and initialise the systemSpecific structure\n\n Should return R_NilValue on failure so that engine\n can tidy up memory allocation"] 500 | GE_InitState = 0, 501 | #[doc = "This event gives the registered system a chance to undo\n anything done in the initialisation."] 502 | GE_FinaliseState = 1, 503 | #[doc = "This is sent by the graphics engine prior to initialising\n the display list. It give the graphics system the chance\n to squirrel away information it will need for redrawing the\n the display list"] 504 | GE_SaveState = 2, 505 | #[doc = "This is sent by the graphics engine prior to replaying the\n display list. It gives the graphics system the chance to\n restore any information it saved on the GE_SaveState event"] 506 | GE_RestoreState = 6, 507 | #[doc = "Copy system state information to the current device.\n This is used when copying graphics from one device to another\n so all the graphics system needs to do is to copy across\n the bits required for the display list to draw faithfully\n on the new device."] 508 | GE_CopyState = 3, 509 | #[doc = "Create a snapshot of the system state that is sufficient\n for the current \"image\" to be reproduced"] 510 | GE_SaveSnapshotState = 4, 511 | #[doc = "Restore the system state that is saved by GE_SaveSnapshotState"] 512 | GE_RestoreSnapshotState = 5, 513 | #[doc = "When replaying the display list, the graphics engine\n checks, after each replayed action, that the action\n produced valid output. This is the graphics system's\n chance to say that the output is crap (in which case the\n graphics engine will abort the display list replay)."] 514 | GE_CheckPlot = 7, 515 | #[doc = "The device wants to scale the current pointsize\n (for scaling an image)\n This is not a nice general solution, but a quick fix for\n the Windows device."] 516 | GE_ScalePS = 8, 517 | } 518 | #[repr(u32)] 519 | #[doc = "Some line end/join constants"] 520 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 521 | pub enum R_GE_lineend { 522 | GE_ROUND_CAP = 1, 523 | GE_BUTT_CAP = 2, 524 | GE_SQUARE_CAP = 3, 525 | } 526 | #[repr(u32)] 527 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 528 | pub enum R_GE_linejoin { 529 | GE_ROUND_JOIN = 1, 530 | GE_MITRE_JOIN = 2, 531 | GE_BEVEL_JOIN = 3, 532 | } 533 | #[doc = "A structure containing graphical parameters\n\n This is how graphical parameters are passed from graphics systems\n to the graphics engine AND from the graphics engine to graphics\n devices.\n\n Devices are not *required* to honour graphical parameters\n (e.g., alpha transparency is going to be tough for some)"] 534 | #[repr(C)] 535 | #[derive(Debug, Copy, Clone)] 536 | pub struct R_GE_gcontext { 537 | #[doc = "pen colour (lines, text, borders, ...)"] 538 | pub col: ::std::os::raw::c_int, 539 | #[doc = "fill colour (for polygons, circles, rects, ...)"] 540 | pub fill: ::std::os::raw::c_int, 541 | #[doc = "Gamma correction"] 542 | pub gamma: f64, 543 | #[doc = "Line width (roughly number of pixels)"] 544 | pub lwd: f64, 545 | #[doc = "Line type (solid, dashed, dotted, ...)"] 546 | pub lty: ::std::os::raw::c_int, 547 | #[doc = "Line end"] 548 | pub lend: R_GE_lineend, 549 | #[doc = "line join"] 550 | pub ljoin: R_GE_linejoin, 551 | #[doc = "line mitre"] 552 | pub lmitre: f64, 553 | #[doc = "Character expansion (font size = fontsize*cex)"] 554 | pub cex: f64, 555 | #[doc = "Font size in points"] 556 | pub ps: f64, 557 | #[doc = "Line height (multiply by font size)"] 558 | pub lineheight: f64, 559 | #[doc = "Font face (plain, italic, bold, ...)"] 560 | pub fontface: ::std::os::raw::c_int, 561 | #[doc = "Font family"] 562 | pub fontfamily: [::std::os::raw::c_char; 201usize], 563 | #[doc = "Reference to a pattern fill"] 564 | pub patternFill: SEXP, 565 | } 566 | pub type pGEcontext = *mut R_GE_gcontext; 567 | #[doc = "--------- New (in 1.4.0) device driver structure ---------\n NOTES:\n 1. All locations and dimensions are in device coordinates.\n 2. I found this comment in the doc for dev_Open -- looks nasty\n Any known instances of such a thing happening? Should be\n replaced by a function to query the device for preferred gpars\n settings? (to be called when the device is initialised)\n\n NOTE that it is perfectly acceptable for this\n function to set generic graphics parameters too\n (i.e., override the generic parameter settings\n which GInit sets up) all at the author's own risk\n of course :)\n\n 3. Do we really need dev_StrWidth as well as dev_MetricInfo?\n I can see the difference between the two -- its just a\n question of whether dev_MetricInfo should just return\n what dev_StrWidth would give if font metric information is\n not available. I guess having both allows the developer\n to decide when to ask for which sort of value, and to decide\n what to do when font metric information is not available.\n And why not a dev_StrHeight?\n 4. Should \"ipr\", \"asp\", and \"cra\" be in the device description?\n If not, then where?\n I guess they don't need to be if no device makes use of them.\n On the other hand, they would need to be replaced by a device\n call that R base graphics could use to get enough information\n to figure them out. (e.g., some sort of dpi() function to\n complement the size() function.)"] 568 | pub type DevDesc = _DevDesc; 569 | pub type pDevDesc = *mut DevDesc; 570 | #[repr(C)] 571 | #[derive(Debug, Copy, Clone)] 572 | pub struct _DevDesc { 573 | #[doc = "left raster coordinate"] 574 | pub left: f64, 575 | #[doc = "right raster coordinate"] 576 | pub right: f64, 577 | #[doc = "bottom raster coordinate"] 578 | pub bottom: f64, 579 | #[doc = "top raster coordinate"] 580 | pub top: f64, 581 | #[doc = "R only has the notion of a rectangular clipping region"] 582 | pub clipLeft: f64, 583 | pub clipRight: f64, 584 | pub clipBottom: f64, 585 | pub clipTop: f64, 586 | #[doc = "x character addressing offset - unused"] 587 | pub xCharOffset: f64, 588 | #[doc = "y character addressing offset"] 589 | pub yCharOffset: f64, 590 | #[doc = "1/2 interline space as frac of line height"] 591 | pub yLineBias: f64, 592 | #[doc = "Inches per raster; \\[0\\]=x, \\[1\\]=y"] 593 | pub ipr: [f64; 2usize], 594 | #[doc = "Character size in rasters; \\[0\\]=x, \\[1\\]=y"] 595 | pub cra: [f64; 2usize], 596 | #[doc = "(initial) Device Gamma Correction"] 597 | pub gamma: f64, 598 | #[doc = "Device-level clipping"] 599 | pub canClip: Rboolean, 600 | #[doc = "can the gamma factor be modified?"] 601 | pub canChangeGamma: Rboolean, 602 | #[doc = "Can do at least some horiz adjust of text\n0 = none, 1 = {0,0.5,1}, 2 = \\[0,1\\]"] 603 | pub canHAdj: ::std::os::raw::c_int, 604 | #[doc = "Device initial settings\n/\n/* These are things that the device must set up when it is created.\n The graphics system can modify them and track current values,"] 605 | pub startps: f64, 606 | #[doc = "sets par(\"fg\"), par(\"col\") and gpar(\"col\")"] 607 | pub startcol: ::std::os::raw::c_int, 608 | #[doc = "sets par(\"bg\") and gpar(\"fill\")"] 609 | pub startfill: ::std::os::raw::c_int, 610 | pub startlty: ::std::os::raw::c_int, 611 | pub startfont: ::std::os::raw::c_int, 612 | pub startgamma: f64, 613 | #[doc = "pointer to device specific parameters"] 614 | pub deviceSpecific: *mut ::std::os::raw::c_void, 615 | #[doc = "toggle for initial display list status"] 616 | pub displayListOn: Rboolean, 617 | #[doc = "can the device generate mousedown events"] 618 | pub canGenMouseDown: Rboolean, 619 | #[doc = "can the device generate mousemove events"] 620 | pub canGenMouseMove: Rboolean, 621 | #[doc = "can the device generate mouseup events"] 622 | pub canGenMouseUp: Rboolean, 623 | #[doc = "can the device generate keyboard events"] 624 | pub canGenKeybd: Rboolean, 625 | #[doc = "can the device generate idle events"] 626 | pub canGenIdle: Rboolean, 627 | #[doc = "This is set while getGraphicsEvent\nis actively looking for events"] 628 | pub gettingEvent: Rboolean, 629 | pub activate: ::std::option::Option, 630 | pub circle: ::std::option::Option< 631 | unsafe extern "C" fn(x: f64, y: f64, r: f64, gc: pGEcontext, dd: pDevDesc), 632 | >, 633 | pub clip: ::std::option::Option< 634 | unsafe extern "C" fn(x0: f64, x1: f64, y0: f64, y1: f64, dd: pDevDesc), 635 | >, 636 | pub close: ::std::option::Option, 637 | pub deactivate: ::std::option::Option, 638 | pub locator: ::std::option::Option< 639 | unsafe extern "C" fn(x: *mut f64, y: *mut f64, dd: pDevDesc) -> Rboolean, 640 | >, 641 | pub line: ::std::option::Option< 642 | unsafe extern "C" fn(x1: f64, y1: f64, x2: f64, y2: f64, gc: pGEcontext, dd: pDevDesc), 643 | >, 644 | pub metricInfo: ::std::option::Option< 645 | unsafe extern "C" fn( 646 | c: ::std::os::raw::c_int, 647 | gc: pGEcontext, 648 | ascent: *mut f64, 649 | descent: *mut f64, 650 | width: *mut f64, 651 | dd: pDevDesc, 652 | ), 653 | >, 654 | pub mode: 655 | ::std::option::Option, 656 | pub newPage: ::std::option::Option, 657 | pub polygon: ::std::option::Option< 658 | unsafe extern "C" fn( 659 | n: ::std::os::raw::c_int, 660 | x: *mut f64, 661 | y: *mut f64, 662 | gc: pGEcontext, 663 | dd: pDevDesc, 664 | ), 665 | >, 666 | pub polyline: ::std::option::Option< 667 | unsafe extern "C" fn( 668 | n: ::std::os::raw::c_int, 669 | x: *mut f64, 670 | y: *mut f64, 671 | gc: pGEcontext, 672 | dd: pDevDesc, 673 | ), 674 | >, 675 | pub rect: ::std::option::Option< 676 | unsafe extern "C" fn(x0: f64, y0: f64, x1: f64, y1: f64, gc: pGEcontext, dd: pDevDesc), 677 | >, 678 | pub path: ::std::option::Option< 679 | unsafe extern "C" fn( 680 | x: *mut f64, 681 | y: *mut f64, 682 | npoly: ::std::os::raw::c_int, 683 | nper: *mut ::std::os::raw::c_int, 684 | winding: Rboolean, 685 | gc: pGEcontext, 686 | dd: pDevDesc, 687 | ), 688 | >, 689 | pub raster: ::std::option::Option< 690 | unsafe extern "C" fn( 691 | raster: *mut ::std::os::raw::c_uint, 692 | w: ::std::os::raw::c_int, 693 | h: ::std::os::raw::c_int, 694 | x: f64, 695 | y: f64, 696 | width: f64, 697 | height: f64, 698 | rot: f64, 699 | interpolate: Rboolean, 700 | gc: pGEcontext, 701 | dd: pDevDesc, 702 | ), 703 | >, 704 | pub cap: ::std::option::Option SEXP>, 705 | pub size: ::std::option::Option< 706 | unsafe extern "C" fn( 707 | left: *mut f64, 708 | right: *mut f64, 709 | bottom: *mut f64, 710 | top: *mut f64, 711 | dd: pDevDesc, 712 | ), 713 | >, 714 | pub strWidth: ::std::option::Option< 715 | unsafe extern "C" fn( 716 | str_: *const ::std::os::raw::c_char, 717 | gc: pGEcontext, 718 | dd: pDevDesc, 719 | ) -> f64, 720 | >, 721 | pub text: ::std::option::Option< 722 | unsafe extern "C" fn( 723 | x: f64, 724 | y: f64, 725 | str_: *const ::std::os::raw::c_char, 726 | rot: f64, 727 | hadj: f64, 728 | gc: pGEcontext, 729 | dd: pDevDesc, 730 | ), 731 | >, 732 | pub onExit: ::std::option::Option, 733 | #[doc = "device_getEvent is no longer used, but the slot is kept for back\n compatibility of the structure."] 734 | pub getEvent: ::std::option::Option< 735 | unsafe extern "C" fn(arg1: SEXP, arg2: *const ::std::os::raw::c_char) -> SEXP, 736 | >, 737 | pub newFrameConfirm: ::std::option::Option Rboolean>, 738 | #[doc = "and strWidthUTF8"] 739 | pub hasTextUTF8: Rboolean, 740 | pub textUTF8: ::std::option::Option< 741 | unsafe extern "C" fn( 742 | x: f64, 743 | y: f64, 744 | str_: *const ::std::os::raw::c_char, 745 | rot: f64, 746 | hadj: f64, 747 | gc: pGEcontext, 748 | dd: pDevDesc, 749 | ), 750 | >, 751 | pub strWidthUTF8: ::std::option::Option< 752 | unsafe extern "C" fn( 753 | str_: *const ::std::os::raw::c_char, 754 | gc: pGEcontext, 755 | dd: pDevDesc, 756 | ) -> f64, 757 | >, 758 | pub wantSymbolUTF8: Rboolean, 759 | #[doc = "Is rotated text good enough to be preferable to Hershey in\ncontour labels? Old default was FALSE."] 760 | pub useRotatedTextInContour: Rboolean, 761 | #[doc = "This is an environment holding event handlers."] 762 | pub eventEnv: SEXP, 763 | pub eventHelper: 764 | ::std::option::Option, 765 | pub holdflush: ::std::option::Option< 766 | unsafe extern "C" fn(dd: pDevDesc, level: ::std::os::raw::c_int) -> ::std::os::raw::c_int, 767 | >, 768 | #[doc = "1 = no, 2 = yes"] 769 | pub haveTransparency: ::std::os::raw::c_int, 770 | #[doc = "1 = no, 2 = fully, 3 = semi"] 771 | pub haveTransparentBg: ::std::os::raw::c_int, 772 | #[doc = "1 = no, 2 = yes, 3 = except for missing values"] 773 | pub haveRaster: ::std::os::raw::c_int, 774 | #[doc = "1 = no, 2 = yes"] 775 | pub haveCapture: ::std::os::raw::c_int, 776 | #[doc = "1 = no, 2 = yes"] 777 | pub haveLocator: ::std::os::raw::c_int, 778 | pub setPattern: 779 | ::std::option::Option SEXP>, 780 | pub releasePattern: ::std::option::Option, 781 | pub setClipPath: 782 | ::std::option::Option SEXP>, 783 | pub releaseClipPath: ::std::option::Option, 784 | pub setMask: 785 | ::std::option::Option SEXP>, 786 | pub releaseMask: ::std::option::Option, 787 | #[doc = "This should match R_GE_version,\n BUT it does not have to.\n It give the graphics engine a chance to work with\n graphics device packages BEFORE they update to\n changes in R_GE_version."] 788 | pub deviceVersion: ::std::os::raw::c_int, 789 | #[doc = "This can be used to OVERRIDE canClip so that graphics engine\n leaves ALL clipping to the graphics device"] 790 | pub deviceClip: Rboolean, 791 | pub defineGroup: ::std::option::Option< 792 | unsafe extern "C" fn( 793 | source: SEXP, 794 | op: ::std::os::raw::c_int, 795 | destination: SEXP, 796 | dd: pDevDesc, 797 | ) -> SEXP, 798 | >, 799 | pub useGroup: 800 | ::std::option::Option, 801 | pub releaseGroup: ::std::option::Option, 802 | pub stroke: 803 | ::std::option::Option, 804 | pub fill: ::std::option::Option< 805 | unsafe extern "C" fn(path: SEXP, rule: ::std::os::raw::c_int, gc: pGEcontext, dd: pDevDesc), 806 | >, 807 | pub fillStroke: ::std::option::Option< 808 | unsafe extern "C" fn(path: SEXP, rule: ::std::os::raw::c_int, gc: pGEcontext, dd: pDevDesc), 809 | >, 810 | pub capabilities: ::std::option::Option SEXP>, 811 | #[doc = "Area for future expansion.\nBy zeroing this, devices are more likely to work if loaded\ninto a later version of R than that they were compiled under."] 812 | pub reserved: [::std::os::raw::c_char; 64usize], 813 | } 814 | #[repr(i32)] 815 | #[doc = "These give the indices of some known keys"] 816 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 817 | pub enum R_KeyName { 818 | knUNKNOWN = -1, 819 | knLEFT = 0, 820 | knUP = 1, 821 | knRIGHT = 2, 822 | knDOWN = 3, 823 | knF1 = 4, 824 | knF2 = 5, 825 | knF3 = 6, 826 | knF4 = 7, 827 | knF5 = 8, 828 | knF6 = 9, 829 | knF7 = 10, 830 | knF8 = 11, 831 | knF9 = 12, 832 | knF10 = 13, 833 | knF11 = 14, 834 | knF12 = 15, 835 | knPGUP = 16, 836 | knPGDN = 17, 837 | knEND = 18, 838 | knHOME = 19, 839 | knINS = 20, 840 | knDEL = 21, 841 | } 842 | #[repr(u32)] 843 | #[doc = "These are the three possible mouse events"] 844 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 845 | pub enum R_MouseEvent { 846 | meMouseDown = 0, 847 | meMouseUp = 1, 848 | meMouseMove = 2, 849 | } 850 | pub type GEDevDesc = _GEDevDesc; 851 | pub type GEcallback = ::std::option::Option< 852 | unsafe extern "C" fn(arg1: GEevent, arg2: *mut GEDevDesc, arg3: SEXP) -> SEXP, 853 | >; 854 | #[repr(C)] 855 | #[derive(Debug, Copy, Clone)] 856 | pub struct GESystemDesc { 857 | #[doc = "An array of information about each graphics system that\n has registered with the graphics engine.\n This is used to store graphics state for each graphics\n system on each device."] 858 | pub systemSpecific: *mut ::std::os::raw::c_void, 859 | #[doc = "An array of function pointers, one per graphics system that\n has registered with the graphics engine.\n\n system_Callback is called when the graphics engine wants\n to give a graphics system the chance to play with its\n device-specific information (stored in systemSpecific)\n There are two parameters: an \"event\" to tell the graphics\n system why the graphics engine has called this function,\n and the systemSpecific pointer. The graphics engine\n has to pass the systemSpecific pointer because only\n the graphics engine will know what array index to use."] 860 | pub callback: GEcallback, 861 | } 862 | #[repr(C)] 863 | #[derive(Debug, Copy, Clone)] 864 | pub struct _GEDevDesc { 865 | #[doc = "Stuff that the devices can see (and modify).\n All detailed in GraphicsDevice.h"] 866 | pub dev: pDevDesc, 867 | #[doc = "toggle for display list status"] 868 | pub displayListOn: Rboolean, 869 | #[doc = "display list"] 870 | pub displayList: SEXP, 871 | #[doc = "A pointer to the end of the display list\nto avoid tranversing pairlists"] 872 | pub DLlastElt: SEXP, 873 | #[doc = "The last element of the display list\n just prior to when the display list\n was last initialised"] 874 | pub savedSnapshot: SEXP, 875 | #[doc = "Has the device received any output?"] 876 | pub dirty: Rboolean, 877 | #[doc = "Should a graphics call be stored\n on the display list?\n Set to FALSE by do_recordGraphics,\n do_dotcallgr, and do_Externalgr\n so that nested calls are not\n recorded on the display list"] 878 | pub recordGraphics: Rboolean, 879 | #[doc = "Stuff about the device that only graphics systems see.\n The graphics engine has no idea what is in here.\n Used by graphics systems to store system state per device."] 880 | pub gesd: [*mut GESystemDesc; 24usize], 881 | #[doc = "per-device setting for 'ask' (use NewFrameConfirm)"] 882 | pub ask: Rboolean, 883 | #[doc = "Is a device appending a path ?"] 884 | pub appending: Rboolean, 885 | } 886 | pub type pGEDevDesc = *mut GEDevDesc; 887 | #[doc = "-------------------------------------------------------------------\n\n COLOUR CODE is concerned with the internals of R colour representation\n\n From colors.c, used in par.c, grid/src/gpar.c"] 888 | pub type rcolor = ::std::os::raw::c_uint; 889 | #[doc = "../../appl/integrate.c"] 890 | pub type integr_fn = ::std::option::Option< 891 | unsafe extern "C" fn(x: *mut f64, n: ::std::os::raw::c_int, ex: *mut ::std::os::raw::c_void), 892 | >; 893 | #[doc = "main/optim.c"] 894 | pub type optimfn = ::std::option::Option< 895 | unsafe extern "C" fn( 896 | arg1: ::std::os::raw::c_int, 897 | arg2: *mut f64, 898 | arg3: *mut ::std::os::raw::c_void, 899 | ) -> f64, 900 | >; 901 | pub type optimgr = ::std::option::Option< 902 | unsafe extern "C" fn( 903 | arg1: ::std::os::raw::c_int, 904 | arg2: *mut f64, 905 | arg3: *mut f64, 906 | arg4: *mut ::std::os::raw::c_void, 907 | ), 908 | >; 909 | #[doc = "type of pointer to the target and gradient functions"] 910 | pub type fcn_p = ::std::option::Option< 911 | unsafe extern "C" fn( 912 | arg1: ::std::os::raw::c_int, 913 | arg2: *mut f64, 914 | arg3: *mut f64, 915 | arg4: *mut ::std::os::raw::c_void, 916 | ), 917 | >; 918 | #[doc = "type of pointer to the hessian functions"] 919 | pub type d2fcn_p = ::std::option::Option< 920 | unsafe extern "C" fn( 921 | arg1: ::std::os::raw::c_int, 922 | arg2: ::std::os::raw::c_int, 923 | arg3: *mut f64, 924 | arg4: *mut f64, 925 | arg5: *mut ::std::os::raw::c_void, 926 | ), 927 | >; 928 | #[repr(u32)] 929 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 930 | pub enum RNGtype { 931 | WICHMANN_HILL = 0, 932 | MARSAGLIA_MULTICARRY = 1, 933 | SUPER_DUPER = 2, 934 | MERSENNE_TWISTER = 3, 935 | KNUTH_TAOCP = 4, 936 | USER_UNIF = 5, 937 | KNUTH_TAOCP2 = 6, 938 | LECUYER_CMRG = 7, 939 | } 940 | #[repr(u32)] 941 | #[doc = "Different kinds of \"N(0,1)\" generators :"] 942 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 943 | pub enum N01type { 944 | BUGGY_KINDERMAN_RAMAGE = 0, 945 | AHRENS_DIETER = 1, 946 | BOX_MULLER = 2, 947 | USER_NORM = 3, 948 | INVERSION = 4, 949 | KINDERMAN_RAMAGE = 5, 950 | } 951 | #[repr(u32)] 952 | #[doc = "Different ways to generate discrete uniform samples"] 953 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 954 | pub enum Sampletype { 955 | ROUNDING = 0, 956 | REJECTION = 1, 957 | } 958 | pub type Int32 = ::std::os::raw::c_uint; 959 | #[doc = "R 4.3 redefined `Rcomplex` to a union for compatibility with Fortran.\n But the old definition is compatible both the union version\n and the struct version.\n See: \n
"] 960 | #[repr(C)] 961 | #[derive(Debug, Copy, Clone)] 962 | pub struct Rcomplex { 963 | pub r: f64, 964 | pub i: f64, 965 | } 966 | pub type __builtin_va_list = *mut ::std::os::raw::c_char; 967 | extern "C" { 968 | #[doc = "IEEE NaN"] 969 | pub static mut R_NaN: f64; 970 | #[doc = "IEEE Inf"] 971 | pub static mut R_PosInf: f64; 972 | #[doc = "IEEE -Inf"] 973 | pub static mut R_NegInf: f64; 974 | #[doc = "NA_REAL: IEEE"] 975 | pub static mut R_NaReal: f64; 976 | #[doc = "NA_INTEGER:= INT_MIN currently"] 977 | pub static mut R_NaInt: ::std::os::raw::c_int; 978 | #[doc = "NA_STRING is a SEXP, so defined in Rinternals.h"] 979 | pub fn R_IsNA(arg1: f64) -> ::std::os::raw::c_int; 980 | pub fn R_IsNaN(arg1: f64) -> ::std::os::raw::c_int; 981 | pub fn R_finite(arg1: f64) -> ::std::os::raw::c_int; 982 | pub fn Rf_error(arg1: *const ::std::os::raw::c_char, ...) -> !; 983 | pub fn UNIMPLEMENTED(arg1: *const ::std::os::raw::c_char) -> !; 984 | pub fn WrongArgCount(arg1: *const ::std::os::raw::c_char) -> !; 985 | pub fn Rf_warning(arg1: *const ::std::os::raw::c_char, ...); 986 | pub fn R_ShowMessage(s: *const ::std::os::raw::c_char); 987 | pub fn vmaxget() -> *mut ::std::os::raw::c_void; 988 | pub fn vmaxset(arg1: *const ::std::os::raw::c_void); 989 | pub fn R_gc(); 990 | pub fn R_gc_running() -> ::std::os::raw::c_int; 991 | pub fn R_alloc(arg1: usize, arg2: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; 992 | pub fn R_allocLD(nelem: usize) -> *mut u128; 993 | pub fn S_alloc( 994 | arg1: ::std::os::raw::c_long, 995 | arg2: ::std::os::raw::c_int, 996 | ) -> *mut ::std::os::raw::c_char; 997 | pub fn S_realloc( 998 | arg1: *mut ::std::os::raw::c_char, 999 | arg2: ::std::os::raw::c_long, 1000 | arg3: ::std::os::raw::c_long, 1001 | arg4: ::std::os::raw::c_int, 1002 | ) -> *mut ::std::os::raw::c_char; 1003 | pub fn R_malloc_gc(arg1: usize) -> *mut ::std::os::raw::c_void; 1004 | pub fn R_calloc_gc(arg1: usize, arg2: usize) -> *mut ::std::os::raw::c_void; 1005 | pub fn R_realloc_gc( 1006 | arg1: *mut ::std::os::raw::c_void, 1007 | arg2: usize, 1008 | ) -> *mut ::std::os::raw::c_void; 1009 | #[doc = "../../main/sort.c :"] 1010 | pub fn R_isort(arg1: *mut ::std::os::raw::c_int, arg2: ::std::os::raw::c_int); 1011 | pub fn R_rsort(arg1: *mut f64, arg2: ::std::os::raw::c_int); 1012 | pub fn R_csort(arg1: *mut Rcomplex, arg2: ::std::os::raw::c_int); 1013 | pub fn rsort_with_index( 1014 | arg1: *mut f64, 1015 | arg2: *mut ::std::os::raw::c_int, 1016 | arg3: ::std::os::raw::c_int, 1017 | ); 1018 | pub fn Rf_revsort( 1019 | arg1: *mut f64, 1020 | arg2: *mut ::std::os::raw::c_int, 1021 | arg3: ::std::os::raw::c_int, 1022 | ); 1023 | pub fn Rf_iPsort( 1024 | arg1: *mut ::std::os::raw::c_int, 1025 | arg2: ::std::os::raw::c_int, 1026 | arg3: ::std::os::raw::c_int, 1027 | ); 1028 | pub fn Rf_rPsort(arg1: *mut f64, arg2: ::std::os::raw::c_int, arg3: ::std::os::raw::c_int); 1029 | pub fn Rf_cPsort(arg1: *mut Rcomplex, arg2: ::std::os::raw::c_int, arg3: ::std::os::raw::c_int); 1030 | #[doc = "../../main/qsort.c : */\n/* dummy renamed to II to avoid problems with g++ on Solaris"] 1031 | pub fn R_qsort(v: *mut f64, i: usize, j: usize); 1032 | pub fn R_qsort_I( 1033 | v: *mut f64, 1034 | II: *mut ::std::os::raw::c_int, 1035 | i: ::std::os::raw::c_int, 1036 | j: ::std::os::raw::c_int, 1037 | ); 1038 | pub fn R_qsort_int(iv: *mut ::std::os::raw::c_int, i: usize, j: usize); 1039 | pub fn R_qsort_int_I( 1040 | iv: *mut ::std::os::raw::c_int, 1041 | II: *mut ::std::os::raw::c_int, 1042 | i: ::std::os::raw::c_int, 1043 | j: ::std::os::raw::c_int, 1044 | ); 1045 | #[doc = "../../main/util.c and others :"] 1046 | pub fn R_ExpandFileName(arg1: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; 1047 | pub fn Rf_setIVector( 1048 | arg1: *mut ::std::os::raw::c_int, 1049 | arg2: ::std::os::raw::c_int, 1050 | arg3: ::std::os::raw::c_int, 1051 | ); 1052 | pub fn Rf_setRVector(arg1: *mut f64, arg2: ::std::os::raw::c_int, arg3: f64); 1053 | pub fn Rf_StringFalse(arg1: *const ::std::os::raw::c_char) -> Rboolean; 1054 | pub fn Rf_StringTrue(arg1: *const ::std::os::raw::c_char) -> Rboolean; 1055 | pub fn Rf_isBlankString(arg1: *const ::std::os::raw::c_char) -> Rboolean; 1056 | #[doc = "These two are guaranteed to use '.' as the decimal point,\nand to accept \"NA\"."] 1057 | pub fn R_atof(str_: *const ::std::os::raw::c_char) -> f64; 1058 | pub fn R_strtod(c: *const ::std::os::raw::c_char, end: *mut *mut ::std::os::raw::c_char) 1059 | -> f64; 1060 | pub fn R_tmpnam( 1061 | prefix: *const ::std::os::raw::c_char, 1062 | tempdir: *const ::std::os::raw::c_char, 1063 | ) -> *mut ::std::os::raw::c_char; 1064 | pub fn R_tmpnam2( 1065 | prefix: *const ::std::os::raw::c_char, 1066 | tempdir: *const ::std::os::raw::c_char, 1067 | fileext: *const ::std::os::raw::c_char, 1068 | ) -> *mut ::std::os::raw::c_char; 1069 | pub fn R_free_tmpnam(name: *mut ::std::os::raw::c_char); 1070 | pub fn R_CheckUserInterrupt(); 1071 | pub fn R_CheckStack(); 1072 | pub fn R_CheckStack2(arg1: usize); 1073 | #[doc = "../../appl/interv.c: also in Applic.h"] 1074 | pub fn findInterval( 1075 | xt: *mut f64, 1076 | n: ::std::os::raw::c_int, 1077 | x: f64, 1078 | rightmost_closed: Rboolean, 1079 | all_inside: Rboolean, 1080 | ilo: ::std::os::raw::c_int, 1081 | mflag: *mut ::std::os::raw::c_int, 1082 | ) -> ::std::os::raw::c_int; 1083 | pub fn findInterval2( 1084 | xt: *mut f64, 1085 | n: ::std::os::raw::c_int, 1086 | x: f64, 1087 | rightmost_closed: Rboolean, 1088 | all_inside: Rboolean, 1089 | left_open: Rboolean, 1090 | ilo: ::std::os::raw::c_int, 1091 | mflag: *mut ::std::os::raw::c_int, 1092 | ) -> ::std::os::raw::c_int; 1093 | pub fn find_interv_vec( 1094 | xt: *mut f64, 1095 | n: *mut ::std::os::raw::c_int, 1096 | x: *mut f64, 1097 | nx: *mut ::std::os::raw::c_int, 1098 | rightmost_closed: *mut ::std::os::raw::c_int, 1099 | all_inside: *mut ::std::os::raw::c_int, 1100 | indx: *mut ::std::os::raw::c_int, 1101 | ); 1102 | #[doc = "../../appl/maxcol.c: also in Applic.h"] 1103 | pub fn R_max_col( 1104 | matrix: *mut f64, 1105 | nr: *mut ::std::os::raw::c_int, 1106 | nc: *mut ::std::os::raw::c_int, 1107 | maxes: *mut ::std::os::raw::c_int, 1108 | ties_meth: *mut ::std::os::raw::c_int, 1109 | ); 1110 | pub fn Rprintf(arg1: *const ::std::os::raw::c_char, ...); 1111 | pub fn REprintf(arg1: *const ::std::os::raw::c_char, ...); 1112 | pub fn Rvprintf(arg1: *const ::std::os::raw::c_char, arg2: va_list); 1113 | pub fn REvprintf(arg1: *const ::std::os::raw::c_char, arg2: va_list); 1114 | pub fn R_registerRoutines( 1115 | info: *mut DllInfo, 1116 | croutines: *const R_CMethodDef, 1117 | callRoutines: *const R_CallMethodDef, 1118 | fortranRoutines: *const R_FortranMethodDef, 1119 | externalRoutines: *const R_ExternalMethodDef, 1120 | ) -> ::std::os::raw::c_int; 1121 | pub fn R_useDynamicSymbols(info: *mut DllInfo, value: Rboolean) -> Rboolean; 1122 | pub fn R_forceSymbols(info: *mut DllInfo, value: Rboolean) -> Rboolean; 1123 | pub fn R_getDllInfo(name: *const ::std::os::raw::c_char) -> *mut DllInfo; 1124 | #[doc = "To be used by applications embedding R to register their symbols\nthat are not related to any dynamic module"] 1125 | pub fn R_getEmbeddingDllInfo() -> *mut DllInfo; 1126 | pub fn R_FindSymbol( 1127 | arg1: *const ::std::os::raw::c_char, 1128 | arg2: *const ::std::os::raw::c_char, 1129 | symbol: *mut R_RegisteredNativeSymbol, 1130 | ) -> DL_FUNC; 1131 | #[doc = "Interface for exporting and importing functions from one package\nfor use from C code in a package. The registration part probably\nought to be integrated with the other registrations. The naming of\nthese routines may be less than ideal."] 1132 | pub fn R_RegisterCCallable( 1133 | package: *const ::std::os::raw::c_char, 1134 | name: *const ::std::os::raw::c_char, 1135 | fptr: DL_FUNC, 1136 | ); 1137 | pub fn R_GetCCallable( 1138 | package: *const ::std::os::raw::c_char, 1139 | name: *const ::std::os::raw::c_char, 1140 | ) -> DL_FUNC; 1141 | pub fn R_CHAR(x: SEXP) -> *const ::std::os::raw::c_char; 1142 | #[doc = "Various tests with macro versions in the internal headers"] 1143 | pub fn Rf_isNull(s: SEXP) -> Rboolean; 1144 | pub fn Rf_isSymbol(s: SEXP) -> Rboolean; 1145 | pub fn Rf_isLogical(s: SEXP) -> Rboolean; 1146 | pub fn Rf_isReal(s: SEXP) -> Rboolean; 1147 | pub fn Rf_isComplex(s: SEXP) -> Rboolean; 1148 | pub fn Rf_isExpression(s: SEXP) -> Rboolean; 1149 | pub fn Rf_isEnvironment(s: SEXP) -> Rboolean; 1150 | pub fn Rf_isString(s: SEXP) -> Rboolean; 1151 | pub fn Rf_isObject(s: SEXP) -> Rboolean; 1152 | #[doc = "General Cons Cell Attributes"] 1153 | pub fn ATTRIB(x: SEXP) -> SEXP; 1154 | pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int; 1155 | pub fn MARK(x: SEXP) -> ::std::os::raw::c_int; 1156 | pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int; 1157 | pub fn SET_ATTRIB(x: SEXP, v: SEXP); 1158 | pub fn DUPLICATE_ATTRIB(to: SEXP, from: SEXP); 1159 | pub fn SHALLOW_DUPLICATE_ATTRIB(to: SEXP, from: SEXP); 1160 | pub fn MARK_NOT_MUTABLE(x: SEXP); 1161 | #[doc = "S4 object testing"] 1162 | pub fn IS_S4_OBJECT(x: SEXP) -> ::std::os::raw::c_int; 1163 | #[doc = "Vector Access Functions"] 1164 | pub fn LENGTH(x: SEXP) -> ::std::os::raw::c_int; 1165 | pub fn XLENGTH(x: SEXP) -> R_xlen_t; 1166 | pub fn IS_LONG_VEC(x: SEXP) -> ::std::os::raw::c_int; 1167 | pub fn LOGICAL(x: SEXP) -> *mut ::std::os::raw::c_int; 1168 | pub fn INTEGER(x: SEXP) -> *mut ::std::os::raw::c_int; 1169 | pub fn RAW(x: SEXP) -> *mut Rbyte; 1170 | pub fn REAL(x: SEXP) -> *mut f64; 1171 | pub fn COMPLEX(x: SEXP) -> *mut Rcomplex; 1172 | pub fn LOGICAL_RO(x: SEXP) -> *const ::std::os::raw::c_int; 1173 | pub fn INTEGER_RO(x: SEXP) -> *const ::std::os::raw::c_int; 1174 | pub fn RAW_RO(x: SEXP) -> *const Rbyte; 1175 | pub fn REAL_RO(x: SEXP) -> *const f64; 1176 | pub fn COMPLEX_RO(x: SEXP) -> *const Rcomplex; 1177 | #[doc = "SEXP (STRING_ELT)(SEXP x, R_xlen_t i);"] 1178 | pub fn VECTOR_ELT(x: SEXP, i: R_xlen_t) -> SEXP; 1179 | pub fn SET_STRING_ELT(x: SEXP, i: R_xlen_t, v: SEXP); 1180 | pub fn SET_VECTOR_ELT(x: SEXP, i: R_xlen_t, v: SEXP) -> SEXP; 1181 | pub fn STRING_PTR_RO(x: SEXP) -> *const SEXP; 1182 | pub fn INTEGER_GET_REGION( 1183 | sx: SEXP, 1184 | i: R_xlen_t, 1185 | n: R_xlen_t, 1186 | buf: *mut ::std::os::raw::c_int, 1187 | ) -> R_xlen_t; 1188 | pub fn REAL_GET_REGION(sx: SEXP, i: R_xlen_t, n: R_xlen_t, buf: *mut f64) -> R_xlen_t; 1189 | pub fn LOGICAL_GET_REGION( 1190 | sx: SEXP, 1191 | i: R_xlen_t, 1192 | n: R_xlen_t, 1193 | buf: *mut ::std::os::raw::c_int, 1194 | ) -> R_xlen_t; 1195 | pub fn COMPLEX_GET_REGION(sx: SEXP, i: R_xlen_t, n: R_xlen_t, buf: *mut Rcomplex) -> R_xlen_t; 1196 | pub fn RAW_GET_REGION(sx: SEXP, i: R_xlen_t, n: R_xlen_t, buf: *mut Rbyte) -> R_xlen_t; 1197 | #[doc = "metadata access"] 1198 | pub fn INTEGER_IS_SORTED(x: SEXP) -> ::std::os::raw::c_int; 1199 | pub fn INTEGER_NO_NA(x: SEXP) -> ::std::os::raw::c_int; 1200 | pub fn REAL_IS_SORTED(x: SEXP) -> ::std::os::raw::c_int; 1201 | pub fn REAL_NO_NA(x: SEXP) -> ::std::os::raw::c_int; 1202 | pub fn LOGICAL_IS_SORTED(x: SEXP) -> ::std::os::raw::c_int; 1203 | pub fn LOGICAL_NO_NA(x: SEXP) -> ::std::os::raw::c_int; 1204 | pub fn STRING_IS_SORTED(x: SEXP) -> ::std::os::raw::c_int; 1205 | pub fn STRING_NO_NA(x: SEXP) -> ::std::os::raw::c_int; 1206 | pub fn TAG(e: SEXP) -> SEXP; 1207 | pub fn CDR(e: SEXP) -> SEXP; 1208 | pub fn CAAR(e: SEXP) -> SEXP; 1209 | pub fn CDAR(e: SEXP) -> SEXP; 1210 | pub fn CADR(e: SEXP) -> SEXP; 1211 | pub fn CDDR(e: SEXP) -> SEXP; 1212 | pub fn CDDDR(e: SEXP) -> SEXP; 1213 | pub fn CADDR(e: SEXP) -> SEXP; 1214 | pub fn CADDDR(e: SEXP) -> SEXP; 1215 | pub fn CAD4R(e: SEXP) -> SEXP; 1216 | pub fn MISSING(x: SEXP) -> ::std::os::raw::c_int; 1217 | pub fn SET_TAG(x: SEXP, y: SEXP); 1218 | pub fn SETCAR(x: SEXP, y: SEXP) -> SEXP; 1219 | pub fn SETCDR(x: SEXP, y: SEXP) -> SEXP; 1220 | pub fn SETCADR(x: SEXP, y: SEXP) -> SEXP; 1221 | pub fn SETCADDR(x: SEXP, y: SEXP) -> SEXP; 1222 | pub fn SETCADDDR(x: SEXP, y: SEXP) -> SEXP; 1223 | pub fn SETCAD4R(e: SEXP, y: SEXP) -> SEXP; 1224 | #[doc = "Closure Access Functions"] 1225 | pub fn FORMALS(x: SEXP) -> SEXP; 1226 | pub fn BODY(x: SEXP) -> SEXP; 1227 | pub fn CLOENV(x: SEXP) -> SEXP; 1228 | pub fn RSTEP(x: SEXP) -> ::std::os::raw::c_int; 1229 | pub fn RTRACE(x: SEXP) -> ::std::os::raw::c_int; 1230 | pub fn SET_RSTEP(x: SEXP, v: ::std::os::raw::c_int); 1231 | pub fn SET_RTRACE(x: SEXP, v: ::std::os::raw::c_int); 1232 | #[doc = "Symbol Access Functions"] 1233 | pub fn PRINTNAME(x: SEXP) -> SEXP; 1234 | pub fn ENCLOS(x: SEXP) -> SEXP; 1235 | #[doc = "External pointer access macros"] 1236 | pub fn EXTPTR_PROT(arg1: SEXP) -> SEXP; 1237 | pub fn EXTPTR_TAG(arg1: SEXP) -> SEXP; 1238 | pub fn EXTPTR_PTR(arg1: SEXP) -> *mut ::std::os::raw::c_void; 1239 | #[doc = "The \"global\" environment"] 1240 | pub static mut R_GlobalEnv: SEXP; 1241 | #[doc = "An empty environment at the root of the\nenvironment tree"] 1242 | pub static mut R_EmptyEnv: SEXP; 1243 | #[doc = "The base environment; formerly R_NilValue"] 1244 | pub static mut R_BaseEnv: SEXP; 1245 | #[doc = "The (fake) namespace for base"] 1246 | pub static mut R_BaseNamespace: SEXP; 1247 | #[doc = "Registry for registered namespaces"] 1248 | pub static mut R_NamespaceRegistry: SEXP; 1249 | #[doc = "Current srcref, for debuggers"] 1250 | pub static mut R_Srcref: SEXP; 1251 | #[doc = "The nil object"] 1252 | pub static mut R_NilValue: SEXP; 1253 | #[doc = "Unbound marker"] 1254 | pub static mut R_UnboundValue: SEXP; 1255 | #[doc = "Missing argument marker"] 1256 | pub static mut R_MissingArg: SEXP; 1257 | #[doc = "To be found in BC interp. state\n(marker)"] 1258 | pub static mut R_InBCInterpreter: SEXP; 1259 | #[doc = "Use current expression (marker)"] 1260 | pub static mut R_CurrentExpression: SEXP; 1261 | #[doc = "Marker for restarted function calls"] 1262 | pub static mut R_RestartToken: SEXP; 1263 | #[doc = "\"as.character\""] 1264 | pub static mut R_AsCharacterSymbol: SEXP; 1265 | #[doc = "\"@\""] 1266 | pub static mut R_AtsignSymbol: SEXP; 1267 | #[doc = "<-- backcompatible version of:"] 1268 | pub static mut R_baseSymbol: SEXP; 1269 | #[doc = "\"base\""] 1270 | pub static mut R_BaseSymbol: SEXP; 1271 | #[doc = "\"{\""] 1272 | pub static mut R_BraceSymbol: SEXP; 1273 | #[doc = "\"\\[\\[\""] 1274 | pub static mut R_Bracket2Symbol: SEXP; 1275 | #[doc = "\"\\[\""] 1276 | pub static mut R_BracketSymbol: SEXP; 1277 | #[doc = "\"class\""] 1278 | pub static mut R_ClassSymbol: SEXP; 1279 | #[doc = "\".Device\""] 1280 | pub static mut R_DeviceSymbol: SEXP; 1281 | #[doc = "\"dimnames\""] 1282 | pub static mut R_DimNamesSymbol: SEXP; 1283 | #[doc = "\"dim\""] 1284 | pub static mut R_DimSymbol: SEXP; 1285 | #[doc = "\"$\""] 1286 | pub static mut R_DollarSymbol: SEXP; 1287 | #[doc = "\"...\""] 1288 | pub static mut R_DotsSymbol: SEXP; 1289 | #[doc = "\"::\""] 1290 | pub static mut R_DoubleColonSymbol: SEXP; 1291 | #[doc = "\"drop\""] 1292 | pub static mut R_DropSymbol: SEXP; 1293 | #[doc = "\"eval\""] 1294 | pub static mut R_EvalSymbol: SEXP; 1295 | #[doc = "\"function\""] 1296 | pub static mut R_FunctionSymbol: SEXP; 1297 | #[doc = "\".Last.value\""] 1298 | pub static mut R_LastvalueSymbol: SEXP; 1299 | #[doc = "\"levels\""] 1300 | pub static mut R_LevelsSymbol: SEXP; 1301 | #[doc = "\"mode\""] 1302 | pub static mut R_ModeSymbol: SEXP; 1303 | #[doc = "\"na.rm\""] 1304 | pub static mut R_NaRmSymbol: SEXP; 1305 | #[doc = "\"name\""] 1306 | pub static mut R_NameSymbol: SEXP; 1307 | #[doc = "\"names\""] 1308 | pub static mut R_NamesSymbol: SEXP; 1309 | #[doc = "\".__NAMESPACE__.\""] 1310 | pub static mut R_NamespaceEnvSymbol: SEXP; 1311 | #[doc = "\"package\""] 1312 | pub static mut R_PackageSymbol: SEXP; 1313 | #[doc = "\"previous\""] 1314 | pub static mut R_PreviousSymbol: SEXP; 1315 | #[doc = "\"quote\""] 1316 | pub static mut R_QuoteSymbol: SEXP; 1317 | #[doc = "\"row.names\""] 1318 | pub static mut R_RowNamesSymbol: SEXP; 1319 | #[doc = "\".Random.seed\""] 1320 | pub static mut R_SeedsSymbol: SEXP; 1321 | #[doc = "\"sort.list\""] 1322 | pub static mut R_SortListSymbol: SEXP; 1323 | #[doc = "\"source\""] 1324 | pub static mut R_SourceSymbol: SEXP; 1325 | #[doc = "\"spec\""] 1326 | pub static mut R_SpecSymbol: SEXP; 1327 | #[doc = "\":::\""] 1328 | pub static mut R_TripleColonSymbol: SEXP; 1329 | #[doc = "\"tsp\""] 1330 | pub static mut R_TspSymbol: SEXP; 1331 | #[doc = "\".defined\""] 1332 | pub static mut R_dot_defined: SEXP; 1333 | #[doc = "\".Method\""] 1334 | pub static mut R_dot_Method: SEXP; 1335 | #[doc = "\".packageName\""] 1336 | pub static mut R_dot_packageName: SEXP; 1337 | #[doc = "\".target\""] 1338 | pub static mut R_dot_target: SEXP; 1339 | #[doc = "\".Generic\""] 1340 | pub static mut R_dot_Generic: SEXP; 1341 | #[doc = "NA_STRING as a CHARSXP"] 1342 | pub static mut R_NaString: SEXP; 1343 | #[doc = "\"\" as a CHARSXP"] 1344 | pub static mut R_BlankString: SEXP; 1345 | #[doc = "\"\" as a STRSXP"] 1346 | pub static mut R_BlankScalarString: SEXP; 1347 | #[doc = "srcref related functions"] 1348 | pub fn R_GetCurrentSrcref(arg1: ::std::os::raw::c_int) -> SEXP; 1349 | pub fn R_GetSrcFilename(arg1: SEXP) -> SEXP; 1350 | #[doc = "Type Coercions of all kinds"] 1351 | pub fn Rf_asChar(arg1: SEXP) -> SEXP; 1352 | pub fn Rf_coerceVector(arg1: SEXP, arg2: SEXPTYPE) -> SEXP; 1353 | pub fn Rf_PairToVectorList(x: SEXP) -> SEXP; 1354 | pub fn Rf_VectorToPairList(x: SEXP) -> SEXP; 1355 | pub fn Rf_asCharacterFactor(x: SEXP) -> SEXP; 1356 | pub fn Rf_asLogical(x: SEXP) -> ::std::os::raw::c_int; 1357 | pub fn Rf_asInteger(x: SEXP) -> ::std::os::raw::c_int; 1358 | pub fn Rf_asReal(x: SEXP) -> f64; 1359 | pub fn Rf_asComplex(x: SEXP) -> Rcomplex; 1360 | #[doc = "Other Internally Used Functions, excluding those which are inline-able"] 1361 | pub fn Rf_acopy_string(arg1: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; 1362 | pub fn Rf_alloc3DArray( 1363 | arg1: SEXPTYPE, 1364 | arg2: ::std::os::raw::c_int, 1365 | arg3: ::std::os::raw::c_int, 1366 | arg4: ::std::os::raw::c_int, 1367 | ) -> SEXP; 1368 | pub fn Rf_allocArray(arg1: SEXPTYPE, arg2: SEXP) -> SEXP; 1369 | pub fn Rf_allocMatrix( 1370 | arg1: SEXPTYPE, 1371 | arg2: ::std::os::raw::c_int, 1372 | arg3: ::std::os::raw::c_int, 1373 | ) -> SEXP; 1374 | pub fn Rf_allocList(arg1: ::std::os::raw::c_int) -> SEXP; 1375 | pub fn Rf_allocS4Object() -> SEXP; 1376 | pub fn Rf_allocSExp(arg1: SEXPTYPE) -> SEXP; 1377 | pub fn Rf_allocVector3(arg1: SEXPTYPE, arg2: R_xlen_t, arg3: *mut R_allocator_t) -> SEXP; 1378 | pub fn Rf_any_duplicated(x: SEXP, from_last: Rboolean) -> R_xlen_t; 1379 | pub fn Rf_any_duplicated3(x: SEXP, incomp: SEXP, from_last: Rboolean) -> R_xlen_t; 1380 | pub fn Rf_applyClosure(arg1: SEXP, arg2: SEXP, arg3: SEXP, arg4: SEXP, arg5: SEXP) -> SEXP; 1381 | pub fn Rf_classgets(arg1: SEXP, arg2: SEXP) -> SEXP; 1382 | pub fn Rf_cons(arg1: SEXP, arg2: SEXP) -> SEXP; 1383 | pub fn Rf_copyMatrix(arg1: SEXP, arg2: SEXP, arg3: Rboolean); 1384 | pub fn Rf_copyListMatrix(arg1: SEXP, arg2: SEXP, arg3: Rboolean); 1385 | pub fn Rf_copyMostAttrib(arg1: SEXP, arg2: SEXP); 1386 | pub fn Rf_copyVector(arg1: SEXP, arg2: SEXP); 1387 | pub fn Rf_defineVar(arg1: SEXP, arg2: SEXP, arg3: SEXP); 1388 | pub fn Rf_dimgets(arg1: SEXP, arg2: SEXP) -> SEXP; 1389 | pub fn Rf_dimnamesgets(arg1: SEXP, arg2: SEXP) -> SEXP; 1390 | pub fn Rf_duplicate(arg1: SEXP) -> SEXP; 1391 | pub fn Rf_shallow_duplicate(arg1: SEXP) -> SEXP; 1392 | pub fn R_duplicate_attr(arg1: SEXP) -> SEXP; 1393 | pub fn Rf_lazy_duplicate(arg1: SEXP) -> SEXP; 1394 | #[doc = "the next really should not be here and is also in Defn.h"] 1395 | pub fn Rf_duplicated(arg1: SEXP, arg2: Rboolean) -> SEXP; 1396 | pub fn Rf_eval(arg1: SEXP, arg2: SEXP) -> SEXP; 1397 | pub fn Rf_findFun(arg1: SEXP, arg2: SEXP) -> SEXP; 1398 | pub fn Rf_findVar(arg1: SEXP, arg2: SEXP) -> SEXP; 1399 | pub fn Rf_findVarInFrame(arg1: SEXP, arg2: SEXP) -> SEXP; 1400 | pub fn R_existsVarInFrame(arg1: SEXP, arg2: SEXP) -> Rboolean; 1401 | pub fn R_removeVarFromFrame(arg1: SEXP, arg2: SEXP); 1402 | pub fn Rf_getAttrib(arg1: SEXP, arg2: SEXP) -> SEXP; 1403 | pub fn Rf_GetArrayDimnames(arg1: SEXP) -> SEXP; 1404 | pub fn Rf_GetColNames(arg1: SEXP) -> SEXP; 1405 | pub fn Rf_GetMatrixDimnames( 1406 | arg1: SEXP, 1407 | arg2: *mut SEXP, 1408 | arg3: *mut SEXP, 1409 | arg4: *mut *const ::std::os::raw::c_char, 1410 | arg5: *mut *const ::std::os::raw::c_char, 1411 | ); 1412 | pub fn Rf_GetOption(arg1: SEXP, arg2: SEXP) -> SEXP; 1413 | pub fn Rf_GetOption1(arg1: SEXP) -> SEXP; 1414 | pub fn Rf_GetOptionDigits() -> ::std::os::raw::c_int; 1415 | pub fn Rf_GetOptionWidth() -> ::std::os::raw::c_int; 1416 | pub fn Rf_GetRowNames(arg1: SEXP) -> SEXP; 1417 | pub fn Rf_install(arg1: *const ::std::os::raw::c_char) -> SEXP; 1418 | pub fn Rf_installChar(arg1: SEXP) -> SEXP; 1419 | pub fn Rf_installNoTrChar(arg1: SEXP) -> SEXP; 1420 | pub fn Rf_installTrChar(arg1: SEXP) -> SEXP; 1421 | pub fn Rf_isOrdered(arg1: SEXP) -> Rboolean; 1422 | pub fn Rf_isUnordered(arg1: SEXP) -> Rboolean; 1423 | pub fn Rf_isUnsorted(arg1: SEXP, arg2: Rboolean) -> Rboolean; 1424 | pub fn Rf_lengthgets(arg1: SEXP, arg2: R_len_t) -> SEXP; 1425 | pub fn Rf_xlengthgets(arg1: SEXP, arg2: R_xlen_t) -> SEXP; 1426 | pub fn R_lsInternal(arg1: SEXP, arg2: Rboolean) -> SEXP; 1427 | pub fn R_lsInternal3(arg1: SEXP, arg2: Rboolean, arg3: Rboolean) -> SEXP; 1428 | pub fn Rf_match(arg1: SEXP, arg2: SEXP, arg3: ::std::os::raw::c_int) -> SEXP; 1429 | pub fn Rf_namesgets(arg1: SEXP, arg2: SEXP) -> SEXP; 1430 | pub fn Rf_mkChar(arg1: *const ::std::os::raw::c_char) -> SEXP; 1431 | pub fn Rf_mkCharLen(arg1: *const ::std::os::raw::c_char, arg2: ::std::os::raw::c_int) -> SEXP; 1432 | pub fn Rf_ncols(arg1: SEXP) -> ::std::os::raw::c_int; 1433 | pub fn Rf_nrows(arg1: SEXP) -> ::std::os::raw::c_int; 1434 | pub fn Rf_nthcdr(arg1: SEXP, arg2: ::std::os::raw::c_int) -> SEXP; 1435 | pub fn R_ParseEvalString(arg1: *const ::std::os::raw::c_char, arg2: SEXP) -> SEXP; 1436 | pub fn Rf_PrintValue(arg1: SEXP); 1437 | pub fn Rf_setAttrib(arg1: SEXP, arg2: SEXP, arg3: SEXP) -> SEXP; 1438 | pub fn Rf_setVar(arg1: SEXP, arg2: SEXP, arg3: SEXP); 1439 | pub fn Rf_str2type(arg1: *const ::std::os::raw::c_char) -> SEXPTYPE; 1440 | pub fn Rf_StringBlank(arg1: SEXP) -> Rboolean; 1441 | pub fn Rf_substitute(arg1: SEXP, arg2: SEXP) -> SEXP; 1442 | pub fn Rf_topenv(arg1: SEXP, arg2: SEXP) -> SEXP; 1443 | pub fn Rf_translateChar(arg1: SEXP) -> *const ::std::os::raw::c_char; 1444 | pub fn Rf_translateCharUTF8(arg1: SEXP) -> *const ::std::os::raw::c_char; 1445 | pub fn Rf_type2char(arg1: SEXPTYPE) -> *const ::std::os::raw::c_char; 1446 | pub fn Rf_type2rstr(arg1: SEXPTYPE) -> SEXP; 1447 | pub fn Rf_type2str(arg1: SEXPTYPE) -> SEXP; 1448 | pub fn Rf_type2str_nowarn(arg1: SEXPTYPE) -> SEXP; 1449 | pub fn Rf_unprotect_ptr(arg1: SEXP); 1450 | pub fn R_tryEval(arg1: SEXP, arg2: SEXP, arg3: *mut ::std::os::raw::c_int) -> SEXP; 1451 | pub fn R_tryEvalSilent(arg1: SEXP, arg2: SEXP, arg3: *mut ::std::os::raw::c_int) -> SEXP; 1452 | pub fn R_GetCurrentEnv() -> SEXP; 1453 | pub fn Rf_asS4(arg1: SEXP, arg2: Rboolean, arg3: ::std::os::raw::c_int) -> SEXP; 1454 | pub fn Rf_S3Class(arg1: SEXP) -> SEXP; 1455 | pub fn Rf_isBasicClass(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; 1456 | pub fn Rf_getCharCE(arg1: SEXP) -> cetype_t; 1457 | pub fn Rf_mkCharCE(arg1: *const ::std::os::raw::c_char, arg2: cetype_t) -> SEXP; 1458 | pub fn Rf_mkCharLenCE( 1459 | arg1: *const ::std::os::raw::c_char, 1460 | arg2: ::std::os::raw::c_int, 1461 | arg3: cetype_t, 1462 | ) -> SEXP; 1463 | pub fn Rf_reEnc( 1464 | x: *const ::std::os::raw::c_char, 1465 | ce_in: cetype_t, 1466 | ce_out: cetype_t, 1467 | subst: ::std::os::raw::c_int, 1468 | ) -> *const ::std::os::raw::c_char; 1469 | #[doc = "Calling a function with arguments evaluated"] 1470 | pub fn R_forceAndCall(e: SEXP, n: ::std::os::raw::c_int, rho: SEXP) -> SEXP; 1471 | #[doc = "External pointer interface"] 1472 | pub fn R_MakeExternalPtr(p: *mut ::std::os::raw::c_void, tag: SEXP, prot: SEXP) -> SEXP; 1473 | pub fn R_ExternalPtrAddr(s: SEXP) -> *mut ::std::os::raw::c_void; 1474 | pub fn R_ExternalPtrTag(s: SEXP) -> SEXP; 1475 | pub fn R_ExternalPtrProtected(s: SEXP) -> SEXP; 1476 | pub fn R_ClearExternalPtr(s: SEXP); 1477 | pub fn R_SetExternalPtrAddr(s: SEXP, p: *mut ::std::os::raw::c_void); 1478 | pub fn R_SetExternalPtrTag(s: SEXP, tag: SEXP); 1479 | pub fn R_SetExternalPtrProtected(s: SEXP, p: SEXP); 1480 | #[doc = "Added in R 3.4.0"] 1481 | pub fn R_MakeExternalPtrFn(p: DL_FUNC, tag: SEXP, prot: SEXP) -> SEXP; 1482 | pub fn R_ExternalPtrAddrFn(s: SEXP) -> DL_FUNC; 1483 | pub fn R_RegisterFinalizer(s: SEXP, fun: SEXP); 1484 | pub fn R_RegisterCFinalizer(s: SEXP, fun: R_CFinalizer_t); 1485 | pub fn R_RegisterFinalizerEx(s: SEXP, fun: SEXP, onexit: Rboolean); 1486 | pub fn R_RegisterCFinalizerEx(s: SEXP, fun: R_CFinalizer_t, onexit: Rboolean); 1487 | pub fn R_RunPendingFinalizers(); 1488 | #[doc = "Weak reference interface"] 1489 | pub fn R_MakeWeakRef(key: SEXP, val: SEXP, fin: SEXP, onexit: Rboolean) -> SEXP; 1490 | pub fn R_MakeWeakRefC(key: SEXP, val: SEXP, fin: R_CFinalizer_t, onexit: Rboolean) -> SEXP; 1491 | pub fn R_WeakRefKey(w: SEXP) -> SEXP; 1492 | pub fn R_WeakRefValue(w: SEXP) -> SEXP; 1493 | pub fn R_RunWeakRefFinalizer(w: SEXP); 1494 | pub fn R_ClosureExpr(arg1: SEXP) -> SEXP; 1495 | pub fn R_BytecodeExpr(e: SEXP) -> SEXP; 1496 | #[doc = "Protected evaluation"] 1497 | pub fn R_ToplevelExec( 1498 | fun: ::std::option::Option, 1499 | data: *mut ::std::os::raw::c_void, 1500 | ) -> Rboolean; 1501 | pub fn R_ExecWithCleanup( 1502 | fun: ::std::option::Option SEXP>, 1503 | data: *mut ::std::os::raw::c_void, 1504 | cleanfun: ::std::option::Option, 1505 | cleandata: *mut ::std::os::raw::c_void, 1506 | ) -> SEXP; 1507 | pub fn R_tryCatch( 1508 | arg1: ::std::option::Option< 1509 | unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> SEXP, 1510 | >, 1511 | arg2: *mut ::std::os::raw::c_void, 1512 | arg3: SEXP, 1513 | arg4: ::std::option::Option< 1514 | unsafe extern "C" fn(arg1: SEXP, arg2: *mut ::std::os::raw::c_void) -> SEXP, 1515 | >, 1516 | arg5: *mut ::std::os::raw::c_void, 1517 | arg6: ::std::option::Option, 1518 | arg7: *mut ::std::os::raw::c_void, 1519 | ) -> SEXP; 1520 | pub fn R_tryCatchError( 1521 | arg1: ::std::option::Option< 1522 | unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> SEXP, 1523 | >, 1524 | arg2: *mut ::std::os::raw::c_void, 1525 | arg3: ::std::option::Option< 1526 | unsafe extern "C" fn(arg1: SEXP, arg2: *mut ::std::os::raw::c_void) -> SEXP, 1527 | >, 1528 | arg4: *mut ::std::os::raw::c_void, 1529 | ) -> SEXP; 1530 | pub fn R_withCallingErrorHandler( 1531 | arg1: ::std::option::Option< 1532 | unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> SEXP, 1533 | >, 1534 | arg2: *mut ::std::os::raw::c_void, 1535 | arg3: ::std::option::Option< 1536 | unsafe extern "C" fn(arg1: SEXP, arg2: *mut ::std::os::raw::c_void) -> SEXP, 1537 | >, 1538 | arg4: *mut ::std::os::raw::c_void, 1539 | ) -> SEXP; 1540 | pub fn R_MakeUnwindCont() -> SEXP; 1541 | pub fn R_ContinueUnwind(cont: SEXP) -> !; 1542 | pub fn R_UnwindProtect( 1543 | fun: ::std::option::Option SEXP>, 1544 | data: *mut ::std::os::raw::c_void, 1545 | cleanfun: ::std::option::Option< 1546 | unsafe extern "C" fn(data: *mut ::std::os::raw::c_void, jump: Rboolean), 1547 | >, 1548 | cleandata: *mut ::std::os::raw::c_void, 1549 | cont: SEXP, 1550 | ) -> SEXP; 1551 | #[doc = "Environment and Binding Features"] 1552 | pub fn R_NewEnv(arg1: SEXP, arg2: ::std::os::raw::c_int, arg3: ::std::os::raw::c_int) -> SEXP; 1553 | pub fn R_IsPackageEnv(rho: SEXP) -> Rboolean; 1554 | pub fn R_PackageEnvName(rho: SEXP) -> SEXP; 1555 | pub fn R_FindPackageEnv(info: SEXP) -> SEXP; 1556 | pub fn R_IsNamespaceEnv(rho: SEXP) -> Rboolean; 1557 | pub fn R_NamespaceEnvSpec(rho: SEXP) -> SEXP; 1558 | pub fn R_FindNamespace(info: SEXP) -> SEXP; 1559 | pub fn R_LockEnvironment(env: SEXP, bindings: Rboolean); 1560 | pub fn R_EnvironmentIsLocked(env: SEXP) -> Rboolean; 1561 | pub fn R_LockBinding(sym: SEXP, env: SEXP); 1562 | pub fn R_unLockBinding(sym: SEXP, env: SEXP); 1563 | pub fn R_MakeActiveBinding(sym: SEXP, fun: SEXP, env: SEXP); 1564 | pub fn R_BindingIsLocked(sym: SEXP, env: SEXP) -> Rboolean; 1565 | pub fn R_BindingIsActive(sym: SEXP, env: SEXP) -> Rboolean; 1566 | pub fn R_ActiveBindingFunction(sym: SEXP, env: SEXP) -> SEXP; 1567 | pub fn R_HasFancyBindings(rho: SEXP) -> Rboolean; 1568 | pub fn Rf_errorcall(arg1: SEXP, arg2: *const ::std::os::raw::c_char, ...) -> !; 1569 | pub fn Rf_warningcall(arg1: SEXP, arg2: *const ::std::os::raw::c_char, ...); 1570 | pub fn Rf_warningcall_immediate(arg1: SEXP, arg2: *const ::std::os::raw::c_char, ...); 1571 | pub fn R_XDREncodeDouble(d: f64, buf: *mut ::std::os::raw::c_void); 1572 | pub fn R_XDRDecodeDouble(buf: *mut ::std::os::raw::c_void) -> f64; 1573 | pub fn R_XDREncodeInteger(i: ::std::os::raw::c_int, buf: *mut ::std::os::raw::c_void); 1574 | pub fn R_XDRDecodeInteger(buf: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; 1575 | pub fn R_InitInPStream( 1576 | stream: R_inpstream_t, 1577 | data: R_pstream_data_t, 1578 | type_: R_pstream_format_t, 1579 | inchar: ::std::option::Option< 1580 | unsafe extern "C" fn(arg1: R_inpstream_t) -> ::std::os::raw::c_int, 1581 | >, 1582 | inbytes: ::std::option::Option< 1583 | unsafe extern "C" fn( 1584 | arg1: R_inpstream_t, 1585 | arg2: *mut ::std::os::raw::c_void, 1586 | arg3: ::std::os::raw::c_int, 1587 | ), 1588 | >, 1589 | phook: ::std::option::Option SEXP>, 1590 | pdata: SEXP, 1591 | ); 1592 | pub fn R_InitOutPStream( 1593 | stream: R_outpstream_t, 1594 | data: R_pstream_data_t, 1595 | type_: R_pstream_format_t, 1596 | version: ::std::os::raw::c_int, 1597 | outchar: ::std::option::Option< 1598 | unsafe extern "C" fn(arg1: R_outpstream_t, arg2: ::std::os::raw::c_int), 1599 | >, 1600 | outbytes: ::std::option::Option< 1601 | unsafe extern "C" fn( 1602 | arg1: R_outpstream_t, 1603 | arg2: *mut ::std::os::raw::c_void, 1604 | arg3: ::std::os::raw::c_int, 1605 | ), 1606 | >, 1607 | phook: ::std::option::Option SEXP>, 1608 | pdata: SEXP, 1609 | ); 1610 | pub fn R_InitFileInPStream( 1611 | stream: R_inpstream_t, 1612 | fp: *mut FILE, 1613 | type_: R_pstream_format_t, 1614 | phook: ::std::option::Option SEXP>, 1615 | pdata: SEXP, 1616 | ); 1617 | pub fn R_InitFileOutPStream( 1618 | stream: R_outpstream_t, 1619 | fp: *mut FILE, 1620 | type_: R_pstream_format_t, 1621 | version: ::std::os::raw::c_int, 1622 | phook: ::std::option::Option SEXP>, 1623 | pdata: SEXP, 1624 | ); 1625 | pub fn R_Serialize(s: SEXP, ops: R_outpstream_t); 1626 | pub fn R_Unserialize(ips: R_inpstream_t) -> SEXP; 1627 | pub fn R_SerializeInfo(ips: R_inpstream_t) -> SEXP; 1628 | #[doc = "slot management (in attrib.c)"] 1629 | pub fn R_do_slot(obj: SEXP, name: SEXP) -> SEXP; 1630 | pub fn R_do_slot_assign(obj: SEXP, name: SEXP, value: SEXP) -> SEXP; 1631 | pub fn R_has_slot(obj: SEXP, name: SEXP) -> ::std::os::raw::c_int; 1632 | #[doc = "S3-S4 class (inheritance), attrib.c"] 1633 | pub fn R_S4_extends(klass: SEXP, useTable: SEXP) -> SEXP; 1634 | #[doc = "class definition, new objects (objects.c)"] 1635 | pub fn R_do_MAKE_CLASS(what: *const ::std::os::raw::c_char) -> SEXP; 1636 | pub fn R_getClassDef(what: *const ::std::os::raw::c_char) -> SEXP; 1637 | pub fn R_getClassDef_R(what: SEXP) -> SEXP; 1638 | pub fn R_has_methods_attached() -> Rboolean; 1639 | pub fn R_isVirtualClass(class_def: SEXP, env: SEXP) -> Rboolean; 1640 | pub fn R_extends(class1: SEXP, class2: SEXP, env: SEXP) -> Rboolean; 1641 | pub fn R_do_new_object(class_def: SEXP) -> SEXP; 1642 | #[doc = "supporting a C-level version of is(., .) :"] 1643 | pub fn R_check_class_and_super( 1644 | x: SEXP, 1645 | valid: *mut *const ::std::os::raw::c_char, 1646 | rho: SEXP, 1647 | ) -> ::std::os::raw::c_int; 1648 | pub fn R_check_class_etc( 1649 | x: SEXP, 1650 | valid: *mut *const ::std::os::raw::c_char, 1651 | ) -> ::std::os::raw::c_int; 1652 | #[doc = "preserve objects across GCs"] 1653 | pub fn R_PreserveObject(arg1: SEXP); 1654 | pub fn R_ReleaseObject(arg1: SEXP); 1655 | pub fn R_NewPreciousMSet(arg1: ::std::os::raw::c_int) -> SEXP; 1656 | pub fn R_PreserveInMSet(x: SEXP, mset: SEXP); 1657 | pub fn R_ReleaseFromMSet(x: SEXP, mset: SEXP); 1658 | pub fn R_ReleaseMSet(mset: SEXP, keepSize: ::std::os::raw::c_int); 1659 | #[doc = "Shutdown actions"] 1660 | pub fn R_dot_Last(); 1661 | pub fn R_RunExitFinalizers(); 1662 | pub fn R_system(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; 1663 | pub fn R_compute_identical(arg1: SEXP, arg2: SEXP, arg3: ::std::os::raw::c_int) -> Rboolean; 1664 | pub fn R_body_no_src(x: SEXP) -> SEXP; 1665 | #[doc = "C version of R's indx <- order(..., na.last, decreasing) :\ne.g. arglist = Rf_lang2(x,y) or Rf_lang3(x,y,z)"] 1666 | pub fn R_orderVector( 1667 | indx: *mut ::std::os::raw::c_int, 1668 | n: ::std::os::raw::c_int, 1669 | arglist: SEXP, 1670 | nalast: Rboolean, 1671 | decreasing: Rboolean, 1672 | ); 1673 | #[doc = "C version of R's indx <- order(x, na.last, decreasing) :"] 1674 | pub fn R_orderVector1( 1675 | indx: *mut ::std::os::raw::c_int, 1676 | n: ::std::os::raw::c_int, 1677 | x: SEXP, 1678 | nalast: Rboolean, 1679 | decreasing: Rboolean, 1680 | ); 1681 | #[doc = "These are the public inlinable functions that are provided in\nRinlinedfuns.h It is *essential* that these do not appear in any\nother header file, with or without the Rf_ prefix."] 1682 | pub fn Rf_allocVector(arg1: SEXPTYPE, arg2: R_xlen_t) -> SEXP; 1683 | pub fn Rf_conformable(arg1: SEXP, arg2: SEXP) -> Rboolean; 1684 | pub fn Rf_elt(arg1: SEXP, arg2: ::std::os::raw::c_int) -> SEXP; 1685 | pub fn Rf_inherits(arg1: SEXP, arg2: *const ::std::os::raw::c_char) -> Rboolean; 1686 | pub fn Rf_isArray(arg1: SEXP) -> Rboolean; 1687 | pub fn Rf_isFactor(arg1: SEXP) -> Rboolean; 1688 | pub fn Rf_isFrame(arg1: SEXP) -> Rboolean; 1689 | pub fn Rf_isFunction(arg1: SEXP) -> Rboolean; 1690 | pub fn Rf_isInteger(arg1: SEXP) -> Rboolean; 1691 | pub fn Rf_isLanguage(arg1: SEXP) -> Rboolean; 1692 | pub fn Rf_isList(arg1: SEXP) -> Rboolean; 1693 | pub fn Rf_isMatrix(arg1: SEXP) -> Rboolean; 1694 | pub fn Rf_isNewList(arg1: SEXP) -> Rboolean; 1695 | pub fn Rf_isNumber(arg1: SEXP) -> Rboolean; 1696 | pub fn Rf_isNumeric(arg1: SEXP) -> Rboolean; 1697 | pub fn Rf_isPairList(arg1: SEXP) -> Rboolean; 1698 | pub fn Rf_isPrimitive(arg1: SEXP) -> Rboolean; 1699 | pub fn Rf_isTs(arg1: SEXP) -> Rboolean; 1700 | pub fn Rf_isUserBinop(arg1: SEXP) -> Rboolean; 1701 | pub fn Rf_isVector(arg1: SEXP) -> Rboolean; 1702 | pub fn Rf_isVectorAtomic(arg1: SEXP) -> Rboolean; 1703 | pub fn Rf_isVectorList(arg1: SEXP) -> Rboolean; 1704 | pub fn Rf_isVectorizable(arg1: SEXP) -> Rboolean; 1705 | pub fn Rf_lang1(arg1: SEXP) -> SEXP; 1706 | pub fn Rf_lang2(arg1: SEXP, arg2: SEXP) -> SEXP; 1707 | pub fn Rf_lang3(arg1: SEXP, arg2: SEXP, arg3: SEXP) -> SEXP; 1708 | pub fn Rf_lang4(arg1: SEXP, arg2: SEXP, arg3: SEXP, arg4: SEXP) -> SEXP; 1709 | pub fn Rf_lang5(arg1: SEXP, arg2: SEXP, arg3: SEXP, arg4: SEXP, arg5: SEXP) -> SEXP; 1710 | pub fn Rf_lang6(arg1: SEXP, arg2: SEXP, arg3: SEXP, arg4: SEXP, arg5: SEXP, arg6: SEXP) 1711 | -> SEXP; 1712 | pub fn Rf_lastElt(arg1: SEXP) -> SEXP; 1713 | pub fn Rf_lcons(arg1: SEXP, arg2: SEXP) -> SEXP; 1714 | pub fn Rf_length(arg1: SEXP) -> R_len_t; 1715 | pub fn Rf_list1(arg1: SEXP) -> SEXP; 1716 | pub fn Rf_list2(arg1: SEXP, arg2: SEXP) -> SEXP; 1717 | pub fn Rf_list3(arg1: SEXP, arg2: SEXP, arg3: SEXP) -> SEXP; 1718 | pub fn Rf_list4(arg1: SEXP, arg2: SEXP, arg3: SEXP, arg4: SEXP) -> SEXP; 1719 | pub fn Rf_list5(arg1: SEXP, arg2: SEXP, arg3: SEXP, arg4: SEXP, arg5: SEXP) -> SEXP; 1720 | pub fn Rf_list6(arg1: SEXP, arg2: SEXP, arg3: SEXP, arg4: SEXP, arg5: SEXP, arg6: SEXP) 1721 | -> SEXP; 1722 | pub fn Rf_listAppend(arg1: SEXP, arg2: SEXP) -> SEXP; 1723 | pub fn Rf_mkNamed(arg1: SEXPTYPE, arg2: *mut *const ::std::os::raw::c_char) -> SEXP; 1724 | pub fn Rf_mkString(arg1: *const ::std::os::raw::c_char) -> SEXP; 1725 | pub fn Rf_nlevels(arg1: SEXP) -> ::std::os::raw::c_int; 1726 | pub fn Rf_stringPositionTr( 1727 | arg1: SEXP, 1728 | arg2: *const ::std::os::raw::c_char, 1729 | ) -> ::std::os::raw::c_int; 1730 | pub fn Rf_ScalarComplex(arg1: Rcomplex) -> SEXP; 1731 | pub fn Rf_ScalarInteger(arg1: ::std::os::raw::c_int) -> SEXP; 1732 | pub fn Rf_ScalarLogical(arg1: ::std::os::raw::c_int) -> SEXP; 1733 | pub fn Rf_ScalarRaw(arg1: Rbyte) -> SEXP; 1734 | pub fn Rf_ScalarReal(arg1: f64) -> SEXP; 1735 | pub fn Rf_ScalarString(arg1: SEXP) -> SEXP; 1736 | pub fn Rf_xlength(arg1: SEXP) -> R_xlen_t; 1737 | pub fn LENGTH_EX( 1738 | x: SEXP, 1739 | file: *const ::std::os::raw::c_char, 1740 | line: ::std::os::raw::c_int, 1741 | ) -> ::std::os::raw::c_int; 1742 | pub fn Rf_protect(arg1: SEXP) -> SEXP; 1743 | pub fn Rf_unprotect(arg1: ::std::os::raw::c_int); 1744 | pub fn R_ProtectWithIndex(arg1: SEXP, arg2: *mut PROTECT_INDEX); 1745 | pub fn R_Reprotect(arg1: SEXP, arg2: PROTECT_INDEX); 1746 | pub fn CAR(e: SEXP) -> SEXP; 1747 | pub fn DATAPTR(x: SEXP) -> *mut ::std::os::raw::c_void; 1748 | pub fn DATAPTR_RO(x: SEXP) -> *const ::std::os::raw::c_void; 1749 | pub fn DATAPTR_OR_NULL(x: SEXP) -> *const ::std::os::raw::c_void; 1750 | pub fn LOGICAL_OR_NULL(x: SEXP) -> *const ::std::os::raw::c_int; 1751 | pub fn INTEGER_OR_NULL(x: SEXP) -> *const ::std::os::raw::c_int; 1752 | pub fn REAL_OR_NULL(x: SEXP) -> *const f64; 1753 | pub fn COMPLEX_OR_NULL(x: SEXP) -> *const Rcomplex; 1754 | pub fn RAW_OR_NULL(x: SEXP) -> *const Rbyte; 1755 | pub fn INTEGER_ELT(x: SEXP, i: R_xlen_t) -> ::std::os::raw::c_int; 1756 | pub fn REAL_ELT(x: SEXP, i: R_xlen_t) -> f64; 1757 | pub fn LOGICAL_ELT(x: SEXP, i: R_xlen_t) -> ::std::os::raw::c_int; 1758 | pub fn COMPLEX_ELT(x: SEXP, i: R_xlen_t) -> Rcomplex; 1759 | pub fn RAW_ELT(x: SEXP, i: R_xlen_t) -> Rbyte; 1760 | pub fn STRING_ELT(x: SEXP, i: R_xlen_t) -> SEXP; 1761 | pub fn SET_LOGICAL_ELT(x: SEXP, i: R_xlen_t, v: ::std::os::raw::c_int); 1762 | pub fn SET_INTEGER_ELT(x: SEXP, i: R_xlen_t, v: ::std::os::raw::c_int); 1763 | pub fn SET_REAL_ELT(x: SEXP, i: R_xlen_t, v: f64); 1764 | pub fn SET_COMPLEX_ELT(x: SEXP, i: R_xlen_t, v: Rcomplex); 1765 | pub fn SET_RAW_ELT(x: SEXP, i: R_xlen_t, v: Rbyte); 1766 | #[doc = "ALTREP support"] 1767 | pub fn ALTREP_CLASS(x: SEXP) -> SEXP; 1768 | pub fn R_altrep_data1(x: SEXP) -> SEXP; 1769 | pub fn R_altrep_data2(x: SEXP) -> SEXP; 1770 | pub fn R_set_altrep_data1(x: SEXP, v: SEXP); 1771 | pub fn R_set_altrep_data2(x: SEXP, v: SEXP); 1772 | pub fn LOGICAL0(x: SEXP) -> *mut ::std::os::raw::c_int; 1773 | pub fn INTEGER0(x: SEXP) -> *mut ::std::os::raw::c_int; 1774 | pub fn RAW0(x: SEXP) -> *mut Rbyte; 1775 | pub fn ALTREP(x: SEXP) -> ::std::os::raw::c_int; 1776 | #[doc = "public C interface"] 1777 | pub fn R_asHashtable(h: SEXP) -> R_hashtab_type; 1778 | pub fn R_HashtabSEXP(h: R_hashtab_type) -> SEXP; 1779 | pub fn R_isHashtable(h: SEXP) -> ::std::os::raw::c_int; 1780 | pub fn R_mkhashtab(type_: ::std::os::raw::c_int, arg1: ::std::os::raw::c_int) 1781 | -> R_hashtab_type; 1782 | pub fn R_gethash(h: R_hashtab_type, key: SEXP, nomatch: SEXP) -> SEXP; 1783 | pub fn R_sethash(h: R_hashtab_type, key: SEXP, value: SEXP) -> SEXP; 1784 | pub fn R_remhash(h: R_hashtab_type, key: SEXP) -> ::std::os::raw::c_int; 1785 | pub fn R_numhash(h: R_hashtab_type) -> ::std::os::raw::c_int; 1786 | pub fn R_typhash(h: R_hashtab_type) -> ::std::os::raw::c_int; 1787 | pub fn R_maphash(h: R_hashtab_type, FUN: SEXP) -> SEXP; 1788 | pub fn R_maphashC( 1789 | h: R_hashtab_type, 1790 | FUN: ::std::option::Option< 1791 | unsafe extern "C" fn(arg1: SEXP, arg2: SEXP, arg3: *mut ::std::os::raw::c_void), 1792 | >, 1793 | data: *mut ::std::os::raw::c_void, 1794 | ); 1795 | pub fn R_clrhash(h: R_hashtab_type); 1796 | pub fn SET_OBJECT(x: SEXP, v: ::std::os::raw::c_int); 1797 | pub fn IS_SCALAR(x: SEXP, type_: ::std::os::raw::c_int) -> ::std::os::raw::c_int; 1798 | pub fn Rf_psmatch( 1799 | arg1: *const ::std::os::raw::c_char, 1800 | arg2: *const ::std::os::raw::c_char, 1801 | arg3: Rboolean, 1802 | ) -> Rboolean; 1803 | #[doc = "C stack limit"] 1804 | pub static mut R_CStackLimit: usize; 1805 | pub fn Rf_endEmbeddedR(fatal: ::std::os::raw::c_int); 1806 | pub fn Rf_initialize_R( 1807 | ac: ::std::os::raw::c_int, 1808 | av: *mut *mut ::std::os::raw::c_char, 1809 | ) -> ::std::os::raw::c_int; 1810 | pub fn setup_Rmainloop(); 1811 | pub fn CleanEd(); 1812 | pub fn R_CleanTempDir(); 1813 | pub fn setup_term_ui(); 1814 | pub static mut UserBreak: ::std::os::raw::c_int; 1815 | pub fn GA_initapp( 1816 | arg1: ::std::os::raw::c_int, 1817 | arg2: *mut *mut ::std::os::raw::c_char, 1818 | ) -> ::std::os::raw::c_int; 1819 | pub fn GA_appcleanup(); 1820 | #[doc = "R's versions with !R_FINITE checks"] 1821 | pub fn R_pow(x: f64, y: f64) -> f64; 1822 | pub fn R_pow_di(arg1: f64, arg2: ::std::os::raw::c_int) -> f64; 1823 | #[doc = "Random Number Generators"] 1824 | pub fn norm_rand() -> f64; 1825 | pub fn unif_rand() -> f64; 1826 | pub fn R_unif_index(arg1: f64) -> f64; 1827 | pub fn exp_rand() -> f64; 1828 | #[doc = "Normal Distribution"] 1829 | pub fn Rf_dnorm4(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; 1830 | pub fn Rf_pnorm5( 1831 | arg1: f64, 1832 | arg2: f64, 1833 | arg3: f64, 1834 | arg4: ::std::os::raw::c_int, 1835 | arg5: ::std::os::raw::c_int, 1836 | ) -> f64; 1837 | pub fn Rf_qnorm5( 1838 | arg1: f64, 1839 | arg2: f64, 1840 | arg3: f64, 1841 | arg4: ::std::os::raw::c_int, 1842 | arg5: ::std::os::raw::c_int, 1843 | ) -> f64; 1844 | pub fn Rf_rnorm(arg1: f64, arg2: f64) -> f64; 1845 | pub fn Rf_pnorm_both( 1846 | arg1: f64, 1847 | arg2: *mut f64, 1848 | arg3: *mut f64, 1849 | arg4: ::std::os::raw::c_int, 1850 | arg5: ::std::os::raw::c_int, 1851 | ); 1852 | #[doc = "Uniform Distribution"] 1853 | pub fn Rf_dunif(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; 1854 | pub fn Rf_punif( 1855 | arg1: f64, 1856 | arg2: f64, 1857 | arg3: f64, 1858 | arg4: ::std::os::raw::c_int, 1859 | arg5: ::std::os::raw::c_int, 1860 | ) -> f64; 1861 | pub fn Rf_qunif( 1862 | arg1: f64, 1863 | arg2: f64, 1864 | arg3: f64, 1865 | arg4: ::std::os::raw::c_int, 1866 | arg5: ::std::os::raw::c_int, 1867 | ) -> f64; 1868 | pub fn Rf_runif(arg1: f64, arg2: f64) -> f64; 1869 | #[doc = "Gamma Distribution"] 1870 | pub fn Rf_dgamma(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; 1871 | pub fn Rf_pgamma( 1872 | arg1: f64, 1873 | arg2: f64, 1874 | arg3: f64, 1875 | arg4: ::std::os::raw::c_int, 1876 | arg5: ::std::os::raw::c_int, 1877 | ) -> f64; 1878 | pub fn Rf_qgamma( 1879 | arg1: f64, 1880 | arg2: f64, 1881 | arg3: f64, 1882 | arg4: ::std::os::raw::c_int, 1883 | arg5: ::std::os::raw::c_int, 1884 | ) -> f64; 1885 | pub fn Rf_rgamma(arg1: f64, arg2: f64) -> f64; 1886 | pub fn Rf_log1pmx(arg1: f64) -> f64; 1887 | pub fn Rf_log1pexp(arg1: f64) -> f64; 1888 | pub fn Rf_log1mexp(arg1: f64) -> f64; 1889 | pub fn Rf_lgamma1p(arg1: f64) -> f64; 1890 | #[doc = "Compute the log of a sum or difference from logs of terms, i.e.,\n\n log (exp (logx) + exp (logy))\n or log (exp (logx) - exp (logy))\n\n without causing overflows or throwing away too much accuracy:"] 1891 | pub fn Rf_logspace_add(arg1: f64, arg2: f64) -> f64; 1892 | pub fn Rf_logspace_sub(arg1: f64, arg2: f64) -> f64; 1893 | pub fn Rf_logspace_sum(arg1: *const f64, arg2: ::std::os::raw::c_int) -> f64; 1894 | #[doc = "Beta Distribution"] 1895 | pub fn Rf_dbeta(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; 1896 | pub fn Rf_pbeta( 1897 | arg1: f64, 1898 | arg2: f64, 1899 | arg3: f64, 1900 | arg4: ::std::os::raw::c_int, 1901 | arg5: ::std::os::raw::c_int, 1902 | ) -> f64; 1903 | pub fn Rf_qbeta( 1904 | arg1: f64, 1905 | arg2: f64, 1906 | arg3: f64, 1907 | arg4: ::std::os::raw::c_int, 1908 | arg5: ::std::os::raw::c_int, 1909 | ) -> f64; 1910 | pub fn Rf_rbeta(arg1: f64, arg2: f64) -> f64; 1911 | #[doc = "Lognormal Distribution"] 1912 | pub fn Rf_dlnorm(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; 1913 | pub fn Rf_plnorm( 1914 | arg1: f64, 1915 | arg2: f64, 1916 | arg3: f64, 1917 | arg4: ::std::os::raw::c_int, 1918 | arg5: ::std::os::raw::c_int, 1919 | ) -> f64; 1920 | pub fn Rf_qlnorm( 1921 | arg1: f64, 1922 | arg2: f64, 1923 | arg3: f64, 1924 | arg4: ::std::os::raw::c_int, 1925 | arg5: ::std::os::raw::c_int, 1926 | ) -> f64; 1927 | pub fn Rf_rlnorm(arg1: f64, arg2: f64) -> f64; 1928 | #[doc = "Chi-squared Distribution"] 1929 | pub fn Rf_dchisq(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; 1930 | pub fn Rf_pchisq( 1931 | arg1: f64, 1932 | arg2: f64, 1933 | arg3: ::std::os::raw::c_int, 1934 | arg4: ::std::os::raw::c_int, 1935 | ) -> f64; 1936 | pub fn Rf_qchisq( 1937 | arg1: f64, 1938 | arg2: f64, 1939 | arg3: ::std::os::raw::c_int, 1940 | arg4: ::std::os::raw::c_int, 1941 | ) -> f64; 1942 | pub fn Rf_rchisq(arg1: f64) -> f64; 1943 | #[doc = "Non-central Chi-squared Distribution"] 1944 | pub fn Rf_dnchisq(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; 1945 | pub fn Rf_pnchisq( 1946 | arg1: f64, 1947 | arg2: f64, 1948 | arg3: f64, 1949 | arg4: ::std::os::raw::c_int, 1950 | arg5: ::std::os::raw::c_int, 1951 | ) -> f64; 1952 | pub fn Rf_qnchisq( 1953 | arg1: f64, 1954 | arg2: f64, 1955 | arg3: f64, 1956 | arg4: ::std::os::raw::c_int, 1957 | arg5: ::std::os::raw::c_int, 1958 | ) -> f64; 1959 | pub fn Rf_rnchisq(arg1: f64, arg2: f64) -> f64; 1960 | #[doc = "F Distibution"] 1961 | pub fn Rf_df(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; 1962 | pub fn Rf_pf( 1963 | arg1: f64, 1964 | arg2: f64, 1965 | arg3: f64, 1966 | arg4: ::std::os::raw::c_int, 1967 | arg5: ::std::os::raw::c_int, 1968 | ) -> f64; 1969 | pub fn Rf_qf( 1970 | arg1: f64, 1971 | arg2: f64, 1972 | arg3: f64, 1973 | arg4: ::std::os::raw::c_int, 1974 | arg5: ::std::os::raw::c_int, 1975 | ) -> f64; 1976 | pub fn Rf_rf(arg1: f64, arg2: f64) -> f64; 1977 | #[doc = "Student t Distibution"] 1978 | pub fn Rf_dt(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; 1979 | pub fn Rf_pt( 1980 | arg1: f64, 1981 | arg2: f64, 1982 | arg3: ::std::os::raw::c_int, 1983 | arg4: ::std::os::raw::c_int, 1984 | ) -> f64; 1985 | pub fn Rf_qt( 1986 | arg1: f64, 1987 | arg2: f64, 1988 | arg3: ::std::os::raw::c_int, 1989 | arg4: ::std::os::raw::c_int, 1990 | ) -> f64; 1991 | pub fn Rf_rt(arg1: f64) -> f64; 1992 | #[doc = "Binomial Distribution"] 1993 | pub fn Rf_dbinom_raw(x: f64, n: f64, p: f64, q: f64, give_log: ::std::os::raw::c_int) -> f64; 1994 | pub fn Rf_dbinom(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; 1995 | pub fn Rf_pbinom( 1996 | arg1: f64, 1997 | arg2: f64, 1998 | arg3: f64, 1999 | arg4: ::std::os::raw::c_int, 2000 | arg5: ::std::os::raw::c_int, 2001 | ) -> f64; 2002 | pub fn Rf_qbinom( 2003 | arg1: f64, 2004 | arg2: f64, 2005 | arg3: f64, 2006 | arg4: ::std::os::raw::c_int, 2007 | arg5: ::std::os::raw::c_int, 2008 | ) -> f64; 2009 | pub fn Rf_rbinom(arg1: f64, arg2: f64) -> f64; 2010 | #[doc = "Multinomial Distribution"] 2011 | pub fn Rf_rmultinom( 2012 | arg1: ::std::os::raw::c_int, 2013 | arg2: *mut f64, 2014 | arg3: ::std::os::raw::c_int, 2015 | arg4: *mut ::std::os::raw::c_int, 2016 | ); 2017 | #[doc = "Cauchy Distribution"] 2018 | pub fn Rf_dcauchy(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; 2019 | pub fn Rf_pcauchy( 2020 | arg1: f64, 2021 | arg2: f64, 2022 | arg3: f64, 2023 | arg4: ::std::os::raw::c_int, 2024 | arg5: ::std::os::raw::c_int, 2025 | ) -> f64; 2026 | pub fn Rf_qcauchy( 2027 | arg1: f64, 2028 | arg2: f64, 2029 | arg3: f64, 2030 | arg4: ::std::os::raw::c_int, 2031 | arg5: ::std::os::raw::c_int, 2032 | ) -> f64; 2033 | pub fn Rf_rcauchy(arg1: f64, arg2: f64) -> f64; 2034 | #[doc = "Exponential Distribution"] 2035 | pub fn Rf_dexp(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; 2036 | pub fn Rf_pexp( 2037 | arg1: f64, 2038 | arg2: f64, 2039 | arg3: ::std::os::raw::c_int, 2040 | arg4: ::std::os::raw::c_int, 2041 | ) -> f64; 2042 | pub fn Rf_qexp( 2043 | arg1: f64, 2044 | arg2: f64, 2045 | arg3: ::std::os::raw::c_int, 2046 | arg4: ::std::os::raw::c_int, 2047 | ) -> f64; 2048 | pub fn Rf_rexp(arg1: f64) -> f64; 2049 | #[doc = "Geometric Distribution"] 2050 | pub fn Rf_dgeom(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; 2051 | pub fn Rf_pgeom( 2052 | arg1: f64, 2053 | arg2: f64, 2054 | arg3: ::std::os::raw::c_int, 2055 | arg4: ::std::os::raw::c_int, 2056 | ) -> f64; 2057 | pub fn Rf_qgeom( 2058 | arg1: f64, 2059 | arg2: f64, 2060 | arg3: ::std::os::raw::c_int, 2061 | arg4: ::std::os::raw::c_int, 2062 | ) -> f64; 2063 | pub fn Rf_rgeom(arg1: f64) -> f64; 2064 | #[doc = "Hypergeometric Distibution"] 2065 | pub fn Rf_dhyper( 2066 | arg1: f64, 2067 | arg2: f64, 2068 | arg3: f64, 2069 | arg4: f64, 2070 | arg5: ::std::os::raw::c_int, 2071 | ) -> f64; 2072 | pub fn Rf_phyper( 2073 | arg1: f64, 2074 | arg2: f64, 2075 | arg3: f64, 2076 | arg4: f64, 2077 | arg5: ::std::os::raw::c_int, 2078 | arg6: ::std::os::raw::c_int, 2079 | ) -> f64; 2080 | pub fn Rf_qhyper( 2081 | arg1: f64, 2082 | arg2: f64, 2083 | arg3: f64, 2084 | arg4: f64, 2085 | arg5: ::std::os::raw::c_int, 2086 | arg6: ::std::os::raw::c_int, 2087 | ) -> f64; 2088 | pub fn Rf_rhyper(arg1: f64, arg2: f64, arg3: f64) -> f64; 2089 | #[doc = "Negative Binomial Distribution"] 2090 | pub fn Rf_dnbinom(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; 2091 | pub fn Rf_pnbinom( 2092 | arg1: f64, 2093 | arg2: f64, 2094 | arg3: f64, 2095 | arg4: ::std::os::raw::c_int, 2096 | arg5: ::std::os::raw::c_int, 2097 | ) -> f64; 2098 | pub fn Rf_qnbinom( 2099 | arg1: f64, 2100 | arg2: f64, 2101 | arg3: f64, 2102 | arg4: ::std::os::raw::c_int, 2103 | arg5: ::std::os::raw::c_int, 2104 | ) -> f64; 2105 | pub fn Rf_rnbinom(arg1: f64, arg2: f64) -> f64; 2106 | pub fn Rf_dnbinom_mu(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; 2107 | pub fn Rf_pnbinom_mu( 2108 | arg1: f64, 2109 | arg2: f64, 2110 | arg3: f64, 2111 | arg4: ::std::os::raw::c_int, 2112 | arg5: ::std::os::raw::c_int, 2113 | ) -> f64; 2114 | pub fn Rf_qnbinom_mu( 2115 | arg1: f64, 2116 | arg2: f64, 2117 | arg3: f64, 2118 | arg4: ::std::os::raw::c_int, 2119 | arg5: ::std::os::raw::c_int, 2120 | ) -> f64; 2121 | pub fn Rf_rnbinom_mu(arg1: f64, arg2: f64) -> f64; 2122 | #[doc = "Poisson Distribution"] 2123 | pub fn Rf_dpois_raw(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; 2124 | pub fn Rf_dpois(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; 2125 | pub fn Rf_ppois( 2126 | arg1: f64, 2127 | arg2: f64, 2128 | arg3: ::std::os::raw::c_int, 2129 | arg4: ::std::os::raw::c_int, 2130 | ) -> f64; 2131 | pub fn Rf_qpois( 2132 | arg1: f64, 2133 | arg2: f64, 2134 | arg3: ::std::os::raw::c_int, 2135 | arg4: ::std::os::raw::c_int, 2136 | ) -> f64; 2137 | pub fn Rf_rpois(arg1: f64) -> f64; 2138 | #[doc = "Weibull Distribution"] 2139 | pub fn Rf_dweibull(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; 2140 | pub fn Rf_pweibull( 2141 | arg1: f64, 2142 | arg2: f64, 2143 | arg3: f64, 2144 | arg4: ::std::os::raw::c_int, 2145 | arg5: ::std::os::raw::c_int, 2146 | ) -> f64; 2147 | pub fn Rf_qweibull( 2148 | arg1: f64, 2149 | arg2: f64, 2150 | arg3: f64, 2151 | arg4: ::std::os::raw::c_int, 2152 | arg5: ::std::os::raw::c_int, 2153 | ) -> f64; 2154 | pub fn Rf_rweibull(arg1: f64, arg2: f64) -> f64; 2155 | #[doc = "Logistic Distribution"] 2156 | pub fn Rf_dlogis(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; 2157 | pub fn Rf_plogis( 2158 | arg1: f64, 2159 | arg2: f64, 2160 | arg3: f64, 2161 | arg4: ::std::os::raw::c_int, 2162 | arg5: ::std::os::raw::c_int, 2163 | ) -> f64; 2164 | pub fn Rf_qlogis( 2165 | arg1: f64, 2166 | arg2: f64, 2167 | arg3: f64, 2168 | arg4: ::std::os::raw::c_int, 2169 | arg5: ::std::os::raw::c_int, 2170 | ) -> f64; 2171 | pub fn Rf_rlogis(arg1: f64, arg2: f64) -> f64; 2172 | #[doc = "Non-central Beta Distribution"] 2173 | pub fn Rf_dnbeta( 2174 | arg1: f64, 2175 | arg2: f64, 2176 | arg3: f64, 2177 | arg4: f64, 2178 | arg5: ::std::os::raw::c_int, 2179 | ) -> f64; 2180 | pub fn Rf_pnbeta( 2181 | arg1: f64, 2182 | arg2: f64, 2183 | arg3: f64, 2184 | arg4: f64, 2185 | arg5: ::std::os::raw::c_int, 2186 | arg6: ::std::os::raw::c_int, 2187 | ) -> f64; 2188 | pub fn Rf_qnbeta( 2189 | arg1: f64, 2190 | arg2: f64, 2191 | arg3: f64, 2192 | arg4: f64, 2193 | arg5: ::std::os::raw::c_int, 2194 | arg6: ::std::os::raw::c_int, 2195 | ) -> f64; 2196 | pub fn Rf_rnbeta(arg1: f64, arg2: f64, arg3: f64) -> f64; 2197 | #[doc = "Non-central F Distribution"] 2198 | pub fn Rf_dnf(arg1: f64, arg2: f64, arg3: f64, arg4: f64, arg5: ::std::os::raw::c_int) -> f64; 2199 | pub fn Rf_pnf( 2200 | arg1: f64, 2201 | arg2: f64, 2202 | arg3: f64, 2203 | arg4: f64, 2204 | arg5: ::std::os::raw::c_int, 2205 | arg6: ::std::os::raw::c_int, 2206 | ) -> f64; 2207 | pub fn Rf_qnf( 2208 | arg1: f64, 2209 | arg2: f64, 2210 | arg3: f64, 2211 | arg4: f64, 2212 | arg5: ::std::os::raw::c_int, 2213 | arg6: ::std::os::raw::c_int, 2214 | ) -> f64; 2215 | #[doc = "Non-central Student t Distribution"] 2216 | pub fn Rf_dnt(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; 2217 | pub fn Rf_pnt( 2218 | arg1: f64, 2219 | arg2: f64, 2220 | arg3: f64, 2221 | arg4: ::std::os::raw::c_int, 2222 | arg5: ::std::os::raw::c_int, 2223 | ) -> f64; 2224 | pub fn Rf_qnt( 2225 | arg1: f64, 2226 | arg2: f64, 2227 | arg3: f64, 2228 | arg4: ::std::os::raw::c_int, 2229 | arg5: ::std::os::raw::c_int, 2230 | ) -> f64; 2231 | #[doc = "Studentized Range Distribution"] 2232 | pub fn Rf_ptukey( 2233 | arg1: f64, 2234 | arg2: f64, 2235 | arg3: f64, 2236 | arg4: f64, 2237 | arg5: ::std::os::raw::c_int, 2238 | arg6: ::std::os::raw::c_int, 2239 | ) -> f64; 2240 | pub fn Rf_qtukey( 2241 | arg1: f64, 2242 | arg2: f64, 2243 | arg3: f64, 2244 | arg4: f64, 2245 | arg5: ::std::os::raw::c_int, 2246 | arg6: ::std::os::raw::c_int, 2247 | ) -> f64; 2248 | #[doc = "Wilcoxon Rank Sum Distribution"] 2249 | pub fn Rf_dwilcox(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; 2250 | pub fn Rf_pwilcox( 2251 | arg1: f64, 2252 | arg2: f64, 2253 | arg3: f64, 2254 | arg4: ::std::os::raw::c_int, 2255 | arg5: ::std::os::raw::c_int, 2256 | ) -> f64; 2257 | pub fn Rf_qwilcox( 2258 | arg1: f64, 2259 | arg2: f64, 2260 | arg3: f64, 2261 | arg4: ::std::os::raw::c_int, 2262 | arg5: ::std::os::raw::c_int, 2263 | ) -> f64; 2264 | pub fn Rf_rwilcox(arg1: f64, arg2: f64) -> f64; 2265 | pub fn wilcox_free(); 2266 | #[doc = "Wilcoxon Signed Rank Distribution"] 2267 | pub fn Rf_dsignrank(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; 2268 | pub fn Rf_psignrank( 2269 | arg1: f64, 2270 | arg2: f64, 2271 | arg3: ::std::os::raw::c_int, 2272 | arg4: ::std::os::raw::c_int, 2273 | ) -> f64; 2274 | pub fn Rf_qsignrank( 2275 | arg1: f64, 2276 | arg2: f64, 2277 | arg3: ::std::os::raw::c_int, 2278 | arg4: ::std::os::raw::c_int, 2279 | ) -> f64; 2280 | pub fn Rf_rsignrank(arg1: f64) -> f64; 2281 | pub fn signrank_free(); 2282 | #[doc = "Gamma and Related Functions"] 2283 | pub fn Rf_gammafn(arg1: f64) -> f64; 2284 | pub fn Rf_lgammafn(arg1: f64) -> f64; 2285 | pub fn Rf_lgammafn_sign(arg1: f64, arg2: *mut ::std::os::raw::c_int) -> f64; 2286 | pub fn Rf_dpsifn( 2287 | arg1: f64, 2288 | arg2: ::std::os::raw::c_int, 2289 | arg3: ::std::os::raw::c_int, 2290 | arg4: ::std::os::raw::c_int, 2291 | arg5: *mut f64, 2292 | arg6: *mut ::std::os::raw::c_int, 2293 | arg7: *mut ::std::os::raw::c_int, 2294 | ); 2295 | pub fn Rf_psigamma(arg1: f64, arg2: f64) -> f64; 2296 | pub fn Rf_digamma(arg1: f64) -> f64; 2297 | pub fn Rf_trigamma(arg1: f64) -> f64; 2298 | pub fn Rf_tetragamma(arg1: f64) -> f64; 2299 | pub fn Rf_pentagamma(arg1: f64) -> f64; 2300 | pub fn Rf_beta(arg1: f64, arg2: f64) -> f64; 2301 | pub fn Rf_lbeta(arg1: f64, arg2: f64) -> f64; 2302 | pub fn Rf_choose(arg1: f64, arg2: f64) -> f64; 2303 | pub fn Rf_lchoose(arg1: f64, arg2: f64) -> f64; 2304 | #[doc = "Bessel Functions"] 2305 | pub fn Rf_bessel_i(arg1: f64, arg2: f64, arg3: f64) -> f64; 2306 | pub fn Rf_bessel_j(arg1: f64, arg2: f64) -> f64; 2307 | pub fn Rf_bessel_k(arg1: f64, arg2: f64, arg3: f64) -> f64; 2308 | pub fn Rf_bessel_y(arg1: f64, arg2: f64) -> f64; 2309 | pub fn Rf_bessel_i_ex(arg1: f64, arg2: f64, arg3: f64, arg4: *mut f64) -> f64; 2310 | pub fn Rf_bessel_j_ex(arg1: f64, arg2: f64, arg3: *mut f64) -> f64; 2311 | pub fn Rf_bessel_k_ex(arg1: f64, arg2: f64, arg3: f64, arg4: *mut f64) -> f64; 2312 | pub fn Rf_bessel_y_ex(arg1: f64, arg2: f64, arg3: *mut f64) -> f64; 2313 | #[doc = "General Support Functions"] 2314 | pub fn Rf_imax2( 2315 | arg1: ::std::os::raw::c_int, 2316 | arg2: ::std::os::raw::c_int, 2317 | ) -> ::std::os::raw::c_int; 2318 | pub fn Rf_imin2( 2319 | arg1: ::std::os::raw::c_int, 2320 | arg2: ::std::os::raw::c_int, 2321 | ) -> ::std::os::raw::c_int; 2322 | pub fn Rf_fmax2(arg1: f64, arg2: f64) -> f64; 2323 | pub fn Rf_fmin2(arg1: f64, arg2: f64) -> f64; 2324 | pub fn Rf_sign(arg1: f64) -> f64; 2325 | pub fn Rf_fprec(arg1: f64, arg2: f64) -> f64; 2326 | pub fn Rf_fround(arg1: f64, arg2: f64) -> f64; 2327 | pub fn Rf_fsign(arg1: f64, arg2: f64) -> f64; 2328 | pub fn Rf_ftrunc(arg1: f64) -> f64; 2329 | pub fn cospi(arg1: f64) -> f64; 2330 | pub fn sinpi(arg1: f64) -> f64; 2331 | pub fn tanpi(arg1: f64) -> f64; 2332 | pub fn Rtanpi(arg1: f64) -> f64; 2333 | pub fn R_ParseVector( 2334 | arg1: SEXP, 2335 | arg2: ::std::os::raw::c_int, 2336 | arg3: *mut ParseStatus, 2337 | arg4: SEXP, 2338 | ) -> SEXP; 2339 | pub fn R_new_altrep(aclass: R_altrep_class_t, data1: SEXP, data2: SEXP) -> SEXP; 2340 | pub fn R_make_altstring_class( 2341 | cname: *const ::std::os::raw::c_char, 2342 | pname: *const ::std::os::raw::c_char, 2343 | info: *mut DllInfo, 2344 | ) -> R_altrep_class_t; 2345 | pub fn R_make_altinteger_class( 2346 | cname: *const ::std::os::raw::c_char, 2347 | pname: *const ::std::os::raw::c_char, 2348 | info: *mut DllInfo, 2349 | ) -> R_altrep_class_t; 2350 | pub fn R_make_altreal_class( 2351 | cname: *const ::std::os::raw::c_char, 2352 | pname: *const ::std::os::raw::c_char, 2353 | info: *mut DllInfo, 2354 | ) -> R_altrep_class_t; 2355 | pub fn R_make_altlogical_class( 2356 | cname: *const ::std::os::raw::c_char, 2357 | pname: *const ::std::os::raw::c_char, 2358 | info: *mut DllInfo, 2359 | ) -> R_altrep_class_t; 2360 | pub fn R_make_altraw_class( 2361 | cname: *const ::std::os::raw::c_char, 2362 | pname: *const ::std::os::raw::c_char, 2363 | info: *mut DllInfo, 2364 | ) -> R_altrep_class_t; 2365 | pub fn R_make_altcomplex_class( 2366 | cname: *const ::std::os::raw::c_char, 2367 | pname: *const ::std::os::raw::c_char, 2368 | info: *mut DllInfo, 2369 | ) -> R_altrep_class_t; 2370 | pub fn R_altrep_inherits(x: SEXP, arg1: R_altrep_class_t) -> Rboolean; 2371 | pub fn R_set_altrep_UnserializeEX_method( 2372 | cls: R_altrep_class_t, 2373 | fun: R_altrep_UnserializeEX_method_t, 2374 | ); 2375 | pub fn R_set_altrep_Unserialize_method( 2376 | cls: R_altrep_class_t, 2377 | fun: R_altrep_Unserialize_method_t, 2378 | ); 2379 | pub fn R_set_altrep_Serialized_state_method( 2380 | cls: R_altrep_class_t, 2381 | fun: R_altrep_Serialized_state_method_t, 2382 | ); 2383 | pub fn R_set_altrep_DuplicateEX_method( 2384 | cls: R_altrep_class_t, 2385 | fun: R_altrep_DuplicateEX_method_t, 2386 | ); 2387 | pub fn R_set_altrep_Duplicate_method(cls: R_altrep_class_t, fun: R_altrep_Duplicate_method_t); 2388 | pub fn R_set_altrep_Coerce_method(cls: R_altrep_class_t, fun: R_altrep_Coerce_method_t); 2389 | pub fn R_set_altrep_Inspect_method(cls: R_altrep_class_t, fun: R_altrep_Inspect_method_t); 2390 | pub fn R_set_altrep_Length_method(cls: R_altrep_class_t, fun: R_altrep_Length_method_t); 2391 | pub fn R_set_altvec_Dataptr_method(cls: R_altrep_class_t, fun: R_altvec_Dataptr_method_t); 2392 | pub fn R_set_altvec_Dataptr_or_null_method( 2393 | cls: R_altrep_class_t, 2394 | fun: R_altvec_Dataptr_or_null_method_t, 2395 | ); 2396 | pub fn R_set_altvec_Extract_subset_method( 2397 | cls: R_altrep_class_t, 2398 | fun: R_altvec_Extract_subset_method_t, 2399 | ); 2400 | pub fn R_set_altinteger_Elt_method(cls: R_altrep_class_t, fun: R_altinteger_Elt_method_t); 2401 | pub fn R_set_altinteger_Get_region_method( 2402 | cls: R_altrep_class_t, 2403 | fun: R_altinteger_Get_region_method_t, 2404 | ); 2405 | pub fn R_set_altinteger_Is_sorted_method( 2406 | cls: R_altrep_class_t, 2407 | fun: R_altinteger_Is_sorted_method_t, 2408 | ); 2409 | pub fn R_set_altinteger_No_NA_method(cls: R_altrep_class_t, fun: R_altinteger_No_NA_method_t); 2410 | pub fn R_set_altinteger_Sum_method(cls: R_altrep_class_t, fun: R_altinteger_Sum_method_t); 2411 | pub fn R_set_altinteger_Min_method(cls: R_altrep_class_t, fun: R_altinteger_Min_method_t); 2412 | pub fn R_set_altinteger_Max_method(cls: R_altrep_class_t, fun: R_altinteger_Max_method_t); 2413 | pub fn R_set_altreal_Elt_method(cls: R_altrep_class_t, fun: R_altreal_Elt_method_t); 2414 | pub fn R_set_altreal_Get_region_method( 2415 | cls: R_altrep_class_t, 2416 | fun: R_altreal_Get_region_method_t, 2417 | ); 2418 | pub fn R_set_altreal_Is_sorted_method(cls: R_altrep_class_t, fun: R_altreal_Is_sorted_method_t); 2419 | pub fn R_set_altreal_No_NA_method(cls: R_altrep_class_t, fun: R_altreal_No_NA_method_t); 2420 | pub fn R_set_altreal_Sum_method(cls: R_altrep_class_t, fun: R_altreal_Sum_method_t); 2421 | pub fn R_set_altreal_Min_method(cls: R_altrep_class_t, fun: R_altreal_Min_method_t); 2422 | pub fn R_set_altreal_Max_method(cls: R_altrep_class_t, fun: R_altreal_Max_method_t); 2423 | pub fn R_set_altlogical_Elt_method(cls: R_altrep_class_t, fun: R_altlogical_Elt_method_t); 2424 | pub fn R_set_altlogical_Get_region_method( 2425 | cls: R_altrep_class_t, 2426 | fun: R_altlogical_Get_region_method_t, 2427 | ); 2428 | pub fn R_set_altlogical_Is_sorted_method( 2429 | cls: R_altrep_class_t, 2430 | fun: R_altlogical_Is_sorted_method_t, 2431 | ); 2432 | pub fn R_set_altlogical_No_NA_method(cls: R_altrep_class_t, fun: R_altlogical_No_NA_method_t); 2433 | pub fn R_set_altlogical_Sum_method(cls: R_altrep_class_t, fun: R_altlogical_Sum_method_t); 2434 | pub fn R_set_altraw_Elt_method(cls: R_altrep_class_t, fun: R_altraw_Elt_method_t); 2435 | pub fn R_set_altraw_Get_region_method(cls: R_altrep_class_t, fun: R_altraw_Get_region_method_t); 2436 | pub fn R_set_altcomplex_Elt_method(cls: R_altrep_class_t, fun: R_altcomplex_Elt_method_t); 2437 | pub fn R_set_altcomplex_Get_region_method( 2438 | cls: R_altrep_class_t, 2439 | fun: R_altcomplex_Get_region_method_t, 2440 | ); 2441 | pub fn R_set_altstring_Elt_method(cls: R_altrep_class_t, fun: R_altstring_Elt_method_t); 2442 | pub fn R_set_altstring_Set_elt_method(cls: R_altrep_class_t, fun: R_altstring_Set_elt_method_t); 2443 | pub fn R_set_altstring_Is_sorted_method( 2444 | cls: R_altrep_class_t, 2445 | fun: R_altstring_Is_sorted_method_t, 2446 | ); 2447 | pub fn R_set_altstring_No_NA_method(cls: R_altrep_class_t, fun: R_altstring_No_NA_method_t); 2448 | pub fn R_GE_getVersion() -> ::std::os::raw::c_int; 2449 | pub fn R_GE_checkVersionOrDie(version: ::std::os::raw::c_int); 2450 | #[doc = "Properly declared version of devNumber"] 2451 | pub fn Rf_ndevNumber(arg1: pDevDesc) -> ::std::os::raw::c_int; 2452 | #[doc = "How many devices exist ? (>= 1)"] 2453 | pub fn Rf_NumDevices() -> ::std::os::raw::c_int; 2454 | #[doc = "Check for an available device slot"] 2455 | pub fn R_CheckDeviceAvailable(); 2456 | pub fn R_CheckDeviceAvailableBool() -> Rboolean; 2457 | #[doc = "Return the number of the current device."] 2458 | pub fn Rf_curDevice() -> ::std::os::raw::c_int; 2459 | #[doc = "Return the number of the next device."] 2460 | pub fn Rf_nextDevice(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; 2461 | #[doc = "Return the number of the previous device."] 2462 | pub fn Rf_prevDevice(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; 2463 | #[doc = "Make the specified device (specified by number) the current device"] 2464 | pub fn Rf_selectDevice(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; 2465 | #[doc = "Kill device which is identified by number."] 2466 | pub fn Rf_killDevice(arg1: ::std::os::raw::c_int); 2467 | pub fn Rf_NoDevices() -> ::std::os::raw::c_int; 2468 | pub fn Rf_NewFrameConfirm(arg1: pDevDesc); 2469 | pub fn Rf_doMouseEvent( 2470 | dd: pDevDesc, 2471 | event: R_MouseEvent, 2472 | buttons: ::std::os::raw::c_int, 2473 | x: f64, 2474 | y: f64, 2475 | ); 2476 | pub fn Rf_doKeybd(dd: pDevDesc, rkey: R_KeyName, keyname: *const ::std::os::raw::c_char); 2477 | pub fn Rf_doIdle(dd: pDevDesc); 2478 | pub fn Rf_doesIdle(dd: pDevDesc) -> Rboolean; 2479 | pub static mut R_interrupts_suspended: Rboolean; 2480 | pub static mut R_interrupts_pending: ::std::os::raw::c_int; 2481 | pub fn Rf_onintr(); 2482 | pub static mut mbcslocale: Rboolean; 2483 | #[doc = "Useful for devices: translates Adobe symbol encoding to UTF-8"] 2484 | pub fn Rf_AdobeSymbol2utf8( 2485 | out: *mut ::std::os::raw::c_char, 2486 | in_: *const ::std::os::raw::c_char, 2487 | nwork: usize, 2488 | usePUA: Rboolean, 2489 | ) -> *mut ::std::os::raw::c_void; 2490 | pub fn Rf_utf8toAdobeSymbol( 2491 | out: *mut ::std::os::raw::c_char, 2492 | in_: *const ::std::os::raw::c_char, 2493 | ) -> ::std::os::raw::c_int; 2494 | pub fn Rf_utf8Toutf8NoPUA(in_: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; 2495 | pub fn Rf_utf8ToLatin1AdobeSymbol2utf8( 2496 | in_: *const ::std::os::raw::c_char, 2497 | usePUA: Rboolean, 2498 | ) -> *const ::std::os::raw::c_char; 2499 | #[doc = "Translates Unicode point to UTF-8"] 2500 | pub fn Rf_ucstoutf8(s: *mut ::std::os::raw::c_char, c: ::std::os::raw::c_uint) -> usize; 2501 | #[doc = "map DevDesc to enclosing GEDevDesc"] 2502 | pub fn Rf_desc2GEDesc(dd: pDevDesc) -> pGEDevDesc; 2503 | pub fn GEdeviceNumber(arg1: pGEDevDesc) -> ::std::os::raw::c_int; 2504 | pub fn GEgetDevice(arg1: ::std::os::raw::c_int) -> pGEDevDesc; 2505 | pub fn GEaddDevice(arg1: pGEDevDesc); 2506 | pub fn GEaddDevice2(arg1: pGEDevDesc, arg2: *const ::std::os::raw::c_char); 2507 | pub fn GEaddDevice2f( 2508 | arg1: pGEDevDesc, 2509 | arg2: *const ::std::os::raw::c_char, 2510 | arg3: *const ::std::os::raw::c_char, 2511 | ); 2512 | pub fn GEkillDevice(arg1: pGEDevDesc); 2513 | pub fn GEcreateDevDesc(dev: pDevDesc) -> pGEDevDesc; 2514 | pub fn GEdestroyDevDesc(dd: pGEDevDesc); 2515 | pub fn GEsystemState( 2516 | dd: pGEDevDesc, 2517 | index: ::std::os::raw::c_int, 2518 | ) -> *mut ::std::os::raw::c_void; 2519 | pub fn GEregisterWithDevice(dd: pGEDevDesc); 2520 | pub fn GEregisterSystem(callback: GEcallback, systemRegisterIndex: *mut ::std::os::raw::c_int); 2521 | pub fn GEunregisterSystem(registerIndex: ::std::os::raw::c_int); 2522 | pub fn GEhandleEvent(event: GEevent, dev: pDevDesc, data: SEXP) -> SEXP; 2523 | pub fn GEfromDeviceX(value: f64, to: GEUnit, dd: pGEDevDesc) -> f64; 2524 | pub fn GEtoDeviceX(value: f64, from: GEUnit, dd: pGEDevDesc) -> f64; 2525 | pub fn GEfromDeviceY(value: f64, to: GEUnit, dd: pGEDevDesc) -> f64; 2526 | pub fn GEtoDeviceY(value: f64, from: GEUnit, dd: pGEDevDesc) -> f64; 2527 | pub fn GEfromDeviceWidth(value: f64, to: GEUnit, dd: pGEDevDesc) -> f64; 2528 | pub fn GEtoDeviceWidth(value: f64, from: GEUnit, dd: pGEDevDesc) -> f64; 2529 | pub fn GEfromDeviceHeight(value: f64, to: GEUnit, dd: pGEDevDesc) -> f64; 2530 | pub fn GEtoDeviceHeight(value: f64, from: GEUnit, dd: pGEDevDesc) -> f64; 2531 | #[doc = "Convert an element of a R colour specification (which might be a\nnumber or a string) into an internal colour specification."] 2532 | pub fn Rf_RGBpar(arg1: SEXP, arg2: ::std::os::raw::c_int) -> rcolor; 2533 | pub fn Rf_RGBpar3(arg1: SEXP, arg2: ::std::os::raw::c_int, arg3: rcolor) -> rcolor; 2534 | #[doc = "Convert an internal colour specification to/from a colour name"] 2535 | pub fn Rf_col2name(col: rcolor) -> *const ::std::os::raw::c_char; 2536 | #[doc = "Convert either a name or a #RRGGBB\\[AA\\] string to internal.\nBecause people were using it, it also converts \"1\", \"2\" ...\nto a colour in the palette, and \"0\" to transparent white."] 2537 | pub fn R_GE_str2col(s: *const ::std::os::raw::c_char) -> rcolor; 2538 | pub fn GE_LENDpar(value: SEXP, ind: ::std::os::raw::c_int) -> R_GE_lineend; 2539 | pub fn GE_LENDget(lend: R_GE_lineend) -> SEXP; 2540 | pub fn GE_LJOINpar(value: SEXP, ind: ::std::os::raw::c_int) -> R_GE_linejoin; 2541 | pub fn GE_LJOINget(ljoin: R_GE_linejoin) -> SEXP; 2542 | pub fn GESetClip(x1: f64, y1: f64, x2: f64, y2: f64, dd: pGEDevDesc); 2543 | pub fn GENewPage(gc: pGEcontext, dd: pGEDevDesc); 2544 | pub fn GELine(x1: f64, y1: f64, x2: f64, y2: f64, gc: pGEcontext, dd: pGEDevDesc); 2545 | pub fn GEPolyline( 2546 | n: ::std::os::raw::c_int, 2547 | x: *mut f64, 2548 | y: *mut f64, 2549 | gc: pGEcontext, 2550 | dd: pGEDevDesc, 2551 | ); 2552 | pub fn GEPolygon( 2553 | n: ::std::os::raw::c_int, 2554 | x: *mut f64, 2555 | y: *mut f64, 2556 | gc: pGEcontext, 2557 | dd: pGEDevDesc, 2558 | ); 2559 | pub fn GEXspline( 2560 | n: ::std::os::raw::c_int, 2561 | x: *mut f64, 2562 | y: *mut f64, 2563 | s: *mut f64, 2564 | open: Rboolean, 2565 | repEnds: Rboolean, 2566 | draw: Rboolean, 2567 | gc: pGEcontext, 2568 | dd: pGEDevDesc, 2569 | ) -> SEXP; 2570 | pub fn GECircle(x: f64, y: f64, radius: f64, gc: pGEcontext, dd: pGEDevDesc); 2571 | pub fn GERect(x0: f64, y0: f64, x1: f64, y1: f64, gc: pGEcontext, dd: pGEDevDesc); 2572 | pub fn GEPath( 2573 | x: *mut f64, 2574 | y: *mut f64, 2575 | npoly: ::std::os::raw::c_int, 2576 | nper: *mut ::std::os::raw::c_int, 2577 | winding: Rboolean, 2578 | gc: pGEcontext, 2579 | dd: pGEDevDesc, 2580 | ); 2581 | pub fn GERaster( 2582 | raster: *mut ::std::os::raw::c_uint, 2583 | w: ::std::os::raw::c_int, 2584 | h: ::std::os::raw::c_int, 2585 | x: f64, 2586 | y: f64, 2587 | width: f64, 2588 | height: f64, 2589 | angle: f64, 2590 | interpolate: Rboolean, 2591 | gc: pGEcontext, 2592 | dd: pGEDevDesc, 2593 | ); 2594 | pub fn GECap(dd: pGEDevDesc) -> SEXP; 2595 | pub fn GEText( 2596 | x: f64, 2597 | y: f64, 2598 | str_: *const ::std::os::raw::c_char, 2599 | enc: cetype_t, 2600 | xc: f64, 2601 | yc: f64, 2602 | rot: f64, 2603 | gc: pGEcontext, 2604 | dd: pGEDevDesc, 2605 | ); 2606 | pub fn GEMode(mode: ::std::os::raw::c_int, dd: pGEDevDesc); 2607 | pub fn GESymbol( 2608 | x: f64, 2609 | y: f64, 2610 | pch: ::std::os::raw::c_int, 2611 | size: f64, 2612 | gc: pGEcontext, 2613 | dd: pGEDevDesc, 2614 | ); 2615 | pub fn GEPretty(lo: *mut f64, up: *mut f64, ndiv: *mut ::std::os::raw::c_int); 2616 | pub fn GEMetricInfo( 2617 | c: ::std::os::raw::c_int, 2618 | gc: pGEcontext, 2619 | ascent: *mut f64, 2620 | descent: *mut f64, 2621 | width: *mut f64, 2622 | dd: pGEDevDesc, 2623 | ); 2624 | pub fn GEStrWidth( 2625 | str_: *const ::std::os::raw::c_char, 2626 | enc: cetype_t, 2627 | gc: pGEcontext, 2628 | dd: pGEDevDesc, 2629 | ) -> f64; 2630 | pub fn GEStrHeight( 2631 | str_: *const ::std::os::raw::c_char, 2632 | enc: cetype_t, 2633 | gc: pGEcontext, 2634 | dd: pGEDevDesc, 2635 | ) -> f64; 2636 | pub fn GEStrMetric( 2637 | str_: *const ::std::os::raw::c_char, 2638 | enc: cetype_t, 2639 | gc: pGEcontext, 2640 | ascent: *mut f64, 2641 | descent: *mut f64, 2642 | width: *mut f64, 2643 | dd: pGEDevDesc, 2644 | ); 2645 | pub fn GEstring_to_pch(pch: SEXP) -> ::std::os::raw::c_int; 2646 | #[doc = "-------------------------------------------------------------------\n\n LINE TEXTURE CODE is concerned with the internals of R\n line texture representation."] 2647 | pub fn GE_LTYpar(arg1: SEXP, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_uint; 2648 | pub fn GE_LTYget(arg1: ::std::os::raw::c_uint) -> SEXP; 2649 | #[doc = "Raster operations"] 2650 | pub fn R_GE_rasterScale( 2651 | sraster: *mut ::std::os::raw::c_uint, 2652 | sw: ::std::os::raw::c_int, 2653 | sh: ::std::os::raw::c_int, 2654 | draster: *mut ::std::os::raw::c_uint, 2655 | dw: ::std::os::raw::c_int, 2656 | dh: ::std::os::raw::c_int, 2657 | ); 2658 | pub fn R_GE_rasterInterpolate( 2659 | sraster: *mut ::std::os::raw::c_uint, 2660 | sw: ::std::os::raw::c_int, 2661 | sh: ::std::os::raw::c_int, 2662 | draster: *mut ::std::os::raw::c_uint, 2663 | dw: ::std::os::raw::c_int, 2664 | dh: ::std::os::raw::c_int, 2665 | ); 2666 | pub fn R_GE_rasterRotatedSize( 2667 | w: ::std::os::raw::c_int, 2668 | h: ::std::os::raw::c_int, 2669 | angle: f64, 2670 | wnew: *mut ::std::os::raw::c_int, 2671 | hnew: *mut ::std::os::raw::c_int, 2672 | ); 2673 | pub fn R_GE_rasterRotatedOffset( 2674 | w: ::std::os::raw::c_int, 2675 | h: ::std::os::raw::c_int, 2676 | angle: f64, 2677 | botleft: ::std::os::raw::c_int, 2678 | xoff: *mut f64, 2679 | yoff: *mut f64, 2680 | ); 2681 | pub fn R_GE_rasterResizeForRotation( 2682 | sraster: *mut ::std::os::raw::c_uint, 2683 | w: ::std::os::raw::c_int, 2684 | h: ::std::os::raw::c_int, 2685 | newRaster: *mut ::std::os::raw::c_uint, 2686 | wnew: ::std::os::raw::c_int, 2687 | hnew: ::std::os::raw::c_int, 2688 | gc: pGEcontext, 2689 | ); 2690 | pub fn R_GE_rasterRotate( 2691 | sraster: *mut ::std::os::raw::c_uint, 2692 | w: ::std::os::raw::c_int, 2693 | h: ::std::os::raw::c_int, 2694 | angle: f64, 2695 | draster: *mut ::std::os::raw::c_uint, 2696 | gc: pGEcontext, 2697 | perPixelAlpha: Rboolean, 2698 | ); 2699 | #[doc = "From plotmath.c"] 2700 | pub fn GEExpressionWidth(expr: SEXP, gc: pGEcontext, dd: pGEDevDesc) -> f64; 2701 | pub fn GEExpressionHeight(expr: SEXP, gc: pGEcontext, dd: pGEDevDesc) -> f64; 2702 | pub fn GEExpressionMetric( 2703 | expr: SEXP, 2704 | gc: pGEcontext, 2705 | ascent: *mut f64, 2706 | descent: *mut f64, 2707 | width: *mut f64, 2708 | dd: pGEDevDesc, 2709 | ); 2710 | pub fn GEMathText( 2711 | x: f64, 2712 | y: f64, 2713 | expr: SEXP, 2714 | xc: f64, 2715 | yc: f64, 2716 | rot: f64, 2717 | gc: pGEcontext, 2718 | dd: pGEDevDesc, 2719 | ); 2720 | #[doc = "From plot3d.c : used in package clines"] 2721 | pub fn GEcontourLines( 2722 | x: *mut f64, 2723 | nx: ::std::os::raw::c_int, 2724 | y: *mut f64, 2725 | ny: ::std::os::raw::c_int, 2726 | z: *mut f64, 2727 | levels: *mut f64, 2728 | nl: ::std::os::raw::c_int, 2729 | ) -> SEXP; 2730 | #[doc = "From vfonts.c"] 2731 | pub fn R_GE_VStrWidth( 2732 | s: *const ::std::os::raw::c_char, 2733 | enc: cetype_t, 2734 | gc: pGEcontext, 2735 | dd: pGEDevDesc, 2736 | ) -> f64; 2737 | pub fn R_GE_VStrHeight( 2738 | s: *const ::std::os::raw::c_char, 2739 | enc: cetype_t, 2740 | gc: pGEcontext, 2741 | dd: pGEDevDesc, 2742 | ) -> f64; 2743 | pub fn R_GE_VText( 2744 | x: f64, 2745 | y: f64, 2746 | s: *const ::std::os::raw::c_char, 2747 | enc: cetype_t, 2748 | x_justify: f64, 2749 | y_justify: f64, 2750 | rotation: f64, 2751 | gc: pGEcontext, 2752 | dd: pGEDevDesc, 2753 | ); 2754 | pub fn GEcurrentDevice() -> pGEDevDesc; 2755 | pub fn GEdeviceDirty(dd: pGEDevDesc) -> Rboolean; 2756 | pub fn GEdirtyDevice(dd: pGEDevDesc); 2757 | pub fn GEcheckState(dd: pGEDevDesc) -> Rboolean; 2758 | pub fn GErecording(call: SEXP, dd: pGEDevDesc) -> Rboolean; 2759 | pub fn GErecordGraphicOperation(op: SEXP, args: SEXP, dd: pGEDevDesc); 2760 | pub fn GEinitDisplayList(dd: pGEDevDesc); 2761 | pub fn GEplayDisplayList(dd: pGEDevDesc); 2762 | pub fn GEcopyDisplayList(fromDevice: ::std::os::raw::c_int); 2763 | pub fn GEcreateSnapshot(dd: pGEDevDesc) -> SEXP; 2764 | pub fn GEplaySnapshot(snapshot: SEXP, dd: pGEDevDesc); 2765 | pub fn GEonExit(); 2766 | pub fn GEnullDevice(); 2767 | pub fn Rf_CreateAtVector( 2768 | axp: *mut f64, 2769 | usr: *const f64, 2770 | nint: ::std::os::raw::c_int, 2771 | logflag: Rboolean, 2772 | ) -> SEXP; 2773 | pub fn Rf_GAxisPars( 2774 | min: *mut f64, 2775 | max: *mut f64, 2776 | n: *mut ::std::os::raw::c_int, 2777 | log: Rboolean, 2778 | axis: ::std::os::raw::c_int, 2779 | ); 2780 | #[doc = "Patterns - from ../../main/patterns.c"] 2781 | pub fn R_GE_isPattern(x: SEXP) -> Rboolean; 2782 | pub fn R_GE_patternType(pattern: SEXP) -> ::std::os::raw::c_int; 2783 | pub fn R_GE_linearGradientX1(pattern: SEXP) -> f64; 2784 | pub fn R_GE_linearGradientY1(pattern: SEXP) -> f64; 2785 | pub fn R_GE_linearGradientX2(pattern: SEXP) -> f64; 2786 | pub fn R_GE_linearGradientY2(pattern: SEXP) -> f64; 2787 | pub fn R_GE_linearGradientNumStops(pattern: SEXP) -> ::std::os::raw::c_int; 2788 | pub fn R_GE_linearGradientStop(pattern: SEXP, i: ::std::os::raw::c_int) -> f64; 2789 | pub fn R_GE_linearGradientColour(pattern: SEXP, i: ::std::os::raw::c_int) -> rcolor; 2790 | pub fn R_GE_linearGradientExtend(pattern: SEXP) -> ::std::os::raw::c_int; 2791 | pub fn R_GE_radialGradientCX1(pattern: SEXP) -> f64; 2792 | pub fn R_GE_radialGradientCY1(pattern: SEXP) -> f64; 2793 | pub fn R_GE_radialGradientR1(pattern: SEXP) -> f64; 2794 | pub fn R_GE_radialGradientCX2(pattern: SEXP) -> f64; 2795 | pub fn R_GE_radialGradientCY2(pattern: SEXP) -> f64; 2796 | pub fn R_GE_radialGradientR2(pattern: SEXP) -> f64; 2797 | pub fn R_GE_radialGradientNumStops(pattern: SEXP) -> ::std::os::raw::c_int; 2798 | pub fn R_GE_radialGradientStop(pattern: SEXP, i: ::std::os::raw::c_int) -> f64; 2799 | pub fn R_GE_radialGradientColour(pattern: SEXP, i: ::std::os::raw::c_int) -> rcolor; 2800 | pub fn R_GE_radialGradientExtend(pattern: SEXP) -> ::std::os::raw::c_int; 2801 | pub fn R_GE_tilingPatternFunction(pattern: SEXP) -> SEXP; 2802 | pub fn R_GE_tilingPatternX(pattern: SEXP) -> f64; 2803 | pub fn R_GE_tilingPatternY(pattern: SEXP) -> f64; 2804 | pub fn R_GE_tilingPatternWidth(pattern: SEXP) -> f64; 2805 | pub fn R_GE_tilingPatternHeight(pattern: SEXP) -> f64; 2806 | pub fn R_GE_tilingPatternExtend(pattern: SEXP) -> ::std::os::raw::c_int; 2807 | pub fn R_GE_clipPathFillRule(path: SEXP) -> ::std::os::raw::c_int; 2808 | pub fn GEStroke(path: SEXP, gc: pGEcontext, dd: pGEDevDesc); 2809 | pub fn GEFill(path: SEXP, rule: ::std::os::raw::c_int, gc: pGEcontext, dd: pGEDevDesc); 2810 | pub fn GEFillStroke(path: SEXP, rule: ::std::os::raw::c_int, gc: pGEcontext, dd: pGEDevDesc); 2811 | pub fn R_GE_maskType(mask: SEXP) -> ::std::os::raw::c_int; 2812 | #[doc = "S Like Memory Management"] 2813 | pub fn R_chk_calloc(arg1: usize, arg2: usize) -> *mut ::std::os::raw::c_void; 2814 | pub fn R_chk_realloc( 2815 | arg1: *mut ::std::os::raw::c_void, 2816 | arg2: usize, 2817 | ) -> *mut ::std::os::raw::c_void; 2818 | pub fn R_chk_free(arg1: *mut ::std::os::raw::c_void); 2819 | #[doc = "vectorizing function f(x\\[1:n\\], ...) -> x\\[\\] {overwriting x\\[\\]}."] 2820 | pub fn Rdqags( 2821 | f: integr_fn, 2822 | ex: *mut ::std::os::raw::c_void, 2823 | a: *mut f64, 2824 | b: *mut f64, 2825 | epsabs: *mut f64, 2826 | epsrel: *mut f64, 2827 | result: *mut f64, 2828 | abserr: *mut f64, 2829 | neval: *mut ::std::os::raw::c_int, 2830 | ier: *mut ::std::os::raw::c_int, 2831 | limit: *mut ::std::os::raw::c_int, 2832 | lenw: *mut ::std::os::raw::c_int, 2833 | last: *mut ::std::os::raw::c_int, 2834 | iwork: *mut ::std::os::raw::c_int, 2835 | work: *mut f64, 2836 | ); 2837 | pub fn Rdqagi( 2838 | f: integr_fn, 2839 | ex: *mut ::std::os::raw::c_void, 2840 | bound: *mut f64, 2841 | inf: *mut ::std::os::raw::c_int, 2842 | epsabs: *mut f64, 2843 | epsrel: *mut f64, 2844 | result: *mut f64, 2845 | abserr: *mut f64, 2846 | neval: *mut ::std::os::raw::c_int, 2847 | ier: *mut ::std::os::raw::c_int, 2848 | limit: *mut ::std::os::raw::c_int, 2849 | lenw: *mut ::std::os::raw::c_int, 2850 | last: *mut ::std::os::raw::c_int, 2851 | iwork: *mut ::std::os::raw::c_int, 2852 | work: *mut f64, 2853 | ); 2854 | pub fn vmmin( 2855 | n: ::std::os::raw::c_int, 2856 | b: *mut f64, 2857 | Fmin: *mut f64, 2858 | fn_: optimfn, 2859 | gr: optimgr, 2860 | maxit: ::std::os::raw::c_int, 2861 | trace: ::std::os::raw::c_int, 2862 | mask: *mut ::std::os::raw::c_int, 2863 | abstol: f64, 2864 | reltol: f64, 2865 | nREPORT: ::std::os::raw::c_int, 2866 | ex: *mut ::std::os::raw::c_void, 2867 | fncount: *mut ::std::os::raw::c_int, 2868 | grcount: *mut ::std::os::raw::c_int, 2869 | fail: *mut ::std::os::raw::c_int, 2870 | ); 2871 | pub fn nmmin( 2872 | n: ::std::os::raw::c_int, 2873 | Bvec: *mut f64, 2874 | X: *mut f64, 2875 | Fmin: *mut f64, 2876 | fn_: optimfn, 2877 | fail: *mut ::std::os::raw::c_int, 2878 | abstol: f64, 2879 | intol: f64, 2880 | ex: *mut ::std::os::raw::c_void, 2881 | alpha: f64, 2882 | bet: f64, 2883 | gamm: f64, 2884 | trace: ::std::os::raw::c_int, 2885 | fncount: *mut ::std::os::raw::c_int, 2886 | maxit: ::std::os::raw::c_int, 2887 | ); 2888 | pub fn cgmin( 2889 | n: ::std::os::raw::c_int, 2890 | Bvec: *mut f64, 2891 | X: *mut f64, 2892 | Fmin: *mut f64, 2893 | fn_: optimfn, 2894 | gr: optimgr, 2895 | fail: *mut ::std::os::raw::c_int, 2896 | abstol: f64, 2897 | intol: f64, 2898 | ex: *mut ::std::os::raw::c_void, 2899 | type_: ::std::os::raw::c_int, 2900 | trace: ::std::os::raw::c_int, 2901 | fncount: *mut ::std::os::raw::c_int, 2902 | grcount: *mut ::std::os::raw::c_int, 2903 | maxit: ::std::os::raw::c_int, 2904 | ); 2905 | pub fn lbfgsb( 2906 | n: ::std::os::raw::c_int, 2907 | m: ::std::os::raw::c_int, 2908 | x: *mut f64, 2909 | l: *mut f64, 2910 | u: *mut f64, 2911 | nbd: *mut ::std::os::raw::c_int, 2912 | Fmin: *mut f64, 2913 | fn_: optimfn, 2914 | gr: optimgr, 2915 | fail: *mut ::std::os::raw::c_int, 2916 | ex: *mut ::std::os::raw::c_void, 2917 | factr: f64, 2918 | pgtol: f64, 2919 | fncount: *mut ::std::os::raw::c_int, 2920 | grcount: *mut ::std::os::raw::c_int, 2921 | maxit: ::std::os::raw::c_int, 2922 | msg: *mut ::std::os::raw::c_char, 2923 | trace: ::std::os::raw::c_int, 2924 | nREPORT: ::std::os::raw::c_int, 2925 | ); 2926 | pub fn samin( 2927 | n: ::std::os::raw::c_int, 2928 | pb: *mut f64, 2929 | yb: *mut f64, 2930 | fn_: optimfn, 2931 | maxit: ::std::os::raw::c_int, 2932 | tmax: ::std::os::raw::c_int, 2933 | ti: f64, 2934 | trace: ::std::os::raw::c_int, 2935 | ex: *mut ::std::os::raw::c_void, 2936 | ); 2937 | #[doc = "appl/pretty.c: for use in engine.c and util.c"] 2938 | pub fn R_pretty( 2939 | lo: *mut f64, 2940 | up: *mut f64, 2941 | ndiv: *mut ::std::os::raw::c_int, 2942 | min_n: ::std::os::raw::c_int, 2943 | shrink_sml: f64, 2944 | high_u_fact: *const f64, 2945 | eps_correction: ::std::os::raw::c_int, 2946 | return_bounds: ::std::os::raw::c_int, 2947 | ) -> f64; 2948 | #[doc = "Also used in packages nlme, pcaPP"] 2949 | pub fn optif9( 2950 | nr: ::std::os::raw::c_int, 2951 | n: ::std::os::raw::c_int, 2952 | x: *mut f64, 2953 | fcn: fcn_p, 2954 | d1fcn: fcn_p, 2955 | d2fcn: d2fcn_p, 2956 | state: *mut ::std::os::raw::c_void, 2957 | typsiz: *mut f64, 2958 | fscale: f64, 2959 | method: ::std::os::raw::c_int, 2960 | iexp: ::std::os::raw::c_int, 2961 | msg: *mut ::std::os::raw::c_int, 2962 | ndigit: ::std::os::raw::c_int, 2963 | itnlim: ::std::os::raw::c_int, 2964 | iagflg: ::std::os::raw::c_int, 2965 | iahflg: ::std::os::raw::c_int, 2966 | dlt: f64, 2967 | gradtl: f64, 2968 | stepmx: f64, 2969 | steptl: f64, 2970 | xpls: *mut f64, 2971 | fpls: *mut f64, 2972 | gpls: *mut f64, 2973 | itrmcd: *mut ::std::os::raw::c_int, 2974 | a: *mut f64, 2975 | wrk: *mut f64, 2976 | itncnt: *mut ::std::os::raw::c_int, 2977 | ); 2978 | pub fn R_sample_kind() -> Sampletype; 2979 | pub fn GetRNGstate(); 2980 | pub fn PutRNGstate(); 2981 | pub fn user_unif_rand() -> *mut f64; 2982 | pub fn user_unif_init(arg1: Int32); 2983 | pub fn user_unif_nseed() -> *mut ::std::os::raw::c_int; 2984 | pub fn user_unif_seedloc() -> *mut ::std::os::raw::c_int; 2985 | pub fn user_norm_rand() -> *mut f64; 2986 | } 2987 | --------------------------------------------------------------------------------