OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[linuxjm/LDP_man-pages.git] / draft / man3 / atoi.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified Mon Mar 29 22:39:41 1993, David Metcalfe
28 .\" Modified Sat Jul 24 21:38:42 1993, Rik Faith (faith@cs.unc.edu)
29 .\" Modified Sun Dec 17 18:35:06 2000, Joseph S. Myers
30 .\"
31 .\" Japanese Version Copyright (c) 1996 Kentaro OGAWA
32 .\"         all rights reserved.
33 .\" Translated Sat, 13 Jul 1996 22:47:32 +0900
34 .\"         by Kentaro OGAWA <k_ogawa@oyna.cc.muroran-it.ac.jp>
35 .\" Updated Tue 30 Jan 2001 JST by Kentaro Shirakata <argrath@ub32.org>
36 .\"
37 .TH ATOI 3  2010-09-20 "GNU" "Linux Programmer's Manual"
38 .SH Ì¾Á°
39 .\"O atoi, atol, atoll, atoq \- convert a string to an integer
40 atoi, atol, atoll, atoq \- Ê¸»úÎó¤òÀ°¿ô·¿¤ËÊÑ´¹¤¹¤ë
41 .SH ½ñ¼°
42 .nf
43 .B #include <stdlib.h>
44 .sp
45 .BI "int atoi(const char *" nptr );
46 .br
47 .BI "long atol(const char *" nptr );
48 .br
49 .BI "long long atoll(const char *" nptr );
50 .br
51 .BI "long long atoq(const char *" nptr );
52 .fi
53 .sp
54 .in -4n
55 .\"O Feature Test Macro Requirements for glibc (see
56 .\"O .BR feature_test_macros (7)):
57 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
58 .RB ( feature_test_macros (7)
59 »²¾È):
60 .in
61 .sp
62 .ad l
63 .BR atoll ():
64 .RS 4
65 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
66 _POSIX_C_SOURCE\ >=\ 200112L;
67 .br
68 or
69 .I cc\ -std=c99
70 .RE
71 .ad
72 .\"O .SH DESCRIPTION
73 .SH ÀâÌÀ
74 .BR atoi ()
75 ´Ø¿ô¤Ï¡¢\fInptr\fP ¤Ë¤è¤Ã¤Æ»Ø¼¨¤µ¤ì¤ëʸ»úÎó¤Î¤Ï¤¸¤á¤ÎÉôʬ¤ò
76 .I int
77 ·¿À°¿ô¤ËÊÑ´¹¤¹¤ë¡£
78 ¤³¤Î¿¶¤ëÉñ¤¤¤Ï¡¢
79 .BR atoi ()
80 ´Ø¿ô¤¬¥¨¥é¡¼¤ò¸«¤Ä¤±¤Ê¤¤ÅÀ°Ê³°¤Ï¡¢
81 .sp
82 .in +4n
83 strtol(nptr, (char **) NULL, 10);
84 .in
85 .sp
86 ¤ÈƱ¤¸¤Ç¤¢¤ë¡£
87 .PP
88 .\"O The
89 .\"O .BR atol ()
90 .\"O and
91 .\"O .BR atoll ()
92 .\"O functions behave the same as
93 .\"O .BR atoi (),
94 .\"O except that they convert the initial portion of the
95 .\"O string to their return type of \fIlong\fP or \fIlong long\fP.
96 .BR atol ()
97 ´Ø¿ô¤È
98 .BR atoll ()
99 ´Ø¿ô¤Ï
100 .BR atoi ()
101 ¤ÈƱÍͤﶤëÉñ¤¤¤ò¤¹¤ë¤¬¡¢
102 ʸ»úÎó¤Î¤Ï¤¸¤á¤ÎÉôʬ¤ò¤½¤ì¤¾¤ì \fIlong\fP ¤ä \fIlong long\fP ¤ËÊÑ´¹¤¹¤ë¡£
103 .\"O .BR atoq ()
104 .\"O is an obsolete name for
105 .\"O .BR atoll ().
106 .BR atoq ()
107 ¤Ï
108 .BR atoll ()
109 ¤Î¸Å¤¤Ì¾Á°¤Ç¤¢¤ë¡£
110 .SH ÊÖ¤êÃÍ
111 ÊÑ´¹¤µ¤ì¤¿ÃÍ¡£
112 .SH ½àµò
113 SVr4, POSIX.1-2001, 4.3BSD, C99.
114 .\"O C89 and
115 .\"O POSIX.1-1996 include the functions
116 .\"O .BR atoi ()
117 .\"O and
118 .\"O .BR atol ()
119 .\"O only.
120 .\"O .BR atoq ()
121 .\"O is a GNU extension.
122 C89 ¤È POSIX.1-1996 ¤Ë¤Ï
123 .BR atoi ()
124 ¤È
125 .BR atol ()
126 ¤À¤±¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£
127 .BR atoq ()
128 ¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£
129 .\"O .SH "NOTES"
130 .SH Ãí°Õ
131 .\"O The nonstandard
132 .\"O .BR atoq ()
133 .\"O function is not present in libc 4.6.27
134 .\"O or glibc 2, but is present in libc5 and libc 4.7 (though only as an
135 .\"O inline function in \fI<stdlib.h>\fP until libc 5.4.44).
136 .\"O The
137 .\"O .BR atoll ()
138 .\"O function is present in glibc 2 since version 2.0.2, but
139 .\"O not in libc4 or libc5.
140 Èóɸ½à¤Ç¤¢¤ë
141 .BR atoq ()
142 ´Ø¿ô¤Ï libc 4.6.27 ¤ä glibc 2 ¤Ë¤Ï´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢
143 libc5 ¤È libc 4.7 ¤Ë¤Ï¸ºß¤·¤Æ¤¤¤ë (¤¿¤À¤· libc 5.4.44 ¤Þ¤Ç¤Ï
144 \fI<stdlib.h>\fP ¤Î¥¤¥ó¥é¥¤¥ó´Ø¿ô¤Î¤ß¤Ç¤¢¤ë)¡£
145 .BR atoll ()
146 ´Ø¿ô¤Ï glibc 2 ¤Î¥Ð¡¼¥¸¥ç¥ó 2.0.2 ¤«¤é¸ºß¤·¤Æ¤¤¤ë¤¬¡¢
147 libc4 ¤ä libc5 ¤Ë¤Ï¸ºß¤·¤Ê¤¤¡£
148 .SH ´ØÏ¢¹àÌÜ
149 .BR atof (3),
150 .BR strtod (3),
151 .BR strtol (3),
152 .BR strtoul (3)