]>
Commit | Line | Data |
---|---|---|
224c7076 A |
1 | --- atoi.3.orig 2007-04-08 18:49:34.000000000 -0700 |
2 | +++ atoi.3 2007-04-08 19:19:59.000000000 -0700 | |
3d9156a7 A |
3 | @@ -40,7 +40,8 @@ |
4 | .Dt ATOI 3 | |
5 | .Os | |
6 | .Sh NAME | |
7 | -.Nm atoi | |
8 | +.Nm atoi , | |
9 | +.Nm atoi_l | |
10 | .Nd convert | |
11 | .Tn ASCII | |
12 | string to integer | |
224c7076 A |
13 | @@ -49,20 +50,31 @@ |
14 | .Sh SYNOPSIS | |
3d9156a7 A |
15 | .In stdlib.h |
16 | .Ft int | |
224c7076 A |
17 | -.Fn atoi "const char *nptr" |
18 | +.Fn atoi "const char *str" | |
3d9156a7 A |
19 | +.In xlocale.h |
20 | +.Ft int | |
224c7076 | 21 | +.Fn atoi_l "const char *str" "locale_t loc" |
3d9156a7 A |
22 | .Sh DESCRIPTION |
23 | The | |
24 | .Fn atoi | |
224c7076 A |
25 | function converts the initial portion of the string pointed to by |
26 | -.Fa nptr | |
27 | +.Fa str | |
28 | to | |
29 | .Vt int | |
30 | representation. | |
31 | .Pp | |
32 | It is equivalent to: | |
3d9156a7 | 33 | .Bd -literal -offset indent |
224c7076 A |
34 | -(int)strtol(nptr, (char **)NULL, 10); |
35 | +(int)strtol(str, (char **)NULL, 10); | |
3d9156a7 A |
36 | .Ed |
37 | +.Pp | |
38 | +While the | |
39 | +.Fn atoi | |
40 | +function uses the current locale, the | |
41 | +.Fn atoi_l | |
42 | +function may be passed a locale directly. See | |
43 | +.Xr xlocale 3 | |
44 | +for more information. | |
45 | .Sh IMPLEMENTATION NOTES | |
46 | The | |
47 | .Fn atoi | |
48 | @@ -84,7 +96,8 @@ | |
49 | .Xr atol 3 , | |
50 | .Xr strtod 3 , | |
51 | .Xr strtol 3 , | |
52 | -.Xr strtoul 3 | |
53 | +.Xr strtoul 3 , | |
54 | +.Xr xlocale 3 | |
55 | .Sh STANDARDS | |
56 | The | |
57 | .Fn atoi |