Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

uszprintf(3alleg4) [plan9 man page]

uszprintf(3alleg4)						  Allegro manual						uszprintf(3alleg4)

NAME
uszprintf - Writes formatted data into a buffer, specifying size. Allegro game programming library. SYNOPSIS
#include <allegro.h> int uszprintf(char *buf, int size, const char *format, ...); DESCRIPTION
This function writes formatted data into the output buffer, whose length in bytes is specified by `size' and which is guaranteed to be NULL terminated. Example: char buffer[10]; int player_score; ... uszprintf(buffer, sizeof(buffer), "Your score is: %d", player_score); RETURN VALUE
Returns the number of characters that would have been written without eventual truncation (like with usprintf), not including the terminat- ing null character. SEE ALSO
uconvert(3alleg4), usprintf(3alleg4), uvszprintf(3alleg4), exgui(3alleg4) Allegro version 4.4.2 uszprintf(3alleg4)

Check Out this Related Man Page

uvszprintf(3alleg4)						  Allegro manual					       uvszprintf(3alleg4)

NAME
uvszprintf - Writes formatted data into a buffer, using size and variable arguments. Allegro game programming library. SYNOPSIS
#include <allegro.h> int uvszprintf(char *buf, int size, const char *format, va_list args); DESCRIPTION
This is like uszprintf(), but you pass the variable argument list directly, instead of the arguments themselves. Example: #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? ", "Dave", 25); } RETURN VALUE
Returns the number of characters that would have been written without eventual truncation (like with uvsprintf), not including the termi- nating null character. SEE ALSO
uconvert(3alleg4), uszprintf(3alleg4), uvsprintf(3alleg4) Allegro version 4.4.2 uvszprintf(3alleg4)
Man Page

2 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Shopt -s histappend

What is the point of this? Whenever I close my shell it appends to the history file without adding this. I have never seen it overwrite my history file. # When the shell exits, append to the history file instead of overwriting it shopt -s histappend (3 Replies)
Discussion started by: cokedude
3 Replies

2. UNIX for Advanced & Expert Users

What's your most useful shell?

What's your most useful shell? /bin/sh /bin/csh /bin/ksh /bin/tcsh /bin/bash (249 Replies)
Discussion started by: zylwyz
249 Replies