diff options
| author | Cody <cody@codyq.dev> | 2023-06-25 23:23:36 -0500 |
|---|---|---|
| committer | Cody <cody@codyq.dev> | 2023-06-25 23:23:36 -0500 |
| commit | 91ac969f992521b665bb41c1c024a5f69ca6df67 (patch) | |
| tree | 8562a40e5be385bb7d7f4a69d0840fc8493c71d9 /std/stdlib.c | |
| parent | ae4c1af949c7230c07b2a7cc86a2e4031c37f651 (diff) | |
| parent | c3bb1751d7f62a13a46f28c1eb67d9e20d8d6f7f (diff) | |
| download | sloth-91ac969f992521b665bb41c1c024a5f69ca6df67.tar.gz | |
Merge branch 'master' of github.com:slothlang/sloth
Diffstat (limited to 'std/stdlib.c')
| -rw-r--r-- | std/stdlib.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/std/stdlib.c b/std/stdlib.c new file mode 100644 index 0000000..7e77385 --- /dev/null +++ b/std/stdlib.c @@ -0,0 +1,19 @@ +#include <unistd.h> +#include <stdlib.h> +#include <string.h> + +void wait(long long x) { + sleep(x); +} + +long long slen(char *str) { + return (long long) strlen(str); +} + +char charAt(char *str, long long x) { + return str[x]; +} + +long long parse_int(char *str) { + return (long long) atoi(str); +} |
