gnurl_printf(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸŽ€ NAME πŸŽ€

hii bestie πŸ’– this is gnurl_printf(3) from the libgnurl Manual, and the whole squad here is all about formatted output conversion. The main characters are curl_maprintf, curl_mfprintf, curl_mprintf, curl_msnprintf, curl_msprintf, curl_mvaprintf, curl_mvfprintf, curl_mvprintf, curl_mvsnprintf, and curl_mvsprintf ✨


πŸ’… SYNOPSIS πŸ’…

#include <gnurl/mprintf.h>

int curl_mprintf(const char *format, ...);
int curl_mfprintf(FILE *fd, const char *format, ...);
int curl_msprintf(char *buffer, const char *format, ...);
int curl_msnprintf(char *buffer, size_t maxlength, const char *format,
...);
int curl_mvprintf(const char *format, va_list args);
int curl_mvfprintf(FILE *fd, const char *format, va_list args);
int curl_mvsprintf(char *buffer, const char *format, va_list args);
int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format,
va_list args);
char *curl_maprintf(const char *format, ...);
char *curl_mvaprintf(const char *format, va_list args);

🌸 DESCRIPTION 🌸

okay so these functions all produce output according to a format string and the arguments you give them 🫢 They're mostly clones of the well-known C-style functions, and this page is not doing a detailed explanation of every available formatting rule and usage. That's the vibe: familiar formatting behavior, but with the libgnurl names πŸ’…

πŸ¦‹ notable exceptions πŸ¦‹

  • curl_mprintf() β€” Normal printf() clone.
  • curl_mfprintf() β€” Normal fprintf() clone.
  • curl_msprintf() β€” Normal sprintf() clone.
  • curl_msnprintf() β€” snprintf() clone. Many systems don't have this. It is just like sprintf but with an extra argument after the buffer that specifies the length of the target buffer.
  • curl_mvprintf() β€” Normal vprintf() clone.
  • curl_mvfprintf() β€” Normal vfprintf() clone.
  • curl_mvsprintf() β€” Normal vsprintf() clone.
  • curl_mvsnprintf() β€” vsnprintf() clone. Many systems don't have this. It is just like vsprintf but with an extra argument after the buffer that specifies the length of the target buffer.
  • curl_maprintf() β€” Like printf() but returns the output string as a malloc()ed string. The returned string must be free()ed by the receiver.
  • curl_mvaprintf() β€” Like curl_maprintf() but takes a va_list pointer argument instead of a variable amount of arguments.

⚠️ AVAILABILITY ⚠️

bestie, listen 😭 These functions will be removed from the public libcurl API in the future. Do not use them in any new programs or projects. Like, fr fr β€” new code should not be hopping on this ride πŸ’€


✨ RETURN VALUE ✨

The curl_maprintf and curl_mvaprintf functions return a pointer to a newly allocated string, or NULL if it failed.

All other functions return the number of characters they actually outputted πŸŽ€


πŸ‘€ SEE ALSO πŸ‘€


bye bestie 🫢 β€” source/version: libcurl 7.12, dated 30 April 2004, and this page is gnurl_printf(3) πŸ’–

πŸ“¦ where this page comes from