1use rdll::{TYPEOF, SEXP, SET_TYPEOF};
7
8pub type Rtype = ::std::os::raw::c_uint;
9
10#[allow(unused_doc_comments)]
11#[derive(Copy, PartialEq, Eq, Clone, Debug)]
12pub enum RTypeEnum {
13 NIL,
14 SYM,
15 LIST,
16 CLO,
17 ENV,
18 PROM,
19 LANG,
20 SPECIAL,
21 BUILTIN,
22 CHAR,
24 LGL,
25 INT,
26 REAL,
27 CPLX,
28 STR,
29 VEC,
30 S4,
31 RAW,
32 EXPR,
33 DOT,
35 ANY,
36 BCODE,
37 EXTPTR,
38 WEAKREF,
39 NEW,
40 FREE,
41 FUN,
42}
43
44#[allow(unused_doc_comments)]
45#[inline]
46pub fn match_rtype(x: Rtype) -> RTypeEnum {
47 match x {
48 NILSXP => RTypeEnum::NIL,
49 SYMSXP => RTypeEnum::SYM,
50 LISTSXP => RTypeEnum::LIST,
51 CLOSXP => RTypeEnum::CLO,
52 ENVSXP => RTypeEnum::ENV,
53 PROMSXP => RTypeEnum::PROM,
54 LANGSXP => RTypeEnum::LANG,
55 SPECIALSXP => RTypeEnum::SPECIAL,
56 BUILTINSXP => RTypeEnum::BUILTIN,
57 CHARSXP => RTypeEnum::CHAR,
59 LGLSXP => RTypeEnum::LGL,
60 INTSXP => RTypeEnum::INT,
61 REALSXP => RTypeEnum::REAL,
62 CPLXSXP => RTypeEnum::CPLX,
63 STRSXP => RTypeEnum::STR,
64 VECSXP => RTypeEnum::VEC,
65 S4SXP => RTypeEnum::S4,
66 RAWSXP => RTypeEnum::RAW,
67 EXPRSXP => RTypeEnum::EXPR,
68 DOTSXP => RTypeEnum::DOT,
70 ANYSXP => RTypeEnum::ANY,
71 BCODESXP => RTypeEnum::BCODE,
72 EXTPTRSXP => RTypeEnum::EXTPTR,
73 WEAKREFSXP => RTypeEnum::WEAKREF,
74 NEWSXP => RTypeEnum::NEW,
75 FREESXP => RTypeEnum::FREE,
76 FUNSXP => RTypeEnum::FUN,
77 _ => RTypeEnum::NIL, }
79}
80
81#[allow(non_snake_case)]
82#[inline]
83pub fn RTYPEOF(x: SEXP) -> ::std::os::raw::c_uint {
84 unsafe { TYPEOF(x) as ::std::os::raw::c_uint }
85}
86
87#[allow(non_snake_case)]
88#[inline]
89pub unsafe fn SET_RTYPEOF(x: SEXP, v: ::std::os::raw::c_uint) {
90 SET_TYPEOF(x, v as ::std::os::raw::c_int);
91}
92
93
94
95pub const NILSXP: ::std::os::raw::c_uint = 0; pub struct RNIL;
97
98pub const SYMSXP: ::std::os::raw::c_uint = 1; pub struct RSYM;
100
101pub const LISTSXP: ::std::os::raw::c_uint = 2; pub struct RLIST;
103pub const CLOSXP: ::std::os::raw::c_uint = 3; pub struct RCLOS;
105pub const ENVSXP: ::std::os::raw::c_uint = 4; pub struct RENV;
107pub const PROMSXP: ::std::os::raw::c_uint = 5; pub struct RPROM;
109pub const LANGSXP: ::std::os::raw::c_uint = 6; pub struct RLANG;
111pub const SPECIALSXP: ::std::os::raw::c_uint = 7; pub struct RSPECIAL;
113pub const BUILTINSXP: ::std::os::raw::c_uint = 8; pub const CHARSXP: ::std::os::raw::c_uint = 9; pub struct RCHAR;
117pub const LGLSXP: ::std::os::raw::c_uint = 10; pub struct RLGL;
120pub const INTSXP: ::std::os::raw::c_uint = 13; pub struct RINT;
122pub const REALSXP: ::std::os::raw::c_uint = 14; pub struct RREAL;
124pub const CPLXSXP: ::std::os::raw::c_uint = 15; pub struct RCPLX;
126pub const STRSXP: ::std::os::raw::c_uint = 16; pub struct RSTR;
128pub const DOTSXP: ::std::os::raw::c_uint = 17; pub struct RDOT;
130pub const ANYSXP: ::std::os::raw::c_uint = 18;
131pub struct RANY;
132pub const VECSXP: ::std::os::raw::c_uint = 19; pub struct RVEC;
138pub const EXPRSXP: ::std::os::raw::c_uint = 20; pub struct REXPR;
140pub const BCODESXP: ::std::os::raw::c_uint = 21; pub struct RBCODESXP;
142pub const EXTPTRSXP: ::std::os::raw::c_uint = 22; pub struct REXTPTR;
144pub const WEAKREFSXP: ::std::os::raw::c_uint = 23; pub struct RWEAKREF;
146pub const RAWSXP: ::std::os::raw::c_uint = 24; pub struct RRAW;
148pub const S4SXP: ::std::os::raw::c_uint = 25; pub struct RS4;
150
151pub const NEWSXP: ::std::os::raw::c_uint = 30; pub struct RNEW;
154pub const FREESXP: ::std::os::raw::c_uint = 31; pub struct RFREE;
156pub const FUNSXP: ::std::os::raw::c_uint = 99; pub struct RFUN;