X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=strbuf.h;h=f722331470065f448197ea461ef3af06d3623ff2;hb=42f98745732c68baa6d79a50eab0d726b549025d;hp=fa07ecf094bd3ef8997958fde29199f8fb6421b9;hpb=abf411e28d9df669b0e690578a1eb95c0bd29847;p=git.git diff --git a/strbuf.h b/strbuf.h index fa07ecf09..f72233147 100644 --- a/strbuf.h +++ b/strbuf.h @@ -16,7 +16,7 @@ * * 2. the ->buf member is a byte array that has at least ->len + 1 bytes * allocated. The extra byte is used to store a '\0', allowing the ->buf - * member to be a valid C-string. Every strbuf function ensure this + * member to be a valid C-string. Every strbuf function ensures this * invariant is preserved. * * Note that it is OK to "play" with the buffer directly if you work it @@ -81,7 +81,6 @@ extern void strbuf_trim(struct strbuf *); extern void strbuf_rtrim(struct strbuf *); extern void strbuf_ltrim(struct strbuf *); extern int strbuf_cmp(const struct strbuf *, const struct strbuf *); -extern void strbuf_tolower(struct strbuf *); extern struct strbuf **strbuf_split(const struct strbuf *, int delim); extern void strbuf_list_free(struct strbuf **); @@ -105,6 +104,7 @@ static inline void strbuf_addstr(struct strbuf *sb, const char *s) { strbuf_add(sb, s, strlen(s)); } static inline void strbuf_addbuf(struct strbuf *sb, const struct strbuf *sb2) { + strbuf_grow(sb, sb2->len); strbuf_add(sb, sb2->buf, sb2->len); } extern void strbuf_adddup(struct strbuf *sb, size_t pos, size_t len); @@ -116,9 +116,12 @@ struct strbuf_expand_dict_entry { const char *value; }; extern size_t strbuf_expand_dict_cb(struct strbuf *sb, const char *placeholder, void *context); +extern void strbuf_addbuf_percentquote(struct strbuf *dst, const struct strbuf *src); __attribute__((format (printf,2,3))) extern void strbuf_addf(struct strbuf *sb, const char *fmt, ...); +__attribute__((format (printf,2,0))) +extern void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap); extern size_t strbuf_fread(struct strbuf *, size_t, FILE *); /* XXX: if read fails, any partial read is undone */