summaryrefslogtreecommitdiffstats
path: root/sys/sys/sbuf.h
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2001-06-10 15:48:04 +0000
committerdes <des@FreeBSD.org>2001-06-10 15:48:04 +0000
commit23c38e4e7c8ac5370802f5158ea3085e8d58081a (patch)
treebf847b257ccd40d68502d78a22a262be3f3bcdd9 /sys/sys/sbuf.h
parentadd2afe54c2e0bce5ea9cd2a11cabc257bd6cbb3 (diff)
downloadFreeBSD-src-23c38e4e7c8ac5370802f5158ea3085e8d58081a.zip
FreeBSD-src-23c38e4e7c8ac5370802f5158ea3085e8d58081a.tar.gz
sbuf_new(9) now returns a struct sbuf * instead of an int. If the caller
does not provide a struct sbuf, sbuf_new(9) will allocate one and return a pointer to it.
Diffstat (limited to 'sys/sys/sbuf.h')
-rw-r--r--sys/sys/sbuf.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/sys/sys/sbuf.h b/sys/sys/sbuf.h
index e2f0a6b..0e0d7d5 100644
--- a/sys/sys/sbuf.h
+++ b/sys/sys/sbuf.h
@@ -43,6 +43,7 @@ struct sbuf {
#define SBUF_DYNAMIC 0x00010000 /* s_buf must be freed */
#define SBUF_FINISHED 0x00020000 /* set by sbuf_finish() */
#define SBUF_OVERFLOWED 0x00040000 /* sbuf overflowed */
+#define SBUF_DYNSTRUCT 0x00080000 /* sbuf must be freed */
int s_flags; /* flags */
};
@@ -50,18 +51,18 @@ __BEGIN_DECLS
/*
* API functions
*/
-int sbuf_new(struct sbuf *s, char *buf, int length, int flags);
-void sbuf_clear(struct sbuf *s);
-int sbuf_setpos(struct sbuf *s, int pos);
-int sbuf_cat(struct sbuf *s, const char *str);
-int sbuf_cpy(struct sbuf *s, const char *str);
-int sbuf_printf(struct sbuf *s, char *fmt, ...);
-int sbuf_putc(struct sbuf *s, int c);
-int sbuf_overflowed(struct sbuf *s);
-void sbuf_finish(struct sbuf *s);
-char *sbuf_data(struct sbuf *s);
-int sbuf_len(struct sbuf *s);
-void sbuf_delete(struct sbuf *s);
+struct sbuf *sbuf_new(struct sbuf *s, char *buf, int length, int flags);
+void sbuf_clear(struct sbuf *s);
+int sbuf_setpos(struct sbuf *s, int pos);
+int sbuf_cat(struct sbuf *s, const char *str);
+int sbuf_cpy(struct sbuf *s, const char *str);
+int sbuf_printf(struct sbuf *s, char *fmt, ...);
+int sbuf_putc(struct sbuf *s, int c);
+int sbuf_overflowed(struct sbuf *s);
+void sbuf_finish(struct sbuf *s);
+char *sbuf_data(struct sbuf *s);
+int sbuf_len(struct sbuf *s);
+void sbuf_delete(struct sbuf *s);
__END_DECLS
#endif
OpenPOWER on IntegriCloud