Lines Matching refs:sbuf

50 #include <sys/sbuf.h>
53 static MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers");
96 _assert_sbuf_integrity(const char *fun, struct sbuf *s)
99 ("%s called with a NULL sbuf pointer", fun));
101 ("%s called with uninitialized or corrupt sbuf", fun));
103 ("wrote past end of sbuf (%d >= %d)", s->s_len, s->s_size));
107 _assert_sbuf_state(const char *fun, struct sbuf *s, int state)
110 ("%s called with %sfinished or corrupt sbuf", fun,
138 * Extend an sbuf.
141 sbuf_extend(struct sbuf *s, int addlen)
164 * Initialize an sbuf.
168 struct sbuf *
169 sbuf_new(struct sbuf *s, char *buf, int length, int flags)
172 ("attempt to create an sbuf of negative length (%d)", length));
178 s = (struct sbuf *)SBMALLOC(sizeof *s);
207 * Create an sbuf with uio data
209 struct sbuf *
210 sbuf_uionew(struct sbuf *s, struct uio *uio, int *error)
234 * Clear an sbuf and reset its position.
237 sbuf_clear(struct sbuf *s)
248 * Set the sbuf's end position to an arbitrary value.
249 * Effectively truncates the sbuf at the new position.
252 sbuf_setpos(struct sbuf *s, int pos)
260 ("attempt to seek past end of sbuf (%d >= %d)", pos, s->s_size));
269 * Append a byte string to an sbuf.
272 sbuf_bcat(struct sbuf *s, const void *buf, size_t len)
296 * Copy a byte string from userland into an sbuf.
299 sbuf_bcopyin(struct sbuf *s, const void *uaddr, size_t len)
322 * Copy a byte string into an sbuf.
325 sbuf_bcpy(struct sbuf *s, const void *buf, size_t len)
335 * Append a string to an sbuf.
338 sbuf_cat(struct sbuf *s, const char *str)
360 * Append a string from userland to an sbuf.
363 sbuf_copyin(struct sbuf *s, const void *uaddr, size_t len)
395 * Copy a string into an sbuf.
398 sbuf_cpy(struct sbuf *s, const char *str)
408 * Format the given argument list and append the resulting string to an sbuf.
411 sbuf_vprintf(struct sbuf *s, const char *fmt, va_list ap)
452 ("wrote past end of sbuf (%d >= %d)", s->s_len, s->s_size));
460 * Format the given arguments and append the resulting string to an sbuf.
463 sbuf_printf(struct sbuf *s, const char *fmt, ...)
475 * Append a character to an sbuf.
478 sbuf_putc(struct sbuf *s, int c)
496 * Trim whitespace characters from end of an sbuf.
499 sbuf_trim(struct sbuf *s)
519 * Check if an sbuf overflowed
522 sbuf_overflowed(struct sbuf *s)
528 * Finish off an sbuf.
531 sbuf_finish(struct sbuf *s)
542 * Return a pointer to the sbuf data.
545 sbuf_data(struct sbuf *s)
554 * Return the length of the sbuf data.
557 sbuf_len(struct sbuf *s)
568 * Clear an sbuf, free its buffer if necessary.
571 sbuf_delete(struct sbuf *s)
587 * Check if an sbuf has been finished.
590 sbuf_done(struct sbuf *s)