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><I><B>dst</B></I></TD>
21<TD>Storage destination buffer for the output string.</TD>
22    </TR>
23    <TR>
24<TD><I><B>len</B></I></TD>
25<TD>Storage destination buffer size for the output string.</TD>
26    </TR>
27    <TR>
28<TD><I><B>fmt</B></I></TD>
29<TD>Output format string.</TD>
30    </TR>
31    <TR>
32<TD><I><B>vlist</B></I></TD>
33<TD>List containing a variable number of arguments.</TD>
34    </TR>
35  </TBODY>
36</TABLE>
37<H2>Return Values</H2>
38<P>Always returns the number of characters of a correctly output format string. The termination character (<code>\0</code>) is not included in this number.</P>
39<P>The output string is written to <SPAN class="argument">dst</SPAN>. If the output string is less than <SPAN class="argument">len</SPAN>, the entire string and the terminator (<code>\0</code>) are written.<BR><BR>If the output string is greater than or equal to <SPAN class="argument">len</SPAN> AND<BR>(1) <SPAN class="argument">len</SPAN> is not zero, the terminator (<code>\0</code>) is written to <code><SPAN class="argument">dst</SPAN>[<SPAN class="argument">len</SPAN>&nbsp;-&nbsp;1]</code>.<BR>(2) <SPAN class="argument">len</SPAN> is zero, nothing is done to <SPAN class="argument">dst</SPAN>.
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 nonstandard 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. To configure software to output a space or a colon (<CODE>:</CODE>) every byte, add 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>   &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.<BR><FONT color=#ff0000> However, this function may be used by TWL-SDK functions, high-level libraries, middleware, and other sources, so be careful not to change its behavior when you overwrite it.</FONT>
54</P>
55<H2>See Also</H2>
56<P><CODE><A href="OS_VSNPrintf.html">OS_VSNPrintf</A><BR></CODE></P>
57<H2>Revision History</H2>
58<P>
592009/03/27 Added a note on user-defined functions. <BR>2006/10/23 Initial version.
60</P>
61<hr><p>CONFIDENTIAL</p></body>
62</HTML>