Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Use Rf_ prefix in all function definitions for better IDE navigation #190

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore: Use Rf_ prefix in all function definitions for better IDE na…
…vigation
krlmlr committed Dec 8, 2024
commit d7f36f9f081369ea817fb370c217d19d230fa7ee
6 changes: 3 additions & 3 deletions src/include/Defn.h
Original file line number Diff line number Diff line change
@@ -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);
12 changes: 6 additions & 6 deletions src/main/array.c
Original file line number Diff line number Diff line change
@@ -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);
@@ -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);
20 changes: 10 additions & 10 deletions src/main/attrib.c
Original file line number Diff line number Diff line change
@@ -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);
4 changes: 2 additions & 2 deletions src/main/builtin.c
Original file line number Diff line number Diff line change
@@ -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);
}
2 changes: 1 addition & 1 deletion src/main/character.c
Original file line number Diff line number Diff line change
@@ -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;
22 changes: 11 additions & 11 deletions src/main/coerce.c
Original file line number Diff line number Diff line change
@@ -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)) {
2 changes: 1 addition & 1 deletion src/main/context.c
Original file line number Diff line number Diff line change
@@ -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;

12 changes: 6 additions & 6 deletions src/main/duplicate.c
Original file line number Diff line number Diff line change
@@ -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);
Loading