Add test for fatfs.
[bertos.git] / bertos / fs / fatfs / doc / en / printf.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
2 <html lang="en">\r
3 <head>\r
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
5 <meta http-equiv="Content-Style-Type" content="text/css">\r
6 <link rel="up" title="FatFs" href="../00index_e.html">\r
7 <link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">\r
8 <title>FatFs - f_printf</title>\r
9 </head>\r
10 \r
11 <body>\r
12 \r
13 <div class="para">\r
14 <h2>f_printf</h2>\r
15 <p>The f_printf function writes formatted string to the file.</p>\r
16 <pre>\r
17 int f_printf (\r
18   FIL* <em>FileObject</em>,     /* File object */\r
19   const char* <em>Foramt</em>,  /* Format stirng */\r
20   ...\r
21 );\r
22 </pre>\r
23 </div>\r
24 \r
25 <div class="para">\r
26 <h4>Parameters</h4>\r
27 <dl class="par">\r
28 <dt>FileObject</dt>\r
29 <dd>Pointer to the open file object structure.</dd>\r
30 <dt>Format</dt>\r
31 <dd>Pointer to the null-terminated format string.</dd>\r
32 <dt>...</dt>\r
33 <dd>Optional arguments.</dd>\r
34 \r
35 </dl>\r
36 </div>\r
37 \r
38 \r
39 <div class="para">\r
40 <h4>Return Values</h4>\r
41 <p>When the function succeeded, number of characters written is returned. When the function failed due to disk full or any error, an <tt>EOF</tt> will be returned.</p>\r
42 </div>\r
43 \r
44 \r
45 <div class="para">\r
46 <h4>Description</h4>\r
47 <p>The f_printf() is a wrapper function of <a href="putc.html">f_putc()</a> and <a href="puts.html">f_puts()</a>. The format control directive is a sub-set of standard library. It supports <tt>c s d u X</tt> for the data type, <tt>l</tt> for the precision and <tt>0</tt> for the flags.</p>\r
48 <p>This function is available when read-write configuration and <tt>_USE_STRFUNC</tt> is 1 or 2.</p>\r
49 </div>\r
50 \r
51 \r
52 <div class="para">\r
53 <h4>Example</h4>\r
54 <pre>\r
55     f_printf(&amp;fil, "%6d", -200);         // "  -200"\r
56     f_printf(&amp;fil, "%02u", 5);           // "05"\r
57     f_printf(&amp;fil, "%ld", 12345678L);    // "12345678"\r
58     f_printf(&amp;fil, "%08lX", 1194684UL);  // "00123ABC"\r
59     f_printf(&amp;fil, "%s", "String");      // "String"\r
60     f_printf(&amp;fil, "%c", 'a');           // "a"\r
61 </pre>\r
62 </div>\r
63 \r
64 \r
65 <div class="para">\r
66 <h4>References</h4>\r
67 <p><tt><a href="open.html">f_open</a>, <a href="putc.html">f_putc</a>, <a href="puts.html">f_puts</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>\r
68 </div>\r
69 \r
70 <p class="foot"><a href="../00index_e.html">Return</a></p>\r
71 </body>\r
72 </html>\r