-
Notifications
You must be signed in to change notification settings - Fork 313
/
Rinternals.h
1294 lines (1159 loc) · 43 KB
/
Rinternals.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* R : A Computer Language for Statistical Data Analysis
* Copyright (C) 1999--2024 The R Core Team.
* Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka
*
* This header file is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This file is part of R. R is distributed under the terms of the
* GNU General Public License, either Version 2, June 1991 or Version 3,
* June 2007. See doc/COPYRIGHTS for details of the copyright status of R.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, a copy is available at
* https://www.R-project.org/Licenses/
*/
/* This file is installed and available to packages, but only a small
part of the contents is within the API. See chapter 6 of 'Writing
R Extensions'.
*/
#ifndef R_INTERNALS_H_
#define R_INTERNALS_H_
#ifdef __cplusplus
# include <cstdio>
# include <climits>
# include <cstddef>
#else
# include <stdio.h>
# include <limits.h> /* for INT_MAX */
# include <stddef.h> /* for ptrdiff_t, which is required by C99 */
#endif
#include <R_ext/Arith.h>
#include <R_ext/Boolean.h>
#include <R_ext/Complex.h>
#include <R_ext/Error.h> // includes NORET macro
#include <R_ext/Memory.h>
#include <R_ext/Utils.h>
#include <R_ext/Print.h>
#include <R_ext/Rdynload.h> // for DL_FUNC
#include <R_ext/libextern.h>
/* both config.h and Rconfig.h set SIZEOF_SIZE_T, but Rconfig.h is
skipped if config.h has already been included. */
#ifndef R_CONFIG_H
# include <Rconfig.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef unsigned char Rbyte;
/* type for length of (standard, not long) vectors etc */
typedef int R_len_t;
#define R_LEN_T_MAX INT_MAX
#if ( SIZEOF_SIZE_T > 4 )
# define LONG_VECTOR_SUPPORT
#endif
#ifdef LONG_VECTOR_SUPPORT
typedef ptrdiff_t R_xlen_t;
# define R_XLEN_T_MAX 4503599627370496
# define R_SHORT_LEN_MAX 2147483647
# define R_PRIdXLEN_T "td"
#else
typedef int R_xlen_t;
# define R_XLEN_T_MAX R_LEN_T_MAX
# define R_PRIdXLEN_T "d"
#endif
#ifndef TESTING_WRITE_BARRIER
# define INLINE_PROTECT
#endif
/* Fundamental Data Types: These are largely Lisp
* influenced structures, with the exception of LGLSXP,
* INTSXP, REALSXP, CPLXSXP and STRSXP which are the
* element types for S-like data objects.
*
* --> TypeTable[] in ../main/util.c for typeof()
*/
/* These exact numeric values are seldom used, but they are, e.g., in
* ../main/subassign.c, and they are serialized.
*/
#ifndef enum_SEXPTYPE
/* NOT YET using enum:
* 1) The internal SEXPREC struct has 'SEXPTYPE type : 5'
* (making FUNSXP and CLOSXP equivalent in there),
* giving (-Wall only ?) warnings all over the place
* 2) Many switch(type) { case ... } statements need a final `default:'
* added in order to avoid warnings like [e.g. l.170 of ../main/util.c]
* "enumeration value `FUNSXP' not handled in switch"
*/
typedef unsigned int SEXPTYPE;
#define NILSXP 0 /* nil = NULL */
#define SYMSXP 1 /* symbols */
#define LISTSXP 2 /* lists of dotted pairs */
#define CLOSXP 3 /* closures */
#define ENVSXP 4 /* environments */
#define PROMSXP 5 /* promises: [un]evaluated closure arguments */
#define LANGSXP 6 /* language constructs (special lists) */
#define SPECIALSXP 7 /* special forms */
#define BUILTINSXP 8 /* builtin non-special forms */
#define CHARSXP 9 /* "scalar" string type (internal only)*/
#define LGLSXP 10 /* logical vectors */
/* 11 and 12 were factors and ordered factors in the 1990s */
#define INTSXP 13 /* integer vectors */
#define REALSXP 14 /* real variables */
#define CPLXSXP 15 /* complex variables */
#define STRSXP 16 /* string vectors */
#define DOTSXP 17 /* dot-dot-dot object */
#define ANYSXP 18 /* make "any" args work.
Used in specifying types for symbol
registration to mean anything is okay */
#define VECSXP 19 /* generic vectors */
#define EXPRSXP 20 /* expressions vectors */
#define BCODESXP 21 /* byte code */
#define EXTPTRSXP 22 /* external pointer */
#define WEAKREFSXP 23 /* weak reference */
#define RAWSXP 24 /* raw bytes */
#define OBJSXP 25 /* object, non-vector */
#define S4SXP 25 /* same as OBJSXP, retained for back compatability */
/* used for detecting PROTECT issues in memory.c */
#define NEWSXP 30 /* fresh node created in new page */
#define FREESXP 31 /* node released by GC */
#define FUNSXP 99 /* Closure or Builtin or Special */
#else /* NOT YET */
/*------ enum_SEXPTYPE ----- */
typedef enum {
NILSXP = 0, /* nil = NULL */
SYMSXP = 1, /* symbols */
LISTSXP = 2, /* lists of dotted pairs */
CLOSXP = 3, /* closures */
ENVSXP = 4, /* environments */
PROMSXP = 5, /* promises: [un]evaluated closure arguments */
LANGSXP = 6, /* language constructs (special lists) */
SPECIALSXP = 7, /* special forms */
BUILTINSXP = 8, /* builtin non-special forms */
CHARSXP = 9, /* "scalar" string type (internal only)*/
LGLSXP = 10, /* logical vectors */
INTSXP = 13, /* integer vectors */
REALSXP = 14, /* real variables */
CPLXSXP = 15, /* complex variables */
STRSXP = 16, /* string vectors */
DOTSXP = 17, /* dot-dot-dot object */
ANYSXP = 18, /* make "any" args work */
VECSXP = 19, /* generic vectors */
EXPRSXP = 20, /* expressions vectors */
BCODESXP = 21, /* byte code */
EXTPTRSXP = 22, /* external pointer */
WEAKREFSXP = 23, /* weak reference */
RAWSXP = 24, /* raw bytes */
OBJSXP = 25, /* S4 non-vector */
NEWSXP = 30, /* fresh node created in new page */
FREESXP = 31, /* node released by GC */
FUNSXP = 99 /* Closure or Builtin */
} SEXPTYPE;
#endif
/* These are also used with the write barrier on, in attrib.c and util.c */
#define TYPE_BITS 5
#define MAX_NUM_SEXPTYPE (1<<TYPE_BITS)
typedef struct SEXPREC *SEXP;
/* Define SWITCH_TO_NAMED to use the 'NAMED' mechanism instead of
reference counting. */
#if ! defined(SWITCH_TO_NAMED) && ! defined(SWITCH_TO_REFCNT)
# define SWITCH_TO_REFCNT
#endif
#if defined(SWITCH_TO_REFCNT) && ! defined(COMPUTE_REFCNT_VALUES)
# define COMPUTE_REFCNT_VALUES
#endif
#if defined(SWITCH_TO_REFCNT) && ! defined(ADJUST_ENVIR_REFCNTS)
# define ADJUST_ENVIR_REFCNTS
#endif
#define CHAR(x) R_CHAR(x)
const char *(R_CHAR)(SEXP x);
/* Various tests with macro versions in the internal headers */
Rboolean (Rf_isNull)(SEXP s);
Rboolean (Rf_isSymbol)(SEXP s);
Rboolean (Rf_isLogical)(SEXP s);
Rboolean (Rf_isReal)(SEXP s);
Rboolean (Rf_isComplex)(SEXP s);
Rboolean (Rf_isExpression)(SEXP s);
Rboolean (Rf_isEnvironment)(SEXP s);
Rboolean (Rf_isString)(SEXP s);
Rboolean (Rf_isObject)(SEXP s);
#define IS_SIMPLE_SCALAR(x, type) \
(IS_SCALAR(x, type) && ATTRIB(x) == R_NilValue)
#define NAMEDMAX 7
#ifdef SWITCH_TO_REFCNT
# define INCREMENT_NAMED(x) do { } while (0)
# define DECREMENT_NAMED(x) do { } while (0)
#else
# define INCREMENT_NAMED(x) do { \
SEXP __x__ = (x); \
if (NAMED(__x__) != NAMEDMAX) \
SET_NAMED(__x__, NAMED(__x__) + 1); \
} while (0)
# define DECREMENT_NAMED(x) do { \
SEXP __x__ = (x); \
int __n__ = NAMED(__x__); \
if (__n__ > 0 && __n__ < NAMEDMAX) \
SET_NAMED(__x__, __n__ - 1); \
} while (0)
#endif
/* Macros for some common idioms. */
#ifdef USE_RINTERNALS
# ifdef SWITCH_TO_REFCNT
# define MAYBE_SHARED(x) (REFCNT(x) > 1)
# define NO_REFERENCES(x) (REFCNT(x) == 0)
# else
# define MAYBE_SHARED(x) (NAMED(x) > 1)
# define NO_REFERENCES(x) (NAMED(x) == 0)
# endif
#else
int (MAYBE_SHARED)(SEXP x);
int (NO_REFERENCES)(SEXP x);
#endif
#define MAYBE_REFERENCED(x) (! NO_REFERENCES(x))
#define NOT_SHARED(x) (! MAYBE_SHARED(x))
/* Accessor functions. Many are declared using () to avoid the macro
definitions in the internal headers.
The function STRING_ELT is used as an argument to arrayAssign even
if the macro version is in use.
*/
/* General Cons Cell Attributes */
SEXP (ATTRIB)(SEXP x);
int (OBJECT)(SEXP x);
int (MARK)(SEXP x);
int (TYPEOF)(SEXP x);
int (NAMED)(SEXP x);
int (REFCNT)(SEXP x);
void SET_ATTRIB(SEXP x, SEXP v);
void DUPLICATE_ATTRIB(SEXP to, SEXP from);
void SHALLOW_DUPLICATE_ATTRIB(SEXP to, SEXP from);
void (MARK_NOT_MUTABLE)(SEXP x);
void CLEAR_ATTRIB(SEXP x);
int (ANY_ATTRIB)(SEXP x);
#define NO_ATTRIB(x) (! ANY_ATTRIB(x))
/* S4 object testing */
int (IS_S4_OBJECT)(SEXP x);
/* Vector Access Functions */
int (LENGTH)(SEXP x);
R_xlen_t (XLENGTH)(SEXP x);
R_xlen_t (TRUELENGTH)(SEXP x);
int (IS_LONG_VEC)(SEXP x);
int (LEVELS)(SEXP x);
int *(LOGICAL)(SEXP x);
int *(INTEGER)(SEXP x);
Rbyte *(RAW)(SEXP x);
double *(REAL)(SEXP x);
Rcomplex *(COMPLEX)(SEXP x);
const int *(LOGICAL_RO)(SEXP x);
const int *(INTEGER_RO)(SEXP x);
const Rbyte *(RAW_RO)(SEXP x);
const double *(REAL_RO)(SEXP x);
const Rcomplex *(COMPLEX_RO)(SEXP x);
//SEXP (STRING_ELT)(SEXP x, R_xlen_t i);
SEXP (VECTOR_ELT)(SEXP x, R_xlen_t i);
void SET_STRING_ELT(SEXP x, R_xlen_t i, SEXP v);
SEXP SET_VECTOR_ELT(SEXP x, R_xlen_t i, SEXP v);
SEXP *(STRING_PTR)(SEXP x);
const SEXP *(STRING_PTR_RO)(SEXP x);
const SEXP *(VECTOR_PTR_RO)(SEXP x);
NORET SEXP * (VECTOR_PTR)(SEXP x);
R_xlen_t INTEGER_GET_REGION(SEXP sx, R_xlen_t i, R_xlen_t n, int *buf);
R_xlen_t REAL_GET_REGION(SEXP sx, R_xlen_t i, R_xlen_t n, double *buf);
R_xlen_t LOGICAL_GET_REGION(SEXP sx, R_xlen_t i, R_xlen_t n, int *buf);
R_xlen_t COMPLEX_GET_REGION(SEXP sx, R_xlen_t i, R_xlen_t n, Rcomplex *buf);
R_xlen_t RAW_GET_REGION(SEXP sx, R_xlen_t i, R_xlen_t n, Rbyte *buf);
/* metadata access */
int INTEGER_IS_SORTED(SEXP x);
int INTEGER_NO_NA(SEXP x);
int REAL_IS_SORTED(SEXP x);
int REAL_NO_NA(SEXP x);
int LOGICAL_IS_SORTED(SEXP x);
int LOGICAL_NO_NA(SEXP x);
int STRING_IS_SORTED(SEXP x);
int STRING_NO_NA(SEXP x);
/* List Access Functions */
/* These also work for ... objects */
#define CONS(a, b) Rf_cons((a), (b)) /* data lists */
#define LCONS(a, b) Rf_lcons((a), (b)) /* language lists */
SEXP (TAG)(SEXP e);
SEXP (CDR)(SEXP e);
SEXP (CAAR)(SEXP e);
SEXP (CDAR)(SEXP e);
SEXP (CADR)(SEXP e);
SEXP (CDDR)(SEXP e);
SEXP (CDDDR)(SEXP e);
SEXP (CADDR)(SEXP e);
SEXP (CADDDR)(SEXP e);
SEXP (CAD4R)(SEXP e);
SEXP (CAD5R)(SEXP e);
int (MISSING)(SEXP x);
void SET_TAG(SEXP x, SEXP y);
SEXP SETCAR(SEXP x, SEXP y);
SEXP SETCDR(SEXP x, SEXP y);
SEXP SETCADR(SEXP x, SEXP y);
SEXP SETCADDR(SEXP x, SEXP y);
SEXP SETCADDDR(SEXP x, SEXP y);
SEXP SETCAD4R(SEXP e, SEXP y);
/* Closure Access Functions */
SEXP (FORMALS)(SEXP x);
SEXP (BODY)(SEXP x);
SEXP (CLOENV)(SEXP x);
int (RDEBUG)(SEXP x);
int (RSTEP)(SEXP x);
int (RTRACE)(SEXP x);
void (SET_RDEBUG)(SEXP x, int v);
void (SET_RSTEP)(SEXP x, int v);
void (SET_RTRACE)(SEXP x, int v);
void SET_FORMALS(SEXP x, SEXP v);
void SET_BODY(SEXP x, SEXP v);
void SET_CLOENV(SEXP x, SEXP v);
SEXP R_mkClosure(SEXP, SEXP, SEXP);
SEXP R_ClosureFormals(SEXP);
SEXP R_ClosureBody(SEXP);
SEXP R_ClosureEnv(SEXP);
/* Symbol Access Functions */
SEXP (PRINTNAME)(SEXP x);
SEXP (SYMVALUE)(SEXP x);
SEXP (INTERNAL)(SEXP x);
int (DDVAL)(SEXP x);
/* Environment Access Functions */
SEXP (FRAME)(SEXP x);
SEXP (ENCLOS)(SEXP x);
SEXP (HASHTAB)(SEXP x);
int (ENVFLAGS)(SEXP x);
SEXP R_ParentEnv(SEXP);
/* Promise Access Functions */
SEXP (PRCODE)(SEXP x);
SEXP (PRENV)(SEXP x);
SEXP (PRVALUE)(SEXP x);
int (PRSEEN)(SEXP x);
/* External pointer access macros */
SEXP (EXTPTR_PROT)(SEXP);
SEXP (EXTPTR_TAG)(SEXP);
void *(EXTPTR_PTR)(SEXP);
/* Pointer Protection and Unprotection */
#define PROTECT(s) Rf_protect(s)
#define UNPROTECT(n) Rf_unprotect(n)
#define UNPROTECT_PTR(s) Rf_unprotect_ptr(s)
/* We sometimes need to coerce a protected value and place the new
coerced value under protection. For these cases PROTECT_WITH_INDEX
saves an index of the protection location that can be used to
replace the protected value using REPROTECT. */
typedef int PROTECT_INDEX;
#define PROTECT_WITH_INDEX(x,i) R_ProtectWithIndex(x,i)
#define REPROTECT(x,i) R_Reprotect(x,i)
/* Evaluation Environment */
LibExtern SEXP R_GlobalEnv; /* The "global" environment */
LibExtern SEXP R_EmptyEnv; /* An empty environment at the root of the
environment tree */
LibExtern SEXP R_BaseEnv; /* The base environment; formerly R_NilValue */
LibExtern SEXP R_BaseNamespace; /* The (fake) namespace for base */
LibExtern SEXP R_NamespaceRegistry;/* Registry for registered namespaces */
LibExtern SEXP R_Srcref; /* Current srcref, for debuggers */
/* Special Values */
LibExtern SEXP R_NilValue; /* The nil object */
LibExtern SEXP R_UnboundValue; /* Unbound marker */
LibExtern SEXP R_MissingArg; /* Missing argument marker */
LibExtern SEXP R_InBCInterpreter; /* To be found in BC interp. state
(marker) */
LibExtern SEXP R_CurrentExpression; /* Use current expression (marker) */
#ifdef __MAIN__
attribute_hidden
#else
extern
#endif
SEXP R_RestartToken; /* Marker for restarted function calls */
/* Symbol Table Shortcuts */
LibExtern SEXP R_AsCharacterSymbol;/* "as.character" */
LibExtern SEXP R_AtsignSymbol; /* "@" */
LibExtern SEXP R_baseSymbol; // <-- backcompatible version of:
LibExtern SEXP R_BaseSymbol; // "base"
LibExtern SEXP R_BraceSymbol; /* "{" */
LibExtern SEXP R_Bracket2Symbol; /* "[[" */
LibExtern SEXP R_BracketSymbol; /* "[" */
LibExtern SEXP R_ClassSymbol; /* "class" */
LibExtern SEXP R_DeviceSymbol; /* ".Device" */
LibExtern SEXP R_DimNamesSymbol; /* "dimnames" */
LibExtern SEXP R_DimSymbol; /* "dim" */
LibExtern SEXP R_DollarSymbol; /* "$" */
LibExtern SEXP R_DotsSymbol; /* "..." */
LibExtern SEXP R_DoubleColonSymbol;// "::"
LibExtern SEXP R_DropSymbol; /* "drop" */
LibExtern SEXP R_EvalSymbol; /* "eval" */
LibExtern SEXP R_FunctionSymbol; /* "function" */
LibExtern SEXP R_LastvalueSymbol; /* ".Last.value" */
LibExtern SEXP R_LevelsSymbol; /* "levels" */
LibExtern SEXP R_ModeSymbol; /* "mode" */
LibExtern SEXP R_NaRmSymbol; /* "na.rm" */
LibExtern SEXP R_NameSymbol; /* "name" */
LibExtern SEXP R_NamesSymbol; /* "names" */
LibExtern SEXP R_NamespaceEnvSymbol;// ".__NAMESPACE__."
LibExtern SEXP R_PackageSymbol; /* "package" */
LibExtern SEXP R_PreviousSymbol; /* "previous" */
LibExtern SEXP R_QuoteSymbol; /* "quote" */
LibExtern SEXP R_RowNamesSymbol; /* "row.names" */
LibExtern SEXP R_SeedsSymbol; /* ".Random.seed" */
LibExtern SEXP R_SortListSymbol; /* "sort.list" */
LibExtern SEXP R_SourceSymbol; /* "source" */
LibExtern SEXP R_SpecSymbol; // "spec"
LibExtern SEXP R_TripleColonSymbol;// ":::"
LibExtern SEXP R_TspSymbol; /* "tsp" */
LibExtern SEXP R_dot_defined; /* ".defined" */
LibExtern SEXP R_dot_Method; /* ".Method" */
LibExtern SEXP R_dot_packageName;// ".packageName"
LibExtern SEXP R_dot_target; /* ".target" */
LibExtern SEXP R_dot_Generic; /* ".Generic" */
/* Missing Values - others from Arith.h */
#define NA_STRING R_NaString
LibExtern SEXP R_NaString; /* NA_STRING as a CHARSXP */
LibExtern SEXP R_BlankString; /* "" as a CHARSXP */
LibExtern SEXP R_BlankScalarString;/* "" as a STRSXP */
/* srcref related functions */
SEXP R_GetCurrentSrcref(int);
SEXP R_GetSrcFilename(SEXP);
/*--- FUNCTIONS ------------------------------------------------------ */
/* Type Coercions of all kinds */
SEXP Rf_asChar(SEXP);
SEXP Rf_coerceVector(SEXP, SEXPTYPE);
SEXP Rf_PairToVectorList(SEXP x);
SEXP Rf_VectorToPairList(SEXP x);
SEXP Rf_asCharacterFactor(SEXP x);
int Rf_asLogical(SEXP x);
int Rf_asInteger(SEXP x);
double Rf_asReal(SEXP x);
Rcomplex Rf_asComplex(SEXP x);
// also included in R_ext/Rallocators.h
#ifndef R_ALLOCATOR_TYPE
#define R_ALLOCATOR_TYPE
typedef struct R_allocator R_allocator_t;
#endif
/* Other Internally Used Functions, excluding those which are inline-able*/
char * Rf_acopy_string(const char *);
SEXP Rf_alloc3DArray(SEXPTYPE, int, int, int);
SEXP Rf_allocArray(SEXPTYPE, SEXP);
SEXP Rf_allocMatrix(SEXPTYPE, int, int);
SEXP Rf_allocLang(int);
SEXP Rf_allocList(int);
SEXP Rf_allocS4Object(void);
SEXP Rf_allocSExp(SEXPTYPE);
// next is not documented but generated by inlined calls to Rf_allocVector
SEXP Rf_allocVector3(SEXPTYPE, R_xlen_t, R_allocator_t*);
R_xlen_t Rf_any_duplicated(SEXP x, Rboolean from_last);
R_xlen_t Rf_any_duplicated3(SEXP x, SEXP incomp, Rboolean from_last);
SEXP Rf_classgets(SEXP, SEXP);
SEXP Rf_cons(SEXP, SEXP);
void Rf_copyMatrix(SEXP, SEXP, Rboolean);
void Rf_copyListMatrix(SEXP, SEXP, Rboolean);
void Rf_copyMostAttrib(SEXP, SEXP);
void Rf_copyVector(SEXP, SEXP);
void Rf_defineVar(SEXP, SEXP, SEXP);
SEXP Rf_dimgets(SEXP, SEXP);
SEXP Rf_dimnamesgets(SEXP, SEXP);
SEXP Rf_duplicate(SEXP);
SEXP Rf_shallow_duplicate(SEXP);
SEXP R_duplicate_attr(SEXP);
SEXP R_shallow_duplicate_attr(SEXP);
SEXP Rf_lazy_duplicate(SEXP);
/* the next really should not be here and is also in Defn.h */
SEXP Rf_duplicated(SEXP, Rboolean);
SEXP Rf_eval(SEXP, SEXP);
SEXP Rf_findFun(SEXP, SEXP);
SEXP Rf_findVar(SEXP, SEXP);
SEXP Rf_findVarInFrame(SEXP, SEXP);
SEXP Rf_findVarInFrame3(SEXP, SEXP, Rboolean);
Rboolean R_existsVarInFrame(SEXP, SEXP);
SEXP R_getVar(SEXP, SEXP, Rboolean);
SEXP R_getVarEx(SEXP, SEXP, Rboolean, SEXP);
void R_removeVarFromFrame(SEXP, SEXP);
SEXP Rf_getAttrib(SEXP, SEXP);
SEXP Rf_GetArrayDimnames(SEXP);
SEXP Rf_GetColNames(SEXP);
void Rf_GetMatrixDimnames(SEXP, SEXP*, SEXP*, const char**, const char**);
SEXP Rf_GetOption(SEXP, SEXP); /* pre-2.13.0 compatibility */
SEXP Rf_GetOption1(SEXP);
int Rf_GetOptionDigits(void);
int Rf_GetOptionWidth(void);
SEXP Rf_GetRowNames(SEXP);
void Rf_gsetVar(SEXP, SEXP, SEXP);
SEXP Rf_install(const char *);
SEXP Rf_installChar(SEXP);
SEXP Rf_installNoTrChar(SEXP);
SEXP Rf_installTrChar(SEXP);
Rboolean Rf_isOrdered(SEXP);
Rboolean Rf_isUnordered(SEXP);
Rboolean Rf_isUnsorted(SEXP, Rboolean);
Rboolean R_isTRUE(SEXP);
SEXP Rf_lengthgets(SEXP, R_len_t);
SEXP Rf_xlengthgets(SEXP, R_xlen_t);
SEXP R_lsInternal(SEXP, Rboolean);
SEXP R_lsInternal3(SEXP, Rboolean, Rboolean);
SEXP Rf_match(SEXP, SEXP, int);
SEXP Rf_namesgets(SEXP, SEXP);
SEXP Rf_mkChar(const char *);
SEXP Rf_mkCharLen(const char *, int);
Rboolean Rf_NonNullStringMatch(SEXP, SEXP);
int Rf_ncols(SEXP);
int Rf_nrows(SEXP);
SEXP Rf_nthcdr(SEXP, int);
// ../main/character.c :
typedef enum {Bytes, Chars, Width} nchar_type;
int R_nchar(SEXP string, nchar_type type_,
Rboolean allowNA, Rboolean keepNA, const char* msg_name);
SEXP R_ParseEvalString(const char *, SEXP);
SEXP R_ParseString(const char *);
void Rf_PrintValue(SEXP);
#ifndef INLINE_PROTECT
SEXP Rf_protect(SEXP);
#endif
SEXP Rf_setAttrib(SEXP, SEXP, SEXP);
void Rf_setVar(SEXP, SEXP, SEXP);
SEXPTYPE Rf_str2type(const char *);
Rboolean Rf_StringBlank(SEXP);
SEXP Rf_substitute(SEXP,SEXP);
SEXP Rf_topenv(SEXP, SEXP);
const char * Rf_translateChar(SEXP);
const char * Rf_translateCharUTF8(SEXP);
const char * Rf_type2char(SEXPTYPE);
const char * R_typeToChar(SEXP);
#ifdef USE_TYPE2CHAR_2
const char * R_typeToChar2(SEXP, SEXPTYPE);
#endif
SEXP Rf_type2rstr(SEXPTYPE);
SEXP Rf_type2str(SEXPTYPE);
SEXP Rf_type2str_nowarn(SEXPTYPE);
#ifndef INLINE_PROTECT
void Rf_unprotect(int);
#endif
void Rf_unprotect_ptr(SEXP);
#ifndef INLINE_PROTECT
void R_ProtectWithIndex(SEXP, PROTECT_INDEX *);
void R_Reprotect(SEXP, PROTECT_INDEX);
#endif
SEXP R_tryEval(SEXP, SEXP, int *);
SEXP R_tryEvalSilent(SEXP, SEXP, int *);
SEXP R_GetCurrentEnv(void);
Rboolean Rf_isS4(SEXP);
SEXP Rf_asS4(SEXP, Rboolean, int);
SEXP Rf_S3Class(SEXP);
int Rf_isBasicClass(const char *);
/* cetype_t is an identifier reseved by POSIX, but it is
well established as public. Could remap by a #define though */
typedef enum {
CE_NATIVE = 0,
CE_UTF8 = 1,
CE_LATIN1 = 2,
CE_BYTES = 3,
CE_SYMBOL = 5,
CE_ANY =99
} cetype_t;
cetype_t Rf_getCharCE(SEXP);
Rboolean Rf_charIsASCII(SEXP);
Rboolean Rf_charIsUTF8(SEXP);
Rboolean Rf_charIsLatin1(SEXP);
SEXP Rf_mkCharCE(const char *, cetype_t);
SEXP Rf_mkCharLenCE(const char *, int, cetype_t);
const char *Rf_reEnc(const char *x, cetype_t ce_in, cetype_t ce_out, int subst);
#ifdef __MAIN__
#undef extern
#undef LibExtern
#endif
/* Calling a function with arguments evaluated */
SEXP R_forceAndCall(SEXP e, int n, SEXP rho);
/* External pointer interface */
SEXP R_MakeExternalPtr(void *p, SEXP tag, SEXP prot);
void *R_ExternalPtrAddr(SEXP s);
SEXP R_ExternalPtrTag(SEXP s);
SEXP R_ExternalPtrProtected(SEXP s);
void R_ClearExternalPtr(SEXP s);
void R_SetExternalPtrAddr(SEXP s, void *p);
void R_SetExternalPtrTag(SEXP s, SEXP tag);
void R_SetExternalPtrProtected(SEXP s, SEXP p);
// Added in R 3.4.0
SEXP R_MakeExternalPtrFn(DL_FUNC p, SEXP tag, SEXP prot);
DL_FUNC R_ExternalPtrAddrFn(SEXP s);
/* Finalization interface */
typedef void (*R_CFinalizer_t)(SEXP);
void R_RegisterFinalizer(SEXP s, SEXP fun);
void R_RegisterCFinalizer(SEXP s, R_CFinalizer_t fun);
void R_RegisterFinalizerEx(SEXP s, SEXP fun, Rboolean onexit);
void R_RegisterCFinalizerEx(SEXP s, R_CFinalizer_t fun, Rboolean onexit);
void R_RunPendingFinalizers(void);
/* Weak reference interface */
SEXP R_MakeWeakRef(SEXP key, SEXP val, SEXP fin, Rboolean onexit);
SEXP R_MakeWeakRefC(SEXP key, SEXP val, R_CFinalizer_t fin, Rboolean onexit);
SEXP R_WeakRefKey(SEXP w);
SEXP R_WeakRefValue(SEXP w);
void R_RunWeakRefFinalizer(SEXP w);
SEXP R_PromiseExpr(SEXP);
SEXP R_ClosureExpr(SEXP);
SEXP R_BytecodeExpr(SEXP e);
/* Protected evaluation */
Rboolean R_ToplevelExec(void (*fun)(void *), void *data);
SEXP R_ExecWithCleanup(SEXP (*fun)(void *), void *data,
void (*cleanfun)(void *), void *cleandata);
SEXP R_tryCatch(SEXP (*)(void *), void *, /* body closure*/
SEXP, /* condition classes (STRSXP) */
SEXP (*)(SEXP, void *), void *, /* handler closure */
void (*)(void *), void *); /* finally closure */
SEXP R_tryCatchError(SEXP (*)(void *), void *, /* body closure*/
SEXP (*)(SEXP, void *), void *); /* handler closure */
SEXP R_withCallingErrorHandler(SEXP (*)(void *), void *, /* body closure*/
SEXP (*)(SEXP, void *), void *); /* handler closure */
SEXP R_MakeUnwindCont(void);
NORET void R_ContinueUnwind(SEXP cont);
SEXP R_UnwindProtect(SEXP (*fun)(void *data), void *data,
void (*cleanfun)(void *data, Rboolean jump),
void *cleandata, SEXP cont);
/* Environment and Binding Features */
SEXP R_NewEnv(SEXP, int, int);
Rboolean R_IsPackageEnv(SEXP rho);
SEXP R_PackageEnvName(SEXP rho);
SEXP R_FindPackageEnv(SEXP info);
Rboolean R_IsNamespaceEnv(SEXP rho);
SEXP R_NamespaceEnvSpec(SEXP rho);
SEXP R_FindNamespace(SEXP info);
void R_LockEnvironment(SEXP env, Rboolean bindings);
Rboolean R_EnvironmentIsLocked(SEXP env);
void R_LockBinding(SEXP sym, SEXP env);
void R_unLockBinding(SEXP sym, SEXP env);
void R_MakeActiveBinding(SEXP sym, SEXP fun, SEXP env);
Rboolean R_BindingIsLocked(SEXP sym, SEXP env);
Rboolean R_BindingIsActive(SEXP sym, SEXP env);
SEXP R_ActiveBindingFunction(SEXP sym, SEXP env);
Rboolean R_HasFancyBindings(SEXP rho);
/* ../main/errors.c : */
/* needed for R_load/savehistory handling in front ends */
NORET void Rf_errorcall(SEXP, const char *, ...) R_PRINTF_FORMAT(2, 3);
void Rf_warningcall(SEXP, const char *, ...) R_PRINTF_FORMAT(2, 3);
void Rf_warningcall_immediate(SEXP, const char *, ...) R_PRINTF_FORMAT(2, 3);
/* Save/Load Interface */
#define R_XDR_DOUBLE_SIZE 8
#define R_XDR_INTEGER_SIZE 4
void R_XDREncodeDouble(double d, void *buf);
double R_XDRDecodeDouble(void *buf);
void R_XDREncodeInteger(int i, void *buf);
int R_XDRDecodeInteger(void *buf);
typedef void *R_pstream_data_t;
typedef enum {
R_pstream_any_format,
R_pstream_ascii_format,
R_pstream_binary_format,
R_pstream_xdr_format,
R_pstream_asciihex_format
} R_pstream_format_t;
typedef struct R_outpstream_st *R_outpstream_t;
struct R_outpstream_st {
R_pstream_data_t data;
R_pstream_format_t type;
int version;
void (*OutChar)(R_outpstream_t, int);
void (*OutBytes)(R_outpstream_t, void *, int);
SEXP (*OutPersistHookFunc)(SEXP, SEXP);
SEXP OutPersistHookData;
};
typedef struct R_inpstream_st *R_inpstream_t;
#define R_CODESET_MAX 63
struct R_inpstream_st {
R_pstream_data_t data;
R_pstream_format_t type;
int (*InChar)(R_inpstream_t);
void (*InBytes)(R_inpstream_t, void *, int);
SEXP (*InPersistHookFunc)(SEXP, SEXP);
SEXP InPersistHookData;
char native_encoding[R_CODESET_MAX + 1];
void *nat2nat_obj;
void *nat2utf8_obj;
};
void R_InitInPStream(R_inpstream_t stream, R_pstream_data_t data,
R_pstream_format_t type,
int (*inchar)(R_inpstream_t),
void (*inbytes)(R_inpstream_t, void *, int),
SEXP (*phook)(SEXP, SEXP), SEXP pdata);
void R_InitOutPStream(R_outpstream_t stream, R_pstream_data_t data,
R_pstream_format_t type, int version,
void (*outchar)(R_outpstream_t, int),
void (*outbytes)(R_outpstream_t, void *, int),
SEXP (*phook)(SEXP, SEXP), SEXP pdata);
#ifdef __cplusplus
void R_InitFileInPStream(R_inpstream_t stream, std::FILE *fp,
R_pstream_format_t type,
SEXP (*phook)(SEXP, SEXP), SEXP pdata);
void R_InitFileOutPStream(R_outpstream_t stream, std::FILE *fp,
R_pstream_format_t type, int version,
SEXP (*phook)(SEXP, SEXP), SEXP pdata);
#else
void R_InitFileInPStream(R_inpstream_t stream, FILE *fp,
R_pstream_format_t type,
SEXP (*phook)(SEXP, SEXP), SEXP pdata);
void R_InitFileOutPStream(R_outpstream_t stream, FILE *fp,
R_pstream_format_t type, int version,
SEXP (*phook)(SEXP, SEXP), SEXP pdata);
#endif
#ifdef NEED_CONNECTION_PSTREAMS
/* The connection interface is not available to packages. To
allow limited use of connection pointers this defines the opaque
pointer type. */
#ifndef HAVE_RCONNECTION_TYPEDEF
typedef struct Rconn *Rconnection;
#define HAVE_RCONNECTION_TYPEDEF
#endif
void R_InitConnOutPStream(R_outpstream_t stream, Rconnection con,
R_pstream_format_t type, int version,
SEXP (*phook)(SEXP, SEXP), SEXP pdata);
void R_InitConnInPStream(R_inpstream_t stream, Rconnection con,
R_pstream_format_t type,
SEXP (*phook)(SEXP, SEXP), SEXP pdata);
#endif
void R_Serialize(SEXP s, R_outpstream_t ops);
SEXP R_Unserialize(R_inpstream_t ips);
/* slot management (in attrib.c) */
SEXP R_do_slot(SEXP obj, SEXP name);
SEXP R_do_slot_assign(SEXP obj, SEXP name, SEXP value);
int R_has_slot(SEXP obj, SEXP name);
/* S3-S4 class (inheritance), attrib.c */
SEXP R_S4_extends(SEXP klass, SEXP useTable);
/* class definition, new objects (objects.c) */
SEXP R_do_MAKE_CLASS(const char *what);
SEXP R_getClassDef (const char *what);
SEXP R_getClassDef_R(SEXP what);
Rboolean R_has_methods_attached(void);
Rboolean R_isVirtualClass(SEXP class_def, SEXP env);
Rboolean R_extends (SEXP class1, SEXP class2, SEXP env);
SEXP R_do_new_object(SEXP class_def);
/* supporting a C-level version of is(., .) : */
int R_check_class_and_super(SEXP x, const char **valid, SEXP rho);
int R_check_class_etc (SEXP x, const char **valid);
/* preserve objects across GCs */
void R_PreserveObject(SEXP);
void R_ReleaseObject(SEXP);
SEXP R_NewPreciousMSet(int);
void R_PreserveInMSet(SEXP x, SEXP mset);
void R_ReleaseFromMSet(SEXP x, SEXP mset);
/* Shutdown actions */
void R_dot_Last(void); /* in main.c */
void R_RunExitFinalizers(void); /* in memory.c */
/* Replacements for popen and system */
#ifdef HAVE_POPEN
# ifdef __cplusplus
std::FILE *R_popen(const char *, const char *);
# else
FILE *R_popen(const char *, const char *);
# endif
#endif
int R_system(const char *);
/* R_compute_identical: C version of identical() function
The third arg to R_compute_identical() consists of bitmapped flags for non-default options:
currently the first 4 default to TRUE, so the flag is set for FALSE values:
1 = !NUM_EQ = IDENT_NUM_AS_BITS
2 = !SINGLE_NA = IDENT_NA_AS_BITS
4 = !ATTR_AS_SET = IDENT_ATTR_BY_ORDER
8 = !IGNORE_BYTECODE = IDENT_USE_BYTECODE
16 = !IGNORE_ENV = IDENT_USE_CLOENV
32 = !IGNORE_SRCREF = IDENT_USE_SRCREF
64 = IDENT_EXTPTR_AS_REF
Default from R's default: 16 = IDENT_USE_CLOENV
*/
#define IDENT_NUM_AS_BITS 1
#define IDENT_NA_AS_BITS 2
#define IDENT_ATTR_BY_ORDER 4
#define IDENT_USE_BYTECODE 8
#define IDENT_USE_CLOENV 16
#define IDENT_USE_SRCREF 32
#define IDENT_EXTPTR_AS_REF 64
Rboolean R_compute_identical(SEXP, SEXP, int);
SEXP R_body_no_src(SEXP x); // body(x) without "srcref" etc, ../main/utils.c
/* C version of R's indx <- order(..., na.last, decreasing) :
e.g. arglist = Rf_lang2(x,y) or Rf_lang3(x,y,z) */
void R_orderVector (int *indx, int n, SEXP arglist, Rboolean nalast, Rboolean decreasing);
// C version of R's indx <- order(x, na.last, decreasing) :
void R_orderVector1(int *indx, int n, SEXP x, Rboolean nalast, Rboolean decreasing);
#ifndef R_NO_REMAP
#define acopy_string Rf_acopy_string
#define addMissingVarsToNewEnv Rf_addMissingVarsToNewEnv
#define alloc3DArray Rf_alloc3DArray
#define allocArray Rf_allocArray
#define allocFormalsList2 Rf_allocFormalsList2
#define allocFormalsList3 Rf_allocFormalsList3
#define allocFormalsList4 Rf_allocFormalsList4
#define allocFormalsList5 Rf_allocFormalsList5
#define allocFormalsList6 Rf_allocFormalsList6
#define allocLang Rf_allocLang
#define allocList Rf_allocList
#define allocMatrix Rf_allocMatrix
#define allocS4Object Rf_allocS4Object
#define allocSExp Rf_allocSExp
#define allocVector Rf_allocVector
#define allocVector3 Rf_allocVector3
#define any_duplicated Rf_any_duplicated
#define any_duplicated3 Rf_any_duplicated3
#define applyClosure Rf_applyClosure
#define arraySubscript Rf_arraySubscript
#define asChar Rf_asChar
#define asCharacterFactor Rf_asCharacterFactor
#define asComplex Rf_asComplex
#define asInteger Rf_asInteger
#define asLogical Rf_asLogical
#define asLogical2 Rf_asLogical2
#define asReal Rf_asReal
#define asS4 Rf_asS4
#define charIsASCII Rf_charIsASCII
#define charIsUTF8 Rf_charIsUTF8
#define charIsLatin1 Rf_charIsLatin1
#define classgets Rf_classgets
#define coerceVector Rf_coerceVector
#define conformable Rf_conformable
#define cons Rf_cons
#define fixSubset3Args Rf_fixSubset3Args
#define copyListMatrix Rf_copyListMatrix
#define copyMatrix Rf_copyMatrix
#define copyMostAttrib Rf_copyMostAttrib
#define copyVector Rf_copyVector
#define countContexts Rf_countContexts
#define CreateTag Rf_CreateTag
#define defineVar Rf_defineVar
#define dimgets Rf_dimgets
#define dimnamesgets Rf_dimnamesgets
#define DropDims Rf_DropDims
#define duplicate Rf_duplicate
#define duplicated Rf_duplicated
#define elt Rf_elt
#define errorcall Rf_errorcall
#define eval Rf_eval
#define ExtractSubset Rf_ExtractSubset
#define findFun Rf_findFun
#define findFun3 Rf_findFun3
#define findFunctionForBody Rf_findFunctionForBody
#define findVar Rf_findVar
#define findVarInFrame Rf_findVarInFrame
#define findVarInFrame3 Rf_findVarInFrame3
#define FixupDigits Rf_FixupDigits
#define FixupWidth Rf_FixupWidth
#define GetArrayDimnames Rf_GetArrayDimnames
#define getAttrib Rf_getAttrib
#define getCharCE Rf_getCharCE
#define GetColNames Rf_GetColNames
#define GetMatrixDimnames Rf_GetMatrixDimnames
#define GetOption1 Rf_GetOption1
#define GetOptionDigits Rf_GetOptionDigits
#define GetOptionWidth Rf_GetOptionWidth
#define GetOption Rf_GetOption
#define GetRowNames Rf_GetRowNames
#define gsetVar Rf_gsetVar
#define inherits Rf_inherits
#define install Rf_install
#define installChar Rf_installTrChar
#define installNoTrChar Rf_installNoTrChar
#define installTrChar Rf_installTrChar
#define installDDVAL Rf_installDDVAL
#define installS3Signature Rf_installS3Signature
#define isArray Rf_isArray
#define isBasicClass Rf_isBasicClass
#define isComplex Rf_isComplex
#define isDataFrame Rf_isDataFrame
#define isEnvironment Rf_isEnvironment
#define isExpression Rf_isExpression
#define isFactor Rf_isFactor
#define isFrame Rf_isFrame
#define isFree Rf_isFree
#define isFunction Rf_isFunction
#define isInteger Rf_isInteger
#define isLanguage Rf_isLanguage
#define isList Rf_isList
#define isLogical Rf_isLogical
#define isSymbol Rf_isSymbol
#define isMatrix Rf_isMatrix
#define isNewList Rf_isNewList
#define isNull Rf_isNull
#define isNumeric Rf_isNumeric
#define isNumber Rf_isNumber
#define isObject Rf_isObject
#define isOrdered Rf_isOrdered
#define isPairList Rf_isPairList
#define isPrimitive Rf_isPrimitive
#define isReal Rf_isReal
#define isS4 Rf_isS4
#define isString Rf_isString
#define isTs Rf_isTs
#define isUnmodifiedSpecSym Rf_isUnmodifiedSpecSym
#define isUnordered Rf_isUnordered
#define isUnsorted Rf_isUnsorted
#define isUserBinop Rf_isUserBinop
#define isValidString Rf_isValidString
#define isValidStringF Rf_isValidStringF
#define isVector Rf_isVector
#define isVectorAtomic Rf_isVectorAtomic
#define isVectorizable Rf_isVectorizable
#define isVectorList Rf_isVectorList
#define lang1 Rf_lang1
#define lang2 Rf_lang2
#define lang3 Rf_lang3
#define lang4 Rf_lang4
#define lang5 Rf_lang5
#define lang6 Rf_lang6
#define lastElt Rf_lastElt
#define lazy_duplicate Rf_lazy_duplicate