"",
"int main(int argc, char *argv[])",
"{",
- " CURLcode ret;",
- " CURL *hnd;",
+ " CURLcode result;",
+ " CURL *curl;",
NULL
};
/* easysrc_decl declarations come here */
};
static const char *const srcend[] = {
"",
- " return (int)ret;",
+ " return (int)result;",
"}",
"/**** End of sample code ****/",
NULL
CURLcode easysrc_init(void)
{
- return easysrc_add(&easysrc_code, "hnd = curl_easy_init();");
+ return easysrc_add(&easysrc_code, "curl = curl_easy_init();");
}
CURLcode easysrc_perform(void)
if(!result)
result = easysrc_add(&easysrc_code, "");
if(!result)
- result = easysrc_add(&easysrc_code, "ret = curl_easy_perform(hnd);");
+ result = easysrc_add(&easysrc_code, "result = curl_easy_perform(curl);");
if(!result)
result = easysrc_add(&easysrc_code, "");
CURLcode easysrc_cleanup(void)
{
- CURLcode result = easysrc_add(&easysrc_code, "curl_easy_cleanup(hnd);");
+ CURLcode result = easysrc_add(&easysrc_code, "curl_easy_cleanup(curl);");
if(!result)
- result = easysrc_add(&easysrc_code, "hnd = NULL;");
+ result = easysrc_add(&easysrc_code, "curl = NULL;");
return result;
}
/* If no definition was found, output an explicit value.
* This could happen if new values are defined and used
* but the NameValue list is not updated. */
- result = easysrc_addf(&easysrc_code, "curl_easy_setopt(hnd, %s, %ldL);",
+ result = easysrc_addf(&easysrc_code, "curl_easy_setopt(curl, %s, %ldL);",
name, lval);
}
else
result =
- easysrc_addf(&easysrc_code, "curl_easy_setopt(hnd, %s, (long)%s);",
+ easysrc_addf(&easysrc_code, "curl_easy_setopt(curl, %s, (long)%s);",
name, nv->name);
}
/* If no definition was found, output an explicit value.
* This could happen if new values are defined and used
* but the NameValue list is not updated. */
- result = easysrc_addf(&easysrc_code, "curl_easy_setopt(hnd, %s, %ldL);",
+ result = easysrc_addf(&easysrc_code, "curl_easy_setopt(curl, %s, %ldL);",
name, lval);
}
else {
if(nv2->name && *nv2->name)
/* if max is set */
result = easysrc_addf(&easysrc_code,
- "curl_easy_setopt(hnd, %s, (long)(%s | %s));",
+ "curl_easy_setopt(curl, %s, (long)(%s | %s));",
name, nv->name, nv2->name);
else
/* without a max */
result = easysrc_addf(&easysrc_code,
- "curl_easy_setopt(hnd, %s, (long)%s);",
+ "curl_easy_setopt(curl, %s, (long)%s);",
name, nv->name);
}
}
unsigned long rest = (unsigned long)lval;
const struct NameValueUnsigned *nv = NULL;
curl_msnprintf(preamble, sizeof(preamble),
- "curl_easy_setopt(hnd, %s, ", name);
+ "curl_easy_setopt(curl, %s, ", name);
for(nv = nvlist; nv->name; nv++) {
if((nv->value & ~rest) == 0) {
/* all value flags contained in rest */
if(!result)
result = easysrc_addf(&easysrc_data, "mime%d = NULL;", *mimeno);
if(!result)
- result = easysrc_addf(&easysrc_code, "mime%d = curl_mime_init(hnd);",
+ result = easysrc_addf(&easysrc_code, "mime%d = curl_mime_init(curl);",
*mimeno);
if(!result)
result = easysrc_addf(&easysrc_clean, "curl_mime_free(mime%d);", *mimeno);
if(!result)
result =
- easysrc_addf(&easysrc_code, "curl_easy_setopt(hnd, %s, mime%d);",
+ easysrc_addf(&easysrc_code, "curl_easy_setopt(curl, %s, mime%d);",
name, mimeno);
}
result = libcurl_generate_slist(list, &i);
if(!result)
result =
- easysrc_addf(&easysrc_code, "curl_easy_setopt(hnd, %s, slist%d);",
+ easysrc_addf(&easysrc_code, "curl_easy_setopt(curl, %s, slist%d);",
name, i);
}
result = curl_easy_setopt(curl, tag, lval);
if((lval != defval) && global->libcurl && !result) {
/* we only use this for real if --libcurl was used */
- result = easysrc_addf(&easysrc_code, "curl_easy_setopt(hnd, %s, %ldL);",
+ result = easysrc_addf(&easysrc_code, "curl_easy_setopt(curl, %s, %ldL);",
name, lval);
}
return result;
if(global->libcurl && !result && lval) {
/* we only use this for real if --libcurl was used */
result =
- easysrc_addf(&easysrc_code, "curl_easy_setopt(hnd, %s, (curl_off_t)%"
+ easysrc_addf(&easysrc_code, "curl_easy_setopt(curl, %s, (curl_off_t)%"
CURL_FORMAT_CURL_OFF_T ");", name, lval);
}
escaped = c_escape(str, len);
if(escaped) {
result = easysrc_addf(&easysrc_code,
- "curl_easy_setopt(hnd, %s, \"%s\");",
+ "curl_easy_setopt(curl, %s, \"%s\");",
name, escaped);
curlx_free(escaped);
}
int main(int argc, char *argv[])
{
- CURLcode ret;
- CURL *hnd;
+ CURLcode result;
+ CURL *curl;
- hnd = curl_easy_init();
- curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
- curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
- curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER");
- curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION");
- curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
- curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
+ curl = curl_easy_init();
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
+ curl_easy_setopt(curl, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER");
+ curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/%VERSION");
+ curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
+ curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
/* Here is a list of options the curl code used that cannot get generated
as source easily. You may choose to either not use them or implement
*/
- ret = curl_easy_perform(hnd);
+ result = curl_easy_perform(curl);
- curl_easy_cleanup(hnd);
- hnd = NULL;
+ curl_easy_cleanup(curl);
+ curl = NULL;
- return (int)ret;
+ return (int)result;
}
/**** End of sample code ****/
int main(int argc, char *argv[])
{
- CURLcode ret;
- CURL *hnd;
+ CURLcode result;
+ CURL *curl;
struct curl_slist *slist1;
slist1 = NULL;
slist1 = curl_slist_append(slist1, "X-Files: Mulder");
slist1 = curl_slist_append(slist1, "X-Men: cyclops, iceman");
- hnd = curl_easy_init();
- curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
- curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
- curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER");
- curl_easy_setopt(hnd, CURLOPT_USERPWD, "fake:user");
- curl_easy_setopt(hnd, CURLOPT_HTTPAUTH, (long)CURLAUTH_BASIC);
- curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, slist1);
- curl_easy_setopt(hnd, CURLOPT_USERAGENT, "MyUA");
- curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
- curl_easy_setopt(hnd, CURLOPT_COOKIE, "chocolate=chip");
- curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
- curl_easy_setopt(hnd, CURLOPT_PROTOCOLS_STR, "file,ftp,http");
+ curl = curl_easy_init();
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
+ curl_easy_setopt(curl, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER");
+ curl_easy_setopt(curl, CURLOPT_USERPWD, "fake:user");
+ curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_BASIC);
+ curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist1);
+ curl_easy_setopt(curl, CURLOPT_USERAGENT, "MyUA");
+ curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
+ curl_easy_setopt(curl, CURLOPT_COOKIE, "chocolate=chip");
+ curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
+ curl_easy_setopt(curl, CURLOPT_PROTOCOLS_STR, "file,ftp,http");
/* Here is a list of options the curl code used that cannot get generated
as source easily. You may choose to either not use them or implement
*/
- ret = curl_easy_perform(hnd);
+ result = curl_easy_perform(curl);
- curl_easy_cleanup(hnd);
- hnd = NULL;
+ curl_easy_cleanup(curl);
+ curl = NULL;
curl_slist_free_all(slist1);
slist1 = NULL;
- return (int)ret;
+ return (int)result;
}
/**** End of sample code ****/
int main(int argc, char *argv[])
{
- CURLcode ret;
- CURL *hnd;
-
- hnd = curl_easy_init();
- curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
- curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
- curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER");
- curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "foo=bar&baz=quux");
- curl_easy_setopt(hnd, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)16);
- curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION");
- curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
- curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
+ CURLcode result;
+ CURL *curl;
+
+ curl = curl_easy_init();
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
+ curl_easy_setopt(curl, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER");
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "foo=bar&baz=quux");
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)16);
+ curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/%VERSION");
+ curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
+ curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
/* Here is a list of options the curl code used that cannot get generated
as source easily. You may choose to either not use them or implement
*/
- ret = curl_easy_perform(hnd);
+ result = curl_easy_perform(curl);
- curl_easy_cleanup(hnd);
- hnd = NULL;
+ curl_easy_cleanup(curl);
+ curl = NULL;
- return (int)ret;
+ return (int)result;
}
/**** End of sample code ****/
int main(int argc, char *argv[])
{
- CURLcode ret;
- CURL *hnd;
+ CURLcode result;
+ CURL *curl;
- hnd = curl_easy_init();
- curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
- curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
- curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER\?foo=bar&baz=quux");
- curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION");
- curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
- curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
+ curl = curl_easy_init();
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
+ curl_easy_setopt(curl, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER\?foo=bar&baz=quux");
+ curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/%VERSION");
+ curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
+ curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
/* Here is a list of options the curl code used that cannot get generated
as source easily. You may choose to either not use them or implement
*/
- ret = curl_easy_perform(hnd);
+ result = curl_easy_perform(curl);
- curl_easy_cleanup(hnd);
- hnd = NULL;
+ curl_easy_cleanup(curl);
+ curl = NULL;
- return (int)ret;
+ return (int)result;
}
/**** End of sample code ****/
int main(int argc, char *argv[])
{
- CURLcode ret;
- CURL *hnd;
+ CURLcode result;
+ CURL *curl;
curl_mime *mime1;
curl_mimepart *part1;
curl_mime *mime2;
slist1 = curl_slist_append(slist1, "X-testheader-1: header 1");
slist1 = curl_slist_append(slist1, "X-testheader-2: header 2");
- hnd = curl_easy_init();
- curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
- curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
- curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER");
- mime1 = curl_mime_init(hnd);
+ curl = curl_easy_init();
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
+ curl_easy_setopt(curl, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER");
+ mime1 = curl_mime_init(curl);
part1 = curl_mime_addpart(mime1);
curl_mime_data(part1, "value", CURL_ZERO_TERMINATED);
curl_mime_name(part1, "name");
part1 = curl_mime_addpart(mime1);
- mime2 = curl_mime_init(hnd);
+ mime2 = curl_mime_init(curl);
part2 = curl_mime_addpart(mime2);
curl_mime_filedata(part2, "%LOGDIR/test%TESTNUMBER.txt");
part2 = curl_mime_addpart(mime2);
curl_mime_subparts(part1, mime2);
mime2 = NULL;
curl_mime_name(part1, "file");
- curl_easy_setopt(hnd, CURLOPT_MIMEPOST, mime1);
- curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION");
- curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
- curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
+ curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime1);
+ curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/%VERSION");
+ curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
+ curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
/* Here is a list of options the curl code used that cannot get generated
as source easily. You may choose to either not use them or implement
*/
- ret = curl_easy_perform(hnd);
+ result = curl_easy_perform(curl);
- curl_easy_cleanup(hnd);
- hnd = NULL;
+ curl_easy_cleanup(curl);
+ curl = NULL;
curl_mime_free(mime1);
mime1 = NULL;
curl_mime_free(mime2);
curl_slist_free_all(slist1);
slist1 = NULL;
- return (int)ret;
+ return (int)result;
}
/**** End of sample code ****/
int main(int argc, char *argv[])
{
- CURLcode ret;
- CURL *hnd;
+ CURLcode result;
+ CURL *curl;
struct curl_slist *slist1;
struct curl_slist *slist2;
struct curl_slist *slist3;
slist3 = curl_slist_append(slist3, "NOOP 2");
slist3 = curl_slist_append(slist3, "*FAIL HARD");
- hnd = curl_easy_init();
- curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
- curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
- curl_easy_setopt(hnd, CURLOPT_URL, "ftp://%HOSTIP:%FTPPORT/%TESTNUMBER");
- curl_easy_setopt(hnd, CURLOPT_FTP_SKIP_PASV_IP, 1L);
- curl_easy_setopt(hnd, CURLOPT_QUOTE, slist1);
- curl_easy_setopt(hnd, CURLOPT_POSTQUOTE, slist2);
- curl_easy_setopt(hnd, CURLOPT_PREQUOTE, slist3);
- curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
+ curl = curl_easy_init();
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
+ curl_easy_setopt(curl, CURLOPT_URL, "ftp://%HOSTIP:%FTPPORT/%TESTNUMBER");
+ curl_easy_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, 1L);
+ curl_easy_setopt(curl, CURLOPT_QUOTE, slist1);
+ curl_easy_setopt(curl, CURLOPT_POSTQUOTE, slist2);
+ curl_easy_setopt(curl, CURLOPT_PREQUOTE, slist3);
+ curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
/* Here is a list of options the curl code used that cannot get generated
as source easily. You may choose to either not use them or implement
*/
- ret = curl_easy_perform(hnd);
+ result = curl_easy_perform(curl);
- curl_easy_cleanup(hnd);
- hnd = NULL;
+ curl_easy_cleanup(curl);
+ curl = NULL;
curl_slist_free_all(slist1);
slist1 = NULL;
curl_slist_free_all(slist2);
curl_slist_free_all(slist3);
slist3 = NULL;
- return (int)ret;
+ return (int)result;
}
/**** End of sample code ****/
int main(int argc, char *argv[])
{
- CURLcode ret;
- CURL *hnd;
+ CURLcode result;
+ CURL *curl;
struct curl_slist *slist1;
slist1 = NULL;
slist1 = curl_slist_append(slist1, "recipient.one@example.com");
slist1 = curl_slist_append(slist1, "recipient.two@example.com");
- hnd = curl_easy_init();
- curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
- curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
- curl_easy_setopt(hnd, CURLOPT_URL, "smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER");
- curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1L);
- curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION");
- curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
- curl_easy_setopt(hnd, CURLOPT_MAIL_FROM, "sender@example.com");
- curl_easy_setopt(hnd, CURLOPT_MAIL_RCPT, slist1);
- curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, (curl_off_t)38);
+ curl = curl_easy_init();
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
+ curl_easy_setopt(curl, CURLOPT_URL, "smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER");
+ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
+ curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/%VERSION");
+ curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
+ curl_easy_setopt(curl, CURLOPT_MAIL_FROM, "sender@example.com");
+ curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, slist1);
+ curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)38);
/* Here is a list of options the curl code used that cannot get generated
as source easily. You may choose to either not use them or implement
*/
- ret = curl_easy_perform(hnd);
+ result = curl_easy_perform(curl);
- curl_easy_cleanup(hnd);
- hnd = NULL;
+ curl_easy_cleanup(curl);
+ curl = NULL;
curl_slist_free_all(slist1);
slist1 = NULL;
- return (int)ret;
+ return (int)result;
}
/**** End of sample code ****/
int main(int argc, char *argv[])
{
- CURLcode ret;
- CURL *hnd;
+ CURLcode result;
+ CURL *curl;
- hnd = curl_easy_init();
- curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
- curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
- curl_easy_setopt(hnd, CURLOPT_URL, "pop3://%HOSTIP:%POP3PORT/%TESTNUMBER");
- curl_easy_setopt(hnd, CURLOPT_DIRLISTONLY, 1L);
- curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret");
- curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
+ curl = curl_easy_init();
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
+ curl_easy_setopt(curl, CURLOPT_URL, "pop3://%HOSTIP:%POP3PORT/%TESTNUMBER");
+ curl_easy_setopt(curl, CURLOPT_DIRLISTONLY, 1L);
+ curl_easy_setopt(curl, CURLOPT_USERPWD, "user:secret");
+ curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
/* Here is a list of options the curl code used that cannot get generated
as source easily. You may choose to either not use them or implement
*/
- ret = curl_easy_perform(hnd);
+ result = curl_easy_perform(curl);
- curl_easy_cleanup(hnd);
- hnd = NULL;
+ curl_easy_cleanup(curl);
+ curl = NULL;
- return (int)ret;
+ return (int)result;
}
/**** End of sample code ****/
int main(int argc, char *argv[])
{
- CURLcode ret;
- CURL *hnd;
+ CURLcode result;
+ CURL *curl;
- hnd = curl_easy_init();
- curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
- curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
- curl_easy_setopt(hnd, CURLOPT_URL, "imap://%HOSTIP:%IMAPPORT/%TESTNUMBER/;MAILINDEX=1");
- curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret");
- curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION");
- curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
+ curl = curl_easy_init();
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
+ curl_easy_setopt(curl, CURLOPT_URL, "imap://%HOSTIP:%IMAPPORT/%TESTNUMBER/;MAILINDEX=1");
+ curl_easy_setopt(curl, CURLOPT_USERPWD, "user:secret");
+ curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/%VERSION");
+ curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
/* Here is a list of options the curl code used that cannot get generated
as source easily. You may choose to either not use them or implement
*/
- ret = curl_easy_perform(hnd);
+ result = curl_easy_perform(curl);
- curl_easy_cleanup(hnd);
- hnd = NULL;
+ curl_easy_cleanup(curl);
+ curl = NULL;
- return (int)ret;
+ return (int)result;
}
/**** End of sample code ****/
int main(int argc, char *argv[])
{
- CURLcode ret;
- CURL *hnd;
-
- hnd = curl_easy_init();
- curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
- curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
- curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER");
- curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "ab\201cd\000e\\\"\?\r\n\t\001fghi\x1ajklm\xfd");
- curl_easy_setopt(hnd, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)24);
- curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION");
- curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
- curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
+ CURLcode result;
+ CURL *curl;
+
+ curl = curl_easy_init();
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
+ curl_easy_setopt(curl, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER");
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "ab\201cd\000e\\\"\?\r\n\t\001fghi\x1ajklm\xfd");
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)24);
+ curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/%VERSION");
+ curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
+ curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
/* Here is a list of options the curl code used that cannot get generated
as source easily. You may choose to either not use them or implement
*/
- ret = curl_easy_perform(hnd);
+ result = curl_easy_perform(curl);
- curl_easy_cleanup(hnd);
- hnd = NULL;
+ curl_easy_cleanup(curl);
+ curl = NULL;
- return (int)ret;
+ return (int)result;
}
/**** End of sample code ****/
int main(int argc, char *argv[])
{
- CURLcode ret;
- CURL *hnd;
-
- hnd = curl_easy_init();
- curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
- curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
- curl_easy_setopt(hnd, CURLOPT_URL, "http://moo/");
- curl_easy_setopt(hnd, CURLOPT_PROXY, "http://%HOSTIP:%HTTPPORT");
- curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/%VERSION");
- curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
- curl_easy_setopt(hnd, CURLOPT_SSLVERSION, (long)(CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_TLSv1_3));
- curl_easy_setopt(hnd, CURLOPT_PROXY_SSLVERSION, (long)CURL_SSLVERSION_TLSv1);
- curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
+ CURLcode result;
+ CURL *curl;
+
+ curl = curl_easy_init();
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L);
+ curl_easy_setopt(curl, CURLOPT_URL, "http://moo/");
+ curl_easy_setopt(curl, CURLOPT_PROXY, "http://%HOSTIP:%HTTPPORT");
+ curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/%VERSION");
+ curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
+ curl_easy_setopt(curl, CURLOPT_SSLVERSION, (long)(CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_TLSv1_3));
+ curl_easy_setopt(curl, CURLOPT_PROXY_SSLVERSION, (long)CURL_SSLVERSION_TLSv1);
+ curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
/* Here is a list of options the curl code used that cannot get generated
as source easily. You may choose to either not use them or implement
*/
- ret = curl_easy_perform(hnd);
+ result = curl_easy_perform(curl);
- curl_easy_cleanup(hnd);
- hnd = NULL;
+ curl_easy_cleanup(curl);
+ curl = NULL;
- return (int)ret;
+ return (int)result;
}
/**** End of sample code ****/