GNURLOPT_SEEKDATA(3)
Hey bestie π you're on the GNURLOPT_SEEKDATA(3) page from the curl_easy_setopt options crew. It's short, it's sweet, and it's literally about the custom pointer you hand to your seek callback. No cap.
β¨ NAME β¨
CURLOPT_SEEKDATA β the custom pointer that gets passed to the seek callback. That's the whole vibe π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SEEKDATA, void
*pointer);
β¨ DESCRIPTION β¨
This is the data pointer you pass to the seek callback function. If you're using the CURLOPT_SEEKFUNCTION(3) option, this is the pointer you'll get as input. Iconic behavior, honestly π«Ά
β¨ DEFAULT β¨
If you don't set this, NULL is passed to the callback. That's the default, bestie β no extra drama π
β¨ PROTOCOLS β¨
HTTP, FTP, SFTP. Slay π
β¨ EXAMPLE β¨
static int seek_cb(void *userp, curl_off_t offset, int origin)
{
struct data *d = (struct data *)userp;
lseek(d->our_fd, offset, origin);
return CURL_SEEKFUNC_OK;
}
{
struct data seek_data;
curl_easy_setopt(CURL *handle, CURLOPT_SEEKFUNCTION, seek_cb);
curl_easy_setopt(CURL *handle, CURLOPT_SEEKDATA, &seek_data);
}
β¨ AVAILABILITY β¨
Added in 7.18.0. Periodt β¨
β¨ RETURN VALUE β¨
This section is empty in the original, so there are no return-value details listed here. Not me leaving it blank β it's giving "no notes" π
β¨ SEE ALSO β¨
Later, besties π this lil' page is from libcurl 7.37.0, dated 16 Jun 2014 β catch you in the next manpage π¦
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms