Expand description
SEXP type definitions — the C-compatible memory layout for R values.
This defines miniR’s own SEXP ABI. Package C code compiled against our
Rinternals.h header uses this layout to access R values.
All allocations use the C allocator (calloc/malloc/free) so that
SEXPs created by Rust and SEXPs created by C code are interchangeable
and can be freed by either side.
Structs§
- Pairlist
Data - Pairlist node data — matches
minir_pairlist_datain Rinternals.h. Used by LISTSXP/LANGSXP nodes. Stored atdatapointer of the SexpRec. - SexpRec
- A heap-allocated R value in C-compatible layout.
Constants§
- CHARSXP
- CPLXSXP
- ENVSXP
- INTSXP
- LANGSXP
- LGLSXP
- LISTSXP
- NA_
INTEGER - R’s NA_INTEGER — i32::MIN.
- NA_
LOGICAL - R’s NA_LOGICAL — same as NA_INTEGER.
- NA_REAL
- R’s NA_REAL — a specific NaN with payload 1954 (0x7FF00000000007A2).
- NILSXP
- RAWSXP
- REALSXP
- R_
NIL_ VALUE - Null SEXP sentinel.
- STRSXP
- SYMSXP
- VECSXP
Functions§
- alloc_
vector - Allocate a SEXPREC with a typed data buffer using the C allocator.
- calloc 🔒 ⚠
- char_
data ⚠ - Read the CHARSXP data as a Rust &str.
- free 🔒 ⚠
- free_
sexp ⚠ - Free a SEXP and its data buffer using the C allocator.
- integer_
ptr ⚠ - Read INTEGER data pointer.
- is_
na_ real - Check if a f64 is R’s NA_REAL (not just any NaN).
- logical_
ptr ⚠ - Read LOGICAL data pointer.
- malloc 🔒 ⚠
- mk_char
- Allocate a CHARSXP from a Rust string.
- mk_null
- Allocate a NILSXP.
- mk_
string - Allocate a length-1 STRSXP from a Rust string.
- real_
ptr ⚠ - Read REAL data pointer.
- scalar_
integer - Allocate a scalar INTSXP.
- scalar_
logical - Allocate a scalar LGLSXP.
- scalar_
real - Allocate a scalar REALSXP.
- string_
elt ⚠ - Read STRING_ELT.
- vector_
elt ⚠ - Read VECTOR_ELT.
Type Aliases§
- Sexp
- The SEXP pointer type — equivalent to C’s
SEXP.