X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=strbuf.h;h=675a91f93821421aa79de51857b22a4960da8ec1;hb=5c28a8b054cb69a37638b0261fc370422c8fab58;hp=eaa8704d5fa6e85d33953db77dd03de3cb462df4;hpb=011c181cc656c8b3e48882729d1b6238e8c5c537;p=git.git diff --git a/strbuf.h b/strbuf.h index eaa8704d5..675a91f93 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,8 +116,9 @@ 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))) +__attribute__((format (printf,2,3))) extern void strbuf_addf(struct strbuf *sb, const char *fmt, ...); extern size_t strbuf_fread(struct strbuf *, size_t, FILE *); @@ -126,6 +127,7 @@ extern ssize_t strbuf_read(struct strbuf *, int fd, size_t hint); extern int strbuf_read_file(struct strbuf *sb, const char *path, size_t hint); extern int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint); +extern int strbuf_getwholeline(struct strbuf *, FILE *, int); extern int strbuf_getline(struct strbuf *, FILE *, int); extern void stripspace(struct strbuf *buf, int skip_comments);