cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Parameters in CURLOPT_WRITEFUNCTION:

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 2 Mar 2009 09:41:36 +0100 (CET)

On Sun, 1 Mar 2009, Honey Dont wrote:

You're obviously using the library so I would strongly recommend that you use
the curl-library mailing list instead!

> Hi there. I'm new to cURL and going through examples and the tutorial. In
> the CURLOPT_WRITEFUNCTION you have four parameters, two of which is size_t
> size, and size_t nmemb. In the doc for this function it is said, "The size
> of the data pointed to by ptr is size multiplied with nmemb."
>
> Is this to account for the difference in ascii and unicode?

Not at all. It doesn't take anything particular into "account", it just tells
you the size of the data and it uses the same argument set that fwrite()
offers which is why it uses two arguments to specify the size.

> In other words nmemb is the number of elements pointed to by ptr and size is
> either equal to one or two depending on whether unicode is being used or
> not?

libcurl delivers binary data and it has no idea about what it delivers so it
cannot make any such distinction.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-03-02