lib: add a Curl_bufref_uptr() function and use it

Function Curl_bufref_ptr() now returns a const char *.
New function Curl_bufref_uptr() returns a const unsigned char *.

Usage and doc updated.

Closes #19827
This commit is contained in:
Patrick Monnerat 2025-12-03 18:36:03 +01:00 committed by Daniel Stenberg
parent 39d1976b7f
commit f39b8a1174
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
13 changed files with 40 additions and 23 deletions

View file

@ -39,7 +39,8 @@ struct bufref {
void Curl_bufref_init(struct bufref *br);
void Curl_bufref_set(struct bufref *br, const void *ptr, size_t len,
void (*dtor)(void *));
const unsigned char *Curl_bufref_ptr(const struct bufref *br);
const char *Curl_bufref_ptr(const struct bufref *br);
const unsigned char *Curl_bufref_uptr(const struct bufref *br);
size_t Curl_bufref_len(const struct bufref *br);
CURLcode Curl_bufref_memdup(struct bufref *br, const void *ptr, size_t len);
void Curl_bufref_free(struct bufref *br);