aboutsummaryrefslogtreecommitdiffstats
path: root/ste/example/main.c
diff options
context:
space:
mode:
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;
+}