tools/typelist.R

txt <- readLines('tools/typelist.h.in')
m <- regexpr("CURLOPT_\\w+", txt)
opts <- regmatches(txt, m)
i <- match(opts, curl:::curl_symbol_data$name)
table <- curl:::curl_symbol_data[i, ]
for(i in seq_len(nrow(table))){
  name <- table$name[i]
  value <- table$value[i]
  txt <- gsub(paste0(name, " "), sprintf("/*%s*/ %d ", name, value), fixed = TRUE, txt)
}
#txt <- gsub('[ ]+\\\\', '  \\\\', txt)
header <- "/* This file is autogenerated from typelist.h.in */"
writeLines(c(header, txt), "src/typelist.h")

Try the curl package in your browser

Any scripts or data that you put into this service are public.

curl documentation built on Sept. 30, 2024, 9:35 a.m.