1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
.\" (C) 2002 Ian Gulliver
.TH firestring_snprintf 3 2003-05-15
.SH NAME
firestring_snprintf \-
.BR snprintf (3)
provided as a replacement so programs can maintain ANSI C compliance
.SH SYNOPSIS
.B #include <firestring.h>
.br
.B -lfirestring
.LP
.BI "long firestring_snprintf(char * " "out" ", const size_t " "size" ", const char * const " "format" ", " "..." ")"
.SH DESCRIPTION
firestring_snprintf() writes a maximum of
.I size
bytes to
.I out
based on the formatting rules specified in
.I format
and the further arguments provided.
.LP
As
.BR snprintf (3)
is not a ANSI C function, firestring_snprintf() is provided as a replacement for programs wishing to maintain ANSI C compliance. It acts much like
.BR snprintf (3),
except that it only uses single-letter format tags, and only supports a subset of the common formats.
.HP
Formats supported:
.br
%s - char *
.br
%d - int
.br
%l - long
.br
%u - unsigned int
.br
%y - unsigned long
.br
%g - signed long long
.br
%o - unsigned long long
.br
%f - double
.br
%t - time_t (printed in ISO format)
.br
%e - struct firestring_estr_t *
.LP
The %s type handles NULL values by displaying the string "(null)". All numeric types support zero padding through the standard %02d format.
.SH RETURN VALUE
Returns the number of bytes written to
.I out
not including the trailing nil.
.SH AUTHOR
Ian Gulliver <ian@penguinhosting.net>
.SH SEE ALSO
.BR libfirestring (3)
|