Home | History | Annotate | Download | only in util

Lines Matching full:strbuf

5  * Strbuf's can be use in many ways: as a byte array, or to store arbitrary
10 * 1. the ->buf member is always malloc-ed, hence strbuf's can be used to
19 * member to be a valid C-string. Every strbuf function ensure this
34 * missing API to the strbuf module is the way to go.
44 struct strbuf {
52 /*----- strbuf life cycle -----*/
53 extern void strbuf_init(struct strbuf *buf, ssize_t hint);
54 extern void strbuf_release(struct strbuf *);
55 extern char *strbuf_detach(struct strbuf *, size_t *);
57 /*----- strbuf size related -----*/
58 static inline ssize_t strbuf_avail(const struct strbuf *sb) {
62 extern void strbuf_grow(struct strbuf *, size_t);
64 static inline void strbuf_setlen(struct strbuf *sb, size_t len) {
73 static inline void strbuf_addch(struct strbuf *sb, int c) {
79 extern void strbuf_remove(struct strbuf *, size_t pos, size_t len);
81 extern void strbuf_add(struct strbuf *, const void *, size_t);
82 static inline void strbuf_addstr(struct strbuf *sb, const char *s) {
87 extern void strbuf_addf(struct strbuf *sb, const char *fmt, ...);
90 extern ssize_t strbuf_read(struct strbuf *, int fd, ssize_t hint);