This is a collection of printf-style functions that are used with libwget and/or Wget code. They may be useful to other developers that is why they are exported.
◆ wget_vasprintf()
size_t wget_vasprintf |
( |
char ** |
strp, |
|
|
const char * |
fmt, |
|
|
va_list |
args |
|
) |
| |
- Parameters
-
[in] | strp | Pointer to hold the string output |
[in] | fmt | Printf-like format specifier |
[in] | args | va_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.
◆ wget_asprintf()
size_t wget_asprintf |
( |
char ** |
strp, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
- Parameters
-
[in] | strp | Pointer to hold the string output |
[in] | fmt | Printf-like format specifier |
[in] | ... | 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.
◆ wget_vaprintf()
char* wget_vaprintf |
( |
const char * |
fmt, |
|
|
va_list |
args |
|
) |
| |
- Parameters
-
[in] | fmt | Printf-like format specifier |
[in] | args | va_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 or NULL on error. The return value has to be free()'d by the caller when it is no longer needed.
◆ wget_aprintf()
char* wget_aprintf |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
- Parameters
-
[in] | fmt | Printf-like format specifier |
[in] | ... | 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 or NULL on error. The return value has to be free()'d by the caller when it is no longer needed.