1uvszprintf(3) Allegro manual uvszprintf(3)
2
3
4
6 uvszprintf - Writes formatted data into a buffer, using size and vari‐
7 able arguments. Allegro game programming library.
8
10 #include <allegro.h>
11
12
13 int uvszprintf(char *buf, int size, const char *format, va_list args);
14
16 This is like uszprintf(), but you pass the variable argument list
17 directly, instead of the arguments themselves. Example:
18
19 #include <stdarg.h>
20
21 void log_message(const char *format, ...)
22 {
23 char buffer[100];
24 va_list parameters;
25
26 va_start(parameters, format);
27 uvszprintf(buffer, sizeof(buffer), format, parameters);
28 va_end(parameters);
29
30 append_buffer_to_logfile(log_name, buffer);
31 send_buffer_to_other_networked_players(multicast_ip, buffer);
32 and_also_print_it_on_the_screen(cool_font, buffer);
33 }
34
35 void some_other_function(void)
36 {
37 log_message("Hello %s, are you %d years old?\n", "Dave", 25);
38 }
39
41 Returns the number of characters that would have been written without
42 eventual truncation (like with uvsprintf), not including the terminat‐
43 ing null character.
44
45
46
47
49 uconvert(3), uszprintf(3), uvsprintf(3)
50
51
52
53Allegro version 4.2.2 uvszprintf(3)