aboutsummaryrefslogtreecommitdiff
path: root/libs/libc/inc/rand.h
diff options
context:
space:
mode:
authorMarvin Borner2021-04-13 22:09:23 +0200
committerMarvin Borner2021-04-13 22:09:23 +0200
commit9ded3a2bde80eede5fd887812d70c2f834b53c84 (patch)
tree932a90608c5f30d38b810dc4fe9264cc43c2da68 /libs/libc/inc/rand.h
parentf96b8ad1ee83dec08ae636e179cc48019ca50b12 (diff)
Started IO dev manager
Diffstat (limited to 'libs/libc/inc/rand.h')
-rw-r--r--libs/libc/inc/rand.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/libc/inc/rand.h b/libs/libc/inc/rand.h
new file mode 100644
index 0000000..1b41df5
--- /dev/null
+++ b/libs/libc/inc/rand.h
@@ -0,0 +1,15 @@
+// MIT License, Copyright (c) 2020 Marvin Borner
+
+#ifndef RANDOM_H
+#define RANDOM_H
+
+#include <def.h>
+
+#define rand_range(min, max) (rand() % ((max) + 1 - (min)) + (min))
+
+void srand(u32 seed);
+u32 rand(void);
+void rand_fill(void *buf, u32 size);
+char *randstr(u32 size);
+
+#endif