003 File Manager
Current Path:
/usr/local/share/doc/curl
usr
/
local
/
share
/
doc
/
curl
/
📁
..
📄
ALTSVC.md
(1.08 KB)
📄
BINDINGS.md
(5.44 KB)
📄
BUFREF.md
(2.21 KB)
📄
BUG-BOUNTY.md
(3.26 KB)
📄
BUGS.md
(11.65 KB)
📄
CHECKSRC.md
(6.41 KB)
📄
CIPHERS.md
(10.93 KB)
📄
CODE_OF_CONDUCT.md
(1.57 KB)
📄
CODE_REVIEW.md
(5.76 KB)
📄
CODE_STYLE.md
(7.53 KB)
📄
CONTRIBUTE.md
(13.25 KB)
📄
CURL-DISABLE.md
(2.15 KB)
📄
DEPRECATE.md
(399 B)
📄
DYNBUF.md
(2.5 KB)
📄
ECH.md
(4.63 KB)
📄
EXPERIMENTAL.md
(912 B)
📄
FAQ
(65.37 KB)
📄
FEATURES.md
(5.69 KB)
📄
GOVERNANCE.md
(6.77 KB)
📄
HELP-US.md
(3.88 KB)
📄
HISTORY.md
(11.51 KB)
📄
HSTS.md
(1.4 KB)
📄
HTTP-COOKIES.md
(5.09 KB)
📄
HTTP2.md
(4.47 KB)
📄
HTTP3.md
(3.65 KB)
📄
HYPER.md
(1.84 KB)
📄
INSTALL
(315 B)
📄
INSTALL.md
(21.26 KB)
📄
INTERNALS.md
(42.85 KB)
📄
KNOWN_BUGS
(43.34 KB)
📄
MAIL-ETIQUETTE
(11.7 KB)
📄
MQTT.md
(630 B)
📄
NEW-PROTOCOL.md
(4.46 KB)
📄
PARALLEL-TRANSFERS.md
(2.04 KB)
📄
README.md
(495 B)
📄
RELEASE-PROCEDURE.md
(3.24 KB)
📄
ROADMAP.md
(854 B)
📄
RUSTLS.md
(806 B)
📄
SECURITY-PROCESS.md
(5.63 KB)
📄
SSL-PROBLEMS.md
(3.96 KB)
📄
SSLCERTS.md
(8.15 KB)
📄
THANKS
(36.43 KB)
📄
TODO
(46.71 KB)
📄
TheArtOfHttpScripting.md
(27.56 KB)
📄
URL-SYNTAX.md
(13.23 KB)
📄
VERSIONS.md
(2.22 KB)
📁
libcurl
📄
options-in-versions
(10.69 KB)
Editing: BUFREF.md
# bufref This is an internal module for handling buffer references. A referenced buffer is associated with its destructor function that is implicitly called when the reference is invalidated. Once referenced, a buffer cannot be reallocated. A data length is stored within the reference for binary data handling purpose; it is not used by the bufref API. The `struct bufref` is used to hold data referencing a buffer. The members of that structure **MUST NOT** be accessed or modified without using the dedicated bufref API. ## init ```c void Curl_bufref_init(struct bufref *br); ``` Initialises a `bufref` structure. This function **MUST** be called before any other operation is performed on the structure. Upon completion, the referenced buffer is `NULL` and length is zero. This function may also be called to bypass referenced buffer destruction while invalidating the current reference. ## free ```c void Curl_bufref_free(struct bufref *br); ``` Destroys the previously referenced buffer using its destructor and reinitialises the structure for a possible subsequent reuse. ## set ```c void Curl_bufref_set(struct bufref *br, const void *buffer, size_t length, void (*destructor)(void *)); ``` Releases the previously referenced buffer, then assigns the new `buffer` to the structure, associated with its `destructor` function. The later can be specified as `NULL`: this will be the case when the referenced buffer is static. if `buffer` is NULL, `length`must be zero. ## memdup ```c CURLcode Curl_bufref_memdup(struct bufref *br, const void *data, size_t length); ``` Releases the previously referenced buffer, then duplicates the `length`-byte `data` into a buffer allocated via `malloc()` and references the latter associated with destructor `curl_free()`. An additional trailing byte is allocated and set to zero as a possible string zero-terminator; it is not counted in the stored length. Returns `CURLE_OK` if successful, else `CURLE_OUT_OF_MEMORY`. ## ptr ```c const unsigned char *Curl_bufref_ptr(const struct bufref *br); ``` Returns a `const unsigned char *` to the referenced buffer. ## len ```c size_t Curl_bufref_len(const struct bufref *br); ``` Returns the stored length of the referenced buffer.
Upload File
Create Folder