Imported tab->space correction by redhat
[infodrom/manpages-de] / 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 .\" Translated into german by David Thamm <dthamm@bfs.de>
24 .\"
25 .\" sync: man-pages 1.70
26 .\"
27 .TH ASPRINTF 3 "25. November 2004" "GNU" "Bibliotheksfunktionen"
28 .SH NAME
29 asprintf, vasprintf \- Ausgabe in allokierte Zeichenkette
30 .SH "ÜBERSICHT"
31 .B #define _GNU_SOURCE
32 .br
33 .B #include <stdio.h>
34 .sp
35 .BI "int asprintf(char **" strp ", const char *" fmt ", ...);"
36 .sp
37 .BI "int vasprintf(char **" strp ", const char *" fmt ", va_list " ap );
38 .SH BESCHREIBUNG
39 Die Funktionen
40 .B asprintf
41 und
42 .B vasprintf
43 sind analog zu
44 .B sprintf
45 und
46 .B vsprintf
47 mit der Ausnahme, dass sie Speicherplatz für die Zeichenkette
48 allokieren, der ausreichend groß ist, um die Ausgabe inklusive des
49 abschließenden NUL-Zeichens aufzunehmen.  Ein Zeiger darauf wird über
50 den ersten Parameter zurückgegeben.  Dieser Zeiger sollte an
51 .BR free (3)
52 übergeben werden, um den belegten Speicherbereich wieder freizugeben,
53 wenn er nicht mehr benötigt wird.
54 .SH "RÜCKGABEWERT"
55 Wenn erfolgreich, geben diese Funktionen die Anzahl von ausgegebenen
56 Bytes zurück, wie bei
57 .BR sprintf (3).
58 Wenn die Speicherzuteilung nicht möglich war,
59 oder andere Fehler auftreten, geben diese Funktionen -1 zurück und
60 der Inhalt von
61 .I strp
62 ist undefiniert.
63 .SH ANMERKUNGEN
64 Diese Funktionen sind GNU Erweiterungen und nicht in C oder POSIX
65 definiert.  Sie sind ebenso verfügbar unter *BSD.  Die
66 Implementation unter FreeBSD setzt
67 .I strp
68 bei Fehler auf NULL.
69 .SH "SIEHE AUCH"
70 .BR  free (3),
71 .BR  malloc (3),
72 .BR  printf (3).
73
74