|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1995 Danny Gasparovski. ! 3: * ! 4: * Please read the file COPYRIGHT for the ! 5: * terms and conditions of the copyright. ! 6: */ ! 7: ! 8: #ifndef _SBUF_H_ ! 9: #define _SBUF_H_ ! 10: ! 11: #include <stddef.h> ! 12: ! 13: #define sbflush(sb) sbdrop((sb),(sb)->sb_cc) ! 14: #define sbspace(sb) ((sb)->sb_datalen - (sb)->sb_cc) ! 15: ! 16: struct sbuf { ! 17: u_int sb_cc; /* actual chars in buffer */ ! 18: u_int sb_datalen; /* Length of data */ ! 19: char *sb_wptr; /* write pointer. points to where the next ! 20: * bytes should be written in the sbuf */ ! 21: char *sb_rptr; /* read pointer. points to where the next ! 22: * byte should be read from the sbuf */ ! 23: char *sb_data; /* Actual data */ ! 24: }; ! 25: ! 26: void sbfree(struct sbuf *); ! 27: void sbdrop(struct sbuf *, u_int); ! 28: void sbreserve(struct sbuf *, size_t); ! 29: void sbappend(struct socket *, struct mbuf *); ! 30: void sbappendsb(struct sbuf *, struct mbuf *); ! 31: void sbcopy(struct sbuf *, u_int, u_int, char *); ! 32: ! 33: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.