1 --- strtol.3.bsdnew 2009-11-13 14:11:51.000000000 -0800
2 +++ strtol.3 2009-11-13 14:33:25.000000000 -0800
7 -.Nm strtol , strtoll , strtoimax , strtoq
12 .Nd "convert a string value to a"
13 .Vt long , "long long" , intmax_t
15 @@ -45,26 +48,41 @@ integer
22 +.Fa "const char *restrict str"
23 +.Fa "char **restrict endptr"
29 -.Fn strtol "const char * restrict nptr" "char ** restrict endptr" "int base"
31 +.Fa "const char *restrict str"
32 +.Fa "char **restrict endptr"
36 -.Fn strtoll "const char * restrict nptr" "char ** restrict endptr" "int base"
39 -.Fn strtoimax "const char * restrict nptr" "char ** restrict endptr" "int base"
41 +.Fa "const char *restrict str"
42 +.Fa "char **restrict endptr"
49 -.Fn strtoq "const char *nptr" "char **endptr" "int base"
51 +.Fa "const char *str"
59 converts the string in
68 converts the string in
77 converts the string in
83 @@ -88,7 +106,7 @@ The
86 converts the string in
92 @@ -143,11 +161,11 @@ stores the address of the first invalid
93 If there were no digits at all, however,
95 stores the original value of
106 @@ -155,11 +173,17 @@ but
109 on return, the entire string was valid.)
111 +Extended locale versions of these functions are documented in
115 +for more information.
125 @@ -177,7 +201,7 @@ is set to
127 and the function return value is clamped according
128 to the following table.
129 -.Bl -column -offset indent ".Fn strtoimax" ".Sy underflow" ".Sy overflow"
130 +.Bl -column -offset indent ".Fn strtoimax" ".Dv INTMAX_MIN" ".Dv INTMAX_MAX"
131 .It Sy Function Ta Sy underflow Ta Sy overflow
132 .It Fn strtol Ta Dv LONG_MIN Ta Dv LONG_MAX
133 .It Fn strtoll Ta Dv LLONG_MIN Ta Dv LLONG_MAX
134 @@ -195,14 +219,25 @@ no conversion could be performed
136 The given string was out of range; the value converted has been clamped.
139 +.Fd #include <stdlib.h>
140 +.Fd #include <limits.h>
143 +is necessary for the