R/info.S

Defines functions getCurlInfoConstants getCurlInfo

Documented in getCurlInfo getCurlInfoConstants

getCurlInfo =
function(curl, which = getCurlInfoConstants())
{
  rnames = character()

  if(is.character(which)) {
    const = getCurlInfoConstants()          
    i = pmatch(tolower(which), names(const))
    if(any(is.na(i)))
      stop("Invalid curl info name", names(which)[is.na(i)])

    which = getCurlInfoConstants()[i]
  }
  
  x = .Call("R_curl_easy_getinfo", curl, as.integer(which), PACKAGE = "RCurl")

# put the names back on.  
  names(x) = names(which)
  
  x
}


getCurlInfoConstants =
function()
{
  x = .Call("R_getCURLInfoEnum", PACKAGE = "RCurl")
  names(x) = tolower(gsub("_", ".", names(x)))

  x
}

Try the RCurl package in your browser

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

RCurl documentation built on Nov. 3, 2023, 1:09 a.m.