.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Mon Mar 29 22:39:41 1993, David Metcalfe .\" Modified Sat Jul 24 21:38:42 1993, Rik Faith (faith@cs.unc.edu) .\" Modified Sun Dec 17 18:35:06 2000, Joseph S. Myers .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1996 Kentaro OGAWA .\" all rights reserved. .\" Translated Sat, 13 Jul 1996 22:47:32 +0900 .\" by Kentaro OGAWA .\" Updated Tue 30 Jan 2001 JST by Kentaro Shirakata .\" .TH ATOI 3 2014\-08\-19 GNU "Linux Programmer's Manual" .SH 名前 atoi, atol, atoll \- 文字列を整数型に変換する .SH 書式 .nf \fB#include \fP .sp \fBint atoi(const char *\fP\fInptr\fP\fB);\fP .br \fBlong atol(const char *\fP\fInptr\fP\fB);\fP .br \fBlong long atoll(const char *\fP\fInptr\fP\fB);\fP .fi .sp .in -4n glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l \fBatoll\fP(): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br または \fIcc\ \-std=c99\fP .RE .ad .SH 説明 \fBatoi\fP() 関数は、\fInptr\fP によって指示される文字列のはじめの部分を \fIint\fP 型整数に変換する。 この振る舞いは、 \fBatoi\fP() 関数がエラーを見つけない点以外は、 .sp .in +4n strtol(nptr, NULL, 10); .in .sp と同じである。 .PP \fBatol\fP() 関数と \fBatoll\fP() 関数は \fBatoi\fP() と同様の振る舞いをするが、 文字列のはじめの部分をそれぞれ \fIlong\fP や \fIlong long\fP に変換する。 .SH 返り値 変換された値。 .SH 属性 .SS "マルチスレッディング (pthreads(7) 参照)" 関数 \fBatoi\fP(), \fBatol\fP(), \fBatoll\fP() は、例外付きのスレッドセーフである。実行中に \fBsetlocale\fP(3) を呼び出してロケールを変更しない限り、マルチスレッドアプリケーションで安全に使用することができる。 .SH 準拠 SVr4, POSIX.1\-2001, 4.3BSD, C99. C89 と POSIX.1\-1996 には \fBatoi\fP() と \fBatol\fP() だけが含まれている。 .SH 注意 .\" The .\" .BR atoll () .\" function is present in glibc 2 since version 2.0.2, but .\" not in libc4 or libc5. Linux libc は \fBatoll\fP() の古い名前として \fBatoq\fP() を提供していた。 glibc では \fBatoq\fP() は提供されていない。 .SH 関連項目 \fBatof\fP(3), \fBstrtod\fP(3), \fBstrtol\fP(3), \fBstrtoul\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。