diff options
author | obrien <obrien@FreeBSD.org> | 2001-02-27 13:33:07 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2001-02-27 13:33:07 +0000 |
commit | bb70e1687a5a72cc582496d32293aed2b63f5647 (patch) | |
tree | a6ddbcda2c8416d0bced69bd65a91d752bc75d50 /lib/libc/stdlib/strtol.3 | |
parent | a7aa01b9b6a44b97d7111edaa5ab21b829093ccd (diff) | |
download | FreeBSD-src-bb70e1687a5a72cc582496d32293aed2b63f5647.zip FreeBSD-src-bb70e1687a5a72cc582496d32293aed2b63f5647.tar.gz |
Impliment the ISO-C99 strto[u]ll()
and rewrite strto[u]q() in terms of it.
Diffstat (limited to 'lib/libc/stdlib/strtol.3')
-rw-r--r-- | lib/libc/stdlib/strtol.3 | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/lib/libc/stdlib/strtol.3 b/lib/libc/stdlib/strtol.3 index 3f28713..eef3031 100644 --- a/lib/libc/stdlib/strtol.3 +++ b/lib/libc/stdlib/strtol.3 @@ -40,8 +40,8 @@ .Dt STRTOL 3 .Os .Sh NAME -.Nm strtol , strtoq -.Nd convert string value to a long or quad_t integer +.Nm strtol , strtoll , strtoq +.Nd convert string value to a long , long long , or quad_t integer .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -49,6 +49,8 @@ .Fd #include <limits.h> .Ft long .Fn strtol "const char *nptr" "char **endptr" "int base" +.Ft long long +.Fn strtoll "const char *nptr" "char **endptr" "int base" .Fd #include <sys/types.h> .Fd #include <stdlib.h> .Fd #include <limits.h> @@ -64,6 +66,14 @@ to a .Em long value. The +.Fn strtoll +function +converts the string in +.Fa nptr +to a +.Em long long +value. +The .Fn strtoq function converts the string in @@ -145,7 +155,20 @@ If an overflow occurs, .Fn strtol returns .Dv LONG_MAX . -In both cases, +The +.Fn strtoll +function +returns the result of the conversion, +unless the value would underflow or overflow. +If an underflow occurs, +.Fn strtoll +returns +.Dv LLONG_MIN . +If an overflow occurs, +.Fn strtoll +returns +.Dv LLONG_MAX . +In all cases, .Va errno is set to .Er ERANGE . @@ -166,5 +189,13 @@ The function conforms to .St -isoC . +The +.Fn strtoll +function +conforms to +.St -isoC-99 . +The BSD +.Fn strtoq +function is deprecated. .Sh BUGS Ignores the current locale. |