diff options
author | Marvin Borner | 2021-04-13 22:09:23 +0200 |
---|---|---|
committer | Marvin Borner | 2021-04-13 22:09:23 +0200 |
commit | 9ded3a2bde80eede5fd887812d70c2f834b53c84 (patch) | |
tree | 932a90608c5f30d38b810dc4fe9264cc43c2da68 /libs/libc/inc/rand.h | |
parent | f96b8ad1ee83dec08ae636e179cc48019ca50b12 (diff) |
Started IO dev manager
Diffstat (limited to 'libs/libc/inc/rand.h')
-rw-r--r-- | libs/libc/inc/rand.h | 15 |
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 |