Description Usage Arguments Value Author(s)
This function is responsible for creating the text that declares a C/C++ variable of the specified type so that it can be used as a parameter in a C/C++ routine or as a local variable within the routine. It combines a type and a symbol name to create the declaration code. It can optionally put a ; at the end of the code.
1 | getNativeDeclaration(name, v, variableNames, addSemiColon = TRUE, const = NA)
|
name |
the name for the variable or parameter |
v |
a description of the type of the variable being declared.
This is typically obtained by resolving a type definition
from the translation unit using |
variableNames |
the names of other known variables in the routine definition which could be used to avoid conflicts. |
addSemiColon |
a logical value indicating whether to add a ‘;’ at the end of the generated declaration code. When generating parameter declarations for a routine, we don't want the ;. But for local variables, we do. |
const |
this is used in some of the methods
to qualify the declaration as being a constant/immutable
"variable". This information can also be determined
in many cases from the type |
A string (character vector of length 1) giving the declaration for the code.
Duncan Temple Lang
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.