mirror of
https://github.com/curl/curl.git
synced 2026-08-25 10:03:37 +03:00
docs: rename CURLcode variables to 'result'
This commit is contained in:
parent
d21f4372ff
commit
09f01f28ec
381 changed files with 1705 additions and 1695 deletions
|
|
@ -49,14 +49,14 @@ int main(void)
|
|||
{
|
||||
char ftpurl[] = "ftp://ftp.example.com/gnu/binutils/binutils-2.19.1.tar.bz2";
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
long filetime = -1;
|
||||
curl_off_t filesize = 0;
|
||||
const char *filename = strrchr(ftpurl, '/') + 1;
|
||||
|
||||
res = curl_global_init(CURL_GLOBAL_ALL);
|
||||
if(res)
|
||||
return (int)res;
|
||||
result = curl_global_init(CURL_GLOBAL_ALL);
|
||||
if(result)
|
||||
return (int)result;
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
|
|
@ -70,24 +70,24 @@ int main(void)
|
|||
/* Switch on full protocol/debug output */
|
||||
/* curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); */
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
result = curl_easy_perform(curl);
|
||||
|
||||
if(CURLE_OK == res) {
|
||||
if(CURLE_OK == result) {
|
||||
/* https://curl.se/libcurl/c/curl_easy_getinfo.html */
|
||||
res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime);
|
||||
if((CURLE_OK == res) && (filetime >= 0)) {
|
||||
result = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime);
|
||||
if((CURLE_OK == result) && (filetime >= 0)) {
|
||||
time_t file_time = (time_t)filetime;
|
||||
printf("filetime %s: %s", filename, ctime(&file_time));
|
||||
}
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T,
|
||||
&filesize);
|
||||
if((CURLE_OK == res) && (filesize > 0))
|
||||
result = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T,
|
||||
&filesize);
|
||||
if((CURLE_OK == result) && (filesize > 0))
|
||||
printf("filesize %s: %" CURL_FORMAT_CURL_OFF_T " bytes\n",
|
||||
filename, filesize);
|
||||
}
|
||||
else {
|
||||
/* we failed */
|
||||
fprintf(stderr, "curl told us %d\n", res);
|
||||
fprintf(stderr, "curl told us %d\n", result);
|
||||
}
|
||||
|
||||
/* always cleanup */
|
||||
|
|
@ -96,5 +96,5 @@ int main(void)
|
|||
|
||||
curl_global_cleanup();
|
||||
|
||||
return (int)res;
|
||||
return (int)result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue