SPRINTMT(3)

NAME
sprintmt, vsprintmt - multi threading safe print formatting

SYNOPSIS
#include <gno/gno.h>

char *sprintmt (char *buffer, size_t bufferlen, const char *fmt, ...);
char *vsprintmt (char *buffer, size_t bufferlen, const char *fmt, va_list ap);

DESCRIPTION
sprintmt and vsprintmt are multithread-safe versions of the sprintf(3) and vsprintf(3) routines.

The contents of the format string fmt, with appropriate arguments substituted for the format specifiers, is copied into the user supplied buffer. At most, bufferlen-1 characters will be written to buffer.

These routines have a much more limited set of format specifiers than do the usual stdio routines. They are:

    %d, %ld
        Print the decimal representation of a value of type int or long int, respectively.

    %u, %lu
        Print the decimal representation of a value of type unsigned int or unsigned long int, respectively.

    %x, %X, %lx, %lX
        Print the hexadecimal representation of an unsigned int or unsigned long int. If the x character is used, alphabetic characters are in lower case; otherwise they are in upper case.

    %s  Print a NULL-terminated string. If the 's' is preceeded by an 'l', the 'l' is ignored.

    %m  Print the current textual representation of errno, as returned by strerror(3). If the 'm' is preceeded by an 'l', the 'l' is ignored. This format specifier is not available in the usual stdio functions.

RETURN VALUE
These routines return a pointer to the terminating NULL byte in buffer.

MT STATUS
Safe.

SEE ALSO
printf(3), stdio(3), strerror(3).