1 .\" $Id: curl_mprintf.3,v 1.1.1.1 2008-09-23 16:32:05 hoffman Exp $
3 .TH curl_printf 3 "30 April 2004" "libcurl 7.12" "libcurl Manual"
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
9 .B #include <curl/mprintf.h>
11 .BI "int curl_mprintf(const char *" format ", ...);"
13 .BI "int curl_mfprintf(FILE *" fd ", const char *" format ", ...);"
15 .BI "int curl_msprintf(char *" buffer ", const char *" format ", ...);"
17 .BI "int curl_msnprintf(char *" buffer ", size_t " maxlength ", const char *" format ", ...);"
19 .BI "int curl_mvprintf(const char *" format ", va_list " args ");"
21 .BI "int curl_mvfprintf(FILE *" fd ", const char *" format ", va_list " args ");"
23 .BI "int curl_mvsprintf(char *" buffer ", const char *" format ", va_list " args ");"
25 .BI "int curl_mvsnprintf(char *" buffer ", size_t " maxlength ", const char *" format ", va_list " args ");"
27 .BI "char *curl_maprintf(const char *" format ", ...);"
29 .BI "char *curl_mvaprintf(const char *" format ", va_list " args ");"
31 These are all functions that produces 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
36 See this table for notable exceptions.
40 Normal printf() clone.
43 Normal fprintf() clone.
46 Normal sprintf() clone.
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
54 Normal vprintf() clone.
57 Normal vfprintf() clone.
60 Normal vsprintf() clone.
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.
68 Like printf() but returns the output string as a malloc()ed string. The
69 returned string must be free()ed by the receiver.
72 Like curl_maprintf() but takes a va_list pointer argument instead of a
73 variable amount of arguments.
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
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.
85 The \fBcurl_maprintf\fP and \fBcurl_mvaprintf\fP functions return a pointer to
86 a newly allocated string, or NULL it it failed.
88 All other functions return the number of character they actually outputed.
90 .BR printf "(3), " sprintf "(3), " fprintf "(3), " vprintf "(3) "