netinet{,6}: Assert in{,6}_inithead() are only used for system routing tables.
[dragonfly.git] / lib / libc / stdlib / atol.3
1 .\" Copyright (c) 1990, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" This code is derived from software contributed to Berkeley by
5 .\" the American National Standards Committee X3, on Information
6 .\" Processing Systems.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\"    notice, this list of conditions and the following disclaimer in the
15 .\"    documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)atol.3      8.1 (Berkeley) 6/4/93
33 .\" $FreeBSD: src/lib/libc/stdlib/atol.3,v 1.14 2007/01/09 00:28:09 imp Exp $
34 .\"
35 .Dd November 17, 2013
36 .Dt ATOL 3
37 .Os
38 .Sh NAME
39 .Nm atol ,
40 .Nm atoll ,
41 .Nm atol_l ,
42 .Nm atoll_l
43 .Nd convert
44 .Tn ASCII
45 string to
46 .Vt long
47 or
48 .Vt "long long"
49 integer
50 .Sh LIBRARY
51 .Lb libc
52 .Sh SYNOPSIS
53 .In stdlib.h
54 .Ft long
55 .Fn atol "const char *nptr"
56 .Ft "long long"
57 .Fn atoll "const char *nptr"
58 .In xlocale.h
59 .Ft long
60 .Fn atol_l "const char *nptr" "locale_t loc"
61 .Ft "long long"
62 .Fn atoll_l "const char *nptr" "locale_t loc"
63 .Sh DESCRIPTION
64 The
65 .Fn atol
66 function converts the initial portion of the string pointed to by
67 .Fa nptr
68 to
69 .Vt long
70 integer
71 representation.
72 .Pp
73 It is equivalent to:
74 .Pp
75 .Dl "strtol(nptr, NULL, 10);"
76 .Pp
77 The
78 .Fn atoll
79 function converts the initial portion of the string pointed to by
80 .Fa nptr
81 to
82 .Vt "long long"
83 integer
84 representation.
85 .Pp
86 It is equivalent to:
87 .Pp
88 .Dl "strtoll(nptr, NULL, 10);"
89 .Pp
90 The _l-suffixed versions take an explicit locale argument, whereas the
91 non-suffixed versions use the current global or per-thread locale.
92 .Sh ERRORS
93 The functions
94 .Fn atol
95 and
96 .Fn atoll
97 need not
98 affect the value of
99 .Va errno
100 on an error.
101 .Sh SEE ALSO
102 .Xr atof 3 ,
103 .Xr atoi 3 ,
104 .Xr strtod 3 ,
105 .Xr strtol 3 ,
106 .Xr strtoul 3 ,
107 .Xr xlocale 3
108 .Sh STANDARDS
109 The
110 .Fn atol
111 function
112 conforms to
113 .St -isoC .
114 The
115 .Fn atoll
116 function
117 conforms to
118 .St -isoC-99 .