[ RDocumentation ](/)

Moon  [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)

Search all packages and functions

[ base  (version  3.6.2  ) ](/packages/base/versions/3.6.2)

#  getNativeSymbolInfo: Obtain a Description of one or more Native (C/Fortran)
Symbols

##  Description

This finds and returns a description of one or more dynamically loaded or
‘exported’ built-in native symbols. For each name, it returns information
about the name of the symbol, the library in which it is located and, if
available, the number of arguments it expects and by which interface it should
be called (i.e ` [ .Call ](/link/.Call?package=base&version=3.6.2) ` , ` [ .C
](/link/.C?package=base&version=3.6.2) ` , ` [ .Fortran
](/link/.Fortran?package=base&version=3.6.2) ` , or ` [ .External
](/link/.External?package=base&version=3.6.2) ` ). Additionally, it returns
the address of the symbol and this can be passed to other C routines.
Specifically, this provides a way to explicitly share symbols between
different dynamically loaded package libraries. Also, it provides a way to
query where symbols were resolved, and aids diagnosing strange behavior
associated with dynamic resolution.

##  Usage

    
    
    getNativeSymbolInfo(name, PACKAGE, unlist = TRUE,
                        withRegistrationInfo = FALSE)

##  Arguments

name

the name(s) of the native symbol(s).

PACKAGE

an optional argument that specifies to which DLL to restrict the search for
this symbol. If this is ` "base" ` , we search in the  R  executable itself.

unlist

a logical value which controls how the result is returned if the function is
called with the name of a single symbol. If ` unlist ` is ` TRUE ` and the
number of symbol names in ` name ` is one, then the ` NativeSymbolInfo `
object is returned. If it is ` FALSE ` , then a list of ` NativeSymbolInfo `
objects is returned. This is ignored if the number of symbols passed in ` name
` is more than one. To be compatible with earlier versions of this function,
this defaults to ` TRUE ` .

withRegistrationInfo

a logical value indicating whether, if ` TRUE ` , to return information that
was registered with  R  about the symbol and its parameter types if such
information is available, or if ` FALSE ` to return just the address of the
symbol.

##  Value

Generally, a list of ` NativeSymbolInfo ` elements whose elements can be
indexed by the elements of ` name ` in the call. Each ` NativeSymbolInfo `
object is a list containing the following elements:

name

    

the name of the symbol, as given by the ` name ` argument.

address

    

if ` withRegistrationInfo ` is ` FALSE ` , this is the native memory address
of the symbol which can be used to invoke the routine, and also to compare
with other symbol addresses. This is an external pointer object and of class `
NativeSymbol ` . If ` withRegistrationInfo ` is ` TRUE ` and registration
information is available for the symbol, then this is an object of class `
RegisteredNativeSymbol ` and is a reference to an internal data type that has
access to the routine pointer and registration information. This too can be
used in calls to ` [ .Call ](/link/.Call?package=base&version=3.6.2) ` , ` [
.C ](/link/.C?package=base&version=3.6.2) ` , ` [ .Fortran
](/link/.Fortran?package=base&version=3.6.2) ` and ` [ .External
](/link/.External?package=base&version=3.6.2) ` .

dll

    

a list containing 3 elements:

name

    

the short form of the library name which can be used as the value of the `
PACKAGE ` argument in the different native interface functions.

path

    

the fully qualified name of the DLL.

dynamicLookup

    

a logical value indicating whether dynamic resolution is used when looking for
symbols in this library, or only registered routines can be located.

If the routine was explicitly registered by the dynamically loaded library,
the list contains a fourth field  numParameters

    

the number of arguments that should b