OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[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 .\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved.
26 .\" Translated Mon 14 Jan 2002 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
27 .\"
28 .TH ASPRINTF 3 2001-12-18 "GNU" "Linux Programmer's Manual"
29 .\"O .SH NAME
30 .\"O asprintf, vasprintf \- print to allocated string
31 .SH Ì¾Á°
32 asprintf, vasprintf \- Ê¸»úÎó¤ò³ä¤êÅö¤Æ¤Æ¤½¤ì¤Ë½ÐÎϤ¹¤ë
33 .\"O .SH SYNOPSIS
34 .SH ½ñ¼°
35 .B #define _GNU_SOURCE
36 .br
37 .B #include <stdio.h>
38 .sp
39 .BI "int asprintf(char **" strp ", const char *" fmt ", ...);"
40 .sp
41 .BI "int vasprintf(char **" strp ", const char *" fmt ", va_list " ap );
42 .\"O .SH DESCRIPTION
43 .SH ÀâÌÀ
44 .\"O The functions
45 .\"O .BR asprintf ()
46 .\"O and
47 .\"O .BR vasprintf ()
48 .\"O are analogs of
49 .\"O .BR sprintf (3)
50 .\"O and
51 .\"O .BR vsprintf (3),
52 .\"O except that they allocate a string large enough to hold the output
53 .\"O including the terminating null byte,
54 .\"O and return a pointer to it via the first argument.
55 .\"O This pointer should be passed to
56 .\"O .BR free (3)
57 .\"O to release the allocated storage when it is no longer needed.
58 .BR asprintf ()
59 ´Ø¿ô¤È
60 .BR vasprintf ()
61 ´Ø¿ô¤È¤Ï¡¢¤½¤ì¤¾¤ì
62 .BR sprintf (3)
63 ´Ø¿ô¤È
64 .BR vsprintf (3)
65 ´Ø¿ô¤È¤Ë»÷¤Æ¤¤¤ë¤¬¡¢
66 ½ÐÎÏʸ»úÎó¤ò (½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤â´Þ¤á¤Æ)
67 ÊÝ»ý¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÂ礭¤µ¤Î¥á¥â¥ê¤ò³ÎÊݤ·¡¢
68 ºÇ½é¤Î°ú¿ô¤Ë¤½¤Îʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
69 ¤³¤Î¥Ý¥¤¥ó¥¿¤Ï¡¢ÉÔÍפˤʤ俤é
70 .BR free (3)
71 ¤ËÅϤ·¡¢³ä¤êÅö¤Æ¤é¤ì¤¿µ­²±Îΰè¤ò²òÊü¤¹¤Ù¤­¤Ç¤¢¤ë¡£
72 .\"O .SH "RETURN VALUE"
73 .SH ÊÖ¤êÃÍ
74 .\"O When successful, these functions return the number of bytes printed,
75 .\"O just like
76 .\"O .BR sprintf (3).
77 .\"O If memory allocation wasn't possible, or some other error occurs,
78 .\"O these functions will return \-1, and the contents of
79 .\"O .I strp
80 .\"O is undefined.
81 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï½ÐÎϤµ¤ì¤¿¥Ð¥¤¥È¿ô¤ò
82 .RB ( sprintf (3)
83 ¤Î¤è¤¦¤Ë) ÊÖ¤¹¡£
84 ¥á¥â¥ê¤Î³ä¤êÅö¤Æ¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¤ê¡¢
85 ¤½¤Î¾¥¨¥é¡¼¤¬À¸¤¸¤ë¤È¡¢
86 ¤³¤ì¤é¤Î´Ø¿ô¤Ï \-1 ¤òÊÖ¤·¡¢
87 .I strp
88 ¤ÎÆâÍƤÏ̤ÄêµÁ¤È¤Ê¤ë¡£
89 .\"O .SH CONFORMING TO
90 .SH ½àµò
91 .\"O These functions are GNU extensions, not in C or POSIX.
92 .\"O They are also available under *BSD.
93 .\"O The FreeBSD implementation sets
94 .\"O .I strp
95 .\"O to NULL on error.
96 ¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ê¡¢C ¤ä POSIX ¤Î¤â¤Î¤Ç¤Ï¤Ê¤¤¡£
97 ¤³¤ì¤é¤Ï *BSD ¤Ç¤âÍøÍѤǤ­¤ë¡£
98 FreeBSD ¤Î¼ÂÁõ¤Ç¤Ï¡¢¥¨¥é¡¼¤ÎºÝ¤Ë¤Ï
99 .I strp
100 ¤ò NULL ¤Ë¥»¥Ã¥È¤¹¤ë¡£
101 .\"O .SH "SEE ALSO"
102 .SH ´ØÏ¢¹àÌÜ
103 .BR free (3),
104 .BR malloc (3),
105 .BR printf (3),
106 .BR feature_test_macros (7)