diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2001-06-10 15:48:04 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2001-06-10 15:48:04 +0000 |
commit | d64793580110a0b1af88ff47d404b6ae5dec2502 (patch) | |
tree | bf847b257ccd40d68502d78a22a262be3f3bcdd9 /sys/sys/sbuf.h | |
parent | 347d21cb43509e677571b285a1583219447dca55 (diff) | |
download | src-d64793580110a0b1af88ff47d404b6ae5dec2502.tar.gz src-d64793580110a0b1af88ff47d404b6ae5dec2502.zip |
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.
Notes
Notes:
svn path=/head/; revision=77989
Diffstat (limited to 'sys/sys/sbuf.h')
-rw-r--r-- | sys/sys/sbuf.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/sys/sys/sbuf.h b/sys/sys/sbuf.h index e2f0a6b4e89a..0e0d7d564a95 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 |