From 52d6bc8533616dd642c96f8b6e72f459e1b4d465 Mon Sep 17 00:00:00 2001 From: Nic Gaffney Date: Mon, 17 Jul 2023 23:00:30 -0500 Subject: Standard lib rework --- std/extern.sloth | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 std/extern.sloth (limited to 'std/extern.sloth') diff --git a/std/extern.sloth b/std/extern.sloth new file mode 100644 index 0000000..c970541 --- /dev/null +++ b/std/extern.sloth @@ -0,0 +1,28 @@ +# stdio +foreign fn print(str: String) Void; +foreign fn readln() String; +foreign fn filer(path: String) String; +foreign fn curshide(); +foreign fn cursshow(); + +# stdlib +foreign fn wait(x: Int) Int; +foreign fn slen(str: String) Int; +# foreign fn charAt(str: String) Char; +foreign fn parse_int(str: String) Int; +foreign fn termpos(x: Int, y: Int); +foreign fn as_int(x: Float) Int; +foreign fn istr(x: Int) String; +foreign fn system(cmd: String) Int; +foreign fn sequals(a: String, b: String) Bool; +foreign fn termclear() Void; + +#stdmath +foreign fn randGen(min: Int, max: Int) Int; + +#stdsocket +foreign fn serversock(port: Int, addr: String, backlog: Int) Int; +foreign fn clientsock(port: Int, addr: String) Int; +foreign fn closesock(soc: Int, server:Bool); +foreign fn sendsock(msg: String, soc: Int); +foreign fn recvsock(soc: Int) String; -- cgit v1.2.3