Sortix 1.1dev ports manual
This manual documents Sortix 1.1dev ports. You can instead view this document in the latest official manual.
CURLOPT_WRITEFUNCTION(3) | curl_easy_setopt options | CURLOPT_WRITEFUNCTION(3) |
NAME
CURLOPT_WRITEFUNCTION - set callback for writing received dataSYNOPSIS
#include <curl/curl.h> size_t write_callback(char *ptr, size_t size, size_t nmemb, void *userdata); CURLcode curl_easy_setopt(CURL *handle, CURLOPT_WRITEFUNCTION, write_callback);
DESCRIPTION
Pass a pointer to your callback function, which should match the prototype shown above.DEFAULT
libcurl will use 'fwrite' as a callback by default.PROTOCOLS
For all protocolsAVAILABILITY
Support for the CURL_WRITEFUNC_PAUSE return code was added in version 7.18.0.RETURN VALUE
This will return CURLE_OK.EXAMPLE
A common technique is to use this callback to store the incoming data into a dynamically growing allocated buffer. Like in the getinmemory example: https://curl.haxx.se/libcurl/c/getinmemory.htmlSEE ALSO
CURLOPT_WRITEDATA(3), CURLOPT_READFUNCTION(3),November 23, 2018 | libcurl 7.69.0 |