isFnPointer: Queries function/routine pointer object

View source: R/fnPointerUtils.R

isFnPointerR Documentation

Queries function/routine pointer object

Description

These functions allow us to determine if a CXType is a function pointer, and to get the information about the function pointer type.

Usage

isFnPointer(x)
getFnPointerInfo(field, cur = NULL,
                 toks = if(!is.null(cur))
                           sapply(children(cur), getCursorTokens),
                 useCanonical = FALSE) 

Arguments

x

the CXType being queried to determine if it is a function pointer type.

field

a CXType which is a C-level function pointer

cur

the CXCursor associated with the field CXType

toks

a list of the CXCursor objects within the cur cursor.

useCanonical

a logical value controlling whether we use the canonical type or high-level type. If this is TRUE, when we get the type for the pointer, we get the canonical version of this, i.e. ignore typedefs/aliases.

Value

An instance of an S3 class named FunctionPointerInfo which is a list with two elements:

returnType

the return type of the function type

params

the list of the parameter types of the function type

Author(s)

Duncan Temple Lang

References

libclang http://clang.llvm.org/doxygen/group__CINDEX.html

See Also

getType

Examples

v = getVariables(system.file("exampleCode", "funPointer.c", package = "RCIndex"))
isFnPointer(getType(v$fun))

omegahat/RClangSimple documentation built on April 25, 2024, 4:18 a.m.