OSDN Git Service

ae3bcd06ea79c6359ebf19f13bbe87ebb12a9bb4
[linuxjm/LDP_man-pages.git] / release / man3 / atoi.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\"     386BSD man pages
29 .\" Modified Mon Mar 29 22:39:41 1993, David Metcalfe
30 .\" Modified Sat Jul 24 21:38:42 1993, Rik Faith (faith@cs.unc.edu)
31 .\" Modified Sun Dec 17 18:35:06 2000, Joseph S. Myers
32 .\"
33 .\"*******************************************************************
34 .\"
35 .\" This file was generated with po4a. Translate the source file.
36 .\"
37 .\"*******************************************************************
38 .TH ATOI 3 2012\-08\-03 GNU "Linux Programmer's Manual"
39 .SH 名前
40 atoi, atol, atoll, atoq \- 文字列を整数型に変換する
41 .SH 書式
42 .nf
43 \fB#include <stdlib.h>\fP
44 .sp
45 \fBint atoi(const char *\fP\fInptr\fP\fB);\fP
46 .br
47 \fBlong atol(const char *\fP\fInptr\fP\fB);\fP
48 .br
49 \fBlong long atoll(const char *\fP\fInptr\fP\fB);\fP
50 .br
51 \fBlong long atoq(const char *\fP\fInptr\fP\fB);\fP
52 .fi
53 .sp
54 .in -4n
55 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
56 .in
57 .sp
58 .ad l
59 \fBatoll\fP():
60 .RS 4
61 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE
62 || _POSIX_C_SOURCE\ >=\ 200112L;
63 .br
64 または \fIcc\ \-std=c99\fP
65 .RE
66 .ad
67 .SH 説明
68 \fBatoi\fP()  関数は、\fInptr\fP によって指示される文字列のはじめの部分を \fIint\fP 型整数に変換する。 この振る舞いは、
69 \fBatoi\fP()  関数がエラーを見つけない点以外は、
70 .sp
71 .in +4n
72 strtol(nptr, NULL, 10);
73 .in
74 .sp
75 と同じである。
76 .PP
77 \fBatol\fP()  関数と \fBatoll\fP()  関数は \fBatoi\fP()  と同様の振る舞いをするが、 文字列のはじめの部分をそれぞれ
78 \fIlong\fP や \fIlong long\fP に変換する。 \fBatoq\fP()  は \fBatoll\fP()  の古い名前である。
79 .SH 返り値
80 変換された値。
81 .SH 準拠
82 SVr4, POSIX.1\-2001, 4.3BSD, C99.  C89 と POSIX.1\-1996 には \fBatoi\fP()  と
83 \fBatol\fP()  だけが含まれている。 \fBatoq\fP()  は GNU による拡張である。
84 .SH 注意
85 非標準である \fBatoq\fP()  関数は libc 4.6.27 や glibc 2 には含まれていないが、 libc5 と libc 4.7
86 には存在している (ただし libc 5.4.44 までは \fI<stdlib.h>\fP のインライン関数のみである)。
87 \fBatoll\fP()  関数は glibc 2 のバージョン 2.0.2 から存在しているが、 libc4 や libc5 には存在しない。
88 .SH 関連項目
89 \fBatof\fP(3), \fBstrtod\fP(3), \fBstrtol\fP(3), \fBstrtoul\fP(3)
90 .SH この文書について
91 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
92 である。プロジェクトの説明とバグ報告に関する情報は
93 http://www.kernel.org/doc/man\-pages/ に書かれている。