aboutsummaryrefslogtreecommitdiff
path: root/std/stdlib.c
diff options
context:
space:
mode:
authorNic Gaffney <gaffney_nic@protonmail.com>2023-06-28 23:55:00 -0500
committerNic Gaffney <gaffney_nic@protonmail.com>2023-06-28 23:55:00 -0500
commitdd3906c96555805af2580d593cf9429170b07a02 (patch)
treea2f3974b325e4b31d3833a828dec7447108c0fb1 /std/stdlib.c
parentc4d6a1229c35cc889a1db53cf1c9d87d2f662238 (diff)
downloadsloth-dd3906c96555805af2580d593cf9429170b07a02.tar.gz
sockets
Diffstat (limited to 'std/stdlib.c')
-rw-r--r--std/stdlib.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/std/stdlib.c b/std/stdlib.c
index 4a650a4..ed848c3 100644
--- a/std/stdlib.c
+++ b/std/stdlib.c
@@ -3,6 +3,7 @@
#include <string.h>
#include <time.h>
#include <stdio.h>
+#include <stdbool.h>
int wait(int msec) {
struct timespec ts;
@@ -40,6 +41,18 @@ int as_int(float x) {
return (int) x;
}
+bool sequals(char* a, char* b) {
+ if (strlen(a) != strlen(b)) {
+ return false;
+ }
+ for (int i=0; i<strlen(a); i++) {
+ if (a[i] != b[i]) {
+ return false;
+ }
+ }
+ return true;
+}
+
char* istr(int x) {
char* snum = malloc(12);
sprintf(snum, "%d", x);