RInside Version 0.2.12
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
RInsideEnvVars.r
Go to the documentation of this file.
1 #!/usr/bin/r -q
2 #
3 # This owes a lot to littler.R in the littler sources
4 
5 ExcludeVars <- c("R_SESSION_TMPDIR","R_HISTFILE")
6 IncludeVars <- Sys.getenv()
7 IncludeVars <- IncludeVars[grep("^R_",names(IncludeVars),perl=TRUE)]
8 if (.Platform$OS.type == "windows") {
9  IncludeVars <- gsub("\\\\", "/", IncludeVars, perl=TRUE)
10 }
11 cat(" const char *R_VARS[] = {\n")
12 for (i in 1:length(IncludeVars)){
13  if (names(IncludeVars)[i] %in% ExcludeVars)
14  next
15  cat(' "',names(IncludeVars)[i],'","',IncludeVars[i],'",\n',sep='')
16 }
17 cat(" NULL\n };\n")