]>
git.ipfire.org Git - people/ms/u-boot.git/blob - include/circbuf.h
3 * Gerry Hamel, geh@ti.com, Texas Instruments
5 * SPDX-License-Identifier: GPL-2.0+
11 typedef struct circbuf
{
12 unsigned int size
; /* current number of bytes held */
13 unsigned int totalsize
; /* number of bytes allocated */
15 char *top
; /* pointer to current buffer start */
16 char *tail
; /* pointer to space for next element */
18 char *data
; /* all data */
19 char *end
; /* end of data buffer */
22 int buf_init (circbuf_t
* buf
, unsigned int size
);
23 int buf_free (circbuf_t
* buf
);
24 int buf_pop (circbuf_t
* buf
, char *dest
, unsigned int len
);
25 int buf_push (circbuf_t
* buf
, const char *src
, unsigned int len
);