# OS_VSNPrintfEx

## Syntax

  `#include <nitro/os.h>
  int OS_VSNPrintfEx( char *dst, size_t len, const char *fmt, va_list vlist );
  `

## Arguments

`dst` | Storage destination buffer for the output string.
`len` | Storage destination buffer size for the output string.
`fmt` | Output format string.
`vlist` | Variable argument list.

## Return Values

Returns the number of characters with the format string output properly. The termination character ( `\0` ) is not included in this number.

The output string is written to `dst`. If the output string is less than `len`, all of the strings and termination character ( `\0` ) are written.
If the output string is greater than or equal to `len` AND
(1) `len` is not set to zero, the termination character ( `\0` ) is written to `dst[len - 1]`.
(2) If `len` is zero, nothing is done with `dst`.

## Description

Returns the simplified version of the format string. This extends the features of the `OS_VSNPrintf` function and supports non-standard conversion specifiers. The currently supported conversion specifiers are as follows.

- b, B:

  > Converts argument specified as unsigned `char` array elements to unsigned hexadecimal values. When `b` is specified, `abcedf` is used, and for `B`, `ABCDEF` is used. Precision can be specified before `b`/`B`. The precision dictates the number of bytes to display. If you use a period (`.`) when specifying precision, the value after the period indicates the number of bytes at which to wrap the line. When the precision is not specified, a single byte is output. Software can be configured to output a space or a colon (:) every byte by adding a space or a colon (`:`) after `%` as a flag string.

  > Example:

  > `OS_TPrintfEx("%:6.3B\n", mac_address);
  > ` ↓
  > 00:09:BF<newline>12:34:56

This function is compiled with weak symbols. Therefore, you can overwrite them with your own function definitions.

## See Also

`OS_VSNPrintf`

## Revision History

2006/10/23 Initial version.

CONFIDENTIAL