docs: rename CURLcode variables to 'result'

This commit is contained in:
Daniel Stenberg 2025-12-16 15:54:06 +01:00
parent d21f4372ff
commit 09f01f28ec
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
381 changed files with 1705 additions and 1695 deletions

View file

@ -33,9 +33,9 @@ int main(void)
{
CURL *curl;
CURLcode res = curl_global_init(CURL_GLOBAL_ALL);
if(res)
return (int)res;
CURLcode result = curl_global_init(CURL_GLOBAL_ALL);
if(result)
return (int)result;
curl = curl_easy_init();
if(curl) {
@ -45,23 +45,23 @@ int main(void)
/* get the first document */
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
/* Perform the request, res gets the return code */
res = curl_easy_perform(curl);
/* Perform the request, result gets the return code */
result = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
if(result != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
curl_easy_strerror(result));
/* get another document from the same server using the same
connection */
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/docs/");
/* Perform the request, res gets the return code */
res = curl_easy_perform(curl);
/* Perform the request, result gets the return code */
result = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
if(result != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
curl_easy_strerror(result));
/* always cleanup */
curl_easy_cleanup(curl);
@ -69,5 +69,5 @@ int main(void)
curl_global_cleanup();
return (int)res;
return (int)result;
}