aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/sbuf.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/sys/sbuf.h b/sys/sys/sbuf.h
index fce24beeed13..be3d80c52406 100644
--- a/sys/sys/sbuf.h
+++ b/sys/sys/sbuf.h
@@ -33,12 +33,17 @@
#include <sys/_types.h>
+struct sbuf;
+typedef int (sbuf_drain_func)(void *, const char *, int);
+
/*
* Structure definition
*/
struct sbuf {
char *s_buf; /* storage buffer */
- void *s_unused; /* binary compatibility. */
+ sbuf_drain_func *s_drain_func; /* drain function */
+ void *s_drain_arg; /* user-supplied drain argument */
+ int s_error; /* current error code */
int s_size; /* size of storage buffer */
int s_len; /* current length of string */
#define SBUF_FIXEDLEN 0x00000000 /* fixed length buffer (default) */
@@ -69,9 +74,10 @@ int sbuf_printf(struct sbuf *, const char *, ...)
int sbuf_vprintf(struct sbuf *, const char *, __va_list)
__printflike(2, 0);
int sbuf_putc(struct sbuf *, int);
+void sbuf_set_drain(struct sbuf *, sbuf_drain_func *, void *);
int sbuf_trim(struct sbuf *);
int sbuf_overflowed(struct sbuf *);
-void sbuf_finish(struct sbuf *);
+int sbuf_finish(struct sbuf *);
char *sbuf_data(struct sbuf *);
int sbuf_len(struct sbuf *);
int sbuf_done(struct sbuf *);