Skip to content

Commit

Permalink
chore: Use Rf_ prefix in all function definitions for better IDE na…
Browse files Browse the repository at this point in the history
…vigation
  • Loading branch information
krlmlr committed Dec 8, 2024
1 parent 6c65d04 commit d7f36f9
Show file tree
Hide file tree
Showing 23 changed files with 120 additions and 120 deletions.
6 changes: 3 additions & 3 deletions src/include/Defn.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions src/main/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@
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);
else
return R_NilValue;
}

SEXP GetColNames(SEXP dimnames)
SEXP Rf_GetColNames(SEXP dimnames)
{
if (TYPEOF(dimnames) == VECSXP)
return VECTOR_ELT(dimnames, 1);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
20 changes: 10 additions & 10 deletions src/main/attrib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/main/builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/character.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
22 changes: 11 additions & 11 deletions src/main/coerce.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 6 additions & 6 deletions src/main/duplicate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -148,7 +148,7 @@ SEXP duplicate(SEXP s){
return t;
}

SEXP shallow_duplicate(SEXP s)
SEXP Rf_shallow_duplicate(SEXP s)
{
SEXP t;

Expand All @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Loading

0 comments on commit d7f36f9

Please sign in to comment.