4 #include <linux/kernel.h> 33 char *res = sb->
alloc ? sb->
buf : NULL;
43 size_t nr = sb->
len + extra + 1;
58 buf = realloc(sb->
alloc ? sb->
buf : NULL, nr *
sizeof(*buf));
99 va_copy(ap_saved, ap);
107 len = vsnprintf(sb->
buf + sb->
len, sb->
alloc - sb->
len, fmt, ap_saved);
110 pr_debug(
"this should not happen, your vsnprintf is broken");
130 size_t oldlen = sb->
len;
131 size_t oldalloc = sb->
alloc;
158 return sb->
len - oldlen;
int strbuf_init(struct strbuf *sb, ssize_t hint)
int strbuf_grow(struct strbuf *sb, size_t extra)
#define pr_debug(fmt,...)
static ssize_t strbuf_avail(const struct strbuf *sb)
int strbuf_add(struct strbuf *sb, const void *data, size_t len)
x86 movsq based memcpy() in arch/x86/lib/memcpy_64.S") MEMCPY_FN(memcpy_erms
ssize_t strbuf_read(struct strbuf *sb, int fd, ssize_t hint)
static int strbuf_setlen(struct strbuf *sb, size_t len)
static int strbuf_addv(struct strbuf *sb, const char *fmt, va_list ap)
int strbuf_addch(struct strbuf *sb, int c)
char * strbuf_detach(struct strbuf *sb, size_t *sz)
int strbuf_addf(struct strbuf *sb, const char *fmt,...)
void strbuf_release(struct strbuf *sb)