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

NAME

6       CURLOPT_SEEKDATA - custom pointer passed to the seek callback
7

SYNOPSIS

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

DESCRIPTION

15       Data pointer to pass to the seek callback function. If you use the CUR‐
16       LOPT_SEEKFUNCTION(3) option, this is the pointer you'll get as input.
17

DEFAULT

19       If you don't set this, NULL is passed to the callback.
20

PROTOCOLS

22       HTTP, FTP, SFTP
23

EXAMPLE

25       static int seek_cb(void *userp, curl_off_t offset, int origin)
26       {
27         struct data *d = (struct data *)userp;
28         lseek(d->our_fd, offset, origin);
29         return CURL_SEEKFUNC_OK;
30       }
31
32       {
33         struct data seek_data;
34         curl_easy_setopt(CURL *handle, CURLOPT_SEEKFUNCTION, seek_cb);
35         curl_easy_setopt(CURL *handle, CURLOPT_SEEKDATA, &seek_data);
36       }
37

AVAILABILITY

39       Added in 7.18.0
40

RETURN VALUE

SEE ALSO

43       CURLOPT_STDERR(3), CURLOPT_DEBUGFUNCTION(3),
44
45
46
47libcurl 7.76.1                 November 04, 2020           CURLOPT_SEEKDATA(3)
Impressum