Add strtoimax(3) and strtoumax(3).
This commit is contained in:
parent
d79808f85f
commit
cdc5a9673e
|
@ -200,8 +200,8 @@ __BEGIN_DECLS
|
||||||
|
|
||||||
intmax_t imaxabs(intmax_t);
|
intmax_t imaxabs(intmax_t);
|
||||||
/* TODO: imaxdiv */
|
/* TODO: imaxdiv */
|
||||||
/* TODO: strtoimax */
|
intmax_t strtoimax(const char* __restrict, char** __restrict, int);
|
||||||
/* TODO: strtoumax */
|
uintmax_t strtoumax(const char* __restrict, char** __restrict, int);
|
||||||
/* TODO: wcstoimax */
|
/* TODO: wcstoimax */
|
||||||
/* TODO: wcstoumax */
|
/* TODO: wcstoumax */
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
||||||
Copyright(C) Jonas 'Sortie' Termansen 2011.
|
Copyright(C) Jonas 'Sortie' Termansen 2011, 2013.
|
||||||
|
|
||||||
This file is part of the Sortix C Library.
|
This file is part of the Sortix C Library.
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <inttypes.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
@ -79,6 +80,11 @@ extern "C" long long strtoll(const char* str, char** endptr, int base)
|
||||||
return ParseInteger<long long, false>(str, endptr, base);
|
return ParseInteger<long long, false>(str, endptr, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" intmax_t strtoimax(const char* str, char** endptr, int base)
|
||||||
|
{
|
||||||
|
return ParseInteger<intmax_t, false>(str, endptr, base);
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" unsigned long strtoul(const char* str, char** endptr, int base)
|
extern "C" unsigned long strtoul(const char* str, char** endptr, int base)
|
||||||
{
|
{
|
||||||
return ParseInteger<unsigned long, true>(str, endptr, base);
|
return ParseInteger<unsigned long, true>(str, endptr, base);
|
||||||
|
@ -88,3 +94,8 @@ extern "C" unsigned long long strtoull(const char* str, char** endptr, int base)
|
||||||
{
|
{
|
||||||
return ParseInteger<unsigned long long, true>(str, endptr, base);
|
return ParseInteger<unsigned long long, true>(str, endptr, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" uintmax_t strtoumax(const char* str, char** endptr, int base)
|
||||||
|
{
|
||||||
|
return ParseInteger<uintmax_t, true>(str, endptr, base);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue