mirror of
https://github.com/curl/curl.git
synced 2026-08-25 11:23:39 +03:00
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:
parent
0313223853
commit
928363f28c
59 changed files with 715 additions and 725 deletions
|
|
@ -43,7 +43,7 @@ struct WriteThis {
|
|||
size_t sizeleft;
|
||||
};
|
||||
|
||||
static size_t read_callback(char *dest, size_t size, size_t nmemb, void *userp)
|
||||
static size_t read_cb(char *dest, size_t size, size_t nmemb, void *userp)
|
||||
{
|
||||
struct WriteThis *wt = (struct WriteThis *)userp;
|
||||
size_t buffer_size = size*nmemb;
|
||||
|
|
@ -92,7 +92,7 @@ int main(void)
|
|||
curl_easy_setopt(curl, CURLOPT_POST, 1L);
|
||||
|
||||
/* we want to use our own read function */
|
||||
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
||||
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb);
|
||||
|
||||
/* pointer to pass to our read function */
|
||||
curl_easy_setopt(curl, CURLOPT_READDATA, &wt);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue