diff options
Diffstat (limited to '')
| -rw-r--r-- | strbuf.h | 10 |
1 files changed, 9 insertions, 1 deletions
| @@ -66,8 +66,9 @@ static void strbuf_ensure_empty_length(strbuf_t *s, int len); | |||
| 66 | 66 | ||
| 67 | /* Update */ | 67 | /* Update */ |
| 68 | extern void strbuf_append_fmt(strbuf_t *s, const char *format, ...); | 68 | extern void strbuf_append_fmt(strbuf_t *s, const char *format, ...); |
| 69 | extern void strbuf_append_mem(strbuf_t *s, const char *c, int len); | 69 | static void strbuf_append_mem(strbuf_t *s, const char *c, int len); |
| 70 | extern void strbuf_append_string(strbuf_t *s, const char *str); | 70 | extern void strbuf_append_string(strbuf_t *s, const char *str); |
| 71 | extern void strbuf_append_number(strbuf_t *s, double number); | ||
| 71 | static void strbuf_append_char(strbuf_t *s, const char c); | 72 | static void strbuf_append_char(strbuf_t *s, const char c); |
| 72 | static void strbuf_ensure_null(strbuf_t *s); | 73 | static void strbuf_ensure_null(strbuf_t *s); |
| 73 | 74 | ||
| @@ -100,6 +101,13 @@ static inline void strbuf_append_char_unsafe(strbuf_t *s, const char c) | |||
| 100 | s->buf[s->length++] = c; | 101 | s->buf[s->length++] = c; |
| 101 | } | 102 | } |
| 102 | 103 | ||
| 104 | static inline void strbuf_append_mem(strbuf_t *s, const char *c, int len) | ||
| 105 | { | ||
| 106 | strbuf_ensure_empty_length(s, len); | ||
| 107 | memcpy(s->buf + s->length, c, len); | ||
| 108 | s->length += len; | ||
| 109 | } | ||
| 110 | |||
| 103 | static inline void strbuf_ensure_null(strbuf_t *s) | 111 | static inline void strbuf_ensure_null(strbuf_t *s) |
| 104 | { | 112 | { |
| 105 | s->buf[s->length] = 0; | 113 | s->buf[s->length] = 0; |
