]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/curl/docs/libcurl/curl_mprintf.3
hello world
[icculus/iodoom3.git] / neo / curl / docs / libcurl / curl_mprintf.3
1 .\" You can view this file with:
2 .\" nroff -man [file]
3 .\" $Id: curl_mprintf.3,v 1.1 2002/03/04 10:09:49 bagder Exp $
4 .\"
5 .TH curl_printf 3 "20 April 2001" "libcurl 7.7.2" "libcurl Manual"
6 .SH NAME
7 curl_maprintf, curl_mfprintf, curl_mprintf, curl_msnprintf, curl_msprintf
8 curl_mvaprintf, curl_mvfprintf, curl_mvprintf, curl_mvsnprintf,
9 curl_mvsprintf - formatted output conversion
10 .SH SYNOPSIS
11 .B #include <curl/mprintf.h>
12 .sp
13 .BI "int curl_mprintf(const char *" format ", ...);"
14 .br
15 .BI "int curl_mfprintf(FILE *" fd ", const char *" format ", ...);"
16 .br
17 .BI "int curl_msprintf(char *" buffer ", const char *" format ", ...);"
18 .br
19 .BI "int curl_msnprintf(char *" buffer ", size_t " maxlength ", const char *" format ", ...);"
20 .br
21 .BI "int curl_mvprintf(const char *" format ", va_list " args ");"
22 .br
23 .BI "int curl_mvfprintf(FILE *" fd ", const char *" format ", va_list " args ");"
24 .br
25 .BI "int curl_mvsprintf(char *" buffer ", const char *" format ", va_list " args ");"
26 .br
27 .BI "int curl_mvsnprintf(char *" buffer ", size_t " maxlength ", const char *" format ", va_list " args ");"
28 .br
29 .BI "char *curl_maprintf(const char *" format ", ...);"
30 .br
31 .BI "char *curl_mvaprintf(const char *" format ", va_list " args ");"
32 .SH DESCRIPTION
33 These are all functions that produces output according to a format string and
34 given arguments. These are mostly clones of the well-known C-style functions
35 and there will be no detailed explanation of all available formatting rules
36 and usage here.
37
38 See this table for notable exceptions.
39 .RS
40 .TP
41 .B curl_mprintf()
42 Normal printf() clone.
43 .TP
44 .B curl_mfprintf()
45 Normal fprinf() clone.
46 .TP
47 .B curl_msprintf()
48 Normal sprintf() clone.
49 .TP
50 .B curl_msnprintf()
51 snprintf() clone. Many systems don't have this. It is just like \fBsprintf\fP
52 but with an extra argument after the buffer that specifies the length of the
53 target buffer.
54 .TP
55 .B curl_mvprintf()
56 Normal vprintf() clone.
57 .TP
58 .B curl_mvfprintf()
59 Normal vfprintf() clone.
60 .TP
61 .B curl_mvsprintf()
62 Normal vsprintf() clone.
63 .TP
64 .B curl_mvsnprintf()
65 vsnprintf() clone.  Many systems don't have this. It is just like
66 \fBvsprintf\fP but with an extra argument after the buffer that specifies the
67 length of the target buffer.
68 .TP
69 .B curl_maprintf()
70 Like printf() but returns the output string as a malloc()ed string. The
71 returned string must be free()ed by the receiver.
72 .TP
73 .B curl_mvaprintf()
74 Like curl_maprintf() but takes a va_list pointer argument instead of a
75 variable amount of arguments.
76 .RE
77
78 To easily use all these cloned functions instead of the normal ones, #define
79 _MPRINTF_REPLACE before you include the <curl/mprintf.h> file. Then all the
80 normal names like printf, fprintf, sprintf etc will use the curl-functions
81 instead.
82 .SH RETURN VALUE
83 The \fBcurl_maprintf\fP and \fBcurl_mvaprintf\fP functions return a pointer to
84 a newly allocated string, or NULL it it failed.
85
86 All other functions return the number of character they actually outputed.
87 .SH "SEE ALSO"
88 .BR printf "(3), " sprintf "(3), " fprintf "(3), " vprintf "(3) "