---
name: "CURLOPT_XFERINFODATA"
section: "3"
platform: "linux"
package: "curl"
version: "8.23.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/CURLOPT_XFERINFODATA"
---

# CURLOPT\_XFERINFODATA(3)

pointer passed to the progress callback

## NAME

CURLOPT\_XFERINFODATA - pointer passed to the progress callback

## SYNOPSIS

```
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_XFERINFODATA, void *pointer);
```

## DESCRIPTION

Pass a *pointer* that is untouched by libcurl and passed as the first argument in the progress callback set with *[CURLOPT\_XFERINFOFUNCTION(3)](/CURLOPT_XFERINFOFUNCTION/3.md)*.

This is an alias for *[CURLOPT\_PROGRESSDATA(3)](/CURLOPT_PROGRESSDATA/3.md)*.

## DEFAULT

NULL

## PROTOCOLS

This functionality affects all supported protocols

## EXAMPLE

```
struct progress {
  char *private_data;
  size_t size;
};
static int progress_cb(void *clientp,
                       curl_off_t dltotal,
                       curl_off_t dlnow,
                       curl_off_t ultotal,
                       curl_off_t ulnow)
{
  struct progress *memory = clientp;
  printf("private ptr: %p\n", (void *)memory->private_data);
  /* use the values */
  return 0; /* all is good */
}
int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    struct progress data;
    /* pass struct to callback */
    curl_easy_setopt(curl, CURLOPT_XFERINFODATA, &data);
    curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_cb);
  }
}
```

## AVAILABILITY

Added in curl 7.32.0

## RETURN VALUE

*[curl\_easy\_setopt(3)](/curl_easy_setopt/3.md)* returns a CURLcode indicating success or error.

CURLE\_OK (0) means everything was OK, non-zero means an error occurred, see *[libcurl-errors(3)](/libcurl-errors/3.md)*.

## SEE ALSO

[**CURLOPT\_NOPROGRESS**(3)](/CURLOPT_NOPROGRESS/3.md), [**CURLOPT\_VERBOSE**(3)](/CURLOPT_VERBOSE/3.md), [**CURLOPT\_XFERINFOFUNCTION**(3)](/CURLOPT_XFERINFOFUNCTION/3.md)
