Rev Author Line No. Line
1110 kaklik 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3 <title>sd-reader: FAT16 directory functions</title>
4 <link href="doxygen.css" rel="stylesheet" type="text/css">
5 <link href="tabs.css" rel="stylesheet" type="text/css">
6 </head><body>
7 <!-- Generated by Doxygen 1.5.3-20071008 -->
8 <div class="tabs">
9 <ul>
10 <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
11 <li><a href="modules.html"><span>Modules</span></a></li>
12 <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
13 <li><a href="files.html"><span>Files</span></a></li>
14 </ul>
15 </div>
16 <h1>FAT16 directory functions<br>
17 <small>
18 [<a class="el" href="group__fat16.html">FAT16 support</a>]</small>
19 </h1><hr><a name="_details"></a><h2>Detailed Description</h2>
20 Functions for managing directories.
21 <p>
22  
23 <p>
24 <table border="0" cellpadding="0" cellspacing="0">
25 <tr><td></td></tr>
26 <tr><td colspan="2"><br><h2>Functions</h2></td></tr>
27 <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>
28  
29 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Opens a directory. <a href="#g9704120fef030632a76d91cfbbef78b0"></a><br></td></tr>
30 <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>
31  
32 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Closes a directory descriptor. <a href="#g95f491a5a0b6438781aefaedc250e926"></a><br></td></tr>
33 <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>
34  
35 <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>
36 <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>
37  
38 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Resets a directory handle. <a href="#gaed63addc9b9a3d5137f3b552abb42d8"></a><br></td></tr>
39 <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>
40  
41 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a directory. <a href="#g973def42513263e311ffa8e21f42b287"></a><br></td></tr>
42 <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>
43  
44 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deletes a directory. <a href="#gdf22d7b37d27047d41e6d5cbf93cdff4"></a><br></td></tr>
45 </table>
46 <hr><h2>Function Documentation</h2>
47 <a class="anchor" name="g95f491a5a0b6438781aefaedc250e926"></a><!-- doxytag: member="fat16.c::fat16_close_dir" ref="g95f491a5a0b6438781aefaedc250e926" args="(struct fat16_dir_struct *dd)" -->
48 <div class="memitem">
49 <div class="memproto">
50 <table class="memname">
51 <tr>
52 <td class="memname">void fat16_close_dir </td>
53 <td>(</td>
54 <td class="paramtype">struct fat16_dir_struct *&nbsp;</td>
55 <td class="paramname"> <em>dd</em> </td>
56 <td>&nbsp;)&nbsp;</td>
57 <td width="100%"></td>
58 </tr>
59 </table>
60 </div>
61 <div class="memdoc">
62  
63 <p>
64 Closes a directory descriptor.
65 <p>
66 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>
67 <dl compact><dt><b>Parameters:</b></dt><dd>
68 <table border="0" cellspacing="2" cellpadding="0">
69 <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>
70 </table>
71 </dl>
72 <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>
73  
74 </div>
75 </div><p>
76 <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)" -->
77 <div class="memitem">
78 <div class="memproto">
79 <table class="memname">
80 <tr>
81 <td class="memname">uint8_t fat16_create_dir </td>
82 <td>(</td>
83 <td class="paramtype">struct fat16_dir_struct *&nbsp;</td>
84 <td class="paramname"> <em>parent</em>, </td>
85 </tr>
86 <tr>
87 <td class="paramkey"></td>
88 <td></td>
89 <td class="paramtype">const char *&nbsp;</td>
90 <td class="paramname"> <em>dir</em>, </td>
91 </tr>
92 <tr>
93 <td class="paramkey"></td>
94 <td></td>
95 <td class="paramtype">struct <a class="el" href="structfat16__dir__entry__struct.html">fat16_dir_entry_struct</a> *&nbsp;</td>
96 <td class="paramname"> <em>dir_entry</em></td><td>&nbsp;</td>
97 </tr>
98 <tr>
99 <td></td>
100 <td>)</td>
101 <td></td><td></td><td width="100%"></td>
102 </tr>
103 </table>
104 </div>
105 <div class="memdoc">
106  
107 <p>
108 Creates a directory.
109 <p>
110 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>
111 <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>
112 <dl compact><dt><b>Parameters:</b></dt><dd>
113 <table border="0" cellspacing="2" cellpadding="0">
114 <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>
115 <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>
116 <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>
117 </table>
118 </dl>
119 <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl>
120 <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>
121  
122 </div>
123 </div><p>
124 <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)" -->
125 <div class="memitem">
126 <div class="memproto">
127 <table class="memname">
128 <tr>
129 <td class="memname">uint8_t fat16_delete_dir </td>
130 <td>(</td>
131 <td class="paramtype">struct fat16_fs_struct *&nbsp;</td>
132 <td class="paramname"> <em>fs</em>, </td>
133 </tr>
134 <tr>
135 <td class="paramkey"></td>
136 <td></td>
137 <td class="paramtype">struct <a class="el" href="structfat16__dir__entry__struct.html">fat16_dir_entry_struct</a> *&nbsp;</td>
138 <td class="paramname"> <em>dir_entry</em></td><td>&nbsp;</td>
139 </tr>
140 <tr>
141 <td></td>
142 <td>)</td>
143 <td></td><td></td><td width="100%"></td>
144 </tr>
145 </table>
146 </div>
147 <div class="memdoc">
148  
149 <p>
150 Deletes a directory.
151 <p>
152 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>
153 <dl compact><dt><b>Parameters:</b></dt><dd>
154 <table border="0" cellspacing="2" cellpadding="0">
155 <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>
156 <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>
157 </table>
158 </dl>
159 <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl>
160 <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>
161  
162 </div>
163 </div><p>
164 <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)" -->
165 <div class="memitem">
166 <div class="memproto">
167 <table class="memname">
168 <tr>
169 <td class="memname">struct fat16_dir_struct* fat16_open_dir </td>
170 <td>(</td>
171 <td class="paramtype">struct fat16_fs_struct *&nbsp;</td>
172 <td class="paramname"> <em>fs</em>, </td>
173 </tr>
174 <tr>
175 <td class="paramkey"></td>
176 <td></td>
177 <td class="paramtype">const struct <a class="el" href="structfat16__dir__entry__struct.html">fat16_dir_entry_struct</a> *&nbsp;</td>
178 <td class="paramname"> <em>dir_entry</em></td><td>&nbsp;</td>
179 </tr>
180 <tr>
181 <td></td>
182 <td>)</td>
183 <td></td><td></td><td width="100%"><code> [read]</code></td>
184 </tr>
185 </table>
186 </div>
187 <div class="memdoc">
188  
189 <p>
190 Opens a directory.
191 <p>
192 <dl compact><dt><b>Parameters:</b></dt><dd>
193 <table border="0" cellspacing="2" cellpadding="0">
194 <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>
195 <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>
196 </table>
197 </dl>
198 <dl class="return" compact><dt><b>Returns:</b></dt><dd>An opaque directory descriptor on success, 0 on failure. </dd></dl>
199 <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>
200  
201 </div>
202 </div><p>
203 <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)" -->
204 <div class="memitem">
205 <div class="memproto">
206 <table class="memname">
207 <tr>
208 <td class="memname">uint8_t fat16_read_dir </td>
209 <td>(</td>
210 <td class="paramtype">struct fat16_dir_struct *&nbsp;</td>
211 <td class="paramname"> <em>dd</em>, </td>
212 </tr>
213 <tr>
214 <td class="paramkey"></td>
215 <td></td>
216 <td class="paramtype">struct <a class="el" href="structfat16__dir__entry__struct.html">fat16_dir_entry_struct</a> *&nbsp;</td>
217 <td class="paramname"> <em>dir_entry</em></td><td>&nbsp;</td>
218 </tr>
219 <tr>
220 <td></td>
221 <td>)</td>
222 <td></td><td></td><td width="100%"></td>
223 </tr>
224 </table>
225 </div>
226 <div class="memdoc">
227  
228 <p>
229 Reads the next directory entry contained within a parent directory.
230 <p>
231 <dl compact><dt><b>Parameters:</b></dt><dd>
232 <table border="0" cellspacing="2" cellpadding="0">
233 <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>
234 <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>
235 </table>
236 </dl>
237 <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl>
238 <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>
239  
240 </div>
241 </div><p>
242 <a class="anchor" name="gaed63addc9b9a3d5137f3b552abb42d8"></a><!-- doxytag: member="fat16.c::fat16_reset_dir" ref="gaed63addc9b9a3d5137f3b552abb42d8" args="(struct fat16_dir_struct *dd)" -->
243 <div class="memitem">
244 <div class="memproto">
245 <table class="memname">
246 <tr>
247 <td class="memname">uint8_t fat16_reset_dir </td>
248 <td>(</td>
249 <td class="paramtype">struct fat16_dir_struct *&nbsp;</td>
250 <td class="paramname"> <em>dd</em> </td>
251 <td>&nbsp;)&nbsp;</td>
252 <td width="100%"></td>
253 </tr>
254 </table>
255 </div>
256 <div class="memdoc">
257  
258 <p>
259 Resets a directory handle.
260 <p>
261 Resets the directory handle such that reading restarts with the first directory entry.<p>
262 <dl compact><dt><b>Parameters:</b></dt><dd>
263 <table border="0" cellspacing="2" cellpadding="0">
264 <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>
265 </table>
266 </dl>
267 <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl>
268 <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>
269  
270 </div>
271 </div><p>
272 <hr size="1"><address style="text-align: right;"><small>Generated on Thu Dec 13 19:38:48 2007 for sd-reader by&nbsp;
273 <a href="http://www.doxygen.org/index.html">
274 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3-20071008 </small></address>
275 </body>
276 </html>