libwget-printf(3)
π libwget-printf β Libwget printf functions π
okay bestie, welcome to the Library Functions Manual section for libwget-printf, and lemme tell you, this one is a whole vibe. it's the printf glow-up, and we're gonna go through every single function like it's a group chat roll call. no skipping, no skimming, we eat the whole plate. π
β¨ SYNOPSIS β¨
π Functions
size_t wget_vasprintf (char **strp, const char *fmt, va_list args)
size_t wget_asprintf (char **strp, const char *fmt,...)
char * wget_vaprintf (const char *fmt, va_list args)
char * wget_aprintf (const char *fmt,...)
size_t wget_vfprintf (FILE *fp, const char *fmt, va_list args)
size_t wget_fprintf (FILE *fp, const char *fmt,...)
size_t wget_printf (const char *fmt,...)
size_t wget_vsnprintf (char *str, size_t size, const char *fmt, va_list
args)
size_t wget_snprintf (char *str, size_t size, const char *fmt,...)
π Detailed Description π
so basically, this is a collection of printf-style functions that are used with libwget and/or Wget2 code. that's their home base, their main character arc. π
and the tea is: they may be useful to other developers too, which is literally why they are exported. they said "sharing is caring" and honestly? iconic. π
π¦ Function Documentation π¦
π size_t wget_vasprintf (char ** strp, const char * fmt, va_list args)
Parameters
strpβ Pointer to hold the string outputfmtβ Printf-like format specifierargsβva_listof arguments
Returns
Length of the string returned via strp or (size_t) -1 on error
Prints arguments to allocated memory and 0-terminates it. The string is returned via the first argument. It has to be free()'d by the caller when it is no longer needed.
bestie please remember the free() β that memory is yours to clean up, the library is not your maid. π§Ή
π size_t wget_asprintf (char ** strp, const char * fmt, ...)
Parameters
strpβ Pointer to hold the string outputfmtβ Printf-like format specifier...β List of arguments
Returns
Length of the string returned via strp
Prints arguments to allocated memory and 0-terminates it. The string is returned via the first argument. It has to be free()'d by the caller when it is no longer needed.
π char * wget_vaprintf (const char * fmt, va_list args)
Parameters
fmtβ Printf-like format specifierargsβva_listof arguments
Returns
Pointer to 0-terminated string in memory
Prints arguments to memory and returns a pointer to allocated and 0-terminated chunk of memory. The return value has to be free()'d by the caller when it is no longer needed.
π char * wget_aprintf (const char * fmt, ...)
Parameters
fmtβ Printf-like format specifier...β List of arguments
Returns
Pointer to 0-terminated string in memory
Prints arguments to memory and returns a pointer to allocated and 0-terminated chunk of memory. The return value has to be free()'d by the caller when it is no longer needed.
π size_t wget_vfprintf (FILE * fp, const char * fmt, va_list args)
Parameters
fpβFILEpointerfmtβ Printf-like format specifierargsβ List of arguments
Returns
Number of bytes written or -1 on error
Prints arguments to stream fp and returns number of bytes written.
π size_t wget_fprintf (FILE * fp, const char * fmt, ...)
Parameters
fpβFILEpointerfmtβ Printf-like format specifier...β List of arguments
Returns
Number of bytes written or -1 on error
Prints arguments to stream fp and returns number of bytes written.
π size_t wget_printf (const char * fmt, ...)
Parameters
fmtβ Printf-like format specifier...β List of arguments
Returns
Number of bytes written or -1 on error
Prints arguments to stdout and returns number of bytes written.
π size_t wget_vsnprintf (char * str, size_t size, const char * fmt, va_list args)
Parameters
strβ Destination buffersizeβ Size ofstrfmtβ Printf-like format specifierargsβ List of arguments
Returns
Number of bytes written, or, on truncation, that would have been written
Prints arguments to buffer str and returns number of bytes written, or on truncation: that would have been written.
If str is NULL the return value are the number of bytes that would have been written.
okay this one's actually so useful β you can pass NULL to ask "how big does my buffer need to be?" and it tells you. main character energy fr fr. β¨
π size_t wget_snprintf (char * str, size_t size, const char * fmt, ...)
Parameters
strβ Destination buffersizeβ Size ofstrfmtβ Printf-like format specifier...β List of arguments
Returns
Number of bytes written, or, on truncation, that would have been written
Prints arguments to buffer str and returns number of bytes written, or on truncation: that would have been written.
If str is NULL the return value are the number of bytes that would have been written.
π Author π
Generated automatically by Doxygen for wget2 from the source code.
okay that's the whole page, you understood all of it, slay. π this came to you straight from wget2, Version 2.3.0, no cap β go forth and printf responsibly, bestie. ππ¦β¨
π¦ where this page comes from
- fedora 43: wget2-devel 2.3.0-2.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 43: wget2-devel 2.3.0-2.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 44: wget2-devel 2.3.0-1.fc44
- fedora 44: wget2-devel 2.3.0-1.fc44
- fedora 44: wget2-devel 2.3.0-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 44: wget2-devel 2.3.0-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms