?? group__fat16.html
字號(hào):
</table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat16.html#gaed63addc9b9a3d5137f3b552abb42d8" title="Resets a directory handle.">fat16_reset_dir</a> </dd></dl></div></div><p><a class="anchor" name="g0af2ef3d690626a5640a334cefbb27a6"></a><!-- doxytag: member="fat16.h::fat16_read_file" ref="g0af2ef3d690626a5640a334cefbb27a6" args="(struct fat16_file_struct *fd, uint8_t *buffer, uint16_t buffer_len)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int16_t fat16_read_file </td> <td>(</td> <td class="paramtype">struct fat16_file_struct * </td> <td class="paramname"> <em>fd</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint8_t * </td> <td class="paramname"> <em>buffer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint16_t </td> <td class="paramname"> <em>buffer_len</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Reads data from a file. <p>The data requested is read from the current file location.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>fd</em> </td><td>The file handle of the file from which to read. </td></tr> <tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>buffer</em> </td><td>The buffer into which to write. </td></tr> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>buffer_len</em> </td><td>The amount of data to read. </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>The number of bytes read, 0 on end of file, or -1 on failure. </dd></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat16.html#g4f0c785a47b1cf070839b5edec2c6f65" title="Writes data to a file.">fat16_write_file</a> </dd></dl></div></div><p><a class="anchor" name="gaed63addc9b9a3d5137f3b552abb42d8"></a><!-- doxytag: member="fat16.h::fat16_reset_dir" ref="gaed63addc9b9a3d5137f3b552abb42d8" args="(struct fat16_dir_struct *dd)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">uint8_t fat16_reset_dir </td> <td>(</td> <td class="paramtype">struct fat16_dir_struct * </td> <td class="paramname"> <em>dd</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Resets a directory handle. <p>Resets the directory handle such that reading restarts with the first directory entry.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>dd</em> </td><td>The directory handle to reset. </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat16.html#g73c8f0598e8224736b09644c48cf2970" title="Reads the next directory entry contained within a parent directory.">fat16_read_dir</a> </dd></dl></div></div><p><a class="anchor" name="g23740742fa60ca148ef098caac7085c0"></a><!-- doxytag: member="fat16.h::fat16_resize_file" ref="g23740742fa60ca148ef098caac7085c0" args="(struct fat16_file_struct *fd, uint32_t size)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">uint8_t fat16_resize_file </td> <td>(</td> <td class="paramtype">struct fat16_file_struct * </td> <td class="paramname"> <em>fd</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t </td> <td class="paramname"> <em>size</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Resizes a file to have a specific size. <p>Enlarges or shrinks the file pointed to by the file descriptor to have exactly the specified size.<p>If the file is truncated, all bytes having an equal or larger offset than the given size are lost. If the file is expanded, the additional bytes are allocated.<p><dl class="note" compact><dt><b>Note:</b></dt><dd>Please be aware that this function just allocates or deallocates disk space, it does not explicitely clear it. To avoid data leakage, this must be done manually.</dd></dl><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>fd</em> </td><td>The file decriptor of the file which to resize. </td></tr> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>size</em> </td><td>The new size of the file. </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl></div></div><p><a class="anchor" name="gf1511fd1a5419d0828265566dc5d33e4"></a><!-- doxytag: member="fat16.h::fat16_seek_file" ref="gf1511fd1a5419d0828265566dc5d33e4" args="(struct fat16_file_struct *fd, int32_t *offset, uint8_t whence)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">uint8_t fat16_seek_file </td> <td>(</td> <td class="paramtype">struct fat16_file_struct * </td> <td class="paramname"> <em>fd</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t * </td> <td class="paramname"> <em>offset</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint8_t </td> <td class="paramname"> <em>whence</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Repositions the read/write file offset. <p>Changes the file offset where the next call to <a class="el" href="group__fat16__file.html#g0af2ef3d690626a5640a334cefbb27a6" title="Reads data from a file.">fat16_read_file()</a> or <a class="el" href="group__fat16__file.html#g4f0c785a47b1cf070839b5edec2c6f65" title="Writes data to a file.">fat16_write_file()</a> starts reading/writing.<p>If the new offset is beyond the end of the file, <a class="el" href="group__fat16__file.html#g23740742fa60ca148ef098caac7085c0" title="Resizes a file to have a specific size.">fat16_resize_file()</a> is implicitly called, i.e. the file is expanded.<p>The new offset can be given in different ways determined by the <code>whence</code> parameter:<ul><li><b>FAT16_SEEK_SET:</b> <code>*offset</code> is relative to the beginning of the file.</li><li><b>FAT16_SEEK_CUR:</b> <code>*offset</code> is relative to the current file position.</li><li><b>FAT16_SEEK_END:</b> <code>*offset</code> is relative to the end of the file.</li></ul><p>The resulting absolute offset is written to the location the <code>offset</code> parameter points to.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>fd</em> </td><td>The file decriptor of the file on which to seek. </td></tr> <tr><td valign="top"><tt>[in,out]</tt> </td><td valign="top"><em>offset</em> </td><td>A pointer to the new offset, as affected by the <code>whence</code> parameter. The function writes the new absolute offset to this location before it returns. </td></tr> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>whence</em> </td><td>Affects the way <code>offset</code> is interpreted, see above. </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl></div></div><p><a class="anchor" name="g4f0c785a47b1cf070839b5edec2c6f65"></a><!-- doxytag: member="fat16.h::fat16_write_file" ref="g4f0c785a47b1cf070839b5edec2c6f65" args="(struct fat16_file_struct *fd, const uint8_t *buffer, uint16_t buffer_len)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int16_t fat16_write_file </td> <td>(</td> <td class="paramtype">struct fat16_file_struct * </td> <td class="paramname"> <em>fd</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const uint8_t * </td> <td class="paramname"> <em>buffer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint16_t </td> <td class="paramname"> <em>buffer_len</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Writes data to a file. <p>The data is written to the current file location.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>fd</em> </td><td>The file handle of the file to which to write. </td></tr> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>buffer</em> </td><td>The buffer from which to read the data to be written. </td></tr> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>buffer_len</em> </td><td>The amount of data to write. </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>The number of bytes written, 0 on disk full, or -1 on failure. </dd></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat16.html#g0af2ef3d690626a5640a334cefbb27a6" title="Reads data from a file.">fat16_read_file</a> </dd></dl></div></div><p></div><hr size="1"><address style="text-align: right;"><small>Generated on Sun Jun 8 10:23:35 2008 for sd-reader by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address></body></html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -