]>
Commit | Line | Data |
---|---|---|
1f2f436a A |
1 | --- atol.3.orig 2010-02-08 16:26:10.000000000 -0800 |
2 | +++ atol.3 2010-02-13 21:01:28.000000000 -0800 | |
3 | @@ -36,7 +36,8 @@ | |
3d9156a7 A |
4 | .Dt ATOL 3 |
5 | .Os | |
6 | .Sh NAME | |
7 | -.Nm atol , atoll | |
8 | +.Nm atol , atoll , | |
9 | +.Nm atol_l , atoll_l | |
10 | .Nd convert | |
11 | .Tn ASCII | |
12 | string to | |
1f2f436a | 13 | @@ -49,14 +50,19 @@ integer |
224c7076 A |
14 | .Sh SYNOPSIS |
15 | .In stdlib.h | |
16 | .Ft long | |
17 | -.Fn atol "const char *nptr" | |
18 | +.Fn atol "const char *str" | |
3d9156a7 | 19 | .Ft "long long" |
224c7076 A |
20 | -.Fn atoll "const char *nptr" |
21 | +.Fn atoll "const char *str" | |
3d9156a7 A |
22 | +.In xlocale.h |
23 | +.Ft long | |
224c7076 | 24 | +.Fn atol_l "const char *str" "locale_t loc" |
3d9156a7 | 25 | +.Ft "long long" |
224c7076 | 26 | +.Fn atoll_l "const char *str" "locale_t loc" |
3d9156a7 A |
27 | .Sh DESCRIPTION |
28 | The | |
29 | .Fn atol | |
224c7076 A |
30 | function converts the initial portion of the string pointed to by |
31 | -.Fa nptr | |
32 | +.Fa str | |
33 | to | |
34 | .Vt long | |
35 | integer | |
1f2f436a | 36 | @@ -64,12 +70,12 @@ representation. |
224c7076 A |
37 | .Pp |
38 | It is equivalent to: | |
39 | .Pp | |
40 | -.Dl "strtol(nptr, (char **)NULL, 10);" | |
41 | +.Dl "strtol(str, (char **)NULL, 10);" | |
42 | .Pp | |
43 | The | |
44 | .Fn atoll | |
45 | function converts the initial portion of the string pointed to by | |
46 | -.Fa nptr | |
47 | +.Fa str | |
48 | to | |
49 | .Vt "long long" | |
50 | integer | |
1f2f436a | 51 | @@ -77,8 +83,28 @@ representation. |
224c7076 | 52 | .Pp |
3d9156a7 A |
53 | It is equivalent to: |
54 | .Pp | |
224c7076 | 55 | -.Dl "strtoll(nptr, (char **)NULL, 10);" |
1f2f436a | 56 | -.Sh COMPATIBILITY |
224c7076 | 57 | +.Dl "strtoll(str, (char **)NULL, 10);" |
3d9156a7 A |
58 | +.Pp |
59 | +While the | |
60 | +.Fn atol | |
61 | +and | |
62 | +.Fn atoll | |
63 | +functions use the current locale, the | |
64 | +.Fn atol_l | |
65 | +and | |
66 | +.Fn atoll_l | |
67 | +functions may be passed locales directly. See | |
68 | +.Xr xlocale 3 | |
69 | +for more information. | |
1f2f436a A |
70 | +.Sh IMPLEMENTATION NOTES |
71 | +The | |
72 | +.Fn atol , | |
73 | +.Fn atoll , | |
74 | +.Fn atol_l , | |
75 | +and | |
76 | +.Fn atoll_l | |
77 | +functions are thread-safe and async-cancel-safe. | |
78 | +.Pp | |
79 | The | |
80 | .Fx | |
81 | implementations of the | |
82 | @@ -121,7 +147,8 @@ on an error. | |
3d9156a7 A |
83 | .Xr atoi 3 , |
84 | .Xr strtod 3 , | |
85 | .Xr strtol 3 , | |
86 | -.Xr strtoul 3 | |
87 | +.Xr strtoul 3 , | |
88 | +.Xr xlocale 3 | |
89 | .Sh STANDARDS | |
90 | The | |
91 | .Fn atol |