<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>sd-reader: FAT16 directory functions</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.3-20071008 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
  </ul>
</div>
<h1>FAT16 directory functions<br>
<small>
[<a class="el" href="group__fat16.html">FAT16 support</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Functions for managing directories. 
<p>

<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct fat16_dir_struct *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat16__dir.html#g9704120fef030632a76d91cfbbef78b0">fat16_open_dir</a> (struct fat16_fs_struct *fs, const struct <a class="el" href="structfat16__dir__entry__struct.html">fat16_dir_entry_struct</a> *dir_entry)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Opens a directory.  <a href="#g9704120fef030632a76d91cfbbef78b0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat16__dir.html#g95f491a5a0b6438781aefaedc250e926">fat16_close_dir</a> (struct fat16_dir_struct *dd)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Closes a directory descriptor.  <a href="#g95f491a5a0b6438781aefaedc250e926"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat16__dir.html#g73c8f0598e8224736b09644c48cf2970">fat16_read_dir</a> (struct fat16_dir_struct *dd, struct <a class="el" href="structfat16__dir__entry__struct.html">fat16_dir_entry_struct</a> *dir_entry)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reads the next directory entry contained within a parent directory.  <a href="#g73c8f0598e8224736b09644c48cf2970"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat16__dir.html#gaed63addc9b9a3d5137f3b552abb42d8">fat16_reset_dir</a> (struct fat16_dir_struct *dd)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Resets a directory handle.  <a href="#gaed63addc9b9a3d5137f3b552abb42d8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat16__dir.html#g973def42513263e311ffa8e21f42b287">fat16_create_dir</a> (struct fat16_dir_struct *parent, const char *dir, struct <a class="el" href="structfat16__dir__entry__struct.html">fat16_dir_entry_struct</a> *dir_entry)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a directory.  <a href="#g973def42513263e311ffa8e21f42b287"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat16__dir.html#gdf22d7b37d27047d41e6d5cbf93cdff4">fat16_delete_dir</a> (struct fat16_fs_struct *fs, struct <a class="el" href="structfat16__dir__entry__struct.html">fat16_dir_entry_struct</a> *dir_entry)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deletes a directory.  <a href="#gdf22d7b37d27047d41e6d5cbf93cdff4"></a><br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g95f491a5a0b6438781aefaedc250e926"></a><!-- doxytag: member="fat16.c::fat16_close_dir" ref="g95f491a5a0b6438781aefaedc250e926" args="(struct fat16_dir_struct *dd)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void fat16_close_dir           </td>
          <td>(</td>
          <td class="paramtype">struct fat16_dir_struct *&nbsp;</td>
          <td class="paramname"> <em>dd</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Closes a directory descriptor. 
<p>
This function destroys a directory descriptor which was previously obtained by calling <a class="el" href="group__fat16__dir.html#g9704120fef030632a76d91cfbbef78b0" title="Opens a directory.">fat16_open_dir()</a>. When this function returns, the given descriptor will be invalid.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>dd</em>&nbsp;</td><td>The directory descriptor to close. </td></tr>
  </table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat16.html#g9704120fef030632a76d91cfbbef78b0" title="Opens a directory.">fat16_open_dir</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="g973def42513263e311ffa8e21f42b287"></a><!-- doxytag: member="fat16.c::fat16_create_dir" ref="g973def42513263e311ffa8e21f42b287" args="(struct fat16_dir_struct *parent, const char *dir, struct fat16_dir_entry_struct *dir_entry)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t fat16_create_dir           </td>
          <td>(</td>
          <td class="paramtype">struct fat16_dir_struct *&nbsp;</td>
          <td class="paramname"> <em>parent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>dir</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structfat16__dir__entry__struct.html">fat16_dir_entry_struct</a> *&nbsp;</td>
          <td class="paramname"> <em>dir_entry</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Creates a directory. 
<p>
Creates a directory and obtains its directory entry. If the directory to create already exists, its directory entry will be returned within the dir_entry parameter.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>The notes which apply to fat16_create_file also apply to this function.</dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>parent</em>&nbsp;</td><td>The handle of the parent directory of the new directory. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>dir</em>&nbsp;</td><td>The name of the directory to create. </td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>dir_entry</em>&nbsp;</td><td>The directory entry to fill for the new directory. </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__dir.html#gdf22d7b37d27047d41e6d5cbf93cdff4" title="Deletes a directory.">fat16_delete_dir</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="gdf22d7b37d27047d41e6d5cbf93cdff4"></a><!-- doxytag: member="fat16.c::fat16_delete_dir" ref="gdf22d7b37d27047d41e6d5cbf93cdff4" args="(struct fat16_fs_struct *fs, struct fat16_dir_entry_struct *dir_entry)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t fat16_delete_dir           </td>
          <td>(</td>
          <td class="paramtype">struct fat16_fs_struct *&nbsp;</td>
          <td class="paramname"> <em>fs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structfat16__dir__entry__struct.html">fat16_dir_entry_struct</a> *&nbsp;</td>
          <td class="paramname"> <em>dir_entry</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Deletes a directory. 
<p>
This is just a synonym for <a class="el" href="group__fat16__file.html#ge060faccbbeca802afe86be2f4d5b485" title="Deletes a file or directory.">fat16_delete_file()</a>. If a directory is deleted without first deleting its subdirectories and files, disk space occupied by these files will get wasted as there is no chance to release it and mark it as free.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>fs</em>&nbsp;</td><td>The filesystem on which to operate. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>dir_entry</em>&nbsp;</td><td>The directory entry of the directory to delete. </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#g973def42513263e311ffa8e21f42b287" title="Creates a directory.">fat16_create_dir</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="g9704120fef030632a76d91cfbbef78b0"></a><!-- doxytag: member="fat16.c::fat16_open_dir" ref="g9704120fef030632a76d91cfbbef78b0" args="(struct fat16_fs_struct *fs, const struct fat16_dir_entry_struct *dir_entry)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct fat16_dir_struct* fat16_open_dir           </td>
          <td>(</td>
          <td class="paramtype">struct fat16_fs_struct *&nbsp;</td>
          <td class="paramname"> <em>fs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct <a class="el" href="structfat16__dir__entry__struct.html">fat16_dir_entry_struct</a> *&nbsp;</td>
          <td class="paramname"> <em>dir_entry</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Opens a directory. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>fs</em>&nbsp;</td><td>The filesystem on which the directory to open resides. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>dir_entry</em>&nbsp;</td><td>The directory entry which stands for the directory to open. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>An opaque directory descriptor on success, 0 on failure. </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat16.html#g95f491a5a0b6438781aefaedc250e926" title="Closes a directory descriptor.">fat16_close_dir</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="g73c8f0598e8224736b09644c48cf2970"></a><!-- doxytag: member="fat16.c::fat16_read_dir" ref="g73c8f0598e8224736b09644c48cf2970" args="(struct fat16_dir_struct *dd, struct fat16_dir_entry_struct *dir_entry)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t fat16_read_dir           </td>
          <td>(</td>
          <td class="paramtype">struct fat16_dir_struct *&nbsp;</td>
          <td class="paramname"> <em>dd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structfat16__dir__entry__struct.html">fat16_dir_entry_struct</a> *&nbsp;</td>
          <td class="paramname"> <em>dir_entry</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Reads the next directory entry contained within a parent directory. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>dd</em>&nbsp;</td><td>The descriptor of the parent directory from which to read the entry. </td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>dir_entry</em>&nbsp;</td><td>Pointer to a buffer into which to write the directory entry information. </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#gaed63addc9b9a3d5137f3b552abb42d8" title="Resets a directory handle.">fat16_reset_dir</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="gaed63addc9b9a3d5137f3b552abb42d8"></a><!-- doxytag: member="fat16.c::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 *&nbsp;</td>
          <td class="paramname"> <em>dd</em>          </td>
          <td>&nbsp;)&nbsp;</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>&nbsp;</td><td valign="top"><em>dd</em>&nbsp;</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>
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Dec 13 19:38:48 2007 for sd-reader by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3-20071008 </small></address>
</body>
</html>