}
static size_t chunk_append(struct buf_chunk *chunk,
- const unsigned char *buf, size_t len)
+ const uint8_t *buf, size_t len)
{
- unsigned char *p = &chunk->x.data[chunk->w_offset];
+ uint8_t *p = &chunk->x.data[chunk->w_offset];
size_t n = chunk->dlen - chunk->w_offset;
DEBUGASSERT(chunk->dlen >= chunk->w_offset);
if(n) {
}
static size_t chunk_read(struct buf_chunk *chunk,
- unsigned char *buf, size_t len)
+ uint8_t *buf, size_t len)
{
- unsigned char *p = &chunk->x.data[chunk->r_offset];
+ uint8_t *p = &chunk->x.data[chunk->r_offset];
size_t n = chunk->w_offset - chunk->r_offset;
DEBUGASSERT(chunk->w_offset >= chunk->r_offset);
if(!n) {
Curl_bufq_reader *reader,
void *reader_ctx, size_t *pnread)
{
- unsigned char *p = &chunk->x.data[chunk->w_offset];
+ uint8_t *p = &chunk->x.data[chunk->w_offset];
size_t n = chunk->dlen - chunk->w_offset; /* free amount */
CURLcode result;
}
static void chunk_peek(const struct buf_chunk *chunk,
- const unsigned char **pbuf, size_t *plen)
+ const uint8_t **pbuf, size_t *plen)
{
DEBUGASSERT(chunk->w_offset >= chunk->r_offset);
*pbuf = &chunk->x.data[chunk->r_offset];
}
static void chunk_peek_at(const struct buf_chunk *chunk, size_t offset,
- const unsigned char **pbuf, size_t *plen)
+ const uint8_t **pbuf, size_t *plen)
{
offset += chunk->r_offset;
DEBUGASSERT(chunk->w_offset >= offset);
}
CURLcode Curl_bufq_write(struct bufq *q,
- const unsigned char *buf, size_t len,
+ const uint8_t *buf, size_t len,
size_t *pnwritten)
{
struct buf_chunk *tail;
const char *buf, size_t len,
size_t *pnwritten)
{
- return Curl_bufq_write(q, (const unsigned char *)buf, len, pnwritten);
+ return Curl_bufq_write(q, (const uint8_t *)buf, len, pnwritten);
}
-CURLcode Curl_bufq_read(struct bufq *q, unsigned char *buf, size_t len,
+CURLcode Curl_bufq_read(struct bufq *q, uint8_t *buf, size_t len,
size_t *pnread)
{
*pnread = 0;
CURLcode Curl_bufq_cread(struct bufq *q, char *buf, size_t len,
size_t *pnread)
{
- return Curl_bufq_read(q, (unsigned char *)buf, len, pnread);
+ return Curl_bufq_read(q, (uint8_t *)buf, len, pnread);
}
bool Curl_bufq_peek(struct bufq *q,
- const unsigned char **pbuf, size_t *plen)
+ const uint8_t **pbuf, size_t *plen)
{
if(q->head && chunk_is_empty(q->head)) {
prune_head(q);
}
bool Curl_bufq_peek_at(struct bufq *q, size_t offset,
- const unsigned char **pbuf, size_t *plen)
+ const uint8_t **pbuf, size_t *plen)
{
struct buf_chunk *c = q->head;
size_t clen;
CURLcode Curl_bufq_pass(struct bufq *q, Curl_bufq_writer *writer,
void *writer_ctx, size_t *pwritten)
{
- const unsigned char *buf;
+ const uint8_t *buf;
size_t blen;
CURLcode result = CURLE_OK;
}
CURLcode Curl_bufq_write_pass(struct bufq *q,
- const unsigned char *buf, size_t len,
+ const uint8_t *buf, size_t len,
Curl_bufq_writer *writer, void *writer_ctx,
size_t *pwritten)
{
size_t r_offset; /* first unread bytes */
size_t w_offset; /* one after last written byte */
union {
- unsigned char data[1]; /* the buffer for `dlen` bytes */
+ uint8_t data[1]; /* the buffer for `dlen` bytes */
void *dummy; /* alignment */
} x;
};
* CURLE_AGAIN is returned if the buffer queue is full.
*/
CURLcode Curl_bufq_write(struct bufq *q,
- const unsigned char *buf, size_t len,
+ const uint8_t *buf, size_t len,
size_t *pnwritten);
CURLcode Curl_bufq_cwrite(struct bufq *q,
* Read buf from the start of the buffer queue. The buf is copied
* and the amount of copied bytes is returned.
*/
-CURLcode Curl_bufq_read(struct bufq *q, unsigned char *buf, size_t len,
+CURLcode Curl_bufq_read(struct bufq *q, uint8_t *buf, size_t len,
size_t *pnread);
CURLcode Curl_bufq_cread(struct bufq *q, char *buf, size_t len,
* is modified, see `Curl_bufq_skip()``
*/
bool Curl_bufq_peek(struct bufq *q,
- const unsigned char **pbuf, size_t *plen);
+ const uint8_t **pbuf, size_t *plen);
bool Curl_bufq_peek_at(struct bufq *q, size_t offset,
- const unsigned char **pbuf, size_t *plen);
+ const uint8_t **pbuf, size_t *plen);
/**
* Tell the buffer queue to discard `amount` buf bytes at the head
void Curl_bufq_skip(struct bufq *q, size_t amount);
typedef CURLcode Curl_bufq_writer(void *writer_ctx,
- const unsigned char *buf, size_t len,
+ const uint8_t *buf, size_t len,
size_t *pwritten);
/**
* Passes the chunks in the buffer queue to the writer and returns
void *writer_ctx, size_t *pwritten);
typedef CURLcode Curl_bufq_reader(void *reader_ctx,
- unsigned char *buf, size_t len,
+ uint8_t *buf, size_t len,
size_t *pnread);
/**
* amount buffered, chunk size, etc.
*/
CURLcode Curl_bufq_write_pass(struct bufq *q,
- const unsigned char *buf, size_t len,
+ const uint8_t *buf, size_t len,
Curl_bufq_writer *writer, void *writer_ctx,
size_t *pwritten);