]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
232c150a WD |
2 | /* |
3 | * (C) Copyright 2003 | |
4 | * Gerry Hamel, [email protected], Texas Instruments | |
232c150a WD |
5 | */ |
6 | ||
7 | #ifndef __CIRCBUF_H__ | |
8 | #define __CIRCBUF_H__ | |
9 | ||
10 | typedef struct circbuf { | |
11 | unsigned int size; /* current number of bytes held */ | |
12 | unsigned int totalsize; /* number of bytes allocated */ | |
13 | ||
14 | char *top; /* pointer to current buffer start */ | |
15 | char *tail; /* pointer to space for next element */ | |
16 | ||
17 | char *data; /* all data */ | |
18 | char *end; /* end of data buffer */ | |
19 | } circbuf_t; | |
20 | ||
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); | |
25 | ||
26 | #endif |