Install curl-7.19.5.tar.bz2
[msysgit/bosko.git] / mingw / share / man / man3 / curl_mprintf.3
blobb893911dcefa58234e2f1eeae409250aeb047532
1 .\" $Id: curl_mprintf.3,v 1.4 2008-12-28 21:56:56 bagder Exp $
2 .\"
3 .TH curl_printf 3 "30 April 2004" "libcurl 7.12" "libcurl Manual"
4 .SH NAME
5 curl_maprintf, curl_mfprintf, curl_mprintf, curl_msnprintf, curl_msprintf
6 curl_mvaprintf, curl_mvfprintf, curl_mvprintf, curl_mvsnprintf,
7 curl_mvsprintf - formatted output conversion
8 .SH SYNOPSIS
9 .B #include <curl/mprintf.h>
10 .sp
11 .BI "int curl_mprintf(const char *" format ", ...);"
12 .br
13 .BI "int curl_mfprintf(FILE *" fd ", const char *" format ", ...);"
14 .br
15 .BI "int curl_msprintf(char *" buffer ", const char *" format ", ...);"
16 .br
17 .BI "int curl_msnprintf(char *" buffer ", size_t " maxlength ", const char *" format ", ...);"
18 .br
19 .BI "int curl_mvprintf(const char *" format ", va_list " args ");"
20 .br
21 .BI "int curl_mvfprintf(FILE *" fd ", const char *" format ", va_list " args ");"
22 .br
23 .BI "int curl_mvsprintf(char *" buffer ", const char *" format ", va_list " args ");"
24 .br
25 .BI "int curl_mvsnprintf(char *" buffer ", size_t " maxlength ", const char *" format ", va_list " args ");"
26 .br
27 .BI "char *curl_maprintf(const char *" format ", ...);"
28 .br
29 .BI "char *curl_mvaprintf(const char *" format ", va_list " args ");"
30 .SH DESCRIPTION
31 These are all functions that produce output according to a format string and
32 given arguments. These are mostly clones of the well-known C-style functions
33 and there will be no detailed explanation of all available formatting rules
34 and usage here.
36 See this table for notable exceptions.
37 .RS
38 .TP
39 .B curl_mprintf()
40 Normal printf() clone.
41 .TP
42 .B curl_mfprintf()
43 Normal fprintf() clone.
44 .TP
45 .B curl_msprintf()
46 Normal sprintf() clone.
47 .TP
48 .B curl_msnprintf()
49 snprintf() clone. Many systems don't have this. It is just like \fBsprintf\fP
50 but with an extra argument after the buffer that specifies the length of the
51 target buffer.
52 .TP
53 .B curl_mvprintf()
54 Normal vprintf() clone.
55 .TP
56 .B curl_mvfprintf()
57 Normal vfprintf() clone.
58 .TP
59 .B curl_mvsprintf()
60 Normal vsprintf() clone.
61 .TP
62 .B curl_mvsnprintf()
63 vsnprintf() clone.  Many systems don't have this. It is just like
64 \fBvsprintf\fP but with an extra argument after the buffer that specifies the
65 length of the target buffer.
66 .TP
67 .B curl_maprintf()
68 Like printf() but returns the output string as a malloc()ed string. The
69 returned string must be free()ed by the receiver.
70 .TP
71 .B curl_mvaprintf()
72 Like curl_maprintf() but takes a va_list pointer argument instead of a
73 variable amount of arguments.
74 .RE
76 To easily use all these cloned functions instead of the normal ones, #define
77 _MPRINTF_REPLACE before you include the <curl/mprintf.h> file. Then all the
78 normal names like printf, fprintf, sprintf etc will use the curl-functions
79 instead.
80 .SH AVAILABILITY
81 These function will be removed from the public libcurl API in a near
82 future. They will instead be made "available" by source code access only, and
83 then as curlx_-prefixed functions. See lib/README.curlx for further details.
84 .SH RETURN VALUE
85 The \fBcurl_maprintf\fP and \fBcurl_mvaprintf\fP functions return a pointer to
86 a newly allocated string, or NULL if it failed.
88 All other functions return the number of characters they actually outputted.
89 .SH "SEE ALSO"
90 .BR printf "(3), " sprintf "(3), " fprintf "(3), " vprintf "(3) "