summaryrefslogtreecommitdiff
path: root/tnslc/utils
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2024-07-21 00:15:20 -0400
committerKyle Gunger <kgunger12@gmail.com>2024-07-21 00:15:20 -0400
commit308a427f3cdb2c7f618b0d48640d064b88bbbceb (patch)
tree439ea530d05ae31ef6a92bf9b5d16483c3bcd270 /tnslc/utils
parent2f282dd62b9019b6e6613f4af5f50448089497ad (diff)
Basic tokenizer
Diffstat (limited to 'tnslc/utils')
-rw-r--r--tnslc/utils/c_wrap_linux.tnsl4
-rw-r--r--tnslc/utils/file.tnsl2
2 files changed, 3 insertions, 3 deletions
diff --git a/tnslc/utils/c_wrap_linux.tnsl b/tnslc/utils/c_wrap_linux.tnsl
index 1e3155e..62c3962 100644
--- a/tnslc/utils/c_wrap_linux.tnsl
+++ b/tnslc/utils/c_wrap_linux.tnsl
@@ -1,5 +1,5 @@
# Must be included at the top of the file
-asm "extern malloc, realloc, free, printf, open, close, read, write, fseek"
+asm "extern malloc, realloc, free, printf, open, close, read, write, lseek"
{}uint8 _alert = "Alert!\n\0"
{}uint8 _dec = "%d\n\0"
@@ -218,7 +218,7 @@ asm "extern malloc, realloc, free, printf, open, close, read, write, fseek"
asm "mov rdi, r10"
asm "mov rsi, r11"
asm "mov rdx, 0" # standard value for SEEK_SET as per GNU libc
- asm "call fseek wrt ..plt"
+ asm "call lseek wrt ..plt"
# get return value
asm "mov r12, rax"
diff --git a/tnslc/utils/file.tnsl b/tnslc/utils/file.tnsl
index 22b11f1..1d8a1e9 100644
--- a/tnslc/utils/file.tnsl
+++ b/tnslc/utils/file.tnsl
@@ -98,8 +98,8 @@ struct File {
return
;/
- _fseek(self.handle, self.pos - 1)
self.pos = self.pos - 1
+ _fseek(self.handle, self.pos)
/; if (self.at_end == true)
self.at_end = false