readint.c: add new function mrb_int_read.

Difference from `strtoul(3)`:

* reads `mrb_int` based on configuration
* specifies the end of the string
* no sign interpretation
* base 10 only
This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-06-11 12:26:58 +09:00
parent 14a69c6ffd
commit 49af1fca03
4 changed files with 47 additions and 31 deletions
+1
View File
@@ -100,6 +100,7 @@ struct mrb_state;
# define MRB_ENDIAN_LOHI(a,b) b a
#endif
MRB_API mrb_int mrb_int_read(const char *p, const char *e, char **endp);
#ifndef MRB_NO_FLOAT
MRB_API double mrb_float_read(const char*, char**);
#ifdef MRB_USE_FLOAT32