Files
bluelib/core-test/ropes.c

29 lines
457 B
C
Raw Normal View History

2025-04-11 14:01:47 +01:00
#include <blue/core/rope.h>
#include <stdio.h>
int main(void)
{
b_rope a = B_ROPE_CHAR('a');
b_rope b = B_ROPE_CSTR_STATIC("Hello, world!");
b_rope c = B_ROPE_INT(-4096);
b_rope d = B_ROPE_UINT(4096);
b_rope str;
const b_rope *ropes[] = {
&a,
&b,
&c,
&d,
};
b_rope_join(&str, ropes, sizeof ropes / sizeof ropes[0]);
char cstr[1024];
b_rope_to_cstr(&str, cstr, sizeof cstr);
b_rope_destroy(&str);
printf("%s\n", cstr);
return 0;
}