From d7f36f9f081369ea817fb370c217d19d230fa7ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sun, 8 Dec 2024 13:48:01 +0100 Subject: [PATCH] chore: Use `Rf_` prefix in all function definitions for better IDE navigation --- src/include/Defn.h | 6 +++--- src/main/array.c | 12 ++++++------ src/main/attrib.c | 20 ++++++++++---------- src/main/builtin.c | 4 ++-- src/main/character.c | 2 +- src/main/coerce.c | 22 +++++++++++----------- src/main/context.c | 2 +- src/main/duplicate.c | 12 ++++++------ src/main/envir.c | 34 +++++++++++++++++----------------- src/main/errors.c | 10 +++++----- src/main/eval.c | 4 ++-- src/main/main.c | 2 +- src/main/match.c | 6 +++--- src/main/memory.c | 28 ++++++++++++++-------------- src/main/names.c | 8 ++++---- src/main/objects.c | 6 +++--- src/main/options.c | 12 ++++++------ src/main/print.c | 2 +- src/main/sort.c | 2 +- src/main/subset.c | 2 +- src/main/sysutils.c | 10 +++++----- src/main/unique.c | 10 +++++----- src/main/util.c | 24 ++++++++++++------------ 23 files changed, 120 insertions(+), 120 deletions(-) diff --git a/src/include/Defn.h b/src/include/Defn.h index 73b5e887e7e..23ea9c6a638 100644 --- a/src/include/Defn.h +++ b/src/include/Defn.h @@ -2027,9 +2027,9 @@ int DispatchGroup(const char *, SEXP,SEXP,SEXP,SEXP,SEXP*); R_xlen_t dispatch_xlength(SEXP, SEXP, SEXP); R_len_t dispatch_length(SEXP, SEXP, SEXP); SEXP dispatch_subset2(SEXP, R_xlen_t, SEXP, SEXP); -SEXP duplicated(SEXP, Rboolean); -R_xlen_t any_duplicated(SEXP, Rboolean); -R_xlen_t any_duplicated3(SEXP, SEXP, Rboolean); +SEXP Rf_duplicated(SEXP, Rboolean); +R_xlen_t Rf_any_duplicated(SEXP, Rboolean); +R_xlen_t Rf_any_duplicated3(SEXP, SEXP, Rboolean); SEXP evalList(SEXP, SEXP, SEXP, int); SEXP evalListKeepMissing(SEXP, SEXP); int factorsConform(SEXP, SEXP); diff --git a/src/main/array.c b/src/main/array.c index 03167cc2e6d..290eee78674 100644 --- a/src/main/array.c +++ b/src/main/array.c @@ -62,7 +62,7 @@ They are used in bind.c and subset.c, and advertised in Rinternals.h */ -SEXP GetRowNames(SEXP dimnames) +SEXP Rf_GetRowNames(SEXP dimnames) { if (TYPEOF(dimnames) == VECSXP) return VECTOR_ELT(dimnames, 0); @@ -70,7 +70,7 @@ SEXP GetRowNames(SEXP dimnames) return R_NilValue; } -SEXP GetColNames(SEXP dimnames) +SEXP Rf_GetColNames(SEXP dimnames) { if (TYPEOF(dimnames) == VECSXP) return VECTOR_ELT(dimnames, 1); @@ -228,7 +228,7 @@ attribute_hidden SEXP do_matrix(SEXP call, SEXP op, SEXP args, SEXP rho) } -SEXP allocMatrix(SEXPTYPE mode, int nrow, int ncol) +SEXP Rf_allocMatrix(SEXPTYPE mode, int nrow, int ncol) { SEXP s, t; R_xlen_t n; @@ -259,7 +259,7 @@ SEXP allocMatrix(SEXPTYPE mode, int nrow, int ncol) * * @return A 3-dimensional array of the indicated dimensions and mode */ -SEXP alloc3DArray(SEXPTYPE mode, int nrow, int ncol, int nface) +SEXP Rf_alloc3DArray(SEXPTYPE mode, int nrow, int ncol, int nface) { SEXP s, t; R_xlen_t n; @@ -282,7 +282,7 @@ SEXP alloc3DArray(SEXPTYPE mode, int nrow, int ncol, int nface) } -SEXP allocArray(SEXPTYPE mode, SEXP dims) +SEXP Rf_allocArray(SEXPTYPE mode, SEXP dims) { SEXP array; int i; @@ -313,7 +313,7 @@ SEXP allocArray(SEXPTYPE mode, SEXP dims) /* attribute. Note that this function mutates x. */ /* Duplication should occur before this is called. */ -attribute_hidden SEXP DropDims(SEXP x) +attribute_hidden SEXP Rf_DropDims(SEXP x) { PROTECT(x); SEXP dims = getAttrib(x, R_DimSymbol); diff --git a/src/main/attrib.c b/src/main/attrib.c index 08930764401..f652c70a813 100644 --- a/src/main/attrib.c +++ b/src/main/attrib.c @@ -163,7 +163,7 @@ attribute_hidden SEXP getAttrib0(SEXP vec, SEXP name) return R_NilValue; } -SEXP getAttrib(SEXP vec, SEXP name) +SEXP Rf_getAttrib(SEXP vec, SEXP name) { if(TYPEOF(vec) == CHARSXP) error("cannot have attributes on a CHARSXP"); @@ -227,7 +227,7 @@ SEXP do_copyDFattr(SEXP call, SEXP op, SEXP args, SEXP env) /* 'name' should be 1-element STRSXP or SYMSXP */ -SEXP setAttrib(SEXP vec, SEXP name, SEXP val) +SEXP Rf_setAttrib(SEXP vec, SEXP name, SEXP val) { PROTECT(vec); PROTECT(name); @@ -277,7 +277,7 @@ SEXP setAttrib(SEXP vec, SEXP name, SEXP val) /* the output. Note that the Dim and Names attributes */ /* should have been assigned elsewhere. */ -void copyMostAttrib(SEXP inp, SEXP ans) +void Rf_copyMostAttrib(SEXP inp, SEXP ans) { SEXP s; @@ -512,7 +512,7 @@ attribute_hidden SEXP do_comment(SEXP call, SEXP op, SEXP args, SEXP env) /* *Not* called from class(.) <- v, nor oldClass(.) <- v, but * e.g. from attr(x, "class") <- value plus our own C, e.g. ./connections.c */ -SEXP classgets(SEXP vec, SEXP klass) +SEXP Rf_classgets(SEXP vec, SEXP klass) { if (isNull(klass) || isString(klass)) { int ncl = length(klass); @@ -952,7 +952,7 @@ attribute_hidden SEXP do_namesgets(SEXP call, SEXP op, SEXP args, SEXP env) return CAR(args); } -SEXP namesgets(SEXP vec, SEXP val) +SEXP Rf_namesgets(SEXP vec, SEXP val) { int i; SEXP s, rval, tval; @@ -1083,7 +1083,7 @@ static SEXP as_char_simpl(SEXP val1) } -SEXP dimnamesgets(SEXP vec, SEXP val) +SEXP Rf_dimnamesgets(SEXP vec, SEXP val) { PROTECT(vec); PROTECT(val); @@ -1213,7 +1213,7 @@ attribute_hidden SEXP do_dimgets(SEXP call, SEXP op, SEXP args, SEXP env) } // called from setAttrib(vec, R_DimSymbol, val) : -SEXP dimgets(SEXP vec, SEXP val) +SEXP Rf_dimgets(SEXP vec, SEXP val) { PROTECT(vec); PROTECT(val); @@ -1669,7 +1669,7 @@ attribute_hidden SEXP do_attrgets(SEXP call, SEXP op, SEXP args, SEXP env) /* the dimnames for matrices and arrays in a standard form. */ /* NB: this may return R_alloc-ed rn and dn */ -void GetMatrixDimnames(SEXP x, SEXP *rl, SEXP *cl, +void Rf_GetMatrixDimnames(SEXP x, SEXP *rl, SEXP *cl, const char **rn, const char **cn) { SEXP dimnames = getAttrib(x, R_DimNamesSymbol); @@ -1697,7 +1697,7 @@ void GetMatrixDimnames(SEXP x, SEXP *rl, SEXP *cl, } -SEXP GetArrayDimnames(SEXP x) +SEXP Rf_GetArrayDimnames(SEXP x) { return getAttrib(x, R_DimNamesSymbol); } @@ -1760,7 +1760,7 @@ static SEXP set_data_part(SEXP obj, SEXP rhs) { return(val); } -attribute_hidden SEXP S3Class(SEXP obj) +attribute_hidden SEXP Rf_S3Class(SEXP obj) { if(!s_dot_S3Class) init_slot_handling(); return getAttrib(obj, s_dot_S3Class); diff --git a/src/main/builtin.c b/src/main/builtin.c index 0ddd8760a63..b079503f09d 100644 --- a/src/main/builtin.c +++ b/src/main/builtin.c @@ -829,7 +829,7 @@ attribute_hidden SEXP do_makevector(SEXP call, SEXP op, SEXP args, SEXP rho) /* clever with memory here if we wanted to. */ /* used in connections.c, attrib.c, seq.c, .. */ -SEXP xlengthgets(SEXP x, R_xlen_t len) +SEXP Rf_xlengthgets(SEXP x, R_xlen_t len) { R_xlen_t lenx, i; SEXP rval, names, xnames, t; @@ -927,7 +927,7 @@ SEXP xlengthgets(SEXP x, R_xlen_t len) } /* older version */ -SEXP lengthgets(SEXP x, R_len_t len) +SEXP Rf_lengthgets(SEXP x, R_len_t len) { return xlengthgets(x, (R_xlen_t) len); } diff --git a/src/main/character.c b/src/main/character.c index 6cb3b3c4b0d..780898a4878 100644 --- a/src/main/character.c +++ b/src/main/character.c @@ -1792,7 +1792,7 @@ attribute_hidden SEXP do_strtoi(SEXP call, SEXP op, SEXP args, SEXP env) /* creates a new STRSXP which is a suffix of string, starting with given index; the result is returned unprotected */ -attribute_hidden SEXP stringSuffix(SEXP string, int fromIndex) { +attribute_hidden SEXP Rf_stringSuffix(SEXP string, int fromIndex) { int origLen = LENGTH(string); int newLen = origLen - fromIndex; diff --git a/src/main/coerce.c b/src/main/coerce.c index c81a87b3b5f..9970569d1c7 100644 --- a/src/main/coerce.c +++ b/src/main/coerce.c @@ -368,7 +368,7 @@ static SEXP StringFromRaw(Rbyte x, int *warn) /* Conversion between the two list types (LISTSXP and VECSXP). */ -SEXP PairToVectorList(SEXP x) +SEXP Rf_PairToVectorList(SEXP x) { SEXP xptr, xnew, xnames; int i, len = 0, named = 0; @@ -399,7 +399,7 @@ SEXP PairToVectorList(SEXP x) return xnew; } -SEXP VectorToPairList(SEXP x) +SEXP Rf_VectorToPairList(SEXP x) { SEXP xptr, xnew, xnames; int i, len, named; @@ -1180,7 +1180,7 @@ static SEXP coerceSymbol(SEXP v, SEXPTYPE type) return rval; } -SEXP coerceVector(SEXP v, SEXPTYPE type) +SEXP Rf_coerceVector(SEXP v, SEXPTYPE type) { if (TYPEOF(v) == type) return v; @@ -1330,7 +1330,7 @@ SEXP coerceVector(SEXP v, SEXPTYPE type) #undef COERCE_ERROR -attribute_hidden SEXP CreateTag(SEXP x) +attribute_hidden SEXP Rf_CreateTag(SEXP x) { if (isNull(x) || isSymbol(x)) return x; @@ -1444,7 +1444,7 @@ attribute_hidden SEXP do_asCharacterFactor(SEXP call, SEXP op, SEXP args, } /* used in attrib.c, eval.c and unique.c */ -SEXP asCharacterFactor(SEXP x) +SEXP Rf_asCharacterFactor(SEXP x) { SEXP ans; @@ -1802,7 +1802,7 @@ attribute_hidden SEXP do_ascall(SEXP call, SEXP op, SEXP args, SEXP rho) /* return int, not Rboolean, for NA_LOGICAL : */ -attribute_hidden int asLogical2(SEXP x, int checking, SEXP call) +attribute_hidden int Rf_asLogical2(SEXP x, int checking, SEXP call) { int warn = 0; @@ -1834,13 +1834,13 @@ attribute_hidden int asLogical2(SEXP x, int checking, SEXP call) return NA_LOGICAL; } -int asLogical(SEXP x) +int Rf_asLogical(SEXP x) { return asLogical2(x, /* checking = */ 0, R_NilValue); } -int asInteger(SEXP x) +int Rf_asInteger(SEXP x) { int warn = 0, res; @@ -1908,7 +1908,7 @@ R_xlen_t asXLength(SEXP x) return (R_xlen_t) d; } -double asReal(SEXP x) +double Rf_asReal(SEXP x) { int warn = 0; double res; @@ -1944,7 +1944,7 @@ double asReal(SEXP x) return NA_REAL; } -Rcomplex asComplex(SEXP x) +Rcomplex Rf_asComplex(SEXP x) { int warn = 0; Rcomplex z; @@ -2795,7 +2795,7 @@ attribute_hidden SEXP do_docall(SEXP call, SEXP op, SEXP args, SEXP rho) Arguments to do_substitute should not be evaluated. */ -SEXP substitute(SEXP lang, SEXP rho) +SEXP Rf_substitute(SEXP lang, SEXP rho) { SEXP t; switch (TYPEOF(lang)) { diff --git a/src/main/context.c b/src/main/context.c index 4a9e980a2eb..2faf9f0d3c1 100644 --- a/src/main/context.c +++ b/src/main/context.c @@ -531,7 +531,7 @@ attribute_hidden SEXP R_sysfunction(int n, RCNTXT *cptr) /* browser contexts are a bit special because they are transient and for */ /* any closure context with the debug bit set one will be created; so we */ /* need to count those as well */ -attribute_hidden int countContexts(int ctxttype, int browser) { +attribute_hidden int Rf_countContexts(int ctxttype, int browser) { int n=0; RCNTXT *cptr; diff --git a/src/main/duplicate.c b/src/main/duplicate.c index a434b4f3741..6bab192aa4e 100644 --- a/src/main/duplicate.c +++ b/src/main/duplicate.c @@ -130,7 +130,7 @@ attribute_hidden void reset_duplicate_counter(void) } #endif -SEXP duplicate(SEXP s){ +SEXP Rf_duplicate(SEXP s){ SEXP t; #ifdef R_PROFILING @@ -148,7 +148,7 @@ SEXP duplicate(SEXP s){ return t; } -SEXP shallow_duplicate(SEXP s) +SEXP Rf_shallow_duplicate(SEXP s) { SEXP t; @@ -167,7 +167,7 @@ SEXP shallow_duplicate(SEXP s) return t; } -SEXP lazy_duplicate(SEXP s) { +SEXP Rf_lazy_duplicate(SEXP s) { switch (TYPEOF(s)) { case NILSXP: case SYMSXP: @@ -371,7 +371,7 @@ static SEXP duplicate1(SEXP s, Rboolean deep) return t; } -void copyVector(SEXP s, SEXP t) +void Rf_copyVector(SEXP s, SEXP t) { SEXPTYPE sT = TYPEOF(s), tT = TYPEOF(t); if (sT != tT) @@ -405,7 +405,7 @@ void copyVector(SEXP s, SEXP t) } } -void copyListMatrix(SEXP s, SEXP t, Rboolean byrow) +void Rf_copyListMatrix(SEXP s, SEXP t, Rboolean byrow) { int nr = nrows(s), nc = ncols(s); R_xlen_t ns = ((R_xlen_t) nr) * nc; @@ -440,7 +440,7 @@ static R_INLINE SEXP VECTOR_ELT_LD(SEXP x, R_xlen_t i) return lazy_duplicate(VECTOR_ELT(x, i)); } -void copyMatrix(SEXP s, SEXP t, Rboolean byrow) +void Rf_copyMatrix(SEXP s, SEXP t, Rboolean byrow) { int nr = nrows(s), nc = ncols(s); R_xlen_t nt = XLENGTH(t); diff --git a/src/main/envir.c b/src/main/envir.c index fc6e26dd67b..0a86c01a6ba 100644 --- a/src/main/envir.c +++ b/src/main/envir.c @@ -991,7 +991,7 @@ void R_SetVarLocValue(R_varloc_t vl, SEXP value) symbol in this frame (FALSE). This is used for get() and exists(). */ -SEXP findVarInFrame3(SEXP rho, SEXP symbol, Rboolean doGet) +SEXP Rf_findVarInFrame3(SEXP rho, SEXP symbol, Rboolean doGet) { int hashcode; SEXP frame, c; @@ -1096,7 +1096,7 @@ attribute_hidden SEXP R_findVarInFrame(SEXP rho, SEXP symbol) return findVarInFrame3(rho, symbol, TRUE); } -SEXP findVarInFrame(SEXP rho, SEXP symbol) +SEXP Rf_findVarInFrame(SEXP rho, SEXP symbol) { return R_findVarInFrame(rho, symbol); } @@ -1113,7 +1113,7 @@ SEXP findVarInFrame(SEXP rho, SEXP symbol) */ attribute_hidden -void readS3VarsFromFrame(SEXP rho, +void Rf_readS3VarsFromFrame(SEXP rho, SEXP *dotGeneric, SEXP *dotGroup, SEXP *dotClass, SEXP *dotMethod, SEXP *dotGenericCallEnv, SEXP *dotGenericDefEnv) { @@ -1249,7 +1249,7 @@ attribute_hidden SEXP R_findVar(SEXP symbol, SEXP rho) #endif } -SEXP findVar(SEXP symbol, SEXP rho) +SEXP Rf_findVar(SEXP symbol, SEXP rho) { return R_findVar(symbol, rho); } @@ -1549,7 +1549,7 @@ SEXP dynamicfindVar(SEXP symbol, RCNTXT *cptr) */ attribute_hidden -SEXP findFun3(SEXP symbol, SEXP rho, SEXP call) +SEXP Rf_findFun3(SEXP symbol, SEXP rho, SEXP call) { SEXP vl; @@ -1603,7 +1603,7 @@ SEXP findFun3(SEXP symbol, SEXP rho, SEXP call) return R_UnboundValue; } -SEXP findFun(SEXP symbol, SEXP rho) +SEXP Rf_findFun(SEXP symbol, SEXP rho) { return findFun3(symbol, rho, R_CurrentExpression); } @@ -1616,7 +1616,7 @@ SEXP findFun(SEXP symbol, SEXP rho) */ -void defineVar(SEXP symbol, SEXP value, SEXP rho) +void Rf_defineVar(SEXP symbol, SEXP value, SEXP rho) { int hashcode; SEXP frame, c; @@ -1699,7 +1699,7 @@ void defineVar(SEXP symbol, SEXP value, SEXP rho) */ attribute_hidden -void addMissingVarsToNewEnv(SEXP env, SEXP addVars) +void Rf_addMissingVarsToNewEnv(SEXP env, SEXP addVars) { if (addVars == R_NilValue) return; @@ -1821,7 +1821,7 @@ static SEXP setVarInFrame(SEXP rho, SEXP symbol, SEXP value) */ -void setVar(SEXP symbol, SEXP value, SEXP rho) +void Rf_setVar(SEXP symbol, SEXP value, SEXP rho) { SEXP vl; while (rho != R_EmptyEnv) { @@ -1843,7 +1843,7 @@ void setVar(SEXP symbol, SEXP value, SEXP rho) */ -void gsetVar(SEXP symbol, SEXP value, SEXP rho) +void Rf_gsetVar(SEXP symbol, SEXP value, SEXP rho) { if (FRAME_IS_LOCKED(rho)) { if(SYMVALUE(symbol) == R_UnboundValue) @@ -4094,7 +4094,7 @@ attribute_hidden SEXP do_envprofile(SEXP call, SEXP op, SEXP args, SEXP rho) return ans; } -SEXP mkCharCE(const char *name, cetype_t enc) +SEXP Rf_mkCharCE(const char *name, cetype_t enc) { size_t len = strlen(name); if (len > INT_MAX) @@ -4103,12 +4103,12 @@ SEXP mkCharCE(const char *name, cetype_t enc) } /* no longer used in R but documented in 2.7.x */ -SEXP mkCharLen(const char *name, int len) +SEXP Rf_mkCharLen(const char *name, int len) { return mkCharLenCE(name, len, CE_NATIVE); } -SEXP mkChar(const char *name) +SEXP Rf_mkChar(const char *name) { size_t len = strlen(name); if (len > INT_MAX) @@ -4288,7 +4288,7 @@ static void reportInvalidString(SEXP cval, int actionWhenInvalid) the global CHARSXP cache, R_StringHash, it is returned. Otherwise, a new CHARSXP is created, added to the cache and then returned. */ -SEXP mkCharLenCE(const char *name, int len, cetype_t enc) +SEXP Rf_mkCharLenCE(const char *name, int len, cetype_t enc) { SEXP cval, chain; unsigned int hashcode; @@ -4522,7 +4522,7 @@ void do_write_cache() // topenv -SEXP topenv(SEXP target, SEXP envir) { +SEXP Rf_topenv(SEXP target, SEXP envir) { SEXP env = envir; while (env != R_EmptyEnv) { if (env == target || env == R_GlobalEnv || @@ -4552,7 +4552,7 @@ attribute_hidden SEXP do_topenv(SEXP call, SEXP op, SEXP args, SEXP rho) { return topenv(target, envir); } -Rboolean attribute_hidden isUnmodifiedSpecSym(SEXP sym, SEXP env) { +Rboolean attribute_hidden Rf_isUnmodifiedSpecSym(SEXP sym, SEXP env) { if (!IS_SPECIAL_SYMBOL(sym)) return FALSE; for(;env != R_EmptyEnv; env = ENCLOS(env)) @@ -4613,7 +4613,7 @@ void findFunctionForBodyInNamespace(SEXP body, SEXP nsenv, SEXP nsname) { /* findFunctionForBody - for a given function body, try to find a closure and the name of its binding (and the name of the package). For debugging. */ -attribute_hidden void findFunctionForBody(SEXP body) { +attribute_hidden void Rf_findFunctionForBody(SEXP body) { SEXP nstable = HASHTAB(R_NamespaceRegistry); CHECK_HASH_TABLE(nstable); int n = length(nstable); diff --git a/src/main/errors.c b/src/main/errors.c index 9a8fd45bac6..7249b17d09d 100644 --- a/src/main/errors.c +++ b/src/main/errors.c @@ -391,7 +391,7 @@ static SEXP getCurrentCall(void) return c ? c->call : R_NilValue; } -void warning(const char *format, ...) +void Rf_warning(const char *format, ...) { char buf[BUFSIZE], *p; @@ -555,7 +555,7 @@ static void warningcall_dflt(SEXP call, const char *format,...) va_end(ap); } -void warningcall(SEXP call, const char *format, ...) +void Rf_warningcall(SEXP call, const char *format, ...) { va_list(ap); va_start(ap, format); @@ -563,7 +563,7 @@ void warningcall(SEXP call, const char *format, ...) va_end(ap); } -void warningcall_immediate(SEXP call, const char *format, ...) +void Rf_warningcall_immediate(SEXP call, const char *format, ...) { va_list(ap); @@ -908,7 +908,7 @@ NORET static void errorcall_dflt(SEXP call, const char *format,...) va_end(ap); } -NORET void errorcall(SEXP call, const char *format,...) +NORET void Rf_errorcall(SEXP call, const char *format,...) { va_list(ap); @@ -950,7 +950,7 @@ attribute_hidden SEXP do_geterrmessage(SEXP call, SEXP op, SEXP args, SEXP env) return res; } -void error(const char *format, ...) +void Rf_error(const char *format, ...) { char buf[BUFSIZE]; diff --git a/src/main/eval.c b/src/main/eval.c index 879d7679a31..692276f1c19 100644 --- a/src/main/eval.c +++ b/src/main/eval.c @@ -1079,7 +1079,7 @@ static void handle_eval_depth_overflow(void) /* Return value of "e" evaluated in "rho". */ /* some places, e.g. deparse2buff, call this with a promise and rho = NULL */ -SEXP eval(SEXP e, SEXP rho) +SEXP Rf_eval(SEXP e, SEXP rho) { SEXP op, tmp; static int evalcount = 0; @@ -2322,7 +2322,7 @@ static SEXP applyClosure_core(SEXP call, SEXP op, SEXP arglist, SEXP rho, } attribute_hidden -SEXP applyClosure(SEXP call, SEXP op, SEXP arglist, SEXP rho, +SEXP Rf_applyClosure(SEXP call, SEXP op, SEXP arglist, SEXP rho, SEXP suppliedvars, Rboolean unpromise) { SEXP val = applyClosure_core(call, op, arglist, rho, diff --git a/src/main/main.c b/src/main/main.c index 81698d00329..d9cb6ed19e2 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -1229,7 +1229,7 @@ void mainloop(void) /*this functionality now appears in 3 places-jump_to_toplevel/profile/here */ -attribute_hidden void printwhere(void) +attribute_hidden void Rf_printwhere(void) { RCNTXT *cptr; int lct = 1; diff --git a/src/main/match.c b/src/main/match.c index e5c9a0a0d0b..5d0b2a64002 100644 --- a/src/main/match.c +++ b/src/main/match.c @@ -46,7 +46,7 @@ /* used in subscript.c and subassign.c */ -Rboolean NonNullStringMatch(SEXP s, SEXP t) +Rboolean Rf_NonNullStringMatch(SEXP s, SEXP t) { /* "" or NA string matches nothing */ if (s == NA_STRING || t == NA_STRING) return FALSE; @@ -57,7 +57,7 @@ Rboolean NonNullStringMatch(SEXP s, SEXP t) } /* currently unused outside this file */ -Rboolean psmatch(const char *f, const char *t, Rboolean exact) +Rboolean Rf_psmatch(const char *f, const char *t, Rboolean exact) { if (exact) return (Rboolean)!strcmp(f, t); @@ -89,7 +89,7 @@ static R_INLINE SEXP charFromSexp(SEXP s) } } -Rboolean pmatch(SEXP formal, SEXP tag, Rboolean exact) +Rboolean Rf_pmatch(SEXP formal, SEXP tag, Rboolean exact) { SEXP f = charFromSexp(formal); SEXP t = charFromSexp(tag); diff --git a/src/main/memory.c b/src/main/memory.c index ef4c4323dd0..6097b967164 100644 --- a/src/main/memory.c +++ b/src/main/memory.c @@ -2434,7 +2434,7 @@ void *R_realloc_gc(void *p, size_t n) /* "allocSExp" allocate a SEXPREC */ /* call gc if necessary */ -SEXP allocSExp(SEXPTYPE t) +SEXP Rf_allocSExp(SEXPTYPE t) { if (t == NILSXP) /* R_NilValue should be the only NILSXP object */ @@ -2475,7 +2475,7 @@ static SEXP allocSExpNonCons(SEXPTYPE t) /* cons is defined directly to avoid the need to protect its arguments unless a GC will actually occur. */ -SEXP cons(SEXP car, SEXP cdr) +SEXP Rf_cons(SEXP car, SEXP cdr) { SEXP s; if (FORCE_GC || NO_FREE_NODES()) { @@ -2683,7 +2683,7 @@ static void custom_node_free(void *ptr) { */ #define intCHARSXP 73 -SEXP allocVector3(SEXPTYPE type, R_xlen_t length, R_allocator_t *allocator) +SEXP Rf_allocVector3(SEXPTYPE type, R_xlen_t length, R_allocator_t *allocator) { SEXP s; /* For the generational collector it would be safer to work in terms of a VECSXP here, but that would @@ -2990,7 +2990,7 @@ attribute_hidden SEXP allocCharsxp(R_len_t len) return allocVector(intCHARSXP, len); } -SEXP allocList(int n) +SEXP Rf_allocList(int n) { int i; SEXP result; @@ -3000,7 +3000,7 @@ SEXP allocList(int n) return result; } -SEXP allocLang(int n) +SEXP Rf_allocLang(int n) { if (n > 0) return LCONS(R_NilValue, allocList(n - 1)); @@ -3008,7 +3008,7 @@ SEXP allocLang(int n) return R_NilValue; } -SEXP allocS4Object(void) +SEXP Rf_allocS4Object(void) { SEXP s; GC_PROT(s = allocSExpNonCons(OBJSXP)); @@ -3049,31 +3049,31 @@ static SEXP allocFormalsList(int nargs, ...) attribute_hidden /* would need to be in an installed header if not hidden */ -SEXP allocFormalsList2(SEXP sym1, SEXP sym2) +SEXP Rf_allocFormalsList2(SEXP sym1, SEXP sym2) { return allocFormalsList(2, sym1, sym2); } attribute_hidden /* would need to be in an installed header if not hidden */ -SEXP allocFormalsList3(SEXP sym1, SEXP sym2, SEXP sym3) +SEXP Rf_allocFormalsList3(SEXP sym1, SEXP sym2, SEXP sym3) { return allocFormalsList(3, sym1, sym2, sym3); } attribute_hidden /* would need to be in an installed header if not hidden */ -SEXP allocFormalsList4(SEXP sym1, SEXP sym2, SEXP sym3, SEXP sym4) +SEXP Rf_allocFormalsList4(SEXP sym1, SEXP sym2, SEXP sym3, SEXP sym4) { return allocFormalsList(4, sym1, sym2, sym3, sym4); } attribute_hidden /* would need to be in an installed header if not hidden */ -SEXP allocFormalsList5(SEXP sym1, SEXP sym2, SEXP sym3, SEXP sym4, SEXP sym5) +SEXP Rf_allocFormalsList5(SEXP sym1, SEXP sym2, SEXP sym3, SEXP sym4, SEXP sym5) { return allocFormalsList(5, sym1, sym2, sym3, sym4, sym5); } attribute_hidden /* would need to be in an installed header if not hidden */ -SEXP allocFormalsList6(SEXP sym1, SEXP sym2, SEXP sym3, SEXP sym4, +SEXP Rf_allocFormalsList6(SEXP sym1, SEXP sym2, SEXP sym3, SEXP sym4, SEXP sym5, SEXP sym6) { return allocFormalsList(6, sym1, sym2, sym3, sym4, sym5, sym6); @@ -3419,7 +3419,7 @@ NORET void R_signal_unprotect_error(void) } #ifndef INLINE_PROTECT -SEXP protect(SEXP s) +SEXP Rf_protect(SEXP s) { R_CHECK_THREAD; if (R_PPStackTop >= R_PPStackSize) @@ -3431,7 +3431,7 @@ SEXP protect(SEXP s) /* "unprotect" pop argument list from top of R_PPStack */ -void unprotect(int l) +void Rf_unprotect(int l) { R_CHECK_THREAD; if (R_PPStackTop >= l) @@ -3442,7 +3442,7 @@ void unprotect(int l) /* "unprotect_ptr" remove pointer from somewhere in R_PPStack */ -void unprotect_ptr(SEXP s) +void Rf_unprotect_ptr(SEXP s) { R_CHECK_THREAD; int i = R_PPStackTop; diff --git a/src/main/names.c b/src/main/names.c index ac92d85556d..e3d7d2b5637 100644 --- a/src/main/names.c +++ b/src/main/names.c @@ -1182,7 +1182,7 @@ static void initializeDDVALSymbols(void) { } } -attribute_hidden SEXP installDDVAL(int n) { +attribute_hidden SEXP Rf_installDDVAL(int n) { if (n < N_DDVAL_SYMBOLS) return DDVALSymbols[n]; @@ -1253,7 +1253,7 @@ void attribute_hidden InitNames(void) /* If "name" is not found, it is installed in the symbol table. The symbol corresponding to the string "name" is returned. */ -SEXP install(const char *name) +SEXP Rf_install(const char *name) { SEXP sym; int i, hashcode; @@ -1280,7 +1280,7 @@ SEXP install(const char *name) Like the equivalent code pattern, it discards the encoding information, hence in almost all cases installTrChar should be used, instead. */ attribute_hidden -SEXP installNoTrChar(SEXP charSXP) +SEXP Rf_installNoTrChar(SEXP charSXP) { SEXP sym; int i, hashcode; @@ -1322,7 +1322,7 @@ SEXP installNoTrChar(SEXP charSXP) #define maxLength 512 attribute_hidden -SEXP installS3Signature(const char *className, const char *methodName) { +SEXP Rf_installS3Signature(const char *className, const char *methodName) { const char *src; char signature[maxLength]; diff --git a/src/main/objects.c b/src/main/objects.c index 11625916249..1296aebdc02 100644 --- a/src/main/objects.c +++ b/src/main/objects.c @@ -304,7 +304,7 @@ static int match_to_obj(SEXP arg, SEXP obj) { which should be explicitly converted when an S3 method is applied to an object from an S4 subclass. */ -attribute_hidden int isBasicClass(const char *ss) { +attribute_hidden int Rf_isBasicClass(const char *ss) { static SEXP s_S3table = NULL; if(!s_S3table) { s_S3table = R_findVarInFrame(R_MethodsNamespace, @@ -1835,12 +1835,12 @@ SEXP R_get_primname(SEXP object) #endif -Rboolean isS4(SEXP s) +Rboolean Rf_isS4(SEXP s) { return IS_S4_OBJECT(s); } -SEXP asS4(SEXP s, Rboolean flag, int complete) +SEXP Rf_asS4(SEXP s, Rboolean flag, int complete) { if(flag == IS_S4_OBJECT(s)) return s; diff --git a/src/main/options.c b/src/main/options.c index 7d962415551..60f060d04b4 100644 --- a/src/main/options.c +++ b/src/main/options.c @@ -124,13 +124,13 @@ static SEXP makeErrorCall(SEXP fun) return call; } -SEXP GetOption(SEXP tag, SEXP rho) +SEXP Rf_GetOption(SEXP tag, SEXP rho) { return GetOption1(tag); } -SEXP GetOption1(SEXP tag) +SEXP Rf_GetOption1(SEXP tag) { SEXP opt = SYMVALUE(Options()); if (!isList(opt)) error(_("corrupted options list")); @@ -138,7 +138,7 @@ SEXP GetOption1(SEXP tag) return CAR(opt); } -attribute_hidden int FixupWidth(SEXP width, warn_type warn) +attribute_hidden int Rf_FixupWidth(SEXP width, warn_type warn) { int w = asInteger(width); if (w == NA_INTEGER || w < R_MIN_WIDTH_OPT || w > R_MAX_WIDTH_OPT) { @@ -151,12 +151,12 @@ attribute_hidden int FixupWidth(SEXP width, warn_type warn) } return w; } -int GetOptionWidth(void) +int Rf_GetOptionWidth(void) { return FixupWidth(GetOption1(install("width")), iWARN); } -attribute_hidden int FixupDigits(SEXP digits, warn_type warn) +attribute_hidden int Rf_FixupDigits(SEXP digits, warn_type warn) { int d = asInteger(digits); if (d == NA_INTEGER || d < R_MIN_DIGITS_OPT || d > R_MAX_DIGITS_OPT) { @@ -170,7 +170,7 @@ attribute_hidden int FixupDigits(SEXP digits, warn_type warn) return d; } -attribute_hidden int GetOptionDigits(void) +attribute_hidden int Rf_GetOptionDigits(void) { return FixupDigits(GetOption1(install("digits")), iWARN); } diff --git a/src/main/print.c b/src/main/print.c index 99bea41bdcb..1011f330d07 100644 --- a/src/main/print.c +++ b/src/main/print.c @@ -1092,7 +1092,7 @@ attribute_hidden void PrintValueEnv(SEXP s, SEXP env) /* Print an S-expression using global options */ -void PrintValue(SEXP s) +void Rf_PrintValue(SEXP s) { PrintValueEnv(s, R_GlobalEnv); } diff --git a/src/main/sort.c b/src/main/sort.c index 28c882259fd..ae36601f0e3 100644 --- a/src/main/sort.c +++ b/src/main/sort.c @@ -83,7 +83,7 @@ static int scmp(SEXP x, SEXP y, Rboolean nalast) } #define R_INT_MIN 1 + INT_MIN //INT_MIN is NA_INTEGER -Rboolean isUnsorted(SEXP x, Rboolean strictly) +Rboolean Rf_isUnsorted(SEXP x, Rboolean strictly) { R_xlen_t n, i; int itmp = INT_MIN; /* this is NA_INTEGER, < all valid nonNA R integer diff --git a/src/main/subset.c b/src/main/subset.c index 96521f7dec6..4a4dfe4af04 100644 --- a/src/main/subset.c +++ b/src/main/subset.c @@ -112,7 +112,7 @@ NORET static void errorcallMissingSubs(SEXP x, SEXP call) } -attribute_hidden SEXP ExtractSubset(SEXP x, SEXP indx, SEXP call) +attribute_hidden SEXP Rf_ExtractSubset(SEXP x, SEXP indx, SEXP call) { if (x == R_NilValue) return x; diff --git a/src/main/sysutils.c b/src/main/sysutils.c index f931139f8e6..cba5bf9eca2 100644 --- a/src/main/sysutils.c +++ b/src/main/sysutils.c @@ -940,7 +940,7 @@ attribute_hidden SEXP do_iconv(SEXP call, SEXP op, SEXP args, SEXP env) __func__, R_typeToChar(__x__)); \ } while(0); -cetype_t getCharCE(SEXP x) +cetype_t Rf_getCharCE(SEXP x) { CHECK_CHARSXP(x); if(IS_UTF8(x)) return CE_UTF8; @@ -949,13 +949,13 @@ cetype_t getCharCE(SEXP x) else return CE_NATIVE; } -Rboolean charIsASCII(SEXP x) +Rboolean Rf_charIsASCII(SEXP x) { CHECK_CHARSXP(x); return IS_ASCII(x) ? TRUE : FALSE; } -Rboolean charIsUTF8(SEXP x) +Rboolean Rf_charIsUTF8(SEXP x) { CHECK_CHARSXP(x); if (IS_ASCII(x) || IS_UTF8(x)) return TRUE; @@ -964,7 +964,7 @@ Rboolean charIsUTF8(SEXP x) return TRUE; } -Rboolean charIsLatin1(SEXP x) +Rboolean Rf_charIsLatin1(SEXP x) { CHECK_CHARSXP(x); if (IS_ASCII(x) || IS_LATIN1(x)) return TRUE; @@ -1861,7 +1861,7 @@ const char *translateCharFP2(SEXP x) return copyAndFreeStringBuffer(&cbuff); } -SEXP installTrChar(SEXP x) +SEXP Rf_installTrChar(SEXP x) { CHECK_CHARSXP(x); nttype_t t = needsTranslation(x); diff --git a/src/main/unique.c b/src/main/unique.c index 0ffff41000b..a493a96bf57 100644 --- a/src/main/unique.c +++ b/src/main/unique.c @@ -637,7 +637,7 @@ static void removeEntry(SEXP table, SEXP x, R_xlen_t indx, HashData *d) duplicatedInit(x, &data); /* used in scan() */ -SEXP duplicated(SEXP x, Rboolean from_last) +SEXP Rf_duplicated(SEXP x, Rboolean from_last) { SEXP ans; int *v, nmax = NA_INTEGER; @@ -976,7 +976,7 @@ attribute_hidden R_xlen_t sorted_any_duplicated(SEXP x, Rboolean from_last) { #undef SORTED_ANYDUP_NANS /* simpler version of the above : return 1-based index of first, or 0 : */ -R_xlen_t any_duplicated(SEXP x, Rboolean from_last) +R_xlen_t Rf_any_duplicated(SEXP x, Rboolean from_last) { R_xlen_t result = 0; int nmax = NA_INTEGER; @@ -1046,7 +1046,7 @@ static SEXP duplicated3(SEXP x, SEXP incomp, Rboolean from_last, int nmax) } /* return (1-based) index of first duplication, or 0 : */ -R_xlen_t any_duplicated3(SEXP x, SEXP incomp, Rboolean from_last) +R_xlen_t Rf_any_duplicated3(SEXP x, SEXP incomp, Rboolean from_last) { int j, m = length(incomp), nmax = NA_INTEGER; @@ -1479,13 +1479,13 @@ SEXP match5(SEXP itable, SEXP ix, int nmatch, SEXP incomp, SEXP env) return ans; } // end{ match5 } -SEXP matchE(SEXP itable, SEXP ix, int nmatch, SEXP env) +SEXP Rf_matchE(SEXP itable, SEXP ix, int nmatch, SEXP env) { return match5(itable, ix, nmatch, NULL, env); } /* used from other code, not here: */ -SEXP match(SEXP itable, SEXP ix, int nmatch) +SEXP Rf_match(SEXP itable, SEXP ix, int nmatch) { return match5(itable, ix, nmatch, NULL, R_BaseEnv); } diff --git a/src/main/util.c b/src/main/util.c index 58652487951..0a8be9898c5 100644 --- a/src/main/util.c +++ b/src/main/util.c @@ -78,7 +78,7 @@ NORET void F77_SUB(rexitc)(char *msg, int *nchar); /* Many small functions are included from ../include/Rinlinedfuns.h */ -int nrows(SEXP s) // ~== NROW(.) in R +int Rf_nrows(SEXP s) // ~== NROW(.) in R { SEXP t; if (isVector(s) || isList(s)) { @@ -94,7 +94,7 @@ int nrows(SEXP s) // ~== NROW(.) in R } -int ncols(SEXP s) // ~== NCOL(.) in R +int Rf_ncols(SEXP s) // ~== NCOL(.) in R { SEXP t; if (isVector(s) || isList(s)) { @@ -141,7 +141,7 @@ const static char * const falsenames[] = { (char *) NULL, }; -SEXP asChar(SEXP x) +SEXP Rf_asChar(SEXP x) { if (isVectorAtomic(x) && XLENGTH(x) >= 1) { int w, d, e, wi, di, ei; @@ -181,14 +181,14 @@ SEXP asChar(SEXP x) return NA_STRING; } -Rboolean isUnordered(SEXP s) +Rboolean Rf_isUnordered(SEXP s) { return (TYPEOF(s) == INTSXP && inherits(s, "factor") && !inherits(s, "ordered")); } -Rboolean isOrdered(SEXP s) +Rboolean Rf_isOrdered(SEXP s) { return (TYPEOF(s) == INTSXP && inherits(s, "factor") @@ -243,7 +243,7 @@ TypeTable[] = { }; -SEXPTYPE str2type(const char *s) +SEXPTYPE Rf_str2type(const char *s) { int i; for (i = 0; TypeTable[i].str; i++) { @@ -301,7 +301,7 @@ void InitTypeTables(void) { } } -SEXP type2str_nowarn(SEXPTYPE t) /* returns a CHARSXP */ +SEXP Rf_type2str_nowarn(SEXPTYPE t) /* returns a CHARSXP */ { // if (t >= 0 && t < MAX_NUM_SEXPTYPE) { /* branch not really needed */ SEXP res = Type2Table[t].rcharName; @@ -310,7 +310,7 @@ SEXP type2str_nowarn(SEXPTYPE t) /* returns a CHARSXP */ return R_NilValue; } -SEXP type2str(SEXPTYPE t) /* returns a CHARSXP */ +SEXP Rf_type2str(SEXPTYPE t) /* returns a CHARSXP */ { SEXP s = type2str_nowarn(t); if (s != R_NilValue) { @@ -322,7 +322,7 @@ SEXP type2str(SEXPTYPE t) /* returns a CHARSXP */ return mkChar(buf); } -SEXP type2rstr(SEXPTYPE t) /* returns a STRSXP */ +SEXP Rf_type2rstr(SEXPTYPE t) /* returns a STRSXP */ { // if (t < MAX_NUM_SEXPTYPE) { SEXP res = Type2Table[t].rstrName; @@ -465,7 +465,7 @@ Rboolean isBlankString(const char *s) return TRUE; } -Rboolean StringBlank(SEXP x) +Rboolean Rf_StringBlank(SEXP x) { if (x == R_NilValue) return TRUE; else return CHAR(x)[0] == '\0'; @@ -543,7 +543,7 @@ attribute_hidden void Rf_check1arg(SEXP arg, SEXP call, const char *formal) } -SEXP nthcdr(SEXP s, int n) +SEXP Rf_nthcdr(SEXP s, int n) { if (isList(s) || isLanguage(s) || isDataFrame(s) || TYPEOF(s) == DOTSXP ) { while( n-- > 0 ) { @@ -627,7 +627,7 @@ void setSVector(SEXP * vec, int len, SEXP val) */ -attribute_hidden Rboolean isFree(SEXP val) +attribute_hidden Rboolean Rf_isFree(SEXP val) { SEXP t; for (t = R_FreeSEXP; t != R_NilValue; t = CAR(t))