sapphire/core/__internal/io/linux.sp
apio f1668853dd Lots of rewrites.
Planning to use LLVM to make stuff easier. Also, moved the random
sapphire stuff to actual examples in an actual examples/ folder. Also
started a standard library even if the compiler is not ready, because
why not?? Also, it helps the examples.
2022-05-28 20:44:26 +02:00

15 lines
269 B
SourcePawn

import core/linux;
import core/string;
namespace io {
@out (str String) {
linux.sys_write(1,(i8*)String,string.len(String));
}
@in (str) () {
i8* buffer = i8*(256);
linux.sys_read(0,buffer,256);
return (str)buffer;
}
}