diff options
Diffstat (limited to 'strbuf.h')
-rw-r--r-- | strbuf.h | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -62,7 +62,9 @@ extern void strbuf_resize(strbuf_t *s, int len); | |||
62 | static int strbuf_empty_length(strbuf_t *s); | 62 | static int strbuf_empty_length(strbuf_t *s); |
63 | static int strbuf_length(strbuf_t *s); | 63 | static int strbuf_length(strbuf_t *s); |
64 | static char *strbuf_string(strbuf_t *s, int *len); | 64 | static char *strbuf_string(strbuf_t *s, int *len); |
65 | static void strbuf_ensure_empty_length(strbuf_t *s, int len); | 65 | static void strbuf_ensure_empty_length(strbuf_t *s, int len); |
66 | static char *strbuf_empty_ptr(strbuf_t *s); | ||
67 | static void strbuf_extend_length(strbuf_t *s, int len); | ||
66 | 68 | ||
67 | /* Update */ | 69 | /* Update */ |
68 | extern void strbuf_append_fmt(strbuf_t *s, int len, const char *fmt, ...); | 70 | extern void strbuf_append_fmt(strbuf_t *s, int len, const char *fmt, ...); |
@@ -96,6 +98,16 @@ static inline void strbuf_ensure_empty_length(strbuf_t *s, int len) | |||
96 | strbuf_resize(s, s->length + len); | 98 | strbuf_resize(s, s->length + len); |
97 | } | 99 | } |
98 | 100 | ||
101 | static inline char *strbuf_empty_ptr(strbuf_t *s) | ||
102 | { | ||
103 | return s->buf + s->length; | ||
104 | } | ||
105 | |||
106 | static inline void strbuf_extend_length(strbuf_t *s, int len) | ||
107 | { | ||
108 | s->length += len; | ||
109 | } | ||
110 | |||
99 | static inline int strbuf_length(strbuf_t *s) | 111 | static inline int strbuf_length(strbuf_t *s) |
100 | { | 112 | { |
101 | return s->length; | 113 | return s->length; |