From f0b1de70e7b96668712746f028b41fcfa525d8fe Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 16 Dec 2023 11:58:36 +0000 Subject: Split out strings.h --- runtime/src/shed.h | 12 +----------- runtime/src/strings.c | 1 + runtime/src/strings.h | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 runtime/src/strings.h (limited to 'runtime/src') 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 - #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 + +#include "./patio/patio.h" + +typedef PatioInt ShedStringLength; + +struct ShedString { + ShedStringLength length; + uint8_t data[]; +}; + +typedef struct ShedString* ShedString; + +#endif -- cgit v1.2.3