nbd: Permit simple error to NBD_CMD_BLOCK_STATUS
[qemu/ericb.git] / slirp / src / sbuf.h
blob337af1bbdef413a7511eaff5c4a4e4bbe32cea02
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3 * Copyright (c) 1995 Danny Gasparovski.
4 */
6 #ifndef SBUF_H
7 #define SBUF_H
9 #define sbspace(sb) ((sb)->sb_datalen - (sb)->sb_cc)
11 struct sbuf {
12 uint32_t sb_cc; /* actual chars in buffer */
13 uint32_t sb_datalen; /* Length of data */
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 */
21 void sbfree(struct sbuf *);
22 bool sbdrop(struct sbuf *, int);
23 void sbreserve(struct sbuf *, int);
24 void sbappend(struct socket *, struct mbuf *);
25 void sbcopy(struct sbuf *, int, int, char *);
27 #endif