GNURLOPT_SEEKDATA(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

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