| 1 |
\name{curlGlobalInit} |
| 2 |
\alias{curlGlobalInit} |
| 3 |
\alias{curlGlobalCleanup} |
| 4 |
%- Also NEED an '\alias' for EACH other topic documented here. |
| 5 |
\title{Start and stop the Curl library} |
| 6 |
\description{ |
| 7 |
These functions provide a way to both start/initialize |
| 8 |
and stop/uninitialize the libcurl engine. |
| 9 |
There is no need to call |
| 10 |
\code{curlGlobalInit} as it is done implicitly the |
| 11 |
first time one uses the libcurl facilities. |
| 12 |
However, this function does permit one to explicitly |
| 13 |
control how it is initialized. |
| 14 |
Specifically, on Windows one might want to |
| 15 |
avoid re-initializing the Win32 socket facilities |
| 16 |
if the host application (e.g. R) has already done this. |
| 17 |
|
| 18 |
\code{curlGlobalInit} should only be called once per R session. |
| 19 |
Subsequent calls will have no effect, or may confuse the libcurl engine. |
| 20 |
|
| 21 |
One can reclaim the resources the libcurl engine is |
| 22 |
consuming via the \code{curlGlobalCleanup} function |
| 23 |
when one no longer needs the libcurl facilities in |
| 24 |
an R session. |
| 25 |
} |
| 26 |
\usage{ |
| 27 |
curlGlobalInit(flags = c("ssl", "win32")) |
| 28 |
curlGlobalCleanup() |
| 29 |
} |
| 30 |
%- maybe also 'usage' for other objects documented here. |
| 31 |
\arguments{ |
| 32 |
\item{flags}{flags indicating which features to activate. |
| 33 |
These come from the \code{\link{CurlGlobalBits}} |
| 34 |
bit-field. The default is to activate both SSL and Win32 sockets |
| 35 |
(if on Windows). One can specify either the names of the features |
| 36 |
that are matched (via \code{\link{setBitIndicators}}) or |
| 37 |
the integer value. |
| 38 |
} |
| 39 |
} |
| 40 |
\value{ |
| 41 |
\code{curlGobalInit} returns a status code which should be 0. |
| 42 |
\code{curlGlobalCleanup} returns \code{NULL} in all cases. |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
\references{Curl homepage \url{https://curl.se/}} |
| 47 |
\author{Duncan Temple Lang} |
| 48 |
|
| 49 |
\seealso{ |
| 50 |
\code{\link{getCurlHandle}} |
| 51 |
\code{\link{curlPerform}} |
| 52 |
} |
| 53 |
\examples{ |
| 54 |
# Activate only the SSL. |
| 55 |
curlGlobalInit("ssl") |
| 56 |
|
| 57 |
\dontrun{ |
| 58 |
# Don't run these automatically as we should only call this function |
| 59 |
# once per R session |
| 60 |
|
| 61 |
# Everything, the default. |
| 62 |
curlGlobalInit() |
| 63 |
|
| 64 |
# Nothing. |
| 65 |
curlGlobalInit("none") |
| 66 |
curlGlobalInit(0) |
| 67 |
} |
| 68 |
|
| 69 |
} |
| 70 |
\keyword{IO} |