Author: mesyeti <mesyeti@mesyeti.uk>
fix private
basic-std/std/file.bas | 16 +++++++++++++--- basic/source/lexer.c | 3 ++-
diff --git a/basic/source/lexer.c b/basic/source/lexer.c
index 7710c99a03dc3b4634e9ef6b3e32fdf3b4012206..8919b75cefc3ede7233625bc12ff026662a6fd40 100644
--- a/basic/source/lexer.c
+++ b/basic/source/lexer.c
@@ -204,7 +204,8 @@ {"return", TOKEN_RETURN},
{"not", TOKEN_NOT},
{"and", TOKEN_AND},
{"or", TOKEN_OR},
- {"const", TOKEN_CONST}
+ {"const", TOKEN_CONST},
+ {"private", TOKEN_PRIVATE}
};
for (size_t i = 0; i < sizeof(keywords) / sizeof(Keyword); ++ i) {
diff --git a/basic-std/std/file.bas b/basic-std/std/file.bas
index 9d2e5320c1cb4ccc85b8bc67d7c22998cec93da0..4d552b12f6370a29c4777d8cf9ca50f8262acccc 100644
--- a/basic-std/std/file.bas
+++ b/basic-std/std/file.bas
@@ -1,8 +1,14 @@
'NITRON
-extern func fopen(path as ptr(char), mode as ptr(char)) ptr(unit)
-extern func fclose(file as ptr(unit)) i32
-extern func fread(output as ptr(unit), size as uint, n as uint, file as ptr(unit)) uint
+private extern func fopen(path as ptr(char), mode as ptr(char)) ptr(unit)
+private extern func fclose(file as ptr(unit)) i32
+private extern func fread(output as ptr(unit), size as uint, n as uint, file as ptr(unit)) uint
+private extern func ftell(file as ptr(unit)) int
+private extern func fseek(file as ptr(unit), int offset, i32 whence) i32
+
+const SEEK_SET = 0
+const SEEK_CUR = 1
+const SEEK_END = 2
type File
file as ptr(unit)
@@ -39,3 +45,7 @@
func File_Peek(this as ptr(File)) uint
return ftell(this.file) as uint
end
+
+func File_Seek(this as ptr(File), where as uint, offset as int) bool
+ return fseek(this.file, offset, where as i32) == 0
+end