\Header{dyn.load}{Foreign Function Interface}
\alias{is.loaded}{dyn.load}
\alias{symbol.C}{dyn.load}
\alias{symbol.For}{dyn.load}
\keyword{interface}{dyn.load}
\begin{Usage}
\begin{verbatim}
dyn.load(libname)

is.loaded(symbol)
symbol.C(name)
symbol.For(name)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{libname}] a character string giving the pathname to a DLL.
\item[\texttt{symbol}] a character string giving a symbol name.
\item[\texttt{name}] a character string giving either the name of a C
function or Fortran subroutine.
\end{ldescription}
\end{Arguments}
\begin{Value}
The function \texttt{dyn.load} is used for its side effect which
links the specified shared library to the executing \R\ image.
Calls to \texttt{.C} and \texttt{.Fortran} can then be used to execute
C functions or Fortran subroutines contained in the library.\end{Value}
\begin{Note}
The creation of shared libraries the runtime linking of them
into executing programs is very platform dependent.
In recent years there has been some simplification in the process
because the C subroutine call \texttt{dlopen} has become the standard
for doing this under Unix.
\texttt{dyn.load} uses the \texttt{dlopen} mechanism and
should work on all platforms which support it.

The original code for loading DLLs in UNIX
was provided by Heiner Schwarte.
The compatibility code for HP-UX was provided by Luke Tierney.\end{Note}
\begin{SeeAlso}
\texttt{\Link{.C}}, \texttt{\Link{.Fortran}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
is.loaded(symbol.For("hcass2")) #-> probably  FALSE
library(mva)
is.loaded(symbol.For("hcass2")) #-> TRUE
\end{ExampleCode}
\end{Examples}

