opts: added examples

This commit is contained in:
Daniel Stenberg
2014-10-21 08:58:03 +02:00
parent 005f2adaaa
commit c857bb68ec
14 changed files with 290 additions and 28 deletions

View File

@@ -272,12 +272,23 @@ performed.
All
.SH EXAMPLE
.nf
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
curl_easy_perform(curl);
}
.fi
.SH AVAILABILITY
POP3 and SMTP added in 7.31.0
POP3 and SMTP were added in 7.31.0
.SH RETURN VALUE
Returns CURLE_OK on success or
CURLE_OUT_OF_MEMORY if there was insufficient heap space.
Returns CURLE_OK on success or CURLE_OUT_OF_MEMORY if there was insufficient
heap space.
Note that \fIcurl_easy_setopt(3)\fP won't actually parse the given string so
given a bad URL, it will not be detected until \fIcurl_easy_perform(3)\fP or
similar is called.
.SH "SEE ALSO"
.BR CURLOPT_VERBOSE "(3), " CURLOPT_PROTOCOLS "(3), "
.BR CURLOPT_FORBID_REUSE "(3), " CURLOPT_FRESH_CONNECT "(3), "
.BR curl_easy_perform "(3)"