aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/sbuf.h
diff options
context:
space:
mode:
authorKelly Yancey <kbyanc@FreeBSD.org>2002-01-06 08:38:23 +0000
committerKelly Yancey <kbyanc@FreeBSD.org>2002-01-06 08:38:23 +0000
commit7195eb40f93353befb3b51383a600c2d3653c3ce (patch)
treec9f2edd994d53b72edd7bedcd3dd939c54177667 /sys/sys/sbuf.h
parent5213c50d83bdbdb7ef30dfc5ea7b2b418459a975 (diff)
downloadsrc-7195eb40f93353befb3b51383a600c2d3653c3ce.tar.gz
src-7195eb40f93353befb3b51383a600c2d3653c3ce.zip
* Implement SBUF_AUTOEXTEND flag; sbufs created with this flag are
automatically extended to prevent overflow. * Added sbuf_vprintf(); sbuf_printf() is now just a wrapper around sbuf_vprintf(). * Include <stdio.h> and <string.h> when building libsbuf to silence WARNS=4 warnings. Reviewed by: des
Notes
Notes: svn path=/head/; revision=88950
Diffstat (limited to 'sys/sys/sbuf.h')
-rw-r--r--sys/sys/sbuf.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/sys/sbuf.h b/sys/sys/sbuf.h
index 7f50cf3911e9..72cddfe57331 100644
--- a/sys/sys/sbuf.h
+++ b/sys/sys/sbuf.h
@@ -31,15 +31,19 @@
#ifndef _SYS_SBUF_H_
#define _SYS_SBUF_H_
+#include <machine/ansi.h>
+
/*
* Structure definition
*/
struct sbuf {
char *s_buf; /* storage buffer */
- struct sbuf *s_next; /* next in chain */
+ void *s_unused; /* binary compatibility. */
int s_size; /* size of storage buffer */
int s_len; /* current length of string */
+#define SBUF_FIXEDLEN 0x00000000 /* fixed length buffer (default) */
#define SBUF_AUTOEXTEND 0x00000001 /* automatically extend buffer */
+#define SBUF_USRFLAGMSK 0x0000ffff /* mask of flags the user may specify */
#define SBUF_DYNAMIC 0x00010000 /* s_buf must be freed */
#define SBUF_FINISHED 0x00020000 /* set by sbuf_finish() */
#define SBUF_OVERFLOWED 0x00040000 /* sbuf overflowed */
@@ -59,6 +63,7 @@ int sbuf_bcpy(struct sbuf *, const char *, size_t);
int sbuf_cat(struct sbuf *, const char *);
int sbuf_cpy(struct sbuf *, const char *);
int sbuf_printf(struct sbuf *, const char *, ...) __printflike(2, 3);
+int sbuf_vprintf(struct sbuf *, const char *, _BSD_VA_LIST_) __printflike(2, 0);
int sbuf_putc(struct sbuf *, int);
int sbuf_trim(struct sbuf *);
int sbuf_overflowed(struct sbuf *);