Fun API Documentation 0.42.1
The programming language that makes you have fun!
Loading...
Searching...
No Matches
FunCurlBuf Struct Reference

Simple growable buffer for libcurl write callbacks. More...

Data Fields

char * d
size_t n

Detailed Description

Simple growable buffer for libcurl write callbacks.

The buffer grows via realloc as more data arrives. The content is kept NUL-terminated for convenience so it can be treated as a C-string.

Usage pattern:

  • Initialize: FunCurlBuf b = { .d = NULL, .n = 0 };
  • Set CURLOPT_WRITEFUNCTION = fun_curl_write_cb and CURLOPT_WRITEDATA = &b
  • After curl_easy_perform(), b.d points to the collected data (length b.n).
  • Free with free(b.d) when done.

Definition at line 69 of file curl.c.

Field Documentation

◆ d

char* d

Data pointer (NUL-terminated).

Definition at line 70 of file curl.c.

◆ n

size_t n

Number of bytes stored (excluding NUL).

Definition at line 71 of file curl.c.


The documentation for this struct was generated from the following file: