examples: consistent variable naming across examples

- 'CURL *' handles are called 'curl'
- 'CURLM *' handles are called 'multi'
- write callbacks are called 'write_cb'
- read callbacs are called 'read_cb'
- CURLcode variables are called 'res'

It makes the examples look and feel more consistent. It allows for
easier copy and pasting between examples.

Closes #19299
This commit is contained in:
Daniel Stenberg 2025-10-31 14:42:30 +01:00
parent 0313223853
commit 928363f28c
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
59 changed files with 715 additions and 725 deletions

View file

@ -46,10 +46,10 @@ int main(void)
curl = curl_easy_init();
if(curl) {
CURLM *multi_handle;
CURLM *multi;
multi_handle = curl_multi_init();
if(multi_handle) {
multi = curl_multi_init();
if(multi) {
int still_running = 0;
/* Create the form */
@ -82,20 +82,20 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
curl_easy_setopt(curl, CURLOPT_MIMEPOST, form);
curl_multi_add_handle(multi_handle, curl);
curl_multi_add_handle(multi, curl);
do {
CURLMcode mc = curl_multi_perform(multi_handle, &still_running);
CURLMcode mc = curl_multi_perform(multi, &still_running);
if(still_running)
/* wait for activity, timeout or "nothing" */
mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL);
mc = curl_multi_poll(multi, NULL, 0, 1000, NULL);
if(mc)
break;
} while(still_running);
curl_multi_cleanup(multi_handle);
curl_multi_cleanup(multi);
}
/* always cleanup */