summaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-05-08 14:38:22 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-05-08 14:38:22 -0400
commit5dabbe87ed4e86fa0306fd9ef11e7a7fee2a6ddb (patch)
tree36faaf68a5550c408ac8fa3c38e05ab4d05a1f57 /std
parentd8f78898f453e7474dc25fb5f60f6507c68b5f90 (diff)
got double include to REALLY work
Diffstat (limited to 'std')
-rw-r--r--std/io.toc14
1 files changed, 13 insertions, 1 deletions
diff --git a/std/io.toc b/std/io.toc
index 9fa7e08..4f05be5 100644
--- a/std/io.toc
+++ b/std/io.toc
@@ -6,13 +6,14 @@ putchar ::= #foreign("putchar", base.libc) fn(#C int) #C int;
toc_putchar ::= fn(x: char) {
putchar(x as #C int);
}
+printf ::= #foreign("printf", base.libc) fn (#C &"const char", #C ..) #C int;
/*
unfortunately, we can't use fwrite because MSVC doesn't like it when you
use a file handle that's not from the DLL. (i.e. you can't pass your stdout
to the imported version of fwrite)
*/
-
+/*
writes ::= fn(x: []char) {
for c := x {
toc_putchar(c);
@@ -50,4 +51,15 @@ puti ::= fn(x: int) {
writei(x);
toc_putchar('\n');
}
+*/
+/*
+writef ::= fn(x: float) {
+ fmt := "%f\0";
+ printf(&fmt[0], x);
+}
+putf ::= fn(x: float) {
+ writef(x);
+ toc_putchar('\n');
+}
+*/