summaryrefslogtreecommitdiff
path: root/script/entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'script/entry.c')
-rw-r--r--script/entry.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/script/entry.c b/script/entry.c
new file mode 100644
index 0000000..a8f3b68
--- /dev/null
+++ b/script/entry.c
@@ -0,0 +1,16 @@
+#include <stdlib.h>
+#include <string.h>
+
+void* allocate(size_t size) {
+ return malloc(size);
+}
+
+// Expose free so JS can clean up memory and prevent leaks
+void deallocate(void* ptr) {
+ free(ptr);
+}
+
+
+const char *entry(const char *input) {
+ return strdup(input);
+}