1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>OS_VSNPrintfEx</TITLE>
8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">OS_VSNPrintfEx <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></H1>
12<H2>Syntax</H2>
13<DL>
14<DD><CODE>#include &lt;nitro/os.h&gt;<BR> <BR> int OS_VSNPrintfEx( char *dst, size_t len, const char *fmt, va_list vlist );<BR> <BR></CODE>
15</DL>
16<H2>Arguments</H2>
17<TABLE border="1">
18  <TBODY>
19    <TR>
20<TD><CODE>dst</CODE></TD>
21<TD>Storage destination buffer for the output string.</TD>
22    </TR>
23    <TR>
24<TD><CODE>len</CODE></TD>
25<TD>Storage destination buffer size for the output string.</TD>
26    </TR>
27    <TR>
28<TD><CODE>fmt</CODE></TD>
29<TD>Output format string.</TD>
30    </TR>
31    <TR>
32<TD><CODE>vlist</CODE></TD>
33<TD>Variable argument list.</TD>
34    </TR>
35  </TBODY>
36</TABLE>
37<H2>Return Values</H2>
38<P>Returns the number of characters with the format string output properly. The termination character ( <code>\0</code> ) is not included in this number.</P>
39<P>The output string is written to <code>dst</code>. If the output string is less than <code>len</code>, all of the strings and termination character ( <code>\0</code> ) are written. <BR>If the output string is greater than or equal to <code>len</code> AND<BR>(1) <CODE>len</CODE> is not set to zero, the termination character (&nbsp;<code>\0</code>&nbsp;) is written to <code>dst[len&nbsp;-&nbsp;1]</code>.<BR>(2) If <CODE>len</CODE> is zero, nothing is done with <code>dst</code>.
40</P>
41
42<H2>Description</H2>
43<P>Returns the simplified version of the format string. This extends the features of the <A HREF="OS_VSNPrintf.html"><CODE>OS_VSNPrintf</CODE></A> function and supports non-standard conversion specifiers. The currently supported conversion specifiers are as follows.
44<UL>
45<LI>b, B:
46<BLOCKQUOTE>Converts argument specified as unsigned <CODE>char</CODE> array elements to unsigned hexadecimal values. When <CODE>b</CODE> is specified, <CODE>abcedf</CODE> is used, and for <CODE>B</CODE>, <CODE>ABCDEF</CODE> is used. Precision can be specified before <CODE>b</CODE>/<CODE>B</CODE>. The precision dictates the number of bytes to display. If you use a period (<CODE>.</CODE>) 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 (<CODE>:</CODE>) after <CODE>%</CODE> as a flag string.
47  </BLOCKQUOTE>
48<BLOCKQUOTE>Example:</BLOCKQUOTE>
49<BLOCKQUOTE style="background-color:#ffffc0"><CODE>OS_TPrintfEx(&quot;%:6.3B\n&quot;, mac_address);<BR></CODE>&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&darr;<BR> 00:09:BF&lt;newline&gt;12:34:56</BLOCKQUOTE>
50</UL>
51
52
53<P>This function is compiled with weak symbols. Therefore, you can overwrite them with your own function definitions.</P>
54<H2>See Also</H2>
55<P><A href="OS_VSNPrintf.html"><CODE>OS_VSNPrintf</CODE></A></P>
56<H2>Revision History</H2>
57<P>2006/10/23 Initial version.</P>
58<hr><p>CONFIDENTIAL</p></body>
59</HTML>