1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>
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.
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.
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
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Text fragments inspired by Martin Schulze <joey@infodrom.org>.
25 .\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved.
26 .\" Translated Mon 14 Jan 2002 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
28 .TH ASPRINTF 3 2001-12-18 "GNU" "Linux Programmer's Manual"
30 .\"O asprintf, vasprintf \- print to allocated string
32 asprintf, vasprintf \- ʸ»úÎó¤ò³ä¤êÅö¤Æ¤Æ¤½¤ì¤Ë½ÐÎϤ¹¤ë
35 .\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
36 .BR "#define _GNU_SOURCE" " /* feature_test_macros(7) »²¾È */"
40 .BI "int asprintf(char **" strp ", const char *" fmt ", ...);"
42 .BI "int vasprintf(char **" strp ", const char *" fmt ", va_list " ap );
52 .\"O .BR vsprintf (3),
53 .\"O except that they allocate a string large enough to hold the output
54 .\"O including the terminating null byte,
55 .\"O and return a pointer to it via the first argument.
56 .\"O This pointer should be passed to
58 .\"O to release the allocated storage when it is no longer needed.
67 ½ÐÎÏʸ»úÎó¤ò (½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤â´Þ¤á¤Æ)
68 ÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礤µ¤Î¥á¥â¥ê¤ò³ÎÊݤ·¡¢
69 ºÇ½é¤Î°ú¿ô¤Ë¤½¤Îʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
70 ¤³¤Î¥Ý¥¤¥ó¥¿¤Ï¡¢ÉÔÍפˤʤ俤é
72 ¤ËÅϤ·¡¢³ä¤êÅö¤Æ¤é¤ì¤¿µ²±Îΰè¤ò²òÊü¤¹¤Ù¤¤Ç¤¢¤ë¡£
73 .\"O .SH "RETURN VALUE"
75 .\"O When successful, these functions return the number of bytes printed,
78 .\"O If memory allocation wasn't possible, or some other error occurs,
79 .\"O these functions will return \-1, and the contents of
82 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï½ÐÎϤµ¤ì¤¿¥Ð¥¤¥È¿ô¤ò
85 ¥á¥â¥ê¤Î³ä¤êÅö¤Æ¤¬¤Ç¤¤Ê¤«¤Ã¤¿¤ê¡¢
86 ¤½¤Î¾¥¨¥é¡¼¤¬À¸¤¸¤ë¤È¡¢
87 ¤³¤ì¤é¤Î´Ø¿ô¤Ï \-1 ¤òÊÖ¤·¡¢
89 ¤ÎÆâÍƤÏ̤ÄêµÁ¤È¤Ê¤ë¡£
90 .\"O .SH CONFORMING TO
92 .\"O These functions are GNU extensions, not in C or POSIX.
93 .\"O They are also available under *BSD.
94 .\"O The FreeBSD implementation sets
96 .\"O to NULL on error.
97 ¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢C ¤ä POSIX ¤Î¤â¤Î¤Ç¤Ï¤Ê¤¤¡£
98 ¤³¤ì¤é¤Ï *BSD ¤Ç¤âÍøÍѤǤ¤ë¡£
99 FreeBSD ¤Î¼ÂÁõ¤Ç¤Ï¡¢¥¨¥é¡¼¤ÎºÝ¤Ë¤Ï
101 ¤ò NULL ¤Ë¥»¥Ã¥È¤¹¤ë¡£