powered by
functions, structs, struct members, enums, unions, globals, and macros.
parse_headers_collect( dir = R.home("include"), recursive = TRUE, pattern = c("\\.h$", "\\.H$"), preprocess = FALSE, cc = r_cc(), ccflags = NULL, include_dirs = NULL, extract_params = FALSE, extract_return = FALSE, ... )
A named list of data frames with components: functions, structs, struct_members, enums, unions, globals, defines.
functions
structs
struct_members
enums
unions
globals
defines
Directory to search for header files. Defaults to R.home("include").
R.home("include")
Whether to search recursively for headers. Default TRUE.
TRUE
File name pattern to match header files. Default is \.h$ and \.H$.
\.h$
\.H$
Run the C preprocessor (using R's configured CC) on header files before parsing. Defaults to FALSE.
FALSE
The C compiler to use for preprocessing. If NULL the function queries R CMD config CC and falls back to Sys.getenv("CC") and the cc on PATH.
NULL
R CMD config CC
Sys.getenv("CC")
cc
Extra flags to pass to the compiler when preprocessing. If NULL flags are taken from R CMD config CFLAGS and R CMD config CPPFLAGS.
R CMD config CFLAGS
R CMD config CPPFLAGS
Additional directories to add to the include path for preprocessing. A character vector of directories.
Logical; whether to extract parameter types for functions. Default FALSE.
Logical; whether to extract return types for functions. Default FALSE.
Additional arguments passed to preprocess_header (e.g., extra compiler flags)
This helper loops over headers found in a directory and returns a list with tidy data.frames. Useful for programmatic analysis of header collections.
if (FALSE) { if (requireNamespace("treesitter", quietly = TRUE)) { res <- parse_headers_collect(dir = R.home("include"), preprocess = FALSE) head(res$functions) } }
Run the code above in your browser using DataLab