From afe2234fb10053af0401050d81a4ee985a08504f Mon Sep 17 00:00:00 2001 From: Pixel Date: Sat, 5 Feb 2011 13:15:32 -0800 Subject: Adding a few more stdlib functions. --- libc/include/stdlib.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libc/include/stdlib.h') diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h index 5654950..f9f2a94 100644 --- a/libc/include/stdlib.h +++ b/libc/include/stdlib.h @@ -3,6 +3,7 @@ #include #include +#include typedef void (*atexit_func_t)(void); @@ -11,4 +12,8 @@ int atexit(atexit_func_t); void qsort(void *base, size_t nel, size_t width, int (*compar)(const void *, const void *)); +static inline double atof(const char * str) { double r = 0; sscanf(str, "%lf", &r); return r; } +static inline int atoi(const char * str) { int i; sscanf(str, "%i", &i); return i; } +static inline int atol(const char * str) { long l; sscanf(str, "%li", &l); return l; } + #endif -- cgit v1.2.3