uvszprintf(3)
β¨ NAME β¨
uvszprintf β bestie, this one writes formatted data into a buffer, using size and variable arguments π it's part of the Allegro game programming library, periodt.
πΈ SYNOPSIS πΈ
#include <allegro.h>
int uvszprintf(char *buf, int size, const char *format, va_list args);
π DESCRIPTION π
okay so listen. This is literally just like uszprintf(), except instead of handing over the arguments themselves, you pass the variable argument list directly. va_list girlies, this one's for you π«Ά
here's the moment, an example, no cap:
#include <stdarg.h>
void log_message(const char *format, ...)
{
char buffer[100];
va_list parameters;
va_start(parameters, format);
uvszprintf(buffer, sizeof(buffer), format, parameters);
va_end(parameters);
append_buffer_to_logfile(log_name, buffer);
send_buffer_to_other_networked_players(multicast_ip, buffer);
and_also_print_it_on_the_screen(cool_font, buffer);
}
void some_other_function(void)
{
log_message("Hello %s, are you %d years old?\n", "Dave", 25);
}
see how va_start, uvszprintf, va_end is giving main character energy? iconic honestly π
π₯ RETURN VALUE π₯
It returns the number of characters that would have been written without eventual truncation (like with uvsprintf), not including the terminating null character. So it's telling you the size it wanted, even if it couldn't fully deliver. the way that it just... keeps receipts π
π SEE ALSO π
and that's the whole vibe, bestie π¦ this was uvszprintf(3) from the Allegro manual, and it's brought to you by Allegro version 4.4.3 β go format something cute, ily, bye β¨π
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms