Library rename, added HAL, added open function

This commit is contained in:
Add00
2023-08-04 23:13:43 -04:00
parent 36b4a494ae
commit 43b58eb421
12 changed files with 407 additions and 26 deletions

View File

@@ -0,0 +1,20 @@
import fileio;
// test constants
{
// print MAX_FILENAME_SIZE;
// print MAX_FILES_OPEN;
// print END_OF_FILE;
assert END_OF_FILE < 0, "END_OF_FILE failed";
}
// test open
{
var file = open("doesNotExist.txt", "r");
assert file["error"] == true, "error failed";
assert file["size"] == 0, "size failed";
// close(file);
}

View File

@@ -0,0 +1 @@
Hello, World!

View File

@@ -1 +0,0 @@
print "Nothing is here";

View File

@@ -18,8 +18,8 @@
#include "../repl/lib_standard.h"
#include "../repl/lib_random.h"
#include "../repl/lib_runner.h"
#include "../repl/lib_fileio.h"
#include "../repl/lib_math.h"
#include "../repl/lib_io.h"
//supress the print output
static void noPrintFn(const char* output) {
@@ -78,8 +78,8 @@ int main() {
{"standard.toy", "standard", Toy_hookStandard},
{"runner.toy", "runner", Toy_hookRunner},
{"random.toy", "random", Toy_hookRandom},
{"fileio.toy", "fileio", Toy_hookFileIO},
{"math.toy", "math", Toy_hookMath},
{"io.toy", "io", Toy_hookIO},
{NULL, NULL, NULL}
};