1curl_printf(3) libcurl Manual curl_printf(3)
2
3
4
6 curl_maprintf, curl_mfprintf, curl_mprintf, curl_msnprintf,
7 curl_msprintf curl_mvaprintf, curl_mvfprintf, curl_mvprintf, curl_mvs‐
8 nprintf, curl_mvsprintf - formatted output conversion
9
11 #include <curl/mprintf.h>
12
13 int curl_mprintf(const char *format, ...);
14 int curl_mfprintf(FILE *fd, const char *format, ...);
15 int curl_msprintf(char *buffer, const char *format, ...);
16 int curl_msnprintf(char *buffer, size_t maxlength, const char *format,
17 ...);
18 int curl_mvprintf(const char *format, va_list args);
19 int curl_mvfprintf(FILE *fd, const char *format, va_list args);
20 int curl_mvsprintf(char *buffer, const char *format, va_list args);
21 int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format,
22 va_list args);
23 char *curl_maprintf(const char *format, ...);
24 char *curl_mvaprintf(const char *format, va_list args);
25
27 These are all functions that produce output according to a format
28 string and given arguments. These are mostly clones of the well-known
29 C-style functions and there will be no detailed explanation of all
30 available formatting rules and usage here.
31
32 See this table for notable exceptions.
33
34 curl_mprintf()
35 Normal printf() clone.
36
37 curl_mfprintf()
38 Normal fprintf() clone.
39
40 curl_msprintf()
41 Normal sprintf() clone.
42
43 curl_msnprintf()
44 snprintf() clone. Many systems don't have this. It is
45 just like sprintf but with an extra argument after the
46 buffer that specifies the length of the target buffer.
47
48 curl_mvprintf()
49 Normal vprintf() clone.
50
51 curl_mvfprintf()
52 Normal vfprintf() clone.
53
54 curl_mvsprintf()
55 Normal vsprintf() clone.
56
57 curl_mvsnprintf()
58 vsnprintf() clone. Many systems don't have this. It is
59 just like vsprintf but with an extra argument after the
60 buffer that specifies the length of the target buffer.
61
62 curl_maprintf()
63 Like printf() but returns the output string as a mal‐
64 loc()ed string. The returned string must be free()ed by
65 the receiver.
66
67 curl_mvaprintf()
68 Like curl_maprintf() but takes a va_list pointer argument
69 instead of a variable amount of arguments.
70
71 To easily use all these cloned functions instead of the normal ones,
72 #define _MPRINTF_REPLACE before you include the <curl/mprintf.h> file.
73 Then all the normal names like printf, fprintf, sprintf etc will use
74 the curl-functions instead.
75
77 These function will be removed from the public libcurl API in a near
78 future. They will instead be made "available" by source code access
79 only, and then as curlx_-prefixed functions. See lib/README.curlx for
80 further details.
81
83 The curl_maprintf and curl_mvaprintf functions return a pointer to a
84 newly allocated string, or NULL if it failed.
85
86 All other functions return the number of characters they actually out‐
87 putted.
88
90 printf(3), sprintf(3), fprintf(3), vprintf(3)
91
92
93
94libcurl 7.12 30 April 2004 curl_printf(3)