diff options
author | Anton Kling <anton@kling.gg> | 2024-12-09 23:25:02 +0100 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-12-09 23:27:48 +0100 |
commit | 4bd8a81cca44285402af2a5e26db267c44abe4f4 (patch) | |
tree | 5ca227dacc0c863c031789ae51469400b221dfb8 /kernel/includes | |
parent | 3bb66753076f4037883b7c71ce2fb8e78f8b1194 (diff) |
kernel: Add a way to parse numbers from C strings
After making this change I am now actually doubting if using
C strings is a good idea and maybe it should just always just the
string view library that userland makes use of.
But old code and the upcoming commits rely upon this so it is a change my
future less lazy self will do.
Diffstat (limited to 'kernel/includes')
-rw-r--r-- | kernel/includes/ctype.h | 1 | ||||
-rw-r--r-- | kernel/includes/stdlib.h | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/kernel/includes/ctype.h b/kernel/includes/ctype.h index 4f9a3b3..f6be4f2 100644 --- a/kernel/includes/ctype.h +++ b/kernel/includes/ctype.h @@ -1 +1,2 @@ int isdigit(int c); +int tolower(int c); diff --git a/kernel/includes/stdlib.h b/kernel/includes/stdlib.h new file mode 100644 index 0000000..3b24fb6 --- /dev/null +++ b/kernel/includes/stdlib.h @@ -0,0 +1,4 @@ +#include <typedefs.h> + +u64 parse_u64(const char *restrict str, char **restrict endptr, int base, + int *err); |