aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripting.h
diff options
context:
space:
mode:
authornathansmith117 <nathansmith117@sdf.org>2025-02-03 15:43:19 +0000
committernathansmith117 <nathansmith117@sdf.org>2025-02-03 15:43:19 +0000
commit69733d1f2171978e3d15078d24323af39d54c518 (patch)
tree4dacf17246b9a873fb1f505968eecac899e684fe /src/scripting.h
parent305c224104be6558f2ece595a47cf29348b60d66 (diff)
downloadsldj-69733d1f2171978e3d15078d24323af39d54c518.tar.gz
sldj-69733d1f2171978e3d15078d24323af39d54c518.tar.bz2
sldj-69733d1f2171978e3d15078d24323af39d54c518.zip
Scripting working so far
Diffstat (limited to 'src/scripting.h')
-rw-r--r--src/scripting.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/scripting.h b/src/scripting.h
new file mode 100644
index 0000000..fab64b2
--- /dev/null
+++ b/src/scripting.h
@@ -0,0 +1,33 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <errno.h>
+
+#include <raylib.h>
+#include <libtcc.h>
+
+#include "sldjConfig.h"
+
+#ifndef SCRIPTING_H
+#define SCRIPTING_H
+
+typedef Color (*LineScanner)(uint16_t x, uint16_t y, uint32_t frameNumber);
+
+typedef struct SldjScripting {
+ TCCState* state;
+
+ LineScanner lineScanner;
+
+ char* fileBuf;
+ size_t fileSize;
+} SldjScripting;
+
+void initScripting(SldjScripting* scripting);
+void closeScripting(SldjScripting* scripting);
+void compileScript(SldjScripting* scripting, const char filePath[SLDJ_NAMEMAX]);
+
+#endif