]>
Commit | Line | Data |
---|---|---|
3e6d35e5 | 1 | /* SPDX-License-Identifier: BSD-3-Clause */ |
f0cbd3ec FB |
2 | /* |
3 | * Copyright (c) 1995 Danny Gasparovski. | |
f0cbd3ec FB |
4 | */ |
5 | ||
2a6a4076 MA |
6 | #ifndef SBUF_H |
7 | #define SBUF_H | |
f0cbd3ec | 8 | |
f0cbd3ec FB |
9 | #define sbspace(sb) ((sb)->sb_datalen - (sb)->sb_cc) |
10 | ||
11 | struct sbuf { | |
2a7cab9e DDAG |
12 | uint32_t sb_cc; /* actual chars in buffer */ |
13 | uint32_t sb_datalen; /* Length of data */ | |
f0cbd3ec FB |
14 | char *sb_wptr; /* write pointer. points to where the next |
15 | * bytes should be written in the sbuf */ | |
16 | char *sb_rptr; /* read pointer. points to where the next | |
17 | * byte should be read from the sbuf */ | |
18 | char *sb_data; /* Actual data */ | |
19 | }; | |
20 | ||
6cb9c6d3 | 21 | void sbfree(struct sbuf *); |
c21d9594 | 22 | bool sbdrop(struct sbuf *, int); |
6cb9c6d3 BS |
23 | void sbreserve(struct sbuf *, int); |
24 | void sbappend(struct socket *, struct mbuf *); | |
25 | void sbcopy(struct sbuf *, int, int, char *); | |
f0cbd3ec FB |
26 | |
27 | #endif |