aboutsummaryrefslogtreecommitdiff
path: root/example.c
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2026-04-21 19:48:36 +0300
committerSyndamia <kamen@syndamia.com>2026-04-21 19:48:36 +0300
commit3b543388b988702c984d80a35e97ea134d9ed481 (patch)
tree78e9446efd4e9703f4fa8cb56602398b5dd763bd /example.c
parent65452e3680e411da643bd03107637c2d9ef01312 (diff)
downloadfoollib-3b543388b988702c984d80a35e97ea134d9ed481.tar
foollib-3b543388b988702c984d80a35e97ea134d9ed481.tar.gz
foollib-3b543388b988702c984d80a35e97ea134d9ed481.zip
feat!: Function rename and standardize
Diffstat (limited to 'example.c')
-rw-r--r--example.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/example.c b/example.c
new file mode 100644
index 0000000..bddf398
--- /dev/null
+++ b/example.c
@@ -0,0 +1,29 @@
+#include "Array.h"
+#include "BumpAlloc.h"
+#include "GlobalArena.h"
+#include "String.h"
+#include <stdio.h>
+
+int
+main() {
+ g_arena = B_create(KiB(4));
+
+ int *nums = AG_new(sizeof(int), 8);
+ for (int i = 10; i < 20; ++i) {
+ A_push(nums, &i);
+ }
+
+ printf("%lu/%lu |", A_count(nums), A_length(nums));
+ for (int i = 0; i < A_count(nums); ++i)
+ printf(" %d", nums[i]);
+ printf("\n");
+
+ String s = SG_concat("Hello", " ", "World", "!", NULL);
+ printf("%s\n", s);
+
+ String s1 = SG_printf("%s #%d\n", s, 5);
+ printf("%s\n", s1);
+
+ B_destroy(g_arena);
+ return 0;
+}