aboutsummaryrefslogtreecommitdiff
path: root/std/stdlib.c
diff options
context:
space:
mode:
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);