diff options
| author | Nic Gaffney <gaffney_nic@protonmail.com> | 2023-07-17 23:00:30 -0500 |
|---|---|---|
| committer | Nic Gaffney <gaffney_nic@protonmail.com> | 2023-07-17 23:00:30 -0500 |
| commit | 52d6bc8533616dd642c96f8b6e72f459e1b4d465 (patch) | |
| tree | 31f3dc1f3378151e57f7bc37fa2b4e22ab757661 /std/extern.sloth | |
| parent | ee2133a13d61b3b3fb8fcf88f9c9781debd77d9e (diff) | |
| download | sloth-52d6bc8533616dd642c96f8b6e72f459e1b4d465.tar.gz | |
Standard lib rework
Diffstat (limited to 'std/extern.sloth')
| -rw-r--r-- | std/extern.sloth | 28 |
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; |
