blob: 06aa08474d26be7d7e5b3313f12b5be9a0ea5365 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#ifndef SB_H
#define SB_H
#include "sv.h"
#include <stddef.h>
struct sb {
char *string;
size_t length;
size_t capacity;
};
struct sv;
void sb_init(struct sb *ctx, size_t starting_capacity);
void sb_free(struct sb *ctx);
void sb_reset(struct sb *ctx);
int sb_isempty(const struct sb *ctx);
void sb_append_char(struct sb *ctx, char c);
int sb_delete_right(struct sb *ctx, size_t n);
void sb_append(struct sb *ctx, const char *s);
void sb_append_buffer(struct sb *ctx, const char *buffer,
size_t length);
void sb_append_sv(struct sb *ctx, struct sv sv);
void sb_prepend_sv(struct sb *ctx, struct sv sv);
#endif
|