diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b907a0c2..9c5ab58c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,4 @@ name: Tests - on: push: branches: @@ -19,7 +18,7 @@ on: workflow_dispatch: {} jobs: - + test_with_bindgen: # When the event is not issue_comment, always run the tests. When it is, # check if (1) the comment is on pull request, (2) the comment author is the @@ -30,7 +29,7 @@ jobs: if: | github.event_name != 'issue_comment' || (github.event.issue.pull_request && github.event.comment.author_association == 'MEMBER' && startsWith(github.event.comment.body, '/bindings')) - + runs-on: ${{ matrix.config.os }} name: ${{ matrix.config.os }} (R-${{ matrix.config.r }} rust-${{ matrix.config.rust-version }}-${{ matrix.config.target || 'default' }}) @@ -246,6 +245,24 @@ jobs: echo "${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }}" echo "${{ contains(steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE, '[generate bindings]') }}" + check_generate_bindings_flag: + name: Check if [generate bindings] is in latest commit message + runs-on: ubuntu-latest + outputs: + head_commit_message: ${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }} + # generate_bindings: ${{ contains(steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE, '[generate bindings]') }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + - name: Get Head Commit Message + id: get_head_commit_message + run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT" + - name: Show commit message + run: | + echo "${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }}" + echo "${{ contains(steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE, '[generate bindings]') }}" + pr_generated_bindings: name: Make PR with generated bindings needs: [test_with_bindgen, check_generate_bindings_flag] @@ -277,7 +294,7 @@ jobs: git commit -m "Update bindings [skip ci]" - name: Push to PR branch run: git push - + # Gather the generated bindings and push them to generated_bindings branch. # If we need to update the bindings, create a pull request from that branch. commit_generated_bindings: diff --git a/MAINTAINERS_GUIDE.md b/MAINTAINERS_GUIDE.md index f86837bd..0bbe87cf 100644 --- a/MAINTAINERS_GUIDE.md +++ b/MAINTAINERS_GUIDE.md @@ -12,20 +12,6 @@ git commit -m "[generate bindings]" --allow-empty Then after successfully running workflows, GitHub Actions will push a commit with the updated bindings onto your PR branch. -# GUIDE - -## Commit newly generated bindings - -Your last commit must contain `[generate bindings]`. You can make an empty -commit with this message: - -```sh -git commit -m "[generate bindings]" --allow-empty -``` - -Then after successfully running workflows, GitHub Actions will push a commit -with the updated bindings onto your PR branch. - ## Precomputed bindings ### How to update the precomputed bindings? diff --git a/bindings/bindings-linux-aarch64-R4.2.rs b/bindings/bindings-linux-aarch64-R4.2.rs index 80560457..617be899 100644 --- a/bindings/bindings-linux-aarch64-R4.2.rs +++ b/bindings/bindings-linux-aarch64-R4.2.rs @@ -97,33 +97,6 @@ pub const HAVE_ALLOCA_H: u32 = 1; pub const HAVE_UINTPTR_T: u32 = 1; pub const R_XLEN_T_MAX: u64 = 4503599627370496; pub const R_SHORT_LEN_MAX: u32 = 2147483647; -pub const NILSXP: u32 = 0; -pub const SYMSXP: u32 = 1; -pub const LISTSXP: u32 = 2; -pub const CLOSXP: u32 = 3; -pub const ENVSXP: u32 = 4; -pub const PROMSXP: u32 = 5; -pub const LANGSXP: u32 = 6; -pub const SPECIALSXP: u32 = 7; -pub const BUILTINSXP: u32 = 8; -pub const CHARSXP: u32 = 9; -pub const LGLSXP: u32 = 10; -pub const INTSXP: u32 = 13; -pub const REALSXP: u32 = 14; -pub const CPLXSXP: u32 = 15; -pub const STRSXP: u32 = 16; -pub const DOTSXP: u32 = 17; -pub const ANYSXP: u32 = 18; -pub const VECSXP: u32 = 19; -pub const EXPRSXP: u32 = 20; -pub const BCODESXP: u32 = 21; -pub const EXTPTRSXP: u32 = 22; -pub const WEAKREFSXP: u32 = 23; -pub const RAWSXP: u32 = 24; -pub const S4SXP: u32 = 25; -pub const NEWSXP: u32 = 30; -pub const FREESXP: u32 = 31; -pub const FUNSXP: u32 = 99; pub const TYPE_BITS: u32 = 5; pub const MAX_NUM_SEXPTYPE: u32 = 32; pub const NAMEDMAX: u32 = 7; @@ -1310,7 +1283,6 @@ extern "C" { pub fn ATTRIB(x: SEXP) -> SEXP; pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int; pub fn MARK(x: SEXP) -> ::std::os::raw::c_int; - pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int; pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int; pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int; pub fn SET_ATTRIB(x: SEXP, v: SEXP); diff --git a/bindings/bindings-linux-aarch64-R4.3.rs b/bindings/bindings-linux-aarch64-R4.3.rs index f1c80fd3..69e01667 100644 --- a/bindings/bindings-linux-aarch64-R4.3.rs +++ b/bindings/bindings-linux-aarch64-R4.3.rs @@ -98,33 +98,6 @@ pub const HAVE_ALLOCA_H: u32 = 1; pub const HAVE_UINTPTR_T: u32 = 1; pub const R_XLEN_T_MAX: u64 = 4503599627370496; pub const R_SHORT_LEN_MAX: u32 = 2147483647; -pub const NILSXP: u32 = 0; -pub const SYMSXP: u32 = 1; -pub const LISTSXP: u32 = 2; -pub const CLOSXP: u32 = 3; -pub const ENVSXP: u32 = 4; -pub const PROMSXP: u32 = 5; -pub const LANGSXP: u32 = 6; -pub const SPECIALSXP: u32 = 7; -pub const BUILTINSXP: u32 = 8; -pub const CHARSXP: u32 = 9; -pub const LGLSXP: u32 = 10; -pub const INTSXP: u32 = 13; -pub const REALSXP: u32 = 14; -pub const CPLXSXP: u32 = 15; -pub const STRSXP: u32 = 16; -pub const DOTSXP: u32 = 17; -pub const ANYSXP: u32 = 18; -pub const VECSXP: u32 = 19; -pub const EXPRSXP: u32 = 20; -pub const BCODESXP: u32 = 21; -pub const EXTPTRSXP: u32 = 22; -pub const WEAKREFSXP: u32 = 23; -pub const RAWSXP: u32 = 24; -pub const S4SXP: u32 = 25; -pub const NEWSXP: u32 = 30; -pub const FREESXP: u32 = 31; -pub const FUNSXP: u32 = 99; pub const TYPE_BITS: u32 = 5; pub const MAX_NUM_SEXPTYPE: u32 = 32; pub const NAMEDMAX: u32 = 7; @@ -1333,7 +1306,6 @@ extern "C" { pub fn ATTRIB(x: SEXP) -> SEXP; pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int; pub fn MARK(x: SEXP) -> ::std::os::raw::c_int; - pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int; pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int; pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int; pub fn SET_ATTRIB(x: SEXP, v: SEXP); diff --git a/bindings/bindings-linux-aarch64-R4.4-devel.rs b/bindings/bindings-linux-aarch64-R4.4-devel.rs index 7f0b1a5a..be5dd173 100644 --- a/bindings/bindings-linux-aarch64-R4.4-devel.rs +++ b/bindings/bindings-linux-aarch64-R4.4-devel.rs @@ -98,34 +98,6 @@ pub const HAVE_ALLOCA_H: u32 = 1; pub const HAVE_UINTPTR_T: u32 = 1; pub const R_XLEN_T_MAX: u64 = 4503599627370496; pub const R_SHORT_LEN_MAX: u32 = 2147483647; -pub const NILSXP: u32 = 0; -pub const SYMSXP: u32 = 1; -pub const LISTSXP: u32 = 2; -pub const CLOSXP: u32 = 3; -pub const ENVSXP: u32 = 4; -pub const PROMSXP: u32 = 5; -pub const LANGSXP: u32 = 6; -pub const SPECIALSXP: u32 = 7; -pub const BUILTINSXP: u32 = 8; -pub const CHARSXP: u32 = 9; -pub const LGLSXP: u32 = 10; -pub const INTSXP: u32 = 13; -pub const REALSXP: u32 = 14; -pub const CPLXSXP: u32 = 15; -pub const STRSXP: u32 = 16; -pub const DOTSXP: u32 = 17; -pub const ANYSXP: u32 = 18; -pub const VECSXP: u32 = 19; -pub const EXPRSXP: u32 = 20; -pub const BCODESXP: u32 = 21; -pub const EXTPTRSXP: u32 = 22; -pub const WEAKREFSXP: u32 = 23; -pub const RAWSXP: u32 = 24; -pub const OBJSXP: u32 = 25; -pub const S4SXP: u32 = 25; -pub const NEWSXP: u32 = 30; -pub const FREESXP: u32 = 31; -pub const FUNSXP: u32 = 99; pub const TYPE_BITS: u32 = 5; pub const MAX_NUM_SEXPTYPE: u32 = 32; pub const NAMEDMAX: u32 = 7; @@ -1334,7 +1306,6 @@ extern "C" { pub fn ATTRIB(x: SEXP) -> SEXP; pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int; pub fn MARK(x: SEXP) -> ::std::os::raw::c_int; - pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int; pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int; pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int; pub fn SET_ATTRIB(x: SEXP, v: SEXP); diff --git a/bindings/bindings-linux-x86_64-R4.2.rs b/bindings/bindings-linux-x86_64-R4.2.rs index c3367eab..75c9d613 100644 --- a/bindings/bindings-linux-x86_64-R4.2.rs +++ b/bindings/bindings-linux-x86_64-R4.2.rs @@ -97,33 +97,6 @@ pub const HAVE_ALLOCA_H: u32 = 1; pub const HAVE_UINTPTR_T: u32 = 1; pub const R_XLEN_T_MAX: u64 = 4503599627370496; pub const R_SHORT_LEN_MAX: u32 = 2147483647; -pub const NILSXP: u32 = 0; -pub const SYMSXP: u32 = 1; -pub const LISTSXP: u32 = 2; -pub const CLOSXP: u32 = 3; -pub const ENVSXP: u32 = 4; -pub const PROMSXP: u32 = 5; -pub const LANGSXP: u32 = 6; -pub const SPECIALSXP: u32 = 7; -pub const BUILTINSXP: u32 = 8; -pub const CHARSXP: u32 = 9; -pub const LGLSXP: u32 = 10; -pub const INTSXP: u32 = 13; -pub const REALSXP: u32 = 14; -pub const CPLXSXP: u32 = 15; -pub const STRSXP: u32 = 16; -pub const DOTSXP: u32 = 17; -pub const ANYSXP: u32 = 18; -pub const VECSXP: u32 = 19; -pub const EXPRSXP: u32 = 20; -pub const BCODESXP: u32 = 21; -pub const EXTPTRSXP: u32 = 22; -pub const WEAKREFSXP: u32 = 23; -pub const RAWSXP: u32 = 24; -pub const S4SXP: u32 = 25; -pub const NEWSXP: u32 = 30; -pub const FREESXP: u32 = 31; -pub const FUNSXP: u32 = 99; pub const TYPE_BITS: u32 = 5; pub const MAX_NUM_SEXPTYPE: u32 = 32; pub const NAMEDMAX: u32 = 7; @@ -1319,7 +1292,6 @@ extern "C" { pub fn ATTRIB(x: SEXP) -> SEXP; pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int; pub fn MARK(x: SEXP) -> ::std::os::raw::c_int; - pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int; pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int; pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int; pub fn SET_ATTRIB(x: SEXP, v: SEXP); diff --git a/bindings/bindings-linux-x86_64-R4.3.rs b/bindings/bindings-linux-x86_64-R4.3.rs index 07d7019e..e5f4aaef 100644 --- a/bindings/bindings-linux-x86_64-R4.3.rs +++ b/bindings/bindings-linux-x86_64-R4.3.rs @@ -98,33 +98,6 @@ pub const HAVE_ALLOCA_H: u32 = 1; pub const HAVE_UINTPTR_T: u32 = 1; pub const R_XLEN_T_MAX: u64 = 4503599627370496; pub const R_SHORT_LEN_MAX: u32 = 2147483647; -pub const NILSXP: u32 = 0; -pub const SYMSXP: u32 = 1; -pub const LISTSXP: u32 = 2; -pub const CLOSXP: u32 = 3; -pub const ENVSXP: u32 = 4; -pub const PROMSXP: u32 = 5; -pub const LANGSXP: u32 = 6; -pub const SPECIALSXP: u32 = 7; -pub const BUILTINSXP: u32 = 8; -pub const CHARSXP: u32 = 9; -pub const LGLSXP: u32 = 10; -pub const INTSXP: u32 = 13; -pub const REALSXP: u32 = 14; -pub const CPLXSXP: u32 = 15; -pub const STRSXP: u32 = 16; -pub const DOTSXP: u32 = 17; -pub const ANYSXP: u32 = 18; -pub const VECSXP: u32 = 19; -pub const EXPRSXP: u32 = 20; -pub const BCODESXP: u32 = 21; -pub const EXTPTRSXP: u32 = 22; -pub const WEAKREFSXP: u32 = 23; -pub const RAWSXP: u32 = 24; -pub const S4SXP: u32 = 25; -pub const NEWSXP: u32 = 30; -pub const FREESXP: u32 = 31; -pub const FUNSXP: u32 = 99; pub const TYPE_BITS: u32 = 5; pub const MAX_NUM_SEXPTYPE: u32 = 32; pub const NAMEDMAX: u32 = 7; @@ -1342,7 +1315,6 @@ extern "C" { pub fn ATTRIB(x: SEXP) -> SEXP; pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int; pub fn MARK(x: SEXP) -> ::std::os::raw::c_int; - pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int; pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int; pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int; pub fn SET_ATTRIB(x: SEXP, v: SEXP); diff --git a/bindings/bindings-linux-x86_64-R4.4-devel.rs b/bindings/bindings-linux-x86_64-R4.4-devel.rs index b96ea43f..63cded69 100644 --- a/bindings/bindings-linux-x86_64-R4.4-devel.rs +++ b/bindings/bindings-linux-x86_64-R4.4-devel.rs @@ -98,34 +98,6 @@ pub const HAVE_ALLOCA_H: u32 = 1; pub const HAVE_UINTPTR_T: u32 = 1; pub const R_XLEN_T_MAX: u64 = 4503599627370496; pub const R_SHORT_LEN_MAX: u32 = 2147483647; -pub const NILSXP: u32 = 0; -pub const SYMSXP: u32 = 1; -pub const LISTSXP: u32 = 2; -pub const CLOSXP: u32 = 3; -pub const ENVSXP: u32 = 4; -pub const PROMSXP: u32 = 5; -pub const LANGSXP: u32 = 6; -pub const SPECIALSXP: u32 = 7; -pub const BUILTINSXP: u32 = 8; -pub const CHARSXP: u32 = 9; -pub const LGLSXP: u32 = 10; -pub const INTSXP: u32 = 13; -pub const REALSXP: u32 = 14; -pub const CPLXSXP: u32 = 15; -pub const STRSXP: u32 = 16; -pub const DOTSXP: u32 = 17; -pub const ANYSXP: u32 = 18; -pub const VECSXP: u32 = 19; -pub const EXPRSXP: u32 = 20; -pub const BCODESXP: u32 = 21; -pub const EXTPTRSXP: u32 = 22; -pub const WEAKREFSXP: u32 = 23; -pub const RAWSXP: u32 = 24; -pub const OBJSXP: u32 = 25; -pub const S4SXP: u32 = 25; -pub const NEWSXP: u32 = 30; -pub const FREESXP: u32 = 31; -pub const FUNSXP: u32 = 99; pub const TYPE_BITS: u32 = 5; pub const MAX_NUM_SEXPTYPE: u32 = 32; pub const NAMEDMAX: u32 = 7; @@ -1343,7 +1315,6 @@ extern "C" { pub fn ATTRIB(x: SEXP) -> SEXP; pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int; pub fn MARK(x: SEXP) -> ::std::os::raw::c_int; - pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int; pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int; pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int; pub fn SET_ATTRIB(x: SEXP, v: SEXP); diff --git a/bindings/bindings-macos-aarch64-R4.3.rs b/bindings/bindings-macos-aarch64-R4.3.rs index ed38009b..b166b2d4 100644 --- a/bindings/bindings-macos-aarch64-R4.3.rs +++ b/bindings/bindings-macos-aarch64-R4.3.rs @@ -100,33 +100,6 @@ pub const HAVE_ALLOCA_H: u32 = 1; pub const HAVE_UINTPTR_T: u32 = 1; pub const R_XLEN_T_MAX: u64 = 4503599627370496; pub const R_SHORT_LEN_MAX: u32 = 2147483647; -pub const NILSXP: u32 = 0; -pub const SYMSXP: u32 = 1; -pub const LISTSXP: u32 = 2; -pub const CLOSXP: u32 = 3; -pub const ENVSXP: u32 = 4; -pub const PROMSXP: u32 = 5; -pub const LANGSXP: u32 = 6; -pub const SPECIALSXP: u32 = 7; -pub const BUILTINSXP: u32 = 8; -pub const CHARSXP: u32 = 9; -pub const LGLSXP: u32 = 10; -pub const INTSXP: u32 = 13; -pub const REALSXP: u32 = 14; -pub const CPLXSXP: u32 = 15; -pub const STRSXP: u32 = 16; -pub const DOTSXP: u32 = 17; -pub const ANYSXP: u32 = 18; -pub const VECSXP: u32 = 19; -pub const EXPRSXP: u32 = 20; -pub const BCODESXP: u32 = 21; -pub const EXTPTRSXP: u32 = 22; -pub const WEAKREFSXP: u32 = 23; -pub const RAWSXP: u32 = 24; -pub const S4SXP: u32 = 25; -pub const NEWSXP: u32 = 30; -pub const FREESXP: u32 = 31; -pub const FUNSXP: u32 = 99; pub const TYPE_BITS: u32 = 5; pub const MAX_NUM_SEXPTYPE: u32 = 32; pub const NAMEDMAX: u32 = 7; @@ -1344,7 +1317,6 @@ extern "C" { pub fn ATTRIB(x: SEXP) -> SEXP; pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int; pub fn MARK(x: SEXP) -> ::std::os::raw::c_int; - pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int; pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int; pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int; pub fn SET_ATTRIB(x: SEXP, v: SEXP); @@ -2088,7 +2060,6 @@ extern "C" { pub fn unif_rand() -> f64; pub fn R_unif_index(arg1: f64) -> f64; pub fn exp_rand() -> f64; - #[doc = "Normal Distribution"] pub fn Rf_dnorm4(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pnorm5( arg1: f64, @@ -2112,7 +2083,6 @@ extern "C" { arg4: ::std::os::raw::c_int, arg5: ::std::os::raw::c_int, ); - #[doc = "Uniform Distribution"] pub fn Rf_dunif(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_punif( arg1: f64, @@ -2129,7 +2099,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_runif(arg1: f64, arg2: f64) -> f64; - #[doc = "Gamma Distribution"] pub fn Rf_dgamma(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pgamma( arg1: f64, @@ -2150,11 +2119,9 @@ extern "C" { pub fn Rf_log1pexp(arg1: f64) -> f64; pub fn Rf_log1mexp(arg1: f64) -> f64; pub fn Rf_lgamma1p(arg1: f64) -> f64; - #[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:"] pub fn Rf_logspace_add(arg1: f64, arg2: f64) -> f64; pub fn Rf_logspace_sub(arg1: f64, arg2: f64) -> f64; pub fn Rf_logspace_sum(arg1: *const f64, arg2: ::std::os::raw::c_int) -> f64; - #[doc = "Beta Distribution"] pub fn Rf_dbeta(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pbeta( arg1: f64, @@ -2171,7 +2138,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rbeta(arg1: f64, arg2: f64) -> f64; - #[doc = "Lognormal Distribution"] pub fn Rf_dlnorm(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_plnorm( arg1: f64, @@ -2188,7 +2154,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rlnorm(arg1: f64, arg2: f64) -> f64; - #[doc = "Chi-squared Distribution"] pub fn Rf_dchisq(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; pub fn Rf_pchisq( arg1: f64, @@ -2203,7 +2168,6 @@ extern "C" { arg4: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rchisq(arg1: f64) -> f64; - #[doc = "Non-central Chi-squared Distribution"] pub fn Rf_dnchisq(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pnchisq( arg1: f64, @@ -2220,7 +2184,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rnchisq(arg1: f64, arg2: f64) -> f64; - #[doc = "F Distribution"] pub fn Rf_df(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pf( arg1: f64, @@ -2237,7 +2200,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rf(arg1: f64, arg2: f64) -> f64; - #[doc = "Student t Distribution"] pub fn Rf_dt(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; pub fn Rf_pt( arg1: f64, @@ -2252,7 +2214,6 @@ extern "C" { arg4: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rt(arg1: f64) -> f64; - #[doc = "Binomial Distribution"] pub fn Rf_dbinom_raw(x: f64, n: f64, p: f64, q: f64, give_log: ::std::os::raw::c_int) -> f64; pub fn Rf_dbinom(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pbinom( @@ -2270,14 +2231,12 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rbinom(arg1: f64, arg2: f64) -> f64; - #[doc = "Multinomial Distribution"] pub fn Rf_rmultinom( arg1: ::std::os::raw::c_int, arg2: *mut f64, arg3: ::std::os::raw::c_int, arg4: *mut ::std::os::raw::c_int, ); - #[doc = "Cauchy Distribution"] pub fn Rf_dcauchy(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pcauchy( arg1: f64, @@ -2294,7 +2253,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rcauchy(arg1: f64, arg2: f64) -> f64; - #[doc = "Exponential Distribution"] pub fn Rf_dexp(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; pub fn Rf_pexp( arg1: f64, @@ -2309,7 +2267,6 @@ extern "C" { arg4: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rexp(arg1: f64) -> f64; - #[doc = "Geometric Distribution"] pub fn Rf_dgeom(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; pub fn Rf_pgeom( arg1: f64, @@ -2324,7 +2281,6 @@ extern "C" { arg4: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rgeom(arg1: f64) -> f64; - #[doc = "Hypergeometric Distribution"] pub fn Rf_dhyper( arg1: f64, arg2: f64, @@ -2349,7 +2305,6 @@ extern "C" { arg6: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rhyper(arg1: f64, arg2: f64, arg3: f64) -> f64; - #[doc = "Negative Binomial Distribution"] pub fn Rf_dnbinom(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pnbinom( arg1: f64, @@ -2382,7 +2337,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rnbinom_mu(arg1: f64, arg2: f64) -> f64; - #[doc = "Poisson Distribution"] pub fn Rf_dpois_raw(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; pub fn Rf_dpois(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; pub fn Rf_ppois( @@ -2398,7 +2352,6 @@ extern "C" { arg4: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rpois(arg1: f64) -> f64; - #[doc = "Weibull Distribution"] pub fn Rf_dweibull(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pweibull( arg1: f64, @@ -2415,7 +2368,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rweibull(arg1: f64, arg2: f64) -> f64; - #[doc = "Logistic Distribution"] pub fn Rf_dlogis(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_plogis( arg1: f64, @@ -2432,7 +2384,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rlogis(arg1: f64, arg2: f64) -> f64; - #[doc = "Non-central Beta Distribution"] pub fn Rf_dnbeta( arg1: f64, arg2: f64, @@ -2457,7 +2408,6 @@ extern "C" { arg6: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rnbeta(arg1: f64, arg2: f64, arg3: f64) -> f64; - #[doc = "Non-central F Distribution"] pub fn Rf_dnf(arg1: f64, arg2: f64, arg3: f64, arg4: f64, arg5: ::std::os::raw::c_int) -> f64; pub fn Rf_pnf( arg1: f64, @@ -2475,7 +2425,6 @@ extern "C" { arg5: ::std::os::raw::c_int, arg6: ::std::os::raw::c_int, ) -> f64; - #[doc = "Non-central Student t Distribution"] pub fn Rf_dnt(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pnt( arg1: f64, @@ -2491,7 +2440,6 @@ extern "C" { arg4: ::std::os::raw::c_int, arg5: ::std::os::raw::c_int, ) -> f64; - #[doc = "Studentized Range Distribution"] pub fn Rf_ptukey( arg1: f64, arg2: f64, @@ -2508,7 +2456,6 @@ extern "C" { arg5: ::std::os::raw::c_int, arg6: ::std::os::raw::c_int, ) -> f64; - #[doc = "Wilcoxon Rank Sum Distribution"] pub fn Rf_dwilcox(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pwilcox( arg1: f64, @@ -2526,7 +2473,6 @@ extern "C" { ) -> f64; pub fn Rf_rwilcox(arg1: f64, arg2: f64) -> f64; pub fn wilcox_free(); - #[doc = "Wilcoxon Signed Rank Distribution"] pub fn Rf_dsignrank(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; pub fn Rf_psignrank( arg1: f64, @@ -2542,7 +2488,6 @@ extern "C" { ) -> f64; pub fn Rf_rsignrank(arg1: f64) -> f64; pub fn signrank_free(); - #[doc = "Gamma and Related Functions"] pub fn Rf_gammafn(arg1: f64) -> f64; pub fn Rf_lgammafn(arg1: f64) -> f64; pub fn Rf_lgammafn_sign(arg1: f64, arg2: *mut ::std::os::raw::c_int) -> f64; @@ -2564,7 +2509,6 @@ extern "C" { pub fn Rf_lbeta(arg1: f64, arg2: f64) -> f64; pub fn Rf_choose(arg1: f64, arg2: f64) -> f64; pub fn Rf_lchoose(arg1: f64, arg2: f64) -> f64; - #[doc = "Bessel Functions"] pub fn Rf_bessel_i(arg1: f64, arg2: f64, arg3: f64) -> f64; pub fn Rf_bessel_j(arg1: f64, arg2: f64) -> f64; pub fn Rf_bessel_k(arg1: f64, arg2: f64, arg3: f64) -> f64; @@ -2573,7 +2517,6 @@ extern "C" { pub fn Rf_bessel_j_ex(arg1: f64, arg2: f64, arg3: *mut f64) -> f64; pub fn Rf_bessel_k_ex(arg1: f64, arg2: f64, arg3: f64, arg4: *mut f64) -> f64; pub fn Rf_bessel_y_ex(arg1: f64, arg2: f64, arg3: *mut f64) -> f64; - #[doc = "General Support Functions"] pub fn Rf_imax2( arg1: ::std::os::raw::c_int, arg2: ::std::os::raw::c_int, @@ -2717,22 +2660,15 @@ extern "C" { pub fn R_set_altlist_Set_elt_method(cls: R_altrep_class_t, fun: R_altlist_Set_elt_method_t); pub fn R_GE_getVersion() -> ::std::os::raw::c_int; pub fn R_GE_checkVersionOrDie(version: ::std::os::raw::c_int); - #[doc = "Properly declared version of devNumber"] pub fn Rf_ndevNumber(arg1: pDevDesc) -> ::std::os::raw::c_int; - #[doc = "How many devices exist ? (>= 1)"] pub fn Rf_NumDevices() -> ::std::os::raw::c_int; #[doc = "Check for an available device slot"] pub fn R_CheckDeviceAvailable(); pub fn R_CheckDeviceAvailableBool() -> Rboolean; - #[doc = "Return the number of the current device."] pub fn Rf_curDevice() -> ::std::os::raw::c_int; - #[doc = "Return the number of the next device."] pub fn Rf_nextDevice(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; - #[doc = "Return the number of the previous device."] pub fn Rf_prevDevice(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; - #[doc = "Make the specified device (specified by number) the current device"] pub fn Rf_selectDevice(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; - #[doc = "Kill device which is identified by number."] pub fn Rf_killDevice(arg1: ::std::os::raw::c_int); pub fn Rf_NoDevices() -> ::std::os::raw::c_int; pub fn Rf_NewFrameConfirm(arg1: pDevDesc); @@ -2749,7 +2685,6 @@ extern "C" { pub static mut R_interrupts_suspended: Rboolean; pub static mut R_interrupts_pending: ::std::os::raw::c_int; pub static mut mbcslocale: Rboolean; - #[doc = "Useful for devices: translates Adobe symbol encoding to UTF-8"] pub fn Rf_AdobeSymbol2utf8( out: *mut ::std::os::raw::c_char, in_: *const ::std::os::raw::c_char, @@ -2767,7 +2702,6 @@ extern "C" { ) -> *const ::std::os::raw::c_char; #[doc = "Translates Unicode point to UTF-8"] pub fn Rf_ucstoutf8(s: *mut ::std::os::raw::c_char, c: ::std::os::raw::c_uint) -> usize; - #[doc = "map DevDesc to enclosing GEDevDesc"] pub fn Rf_desc2GEDesc(dd: pDevDesc) -> pGEDevDesc; pub fn GEdeviceNumber(arg1: pGEDevDesc) -> ::std::os::raw::c_int; pub fn GEgetDevice(arg1: ::std::os::raw::c_int) -> pGEDevDesc; @@ -2797,10 +2731,8 @@ extern "C" { pub fn GEtoDeviceWidth(value: f64, from: GEUnit, dd: pGEDevDesc) -> f64; pub fn GEfromDeviceHeight(value: f64, to: GEUnit, dd: pGEDevDesc) -> f64; pub fn GEtoDeviceHeight(value: f64, from: GEUnit, dd: pGEDevDesc) -> f64; - #[doc = "Convert an element of a R colour specification (which might be a\nnumber or a string) into an internal colour specification."] pub fn Rf_RGBpar(arg1: SEXP, arg2: ::std::os::raw::c_int) -> rcolor; pub fn Rf_RGBpar3(arg1: SEXP, arg2: ::std::os::raw::c_int, arg3: rcolor) -> rcolor; - #[doc = "Convert an internal colour specification to/from a colour name"] pub fn Rf_col2name(col: rcolor) -> *const ::std::os::raw::c_char; #[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."] pub fn R_GE_str2col(s: *const ::std::os::raw::c_char) -> rcolor; diff --git a/bindings/bindings-macos-x86_64-R4.2.rs b/bindings/bindings-macos-x86_64-R4.2.rs index 0effeabf..7817dd6f 100644 --- a/bindings/bindings-macos-x86_64-R4.2.rs +++ b/bindings/bindings-macos-x86_64-R4.2.rs @@ -99,33 +99,6 @@ pub const HAVE_ALLOCA_H: u32 = 1; pub const HAVE_UINTPTR_T: u32 = 1; pub const R_XLEN_T_MAX: u64 = 4503599627370496; pub const R_SHORT_LEN_MAX: u32 = 2147483647; -pub const NILSXP: u32 = 0; -pub const SYMSXP: u32 = 1; -pub const LISTSXP: u32 = 2; -pub const CLOSXP: u32 = 3; -pub const ENVSXP: u32 = 4; -pub const PROMSXP: u32 = 5; -pub const LANGSXP: u32 = 6; -pub const SPECIALSXP: u32 = 7; -pub const BUILTINSXP: u32 = 8; -pub const CHARSXP: u32 = 9; -pub const LGLSXP: u32 = 10; -pub const INTSXP: u32 = 13; -pub const REALSXP: u32 = 14; -pub const CPLXSXP: u32 = 15; -pub const STRSXP: u32 = 16; -pub const DOTSXP: u32 = 17; -pub const ANYSXP: u32 = 18; -pub const VECSXP: u32 = 19; -pub const EXPRSXP: u32 = 20; -pub const BCODESXP: u32 = 21; -pub const EXTPTRSXP: u32 = 22; -pub const WEAKREFSXP: u32 = 23; -pub const RAWSXP: u32 = 24; -pub const S4SXP: u32 = 25; -pub const NEWSXP: u32 = 30; -pub const FREESXP: u32 = 31; -pub const FUNSXP: u32 = 99; pub const TYPE_BITS: u32 = 5; pub const MAX_NUM_SEXPTYPE: u32 = 32; pub const NAMEDMAX: u32 = 7; @@ -1329,7 +1302,6 @@ extern "C" { pub fn ATTRIB(x: SEXP) -> SEXP; pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int; pub fn MARK(x: SEXP) -> ::std::os::raw::c_int; - pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int; pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int; pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int; pub fn SET_ATTRIB(x: SEXP, v: SEXP); diff --git a/bindings/bindings-macos-x86_64-R4.3.rs b/bindings/bindings-macos-x86_64-R4.3.rs index 26dad2f3..201ad912 100644 --- a/bindings/bindings-macos-x86_64-R4.3.rs +++ b/bindings/bindings-macos-x86_64-R4.3.rs @@ -100,33 +100,6 @@ pub const HAVE_ALLOCA_H: u32 = 1; pub const HAVE_UINTPTR_T: u32 = 1; pub const R_XLEN_T_MAX: u64 = 4503599627370496; pub const R_SHORT_LEN_MAX: u32 = 2147483647; -pub const NILSXP: u32 = 0; -pub const SYMSXP: u32 = 1; -pub const LISTSXP: u32 = 2; -pub const CLOSXP: u32 = 3; -pub const ENVSXP: u32 = 4; -pub const PROMSXP: u32 = 5; -pub const LANGSXP: u32 = 6; -pub const SPECIALSXP: u32 = 7; -pub const BUILTINSXP: u32 = 8; -pub const CHARSXP: u32 = 9; -pub const LGLSXP: u32 = 10; -pub const INTSXP: u32 = 13; -pub const REALSXP: u32 = 14; -pub const CPLXSXP: u32 = 15; -pub const STRSXP: u32 = 16; -pub const DOTSXP: u32 = 17; -pub const ANYSXP: u32 = 18; -pub const VECSXP: u32 = 19; -pub const EXPRSXP: u32 = 20; -pub const BCODESXP: u32 = 21; -pub const EXTPTRSXP: u32 = 22; -pub const WEAKREFSXP: u32 = 23; -pub const RAWSXP: u32 = 24; -pub const S4SXP: u32 = 25; -pub const NEWSXP: u32 = 30; -pub const FREESXP: u32 = 31; -pub const FUNSXP: u32 = 99; pub const TYPE_BITS: u32 = 5; pub const MAX_NUM_SEXPTYPE: u32 = 32; pub const NAMEDMAX: u32 = 7; @@ -1352,7 +1325,6 @@ extern "C" { pub fn ATTRIB(x: SEXP) -> SEXP; pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int; pub fn MARK(x: SEXP) -> ::std::os::raw::c_int; - pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int; pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int; pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int; pub fn SET_ATTRIB(x: SEXP, v: SEXP); diff --git a/bindings/bindings-macos-x86_64-R4.4-devel.rs b/bindings/bindings-macos-x86_64-R4.4-devel.rs index 494018cd..662bcec4 100644 --- a/bindings/bindings-macos-x86_64-R4.4-devel.rs +++ b/bindings/bindings-macos-x86_64-R4.4-devel.rs @@ -1,8 +1,8 @@ /* automatically generated by rust-bindgen 0.69.1 */ /* libR-sys version: 0.6.0 */ -/* bindgen clang version: Homebrew clang version 17.0.3 */ -/* clang-rs version: Homebrew clang version 17.0.3 */ +/* bindgen clang version: Homebrew clang version 16.0.6 */ +/* clang-rs version: Homebrew clang version 16.0.6 */ /* r version: 4.4.0-devel */ #[repr(C)] @@ -100,34 +100,6 @@ pub const HAVE_ALLOCA_H: u32 = 1; pub const HAVE_UINTPTR_T: u32 = 1; pub const R_XLEN_T_MAX: u64 = 4503599627370496; pub const R_SHORT_LEN_MAX: u32 = 2147483647; -pub const NILSXP: u32 = 0; -pub const SYMSXP: u32 = 1; -pub const LISTSXP: u32 = 2; -pub const CLOSXP: u32 = 3; -pub const ENVSXP: u32 = 4; -pub const PROMSXP: u32 = 5; -pub const LANGSXP: u32 = 6; -pub const SPECIALSXP: u32 = 7; -pub const BUILTINSXP: u32 = 8; -pub const CHARSXP: u32 = 9; -pub const LGLSXP: u32 = 10; -pub const INTSXP: u32 = 13; -pub const REALSXP: u32 = 14; -pub const CPLXSXP: u32 = 15; -pub const STRSXP: u32 = 16; -pub const DOTSXP: u32 = 17; -pub const ANYSXP: u32 = 18; -pub const VECSXP: u32 = 19; -pub const EXPRSXP: u32 = 20; -pub const BCODESXP: u32 = 21; -pub const EXTPTRSXP: u32 = 22; -pub const WEAKREFSXP: u32 = 23; -pub const RAWSXP: u32 = 24; -pub const OBJSXP: u32 = 25; -pub const S4SXP: u32 = 25; -pub const NEWSXP: u32 = 30; -pub const FREESXP: u32 = 31; -pub const FUNSXP: u32 = 99; pub const TYPE_BITS: u32 = 5; pub const MAX_NUM_SEXPTYPE: u32 = 32; pub const NAMEDMAX: u32 = 7; @@ -1353,7 +1325,6 @@ extern "C" { pub fn ATTRIB(x: SEXP) -> SEXP; pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int; pub fn MARK(x: SEXP) -> ::std::os::raw::c_int; - pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int; pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int; pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int; pub fn SET_ATTRIB(x: SEXP, v: SEXP); @@ -2098,7 +2069,6 @@ extern "C" { pub fn unif_rand() -> f64; pub fn R_unif_index(arg1: f64) -> f64; pub fn exp_rand() -> f64; - #[doc = "Normal Distribution"] pub fn Rf_dnorm4(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pnorm5( arg1: f64, @@ -2122,7 +2092,6 @@ extern "C" { arg4: ::std::os::raw::c_int, arg5: ::std::os::raw::c_int, ); - #[doc = "Uniform Distribution"] pub fn Rf_dunif(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_punif( arg1: f64, @@ -2139,7 +2108,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_runif(arg1: f64, arg2: f64) -> f64; - #[doc = "Gamma Distribution"] pub fn Rf_dgamma(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pgamma( arg1: f64, @@ -2160,11 +2128,9 @@ extern "C" { pub fn Rf_log1pexp(arg1: f64) -> f64; pub fn Rf_log1mexp(arg1: f64) -> f64; pub fn Rf_lgamma1p(arg1: f64) -> f64; - #[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:"] pub fn Rf_logspace_add(arg1: f64, arg2: f64) -> f64; pub fn Rf_logspace_sub(arg1: f64, arg2: f64) -> f64; pub fn Rf_logspace_sum(arg1: *const f64, arg2: ::std::os::raw::c_int) -> f64; - #[doc = "Beta Distribution"] pub fn Rf_dbeta(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pbeta( arg1: f64, @@ -2181,7 +2147,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rbeta(arg1: f64, arg2: f64) -> f64; - #[doc = "Lognormal Distribution"] pub fn Rf_dlnorm(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_plnorm( arg1: f64, @@ -2198,7 +2163,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rlnorm(arg1: f64, arg2: f64) -> f64; - #[doc = "Chi-squared Distribution"] pub fn Rf_dchisq(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; pub fn Rf_pchisq( arg1: f64, @@ -2213,7 +2177,6 @@ extern "C" { arg4: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rchisq(arg1: f64) -> f64; - #[doc = "Non-central Chi-squared Distribution"] pub fn Rf_dnchisq(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pnchisq( arg1: f64, @@ -2230,7 +2193,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rnchisq(arg1: f64, arg2: f64) -> f64; - #[doc = "F Distribution"] pub fn Rf_df(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pf( arg1: f64, @@ -2247,7 +2209,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rf(arg1: f64, arg2: f64) -> f64; - #[doc = "Student t Distribution"] pub fn Rf_dt(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; pub fn Rf_pt( arg1: f64, @@ -2262,7 +2223,6 @@ extern "C" { arg4: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rt(arg1: f64) -> f64; - #[doc = "Binomial Distribution"] pub fn Rf_dbinom_raw(x: f64, n: f64, p: f64, q: f64, give_log: ::std::os::raw::c_int) -> f64; pub fn Rf_dbinom(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pbinom( @@ -2280,14 +2240,12 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rbinom(arg1: f64, arg2: f64) -> f64; - #[doc = "Multinomial Distribution"] pub fn Rf_rmultinom( arg1: ::std::os::raw::c_int, arg2: *mut f64, arg3: ::std::os::raw::c_int, arg4: *mut ::std::os::raw::c_int, ); - #[doc = "Cauchy Distribution"] pub fn Rf_dcauchy(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pcauchy( arg1: f64, @@ -2304,7 +2262,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rcauchy(arg1: f64, arg2: f64) -> f64; - #[doc = "Exponential Distribution"] pub fn Rf_dexp(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; pub fn Rf_pexp( arg1: f64, @@ -2319,7 +2276,6 @@ extern "C" { arg4: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rexp(arg1: f64) -> f64; - #[doc = "Geometric Distribution"] pub fn Rf_dgeom(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; pub fn Rf_pgeom( arg1: f64, @@ -2334,7 +2290,6 @@ extern "C" { arg4: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rgeom(arg1: f64) -> f64; - #[doc = "Hypergeometric Distribution"] pub fn Rf_dhyper( arg1: f64, arg2: f64, @@ -2359,7 +2314,6 @@ extern "C" { arg6: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rhyper(arg1: f64, arg2: f64, arg3: f64) -> f64; - #[doc = "Negative Binomial Distribution"] pub fn Rf_dnbinom(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pnbinom( arg1: f64, @@ -2392,7 +2346,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rnbinom_mu(arg1: f64, arg2: f64) -> f64; - #[doc = "Poisson Distribution"] pub fn Rf_dpois_raw(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; pub fn Rf_dpois(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; pub fn Rf_ppois( @@ -2408,7 +2361,6 @@ extern "C" { arg4: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rpois(arg1: f64) -> f64; - #[doc = "Weibull Distribution"] pub fn Rf_dweibull(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pweibull( arg1: f64, @@ -2425,7 +2377,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rweibull(arg1: f64, arg2: f64) -> f64; - #[doc = "Logistic Distribution"] pub fn Rf_dlogis(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_plogis( arg1: f64, @@ -2442,7 +2393,6 @@ extern "C" { arg5: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rlogis(arg1: f64, arg2: f64) -> f64; - #[doc = "Non-central Beta Distribution"] pub fn Rf_dnbeta( arg1: f64, arg2: f64, @@ -2467,7 +2417,6 @@ extern "C" { arg6: ::std::os::raw::c_int, ) -> f64; pub fn Rf_rnbeta(arg1: f64, arg2: f64, arg3: f64) -> f64; - #[doc = "Non-central F Distribution"] pub fn Rf_dnf(arg1: f64, arg2: f64, arg3: f64, arg4: f64, arg5: ::std::os::raw::c_int) -> f64; pub fn Rf_pnf( arg1: f64, @@ -2485,7 +2434,6 @@ extern "C" { arg5: ::std::os::raw::c_int, arg6: ::std::os::raw::c_int, ) -> f64; - #[doc = "Non-central Student t Distribution"] pub fn Rf_dnt(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pnt( arg1: f64, @@ -2501,7 +2449,6 @@ extern "C" { arg4: ::std::os::raw::c_int, arg5: ::std::os::raw::c_int, ) -> f64; - #[doc = "Studentized Range Distribution"] pub fn Rf_ptukey( arg1: f64, arg2: f64, @@ -2518,7 +2465,6 @@ extern "C" { arg5: ::std::os::raw::c_int, arg6: ::std::os::raw::c_int, ) -> f64; - #[doc = "Wilcoxon Rank Sum Distribution"] pub fn Rf_dwilcox(arg1: f64, arg2: f64, arg3: f64, arg4: ::std::os::raw::c_int) -> f64; pub fn Rf_pwilcox( arg1: f64, @@ -2536,7 +2482,6 @@ extern "C" { ) -> f64; pub fn Rf_rwilcox(arg1: f64, arg2: f64) -> f64; pub fn wilcox_free(); - #[doc = "Wilcoxon Signed Rank Distribution"] pub fn Rf_dsignrank(arg1: f64, arg2: f64, arg3: ::std::os::raw::c_int) -> f64; pub fn Rf_psignrank( arg1: f64, @@ -2552,7 +2497,6 @@ extern "C" { ) -> f64; pub fn Rf_rsignrank(arg1: f64) -> f64; pub fn signrank_free(); - #[doc = "Gamma and Related Functions"] pub fn Rf_gammafn(arg1: f64) -> f64; pub fn Rf_lgammafn(arg1: f64) -> f64; pub fn Rf_lgammafn_sign(arg1: f64, arg2: *mut ::std::os::raw::c_int) -> f64; @@ -2574,7 +2518,6 @@ extern "C" { pub fn Rf_lbeta(arg1: f64, arg2: f64) -> f64; pub fn Rf_choose(arg1: f64, arg2: f64) -> f64; pub fn Rf_lchoose(arg1: f64, arg2: f64) -> f64; - #[doc = "Bessel Functions"] pub fn Rf_bessel_i(arg1: f64, arg2: f64, arg3: f64) -> f64; pub fn Rf_bessel_j(arg1: f64, arg2: f64) -> f64; pub fn Rf_bessel_k(arg1: f64, arg2: f64, arg3: f64) -> f64; @@ -2583,7 +2526,6 @@ extern "C" { pub fn Rf_bessel_j_ex(arg1: f64, arg2: f64, arg3: *mut f64) -> f64; pub fn Rf_bessel_k_ex(arg1: f64, arg2: f64, arg3: f64, arg4: *mut f64) -> f64; pub fn Rf_bessel_y_ex(arg1: f64, arg2: f64, arg3: *mut f64) -> f64; - #[doc = "General Support Functions"] pub fn Rf_imax2( arg1: ::std::os::raw::c_int, arg2: ::std::os::raw::c_int, @@ -2727,22 +2669,15 @@ extern "C" { pub fn R_set_altlist_Set_elt_method(cls: R_altrep_class_t, fun: R_altlist_Set_elt_method_t); pub fn R_GE_getVersion() -> ::std::os::raw::c_int; pub fn R_GE_checkVersionOrDie(version: ::std::os::raw::c_int); - #[doc = "Properly declared version of devNumber"] pub fn Rf_ndevNumber(arg1: pDevDesc) -> ::std::os::raw::c_int; - #[doc = "How many devices exist ? (>= 1)"] pub fn Rf_NumDevices() -> ::std::os::raw::c_int; #[doc = "Check for an available device slot"] pub fn R_CheckDeviceAvailable(); pub fn R_CheckDeviceAvailableBool() -> Rboolean; - #[doc = "Return the number of the current device."] pub fn Rf_curDevice() -> ::std::os::raw::c_int; - #[doc = "Return the number of the next device."] pub fn Rf_nextDevice(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; - #[doc = "Return the number of the previous device."] pub fn Rf_prevDevice(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; - #[doc = "Make the specified device (specified by number) the current device"] pub fn Rf_selectDevice(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; - #[doc = "Kill device which is identified by number."] pub fn Rf_killDevice(arg1: ::std::os::raw::c_int); pub fn Rf_NoDevices() -> ::std::os::raw::c_int; pub fn Rf_NewFrameConfirm(arg1: pDevDesc); @@ -2759,7 +2694,6 @@ extern "C" { pub static mut R_interrupts_suspended: Rboolean; pub static mut R_interrupts_pending: ::std::os::raw::c_int; pub static mut mbcslocale: Rboolean; - #[doc = "Useful for devices: translates Adobe symbol encoding to UTF-8"] pub fn Rf_AdobeSymbol2utf8( out: *mut ::std::os::raw::c_char, in_: *const ::std::os::raw::c_char, @@ -2777,7 +2711,6 @@ extern "C" { ) -> *const ::std::os::raw::c_char; #[doc = "Translates Unicode point to UTF-8"] pub fn Rf_ucstoutf8(s: *mut ::std::os::raw::c_char, c: ::std::os::raw::c_uint) -> usize; - #[doc = "map DevDesc to enclosing GEDevDesc"] pub fn Rf_desc2GEDesc(dd: pDevDesc) -> pGEDevDesc; pub fn GEdeviceNumber(arg1: pGEDevDesc) -> ::std::os::raw::c_int; pub fn GEgetDevice(arg1: ::std::os::raw::c_int) -> pGEDevDesc; @@ -2807,10 +2740,8 @@ extern "C" { pub fn GEtoDeviceWidth(value: f64, from: GEUnit, dd: pGEDevDesc) -> f64; pub fn GEfromDeviceHeight(value: f64, to: GEUnit, dd: pGEDevDesc) -> f64; pub fn GEtoDeviceHeight(value: f64, from: GEUnit, dd: pGEDevDesc) -> f64; - #[doc = "Convert an element of a R colour specification (which might be a\nnumber or a string) into an internal colour specification."] pub fn Rf_RGBpar(arg1: SEXP, arg2: ::std::os::raw::c_int) -> rcolor; pub fn Rf_RGBpar3(arg1: SEXP, arg2: ::std::os::raw::c_int, arg3: rcolor) -> rcolor; - #[doc = "Convert an internal colour specification to/from a colour name"] pub fn Rf_col2name(col: rcolor) -> *const ::std::os::raw::c_char; #[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."] pub fn R_GE_str2col(s: *const ::std::os::raw::c_char) -> rcolor; diff --git a/bindings/bindings-windows-x86_64-R4.2.rs b/bindings/bindings-windows-x86_64-R4.2.rs index 69467abd..acb29836 100644 --- a/bindings/bindings-windows-x86_64-R4.2.rs +++ b/bindings/bindings-windows-x86_64-R4.2.rs @@ -1,10 +1,10 @@ -/* automatically generated by rust-bindgen 0.69.1 */ - -/* libR-sys version: 0.6.0 */ -/* bindgen clang version: clang version 16.0.6 */ -/* clang-rs version: clang version 16.0.6 */ -/* r version: 4.2.3 */ - +/* automatically generated by rust-bindgen 0.69.1 */ + +/* libR-sys version: 0.6.0 */ +/* bindgen clang version: clang version 16.0.6 */ +/* clang-rs version: clang version 16.0.6 */ +/* r version: 4.2.3 */ + pub const INT_MIN: i32 = -2147483648; pub const SINGLESXP: u32 = 302; pub const R_LEN_T_MAX: u32 = 2147483647; @@ -17,33 +17,6 @@ pub const SIZEOF_SIZE_T: u32 = 8; pub const HAVE_UINTPTR_T: u32 = 1; pub const R_XLEN_T_MAX: u64 = 4503599627370496; pub const R_SHORT_LEN_MAX: u32 = 2147483647; -pub const NILSXP: u32 = 0; -pub const SYMSXP: u32 = 1; -pub const LISTSXP: u32 = 2; -pub const CLOSXP: u32 = 3; -pub const ENVSXP: u32 = 4; -pub const PROMSXP: u32 = 5; -pub const LANGSXP: u32 = 6; -pub const SPECIALSXP: u32 = 7; -pub const BUILTINSXP: u32 = 8; -pub const CHARSXP: u32 = 9; -pub const LGLSXP: u32 = 10; -pub const INTSXP: u32 = 13; -pub const REALSXP: u32 = 14; -pub const CPLXSXP: u32 = 15; -pub const STRSXP: u32 = 16; -pub const DOTSXP: u32 = 17; -pub const ANYSXP: u32 = 18; -pub const VECSXP: u32 = 19; -pub const EXPRSXP: u32 = 20; -pub const BCODESXP: u32 = 21; -pub const EXTPTRSXP: u32 = 22; -pub const WEAKREFSXP: u32 = 23; -pub const RAWSXP: u32 = 24; -pub const S4SXP: u32 = 25; -pub const NEWSXP: u32 = 30; -pub const FREESXP: u32 = 31; -pub const FUNSXP: u32 = 99; pub const TYPE_BITS: u32 = 5; pub const MAX_NUM_SEXPTYPE: u32 = 32; pub const NAMEDMAX: u32 = 7; @@ -1109,7 +1082,6 @@ extern "C" { pub fn ATTRIB(x: SEXP) -> SEXP; pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int; pub fn MARK(x: SEXP) -> ::std::os::raw::c_int; - pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int; pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int; pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int; pub fn SET_ATTRIB(x: SEXP, v: SEXP); diff --git a/bindings/bindings-windows-x86_64-R4.3.rs b/bindings/bindings-windows-x86_64-R4.3.rs index 90ae282c..3358f2e1 100644 --- a/bindings/bindings-windows-x86_64-R4.3.rs +++ b/bindings/bindings-windows-x86_64-R4.3.rs @@ -1,10 +1,10 @@ -/* automatically generated by rust-bindgen 0.69.1 */ - -/* libR-sys version: 0.6.0 */ -/* bindgen clang version: clang version 16.0.6 */ -/* clang-rs version: clang version 16.0.6 */ -/* r version: 4.3.2 */ - +/* automatically generated by rust-bindgen 0.69.1 */ + +/* libR-sys version: 0.6.0 */ +/* bindgen clang version: clang version 16.0.6 */ +/* clang-rs version: clang version 16.0.6 */ +/* r version: 4.3.2 */ + pub const INT_MIN: i32 = -2147483648; pub const SINGLESXP: u32 = 302; pub const R_LEN_T_MAX: u32 = 2147483647; @@ -18,33 +18,6 @@ pub const SIZEOF_SIZE_T: u32 = 8; pub const HAVE_UINTPTR_T: u32 = 1; pub const R_XLEN_T_MAX: u64 = 4503599627370496; pub const R_SHORT_LEN_MAX: u32 = 2147483647; -pub const NILSXP: u32 = 0; -pub const SYMSXP: u32 = 1; -pub const LISTSXP: u32 = 2; -pub const CLOSXP: u32 = 3; -pub const ENVSXP: u32 = 4; -pub const PROMSXP: u32 = 5; -pub const LANGSXP: u32 = 6; -pub const SPECIALSXP: u32 = 7; -pub const BUILTINSXP: u32 = 8; -pub const CHARSXP: u32 = 9; -pub const LGLSXP: u32 = 10; -pub const INTSXP: u32 = 13; -pub const REALSXP: u32 = 14; -pub const CPLXSXP: u32 = 15; -pub const STRSXP: u32 = 16; -pub const DOTSXP: u32 = 17; -pub const ANYSXP: u32 = 18; -pub const VECSXP: u32 = 19; -pub const EXPRSXP: u32 = 20; -pub const BCODESXP: u32 = 21; -pub const EXTPTRSXP: u32 = 22; -pub const WEAKREFSXP: u32 = 23; -pub const RAWSXP: u32 = 24; -pub const S4SXP: u32 = 25; -pub const NEWSXP: u32 = 30; -pub const FREESXP: u32 = 31; -pub const FUNSXP: u32 = 99; pub const TYPE_BITS: u32 = 5; pub const MAX_NUM_SEXPTYPE: u32 = 32; pub const NAMEDMAX: u32 = 7; @@ -1132,7 +1105,6 @@ extern "C" { pub fn ATTRIB(x: SEXP) -> SEXP; pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int; pub fn MARK(x: SEXP) -> ::std::os::raw::c_int; - pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int; pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int; pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int; pub fn SET_ATTRIB(x: SEXP, v: SEXP); diff --git a/bindings/bindings-windows-x86_64-R4.4-devel.rs b/bindings/bindings-windows-x86_64-R4.4-devel.rs index 3a0985f2..e6f471dd 100644 --- a/bindings/bindings-windows-x86_64-R4.4-devel.rs +++ b/bindings/bindings-windows-x86_64-R4.4-devel.rs @@ -1,10 +1,10 @@ -/* automatically generated by rust-bindgen 0.69.1 */ - -/* libR-sys version: 0.6.0 */ -/* bindgen clang version: clang version 16.0.6 */ -/* clang-rs version: clang version 16.0.6 */ -/* r version: 4.4.0-devel */ - +/* automatically generated by rust-bindgen 0.69.1 */ + +/* libR-sys version: 0.6.0 */ +/* bindgen clang version: clang version 16.0.6 */ +/* clang-rs version: clang version 16.0.6 */ +/* r version: 4.4.0-devel */ + pub const INT_MIN: i32 = -2147483648; pub const SINGLESXP: u32 = 302; pub const R_LEN_T_MAX: u32 = 2147483647; @@ -18,34 +18,6 @@ pub const SIZEOF_SIZE_T: u32 = 8; pub const HAVE_UINTPTR_T: u32 = 1; pub const R_XLEN_T_MAX: u64 = 4503599627370496; pub const R_SHORT_LEN_MAX: u32 = 2147483647; -pub const NILSXP: u32 = 0; -pub const SYMSXP: u32 = 1; -pub const LISTSXP: u32 = 2; -pub const CLOSXP: u32 = 3; -pub const ENVSXP: u32 = 4; -pub const PROMSXP: u32 = 5; -pub const LANGSXP: u32 = 6; -pub const SPECIALSXP: u32 = 7; -pub const BUILTINSXP: u32 = 8; -pub const CHARSXP: u32 = 9; -pub const LGLSXP: u32 = 10; -pub const INTSXP: u32 = 13; -pub const REALSXP: u32 = 14; -pub const CPLXSXP: u32 = 15; -pub const STRSXP: u32 = 16; -pub const DOTSXP: u32 = 17; -pub const ANYSXP: u32 = 18; -pub const VECSXP: u32 = 19; -pub const EXPRSXP: u32 = 20; -pub const BCODESXP: u32 = 21; -pub const EXTPTRSXP: u32 = 22; -pub const WEAKREFSXP: u32 = 23; -pub const RAWSXP: u32 = 24; -pub const OBJSXP: u32 = 25; -pub const S4SXP: u32 = 25; -pub const NEWSXP: u32 = 30; -pub const FREESXP: u32 = 31; -pub const FUNSXP: u32 = 99; pub const TYPE_BITS: u32 = 5; pub const MAX_NUM_SEXPTYPE: u32 = 32; pub const NAMEDMAX: u32 = 7; @@ -1133,7 +1105,6 @@ extern "C" { pub fn ATTRIB(x: SEXP) -> SEXP; pub fn OBJECT(x: SEXP) -> ::std::os::raw::c_int; pub fn MARK(x: SEXP) -> ::std::os::raw::c_int; - pub fn TYPEOF(x: SEXP) -> ::std::os::raw::c_int; pub fn NAMED(x: SEXP) -> ::std::os::raw::c_int; pub fn REFCNT(x: SEXP) -> ::std::os::raw::c_int; pub fn SET_ATTRIB(x: SEXP, v: SEXP); diff --git a/build.rs b/build.rs index c832b640..b1d62804 100644 --- a/build.rs +++ b/build.rs @@ -476,6 +476,14 @@ fn generate_bindings(r_paths: &InstallationPaths, version_info: &RVersionInfo) { // included header files changed. .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())); + // Use enum-definition of `SEXPTYPE`, as it is available and compatible + bindgen_builder = bindgen_builder.clang_arg("-Denum_SEXPTYPE"); + + // Collect C-enums into idiomatic Rust-style enums + bindgen_builder = bindgen_builder.default_enum_style(bindgen::EnumVariation::Rust { + non_exhaustive: false, + }); + // Collect C-enums into idiomatic Rust-style enums bindgen_builder = bindgen_builder.default_enum_style(bindgen::EnumVariation::Rust { non_exhaustive: false, @@ -539,6 +547,9 @@ fn generate_bindings(r_paths: &InstallationPaths, version_info: &RVersionInfo) { // Ensure that `SEXPREC` is opaque to Rust let bindgen_builder = bindgen_builder.blocklist_item("SEXPREC"); + // Replace `TYPEOF` definition with one that gives same type as `SEXPTYPE`. + let bindgen_builder = bindgen_builder.blocklist_item("TYPEOF"); + // Finish the builder and generate the bindings. let bindings = bindgen_builder .raw_line(format!( diff --git a/src/lib.rs b/src/lib.rs index d30fe11d..1f85768f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -71,6 +71,11 @@ include!(concat!(env!("OUT_DIR"), "/bindings.rs")); #[derive(Debug)] pub struct SEXPREC(std::ffi::c_void); +extern "C" { + // Return type should match `SEXPTYPE` + pub fn TYPEOF(x: SEXP) -> SEXPTYPE; +} + #[cfg(test)] mod tests { use super::*; @@ -144,7 +149,7 @@ mod tests { unsafe { let val = Rf_protect(R_ParseEvalString(cstr!("1"), R_NilValue)); Rf_PrintValue(val); - assert_eq!(TYPEOF(val) as u32, REALSXP); + assert_eq!(TYPEOF(val), SEXPTYPE::REALSXP); assert_eq!(*REAL(val), 1.); Rf_unprotect(1); }