OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[linuxjm/LDP_man-pages.git] / draft / man3 / asprintf.3
1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>
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 .\" Text fragments inspired by Martin Schulze <joey@infodrom.org>.
24 .\"
25 .\"*******************************************************************
26 .\"
27 .\" This file was generated with po4a. Translate the source file.
28 .\"
29 .\"*******************************************************************
30 .TH ASPRINTF 3 2001\-12\-18 GNU "Linux Programmer's Manual"
31 .SH 名前
32 asprintf, vasprintf \- 文字列を割り当ててそれに出力する
33 .SH 書式
34 \fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */
35 .br
36 \fB#include <stdio.h>\fP
37 .sp
38 \fBint asprintf(char **\fP\fIstrp\fP\fB, const char *\fP\fIfmt\fP\fB, ...);\fP
39 .sp
40 \fBint vasprintf(char **\fP\fIstrp\fP\fB, const char *\fP\fIfmt\fP\fB, va_list
41 \fP\fIap\fP\fB);\fP
42 .SH 説明
43 \fBasprintf\fP()  関数と \fBvasprintf\fP()  関数とは、それぞれ \fBsprintf\fP(3)  関数と
44 \fBvsprintf\fP(3)  関数とに似ているが、 出力文字列を (終端の NULL バイトも含めて)  保持するのに十分な大きさのメモリを確保し、
45 最初の引数にその文字列へのポインタを返す。 このポインタは、不要になったら \fBfree\fP(3)  に渡し、割り当てられた記憶領域を解放すべきである。
46 .SH 返り値
47 成功すると、これらの関数は出力されたバイト数を (\fBsprintf\fP(3)  のように) 返す。 メモリの割り当てができなかったり、
48 その他エラーが生じると、 これらの関数は \-1 を返し、 \fIstrp\fP の内容は未定義となる。
49 .SH 準拠
50 これらの関数は GNU の拡張であり、C や POSIX のものではない。 これらは *BSD でも利用できる。 FreeBSD
51 の実装では、エラーの際には \fIstrp\fP を NULL にセットする。
52 .SH 関連項目
53 \fBfree\fP(3), \fBmalloc\fP(3), \fBprintf\fP(3)