summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/strtol.3
diff options
context:
space:
mode:
authormillert <>2002-06-29 00:20:11 +0000
committermillert <>2002-06-29 00:20:11 +0000
commit6adefe10f90940abb77fbd207bd42c11497679b9 (patch)
treeb09c3b0aa815c3c77e8a7c20492b1d18817cd32b /src/lib/libc/stdlib/strtol.3
parente08f871ca434f7bd4986a8b654059f32fda1e02a (diff)
downloadopenbsd-6adefe10f90940abb77fbd207bd42c11497679b9.tar.gz
openbsd-6adefe10f90940abb77fbd207bd42c11497679b9.tar.bz2
openbsd-6adefe10f90940abb77fbd207bd42c11497679b9.zip
Replace strtou?q() with the more standard strtou?ll(), using weak
aliases to fake up strtou?q(). espie@ OK.
Diffstat (limited to 'src/lib/libc/stdlib/strtol.3')
-rw-r--r--src/lib/libc/stdlib/strtol.327
1 files changed, 23 insertions, 4 deletions
diff --git a/src/lib/libc/stdlib/strtol.3 b/src/lib/libc/stdlib/strtol.3
index afdb84f19b..a5bdff0b81 100644
--- a/src/lib/libc/stdlib/strtol.3
+++ b/src/lib/libc/stdlib/strtol.3
@@ -33,21 +33,27 @@
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 34.\" SUCH DAMAGE.
35.\" 35.\"
36.\" $OpenBSD: strtol.3,v 1.9 2000/08/09 15:51:21 aaron Exp $ 36.\" $OpenBSD: strtol.3,v 1.10 2002/06/29 00:20:11 millert Exp $
37.\" 37.\"
38.Dd June 25, 1992 38.Dd June 25, 1992
39.Dt STRTOL 3 39.Dt STRTOL 3
40.Os 40.Os
41.Sh NAME 41.Sh NAME
42.Nm strtol , 42.Nm strtol ,
43.Nm strtoll ,
43.Nm strtoq 44.Nm strtoq
44.Nd convert string value to a long or quad_t integer 45.Nd convert string value to a long or long long integer
45.Sh SYNOPSIS 46.Sh SYNOPSIS
46.Fd #include <stdlib.h> 47.Fd #include <stdlib.h>
47.Fd #include <limits.h> 48.Fd #include <limits.h>
48.Ft long 49.Ft long
49.Fn strtol "const char *nptr" "char **endptr" "int base" 50.Fn strtol "const char *nptr" "char **endptr" "int base"
50.Pp 51.Pp
52.Fd #include <stdlib.h>
53.Fd #include <limits.h>
54.Ft long long
55.Fn strtoll "const char *nptr" "char **endptr" "int base"
56.Pp
51.Fd #include <sys/types.h> 57.Fd #include <sys/types.h>
52.Fd #include <stdlib.h> 58.Fd #include <stdlib.h>
53.Fd #include <limits.h> 59.Fd #include <limits.h>
@@ -62,12 +68,17 @@ to a
62.Li long 68.Li long
63value. 69value.
64The 70The
65.Fn strtoq 71.Fn strtoll
66function converts the string in 72function converts the string in
67.Fa nptr 73.Fa nptr
68to a 74to a
69.Li quad_t 75.Li long long
70value. 76value.
77The
78.Fn strtoq
79function is a deprecated equivalent of
80.Fn strtoll
81and is provided for backwards compatibility with legacy programs.
71The conversion is done according to the given 82The conversion is done according to the given
72.Fa base , 83.Fa base ,
73which must be a number between 2 and 36 inclusive or the special value 0. 84which must be a number between 2 and 36 inclusive or the special value 0.
@@ -141,6 +152,14 @@ In both cases,
141.Va errno 152.Va errno
142is set to 153is set to
143.Er ERANGE . 154.Er ERANGE .
155.Pp
156The
157.Fn strtoll
158function has identical return values except that
159.Dv LLONG_MIN
160and
161.Dv LLONG_MAX
162are used to indicate underflow and overflow respectively.
144.Sh EXAMPLES 163.Sh EXAMPLES
145Ensuring that a string is a valid number (i.e., in range and containing no 164Ensuring that a string is a valid number (i.e., in range and containing no
146trailing characters) requires clearing 165trailing characters) requires clearing