From 4bd8a81cca44285402af2a5e26db267c44abe4f4 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Mon, 9 Dec 2024 23:25:02 +0100 Subject: 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. --- kernel/includes/ctype.h | 1 + kernel/includes/stdlib.h | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 kernel/includes/stdlib.h (limited to 'kernel/includes') 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 + +u64 parse_u64(const char *restrict str, char **restrict endptr, int base, + int *err); -- cgit v1.2.3