Add some useful functions for strbuf manipulation.
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
9b200fd68c
commit
eacd6dc594
6
strbuf.h
6
strbuf.h
@ -77,8 +77,14 @@ static inline void strbuf_setlen(struct strbuf *sb, size_t len) {
|
||||
#define strbuf_reset(sb) strbuf_setlen(sb, 0)
|
||||
|
||||
/*----- content related -----*/
|
||||
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 **);
|
||||
|
||||
/*----- add data in your buffer -----*/
|
||||
static inline void strbuf_addch(struct strbuf *sb, int c) {
|
||||
|
||||
Reference in New Issue
Block a user