3 #include "../include/cstring.h"
4 #include "../cstring.c"
6 int main(int argc, char *argv[]) {
9 cstring_t *p = cstring_init();
10 printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
12 (p->expand)(p, 'X'); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
13 (p->expand)(p, 'X'); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
14 (p->expand)(p, 'X'); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
15 (p->expand)(p, 'X'); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
16 (p->expand)(p, 'X'); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
17 (p->expand)(p, 'X'); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
18 (p->expand)(p, 'X'); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
19 (p->expand)(p, 'X'); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
20 (p->expand)(p, 'X'); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
21 (p->expand)(p, 'X'); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
24 printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
26 char x[2] = {'X', '\0'};
28 (p->expand_arr)(p, x); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
29 (p->expand_arr)(p, x); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
30 (p->expand_arr)(p, x); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
31 (p->expand_arr)(p, x); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
32 (p->expand_arr)(p, x); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
33 (p->expand_arr)(p, x); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
34 (p->expand_arr)(p, x); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
35 (p->expand_arr)(p, x); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
36 (p->expand_arr)(p, x); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);
37 (p->expand_arr)(p, x); printf("text: %s, size: %i, alloc: %i\n", p->text, p->size, p->alloc);