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

@ -60,7 +60,7 @@
#define INADDR_NONE 0xffffffff
#endif
static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream)
{
size_t written = fwrite(ptr, size, nmemb, (FILE *)stream);
return written;
@ -143,7 +143,7 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
/* send all data to this function */
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
/* call this function to get a socket */
curl_easy_setopt(curl, CURLOPT_OPENSOCKETFUNCTION, opensocket);