aboutsummaryrefslogtreecommitdiff
path: root/runtime/src
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-12-16 11:58:36 +0000
committerMichael Williamson <mike@zwobble.org>2023-12-16 11:58:36 +0000
commitf0b1de70e7b96668712746f028b41fcfa525d8fe (patch)
tree19c3fe8a7c6cea693e969695cc6bb66a248bfef8 /runtime/src
parenta4e0b7fb9643cba77e12df67d761dbc6950ab439 (diff)
Split out strings.h
Diffstat (limited to 'runtime/src')
-rw-r--r--runtime/src/shed.h12
-rw-r--r--runtime/src/strings.c1
-rw-r--r--runtime/src/strings.h17
3 files changed, 19 insertions, 11 deletions
diff --git a/runtime/src/shed.h b/runtime/src/shed.h
index c7950c43..a8fc7fda 100644
--- a/runtime/src/shed.h
+++ b/runtime/src/shed.h
@@ -1,20 +1,10 @@
#ifndef SHED_H
#define SHED_H
-#include <stdint.h>
-
#include "./std/unistd.h"
#include "./patio/patio.h"
#include "./primitives.h"
-
-typedef PatioInt ShedStringLength;
-
-struct ShedString {
- ShedStringLength length;
- uint8_t data[];
-};
-
-typedef struct ShedString* ShedString;
+#include "./strings.h"
struct ShedClosure {
void* function;
diff --git a/runtime/src/strings.c b/runtime/src/strings.c
index 9a81a4fd..9d673a8a 100644
--- a/runtime/src/strings.c
+++ b/runtime/src/strings.c
@@ -1,4 +1,5 @@
#include "./shed.h"
+#include "./strings.h"
ShedString shed__runtime__string_alloc(ShedStringLength length) {
return shed__runtime__alloc(sizeof(ShedStringLength) + length);
diff --git a/runtime/src/strings.h b/runtime/src/strings.h
new file mode 100644
index 00000000..3e964c71
--- /dev/null
+++ b/runtime/src/strings.h
@@ -0,0 +1,17 @@
+#ifndef SHED_STRINGS_H
+#define SHED_STRINGS_H
+
+#include <stdint.h>
+
+#include "./patio/patio.h"
+
+typedef PatioInt ShedStringLength;
+
+struct ShedString {
+ ShedStringLength length;
+ uint8_t data[];
+};
+
+typedef struct ShedString* ShedString;
+
+#endif