diff options
| author | Nic Gaffney <gaffney_nic@protonmail.com> | 2023-06-28 23:55:00 -0500 |
|---|---|---|
| committer | Nic Gaffney <gaffney_nic@protonmail.com> | 2023-06-28 23:55:00 -0500 |
| commit | dd3906c96555805af2580d593cf9429170b07a02 (patch) | |
| tree | a2f3974b325e4b31d3833a828dec7447108c0fb1 /std/stdlib.c | |
| parent | c4d6a1229c35cc889a1db53cf1c9d87d2f662238 (diff) | |
| download | sloth-dd3906c96555805af2580d593cf9429170b07a02.tar.gz | |
sockets
Diffstat (limited to 'std/stdlib.c')
| -rw-r--r-- | std/stdlib.c | 13 |
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); |
