OSDN Git Service

cad53061bba4a0a555824adb548b5986598dc37e
[linuxjm/LDP_man-pages.git] / draft / man3 / asprintf.3
1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>
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 .\" Text fragments inspired by Martin Schulze <joey@infodrom.org>.
26 .\"
27 .\"*******************************************************************
28 .\"
29 .\" This file was generated with po4a. Translate the source file.
30 .\"
31 .\"*******************************************************************
32 .TH ASPRINTF 3 2013\-06\-21 GNU "Linux Programmer's Manual"
33 .SH 名前
34 asprintf, vasprintf \- 文字列を割り当ててそれに出力する
35 .SH 書式
36 \fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */
37 .br
38 \fB#include <stdio.h>\fP
39 .sp
40 \fBint asprintf(char **\fP\fIstrp\fP\fB, const char *\fP\fIfmt\fP\fB, ...);\fP
41 .sp
42 \fBint vasprintf(char **\fP\fIstrp\fP\fB, const char *\fP\fIfmt\fP\fB, va_list
43 \fP\fIap\fP\fB);\fP
44 .SH 説明
45 The functions \fBasprintf\fP()  and \fBvasprintf\fP()  are analogs of
46 \fBsprintf\fP(3)  and \fBvsprintf\fP(3), except that they allocate a string large
47 enough to hold the output including the terminating null byte (\(aq\e0\(aq),
48 and return a pointer to it via the first argument.  This pointer should be
49 passed to \fBfree\fP(3)  to release the allocated storage when it is no longer
50 needed.
51 .SH 返り値
52 成功すると、これらの関数は出力されたバイト数を (\fBsprintf\fP(3)  のように) 返す。 メモリの割り当てができなかったり、
53 その他エラーが生じると、 これらの関数は \-1 を返し、 \fIstrp\fP の内容は未定義となる。
54 .SH 準拠
55 これらの関数は GNU の拡張であり、C や POSIX のものではない。 これらは *BSD でも利用できる。 FreeBSD
56 の実装では、エラーの際には \fIstrp\fP を NULL にセットする。
57 .SH 関連項目
58 \fBfree\fP(3), \fBmalloc\fP(3), \fBprintf\fP(3)
59 .SH この文書について
60 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
61 である。プロジェクトの説明とバグ報告に関する情報は
62 http://www.kernel.org/doc/man\-pages/ に書かれている。