Install curl-7.25.0.tar.bz2
[msysgit.git] / mingw / share / man / man3 / curl_mprintf.3
blobcbf10e1ab00177053cce44a56fb6cb097c7b8f1c
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at http://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .TH curl_printf 3 "30 April 2004" "libcurl 7.12" "libcurl Manual"
23 .SH NAME
24 curl_maprintf, curl_mfprintf, curl_mprintf, curl_msnprintf, curl_msprintf
25 curl_mvaprintf, curl_mvfprintf, curl_mvprintf, curl_mvsnprintf,
26 curl_mvsprintf - formatted output conversion
27 .SH SYNOPSIS
28 .B #include <curl/mprintf.h>
29 .sp
30 .BI "int curl_mprintf(const char *" format ", ...);"
31 .br
32 .BI "int curl_mfprintf(FILE *" fd ", const char *" format ", ...);"
33 .br
34 .BI "int curl_msprintf(char *" buffer ", const char *" format ", ...);"
35 .br
36 .BI "int curl_msnprintf(char *" buffer ", size_t " maxlength ", const char *" format ", ...);"
37 .br
38 .BI "int curl_mvprintf(const char *" format ", va_list " args ");"
39 .br
40 .BI "int curl_mvfprintf(FILE *" fd ", const char *" format ", va_list " args ");"
41 .br
42 .BI "int curl_mvsprintf(char *" buffer ", const char *" format ", va_list " args ");"
43 .br
44 .BI "int curl_mvsnprintf(char *" buffer ", size_t " maxlength ", const char *" format ", va_list " args ");"
45 .br
46 .BI "char *curl_maprintf(const char *" format ", ...);"
47 .br
48 .BI "char *curl_mvaprintf(const char *" format ", va_list " args ");"
49 .SH DESCRIPTION
50 These are all functions that produce output according to a format string and
51 given arguments. These are mostly clones of the well-known C-style functions
52 and there will be no detailed explanation of all available formatting rules
53 and usage here.
55 See this table for notable exceptions.
56 .RS
57 .TP
58 .B curl_mprintf()
59 Normal printf() clone.
60 .TP
61 .B curl_mfprintf()
62 Normal fprintf() clone.
63 .TP
64 .B curl_msprintf()
65 Normal sprintf() clone.
66 .TP
67 .B curl_msnprintf()
68 snprintf() clone. Many systems don't have this. It is just like \fBsprintf\fP
69 but with an extra argument after the buffer that specifies the length of the
70 target buffer.
71 .TP
72 .B curl_mvprintf()
73 Normal vprintf() clone.
74 .TP
75 .B curl_mvfprintf()
76 Normal vfprintf() clone.
77 .TP
78 .B curl_mvsprintf()
79 Normal vsprintf() clone.
80 .TP
81 .B curl_mvsnprintf()
82 vsnprintf() clone.  Many systems don't have this. It is just like
83 \fBvsprintf\fP but with an extra argument after the buffer that specifies the
84 length of the target buffer.
85 .TP
86 .B curl_maprintf()
87 Like printf() but returns the output string as a malloc()ed string. The
88 returned string must be free()ed by the receiver.
89 .TP
90 .B curl_mvaprintf()
91 Like curl_maprintf() but takes a va_list pointer argument instead of a
92 variable amount of arguments.
93 .RE
95 To easily use all these cloned functions instead of the normal ones, #define
96 _MPRINTF_REPLACE before you include the <curl/mprintf.h> file. Then all the
97 normal names like printf, fprintf, sprintf etc will use the curl-functions
98 instead.
99 .SH AVAILABILITY
100 These function will be removed from the public libcurl API in a near
101 future. They will instead be made "available" by source code access only, and
102 then as curlx_-prefixed functions. See lib/README.curlx for further details.
103 .SH RETURN VALUE
104 The \fBcurl_maprintf\fP and \fBcurl_mvaprintf\fP functions return a pointer to
105 a newly allocated string, or NULL if it failed.
107 All other functions return the number of characters they actually outputted.
108 .SH "SEE ALSO"
109 .BR printf "(3), " sprintf "(3), " fprintf "(3), " vprintf "(3) "