1CURLOPT_WRITEDATA(3)       curl_easy_setopt options       CURLOPT_WRITEDATA(3)
2
3
4

NAME

6       CURLOPT_WRITEDATA - custom pointer passed to the write callback
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode   curl_easy_setopt(CURL   *handle,   CURLOPT_WRITEDATA,   void
12       *pointer);
13

DESCRIPTION

15       A data pointer to pass to the write  callback.  If  you  use  the  CUR‐
16       LOPT_WRITEFUNCTION(3)  option,  this  is the pointer you'll get in that
17       callback's 4th argument. If you don't use a write  callback,  you  must
18       make pointer a 'FILE *' (cast to 'void *') as libcurl will pass this to
19       fwrite(3) when writing data.
20
21       The internal CURLOPT_WRITEFUNCTION(3) will write the data to the FILE *
22       given with this option, or to stdout if this option hasn't been set.
23
24       If  you're  using libcurl as a win32 DLL, you MUST use a CURLOPT_WRITE‐
25       FUNCTION(3) if you set this option or you will experience crashes.
26

DEFAULT

28       By default, this is a FILE * to stdout.
29

PROTOCOLS

31       Used for all protocols.
32

EXAMPLE

34       A common technique is to use the write callback to store  the  incoming
35       data  into  a  dynamically growing allocated buffer, and then this CUR‐
36       LOPT_WRITEDATA(3) is used to point to a struct or the buffer  to  store
37       data      in.      Like      in      the      getinmemory      example:
38       https://curl.haxx.se/libcurl/c/getinmemory.html
39

AVAILABILITY

41       Available in all libcurl versions. This option was  formerly  known  as
42       CURLOPT_FILE, the name CURLOPT_WRITEDATA(3) was introduced in 7.9.7.
43

RETURN VALUE

45       This will return CURLE_OK.
46

SEE ALSO

48       CURLOPT_WRITEFUNCTION(3), CURLOPT_READDATA(3),
49
50
51
52libcurl 7.64.0                  August 11, 2018           CURLOPT_WRITEDATA(3)
Impressum