1 /////////////////////////////////////////////////////////////////////////
2 // $Id: sbuf.h 12219 2014-03-02 07:42:24Z vruppert $
3 /////////////////////////////////////////////////////////////////////////
4 /*
5  * Copyright (c) 1995 Danny Gasparovski.
6  *
7  * Please read the file COPYRIGHT for the
8  * terms and conditions of the copyright.
9  */
10 
11 #ifndef _SBUF_H_
12 #define _SBUF_H_
13 
14 #define sbflush(sb) sbdrop((sb),(sb)->sb_cc)
15 #define sbspace(sb) ((sb)->sb_datalen - (sb)->sb_cc)
16 
17 struct sbuf {
18 	u_int	sb_cc;		/* actual chars in buffer */
19 	u_int	sb_datalen;	/* Length of data  */
20 	char	*sb_wptr;	/* write pointer. points to where the next
21 				 * bytes should be written in the sbuf */
22 	char	*sb_rptr;	/* read pointer. points to where the next
23 				 * byte should be read from the sbuf */
24 	char	*sb_data;	/* Actual data */
25 };
26 
27 void sbfree(struct sbuf *);
28 void sbdrop(struct sbuf *, int);
29 void sbreserve(struct sbuf *, int);
30 void sbappend(struct socket *, struct mbuf *);
31 void sbcopy(struct sbuf *, int, int, char *);
32 
33 #endif
34