diff options
Diffstat (limited to 'src/voidc.cc')
| -rw-r--r-- | src/voidc.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/voidc.cc b/src/voidc.cc index 8110184..5bbd7f4 100644 --- a/src/voidc.cc +++ b/src/voidc.cc @@ -1,5 +1,7 @@ +#include <cstdlib> #include <cstring> +#include "source.cc" #include "common.cc" #include "memory.cc" @@ -11,13 +13,16 @@ int main() { } )"; -static const String SOURCE_STRING = {(u8*)SOURCE, strlen(SOURCE)}; -int main() { - String source; - slice_copy(heap_allocator(), &SOURCE_STRING, &source); +static const char* SOURCE_FILE = "source.c"; - slice_write(&source, stdout); +int main() { + String source(SOURCE); + String file(SOURCE_FILE); + + Buffer buffer{}; + bool ret = buffer_init(&buffer, heap_allocator(), &source, &file); + if(!ret) return EXIT_FAILURE; - slice_deallocate(heap_allocator(), &source); + } |
