[Rd] Trailing underscores on C function names
William Dunlap
wdunlap at tibco.com
Wed Feb 7 23:14:40 CET 2018
In the fastmatch package, version 1.1-0, there is a C function called
"ctapply_", with a trailing underscore. However, the NAMESPACE's call to
useDynLib refers to "ctapply", without the trailing underscore.
% grep ctapply NAMESPACE {R,src}/*
NAMESPACE:useDynLib(fastmatch, C_fmatch = fmatch, C_ctapply = ctapply,
C_coalesce = coalesce, C_append = append, mk_hash, get_table, get_values)
NAMESPACE:export(fmatch, fmatch.hash, ctapply, coalesce, "%fin%")
R/ctapply.R:ctapply <- function(X, INDEX, FUN, ..., MERGE=c)
.External(C_ctapply, parent.frame(), X, INDEX, FUN, MERGE, ...)
src/ctapply.c:SEXP ctapply_(SEXP args) {
src/ctapply.c: see ctapply(x, y, identity). It should be uncommon,
though
"Writing R Extensions" mentions, section 5.2, footnote 121, that .C and
.Fortran interpret their first argument as the name of the object file
symbol "possibly after some platform-specific translation, e.g. adding
leading or trailing underscores".
Should useDynLib use the underscored name? The code doesn't seem
"platform-specific". What are the rules concerning added underscores (or
capitalization?) that R uses?
Bill Dunlap
TIBCO Software
wdunlap tibco.com
[[alternative HTML version deleted]]
More information about the R-devel
mailing list