]> git.proxmox.com Git - mirror_qemu.git/blame - slirp/sbuf.h
slirp: add unregister_poll_fd() callback
[mirror_qemu.git] / slirp / sbuf.h
CommitLineData
f0cbd3ec
FB
1/*
2 * Copyright (c) 1995 Danny Gasparovski.
5fafdf24
TS
3 *
4 * Please read the file COPYRIGHT for the
f0cbd3ec
FB
5 * terms and conditions of the copyright.
6 */
7
2a6a4076
MA
8#ifndef SBUF_H
9#define SBUF_H
f0cbd3ec 10
f0cbd3ec
FB
11#define sbspace(sb) ((sb)->sb_datalen - (sb)->sb_cc)
12
13struct sbuf {
2a7cab9e
DDAG
14 uint32_t sb_cc; /* actual chars in buffer */
15 uint32_t sb_datalen; /* Length of data */
f0cbd3ec
FB
16 char *sb_wptr; /* write pointer. points to where the next
17 * bytes should be written in the sbuf */
18 char *sb_rptr; /* read pointer. points to where the next
19 * byte should be read from the sbuf */
20 char *sb_data; /* Actual data */
21};
22
6cb9c6d3
BS
23void sbfree(struct sbuf *);
24void sbdrop(struct sbuf *, int);
25void sbreserve(struct sbuf *, int);
26void sbappend(struct socket *, struct mbuf *);
27void sbcopy(struct sbuf *, int, int, char *);
f0cbd3ec
FB
28
29#endif