aboutsummaryrefslogtreecommitdiffstats
path: root/ste/example/main.c
diff options
context:
space:
mode:
authorjustanothercatgirl <sotov@twistea.su>2025-04-01 01:44:47 +0300
committerjustanothercatgirl <sotov@twistea.su>2025-04-01 01:44:47 +0300
commita5f1cb5ce34f31b9c46de94e55b5f85d571b792f (patch)
tree105116fd5b812124812c6658727b96814fa41b05 /ste/example/main.c
parent08b786a6770c172f433e28b0eb1e893f4fbae40a (diff)
Added stringbuilder and STE
Diffstat (limited to 'ste/example/main.c')
-rw-r--r--ste/example/main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ste/example/main.c b/ste/example/main.c
new file mode 100644
index 0000000..18850d9
--- /dev/null
+++ b/ste/example/main.c
@@ -0,0 +1,15 @@
+#define STRINGBUILDER_IMPLEMENTATION
+#include "../../include/stringbuilder.h" /* refer to [c_headers](https://git.twistea.su/c_headers) */
+#include <stdio.h>
+
+int main(void) {
+ jac_sb sb = jac_sb_empty();
+ #define OUTPUT(str) jac_sb_append_buf(&sb, str)
+ #define INTEGER(i) jac_sb_snprintf(&sb, "%i", i); /* Note the semicolon */
+ # include "tmpl.c"
+ #undef OUTPUT
+ #undef INTEGER
+ printf("%s\n", sb.data);
+ jac_sb_free(sb);
+ return 727;
+}