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