aboutsummaryrefslogtreecommitdiff
path: root/std/extern.sloth
diff options
context:
space:
mode:
authorCody <cody@codyq.dev>2023-07-20 18:13:34 -0500
committerCody <cody@codyq.dev>2023-07-20 18:13:34 -0500
commit1219f5ed8aed0bcb6a416a194fce70f0a290309d (patch)
tree5759c263bc626d288cb69434d1f46e20af49f2de /std/extern.sloth
parent7c53e65cad365ec112d2ec1bd9c3091dbed05720 (diff)
parent52d6bc8533616dd642c96f8b6e72f459e1b4d465 (diff)
downloadsloth-1219f5ed8aed0bcb6a416a194fce70f0a290309d.tar.gz
Merge branch 'master' of github.com:slothlang/slothlang
Diffstat (limited to 'std/extern.sloth')
-rw-r--r--std/extern.sloth28
1 files changed, 28 insertions, 0 deletions
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;