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: Partition table support</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>Partition table support</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
17 Support for reading partition tables and access to partitions.
18 <p>
19  
20 <p>
21 <table border="0" cellpadding="0" cellspacing="0">
22 <tr><td></td></tr>
23 <tr><td colspan="2"><br><h2>Files</h2></td></tr>
24 <tr><td class="memItemLeft" nowrap align="right" valign="top">file &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="partition_8c.html">partition.c</a></td></tr>
25  
26 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Partition table implementation (license: GPLv2 or LGPLv2.1). <br></td></tr>
27  
28 <p>
29 <tr><td class="memItemLeft" nowrap align="right" valign="top">file &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="partition_8h.html">partition.h</a></td></tr>
30  
31 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Partition table header (license: GPLv2 or LGPLv2.1). <br></td></tr>
32  
33 <p>
34 <tr><td class="memItemLeft" nowrap align="right" valign="top">file &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="partition__config_8h.html">partition_config.h</a></td></tr>
35  
36 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Partition configuration (license: GPLv2 or LGPLv2.1). <br></td></tr>
37  
38 <p>
39 <tr><td colspan="2"><br><h2>Modules</h2></td></tr>
40 <tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition__config.html">Configuration of partition table support</a></td></tr>
41  
42 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Preprocessor defines to configure the partition support. <br></td></tr>
43  
44 <p>
45 <tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
46 <tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structpartition__struct.html">partition_struct</a></td></tr>
47  
48 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Describes a partition. <a href="structpartition__struct.html#_details">More...</a><br></td></tr>
49 <tr><td colspan="2"><br><h2>Defines</h2></td></tr>
50 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gab5ffe2ef6119a6815c505e3103a2714"></a><!-- doxytag: member="partition::PARTITION_TYPE_FREE" ref="gab5ffe2ef6119a6815c505e3103a2714" args="" -->
51 #define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#gab5ffe2ef6119a6815c505e3103a2714">PARTITION_TYPE_FREE</a></td></tr>
52  
53 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The partition table entry is not used. <br></td></tr>
54 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga92b6c552d2411e093204cd3ed4cffa3"></a><!-- doxytag: member="partition::PARTITION_TYPE_FAT12" ref="ga92b6c552d2411e093204cd3ed4cffa3" args="" -->
55 #define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#ga92b6c552d2411e093204cd3ed4cffa3">PARTITION_TYPE_FAT12</a></td></tr>
56  
57 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The partition contains a FAT12 filesystem. <br></td></tr>
58 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gf7296b4a29c1f7e5c39e28372648b2cd"></a><!-- doxytag: member="partition::PARTITION_TYPE_FAT16_32MB" ref="gf7296b4a29c1f7e5c39e28372648b2cd" args="" -->
59 #define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#gf7296b4a29c1f7e5c39e28372648b2cd">PARTITION_TYPE_FAT16_32MB</a></td></tr>
60  
61 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The partition contains a FAT16 filesystem with 32MB maximum. <br></td></tr>
62 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gceaa1bf17d4e8961726834e53ed79732"></a><!-- doxytag: member="partition::PARTITION_TYPE_EXTENDED" ref="gceaa1bf17d4e8961726834e53ed79732" args="" -->
63 #define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#gceaa1bf17d4e8961726834e53ed79732">PARTITION_TYPE_EXTENDED</a></td></tr>
64  
65 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The partition is an extended partition with its own partition table. <br></td></tr>
66 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gda7e1b4d950c7a3f42f559ab99f5fe43"></a><!-- doxytag: member="partition::PARTITION_TYPE_FAT16" ref="gda7e1b4d950c7a3f42f559ab99f5fe43" args="" -->
67 #define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#gda7e1b4d950c7a3f42f559ab99f5fe43">PARTITION_TYPE_FAT16</a></td></tr>
68  
69 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The partition contains a FAT16 filesystem. <br></td></tr>
70 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2f6a6c30cc239ae13ea287ff901c95f4"></a><!-- doxytag: member="partition::PARTITION_TYPE_FAT32" ref="g2f6a6c30cc239ae13ea287ff901c95f4" args="" -->
71 #define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#g2f6a6c30cc239ae13ea287ff901c95f4">PARTITION_TYPE_FAT32</a></td></tr>
72  
73 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The partition contains a FAT32 filesystem. <br></td></tr>
74 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga2e0c8e8b4ec10f7b342c0d554b5f6d8"></a><!-- doxytag: member="partition::PARTITION_TYPE_FAT32_LBA" ref="ga2e0c8e8b4ec10f7b342c0d554b5f6d8" args="" -->
75 #define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#ga2e0c8e8b4ec10f7b342c0d554b5f6d8">PARTITION_TYPE_FAT32_LBA</a></td></tr>
76  
77 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The partition contains a FAT32 filesystem with LBA. <br></td></tr>
78 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g52b69fda008ca19d75304a2385cc4900"></a><!-- doxytag: member="partition::PARTITION_TYPE_FAT16_LBA" ref="g52b69fda008ca19d75304a2385cc4900" args="" -->
79 #define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#g52b69fda008ca19d75304a2385cc4900">PARTITION_TYPE_FAT16_LBA</a></td></tr>
80  
81 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The partition contains a FAT16 filesystem with LBA. <br></td></tr>
82 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g1c9a00e3b09b488ce7f3b2ef2904400b"></a><!-- doxytag: member="partition::PARTITION_TYPE_EXTENDED_LBA" ref="g1c9a00e3b09b488ce7f3b2ef2904400b" args="" -->
83 #define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#g1c9a00e3b09b488ce7f3b2ef2904400b">PARTITION_TYPE_EXTENDED_LBA</a></td></tr>
84  
85 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The partition is an extended partition with LBA. <br></td></tr>
86 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gcdc50585fe8130f0a4faee13caade86f"></a><!-- doxytag: member="partition::PARTITION_TYPE_UNKNOWN" ref="gcdc50585fe8130f0a4faee13caade86f" args="" -->
87 #define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#gcdc50585fe8130f0a4faee13caade86f">PARTITION_TYPE_UNKNOWN</a></td></tr>
88  
89 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The partition has an unknown type. <br></td></tr>
90 <tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
91 <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef uint8_t(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#g6a2b9c5359ec033470fc25b2626e56fc">device_read_t</a> )(uint32_t offset, uint8_t *buffer, uint16_t length)</td></tr>
92  
93 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A function pointer used to read from the partition. <a href="#g6a2b9c5359ec033470fc25b2626e56fc"></a><br></td></tr>
94 <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef uint8_t(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#g0c94a44bb3d9090d3ad662a4ea772f9b">device_read_callback_t</a> )(uint8_t *buffer, uint32_t offset, void *p)</td></tr>
95  
96 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A function pointer passed to a <code>device_read_interval_t</code>. <a href="#g0c94a44bb3d9090d3ad662a4ea772f9b"></a><br></td></tr>
97 <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef uint8_t(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#gebc277053a3361aaf4b67a486e24fa24">device_read_interval_t</a> )(uint32_t offset, uint8_t *buffer, uint16_t interval, uint16_t length, <a class="el" href="group__partition.html#g0c94a44bb3d9090d3ad662a4ea772f9b">device_read_callback_t</a> callback, void *p)</td></tr>
98  
99 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A function pointer used to continuously read units of <code>interval</code> bytes and call a callback function. <a href="#gebc277053a3361aaf4b67a486e24fa24"></a><br></td></tr>
100 <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef uint8_t(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#gc6ca9cbb79b5099d610e976365ee2e8e">device_write_t</a> )(uint32_t offset, const uint8_t *buffer, uint16_t length)</td></tr>
101  
102 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A function pointer used to write to the partition. <a href="#gc6ca9cbb79b5099d610e976365ee2e8e"></a><br></td></tr>
103 <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef uint16_t(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#g089849983ec009841429eb6a1d3cb4cc">device_write_callback_t</a> )(uint8_t *buffer, uint32_t offset, void *p)</td></tr>
104  
105 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A function pointer passed to a <code>device_write_interval_t</code>. <a href="#g089849983ec009841429eb6a1d3cb4cc"></a><br></td></tr>
106 <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef uint8_t(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#g975ce8905536b4c1020eb18b5b640158">device_write_interval_t</a> )(uint32_t offset, uint8_t *buffer, uint16_t length, <a class="el" href="group__partition.html#g089849983ec009841429eb6a1d3cb4cc">device_write_callback_t</a> callback, void *p)</td></tr>
107  
108 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A function pointer used to continuously write a data stream obtained from a callback function. <a href="#g975ce8905536b4c1020eb18b5b640158"></a><br></td></tr>
109 <tr><td colspan="2"><br><h2>Functions</h2></td></tr>
110 <tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structpartition__struct.html">partition_struct</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#g3125023db4e9d50adb8489c71fa1be68">partition_open</a> (<a class="el" href="group__partition.html#g6a2b9c5359ec033470fc25b2626e56fc">device_read_t</a> device_read, <a class="el" href="group__partition.html#gebc277053a3361aaf4b67a486e24fa24">device_read_interval_t</a> device_read_interval, <a class="el" href="group__partition.html#gc6ca9cbb79b5099d610e976365ee2e8e">device_write_t</a> device_write, <a class="el" href="group__partition.html#g975ce8905536b4c1020eb18b5b640158">device_write_interval_t</a> device_write_interval, int8_t index)</td></tr>
111  
112 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Opens a partition. <a href="#g3125023db4e9d50adb8489c71fa1be68"></a><br></td></tr>
113 <tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__partition.html#g128f4363de35c81a9ff8026d4db289d2">partition_close</a> (struct <a class="el" href="structpartition__struct.html">partition_struct</a> *partition)</td></tr>
114  
115 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Closes a partition. <a href="#g128f4363de35c81a9ff8026d4db289d2"></a><br></td></tr>
116 </table>
117 <hr><h2>Typedef Documentation</h2>
118 <a class="anchor" name="g0c94a44bb3d9090d3ad662a4ea772f9b"></a><!-- doxytag: member="partition.h::device_read_callback_t" ref="g0c94a44bb3d9090d3ad662a4ea772f9b" args=")(uint8_t *buffer, uint32_t offset, void *p)" -->
119 <div class="memitem">
120 <div class="memproto">
121 <table class="memname">
122 <tr>
123 <td class="memname">typedef uint8_t(* <a class="el" href="group__partition.html#g0c94a44bb3d9090d3ad662a4ea772f9b">device_read_callback_t</a>)(uint8_t *buffer, uint32_t offset, void *p) </td>
124 </tr>
125 </table>
126 </div>
127 <div class="memdoc">
128  
129 <p>
130 A function pointer passed to a <code>device_read_interval_t</code>.
131 <p>
132 <dl compact><dt><b>Parameters:</b></dt><dd>
133 <table border="0" cellspacing="2" cellpadding="0">
134 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>buffer</em>&nbsp;</td><td>The buffer which contains the data just read. </td></tr>
135 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>offset</em>&nbsp;</td><td>The offset from which the data in <code>buffer</code> was read. </td></tr>
136 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>p</em>&nbsp;</td><td>An opaque pointer. </td></tr>
137 </table>
138 </dl>
139 <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__partition.html#gebc277053a3361aaf4b67a486e24fa24" title="A function pointer used to continuously read units of interval bytes and call a callback...">device_read_interval_t</a> </dd></dl>
140  
141 </div>
142 </div><p>
143 <a class="anchor" name="gebc277053a3361aaf4b67a486e24fa24"></a><!-- doxytag: member="partition.h::device_read_interval_t" ref="gebc277053a3361aaf4b67a486e24fa24" args=")(uint32_t offset, uint8_t *buffer, uint16_t interval, uint16_t length, device_read_callback_t callback, void *p)" -->
144 <div class="memitem">
145 <div class="memproto">
146 <table class="memname">
147 <tr>
148 <td class="memname">typedef uint8_t(* <a class="el" href="group__partition.html#gebc277053a3361aaf4b67a486e24fa24">device_read_interval_t</a>)(uint32_t offset, uint8_t *buffer, uint16_t interval, uint16_t length, <a class="el" href="group__partition.html#g0c94a44bb3d9090d3ad662a4ea772f9b">device_read_callback_t</a> callback, void *p) </td>
149 </tr>
150 </table>
151 </div>
152 <div class="memdoc">
153  
154 <p>
155 A function pointer used to continuously read units of <code>interval</code> bytes and call a callback function.
156 <p>
157 This function starts reading at the specified offset. Every <code>interval</code> bytes, it calls the callback function with the associated data buffer.<p>
158 By returning zero, the callback may stop reading.<p>
159 <dl compact><dt><b>Parameters:</b></dt><dd>
160 <table border="0" cellspacing="2" cellpadding="0">
161 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>offset</em>&nbsp;</td><td>Offset from which to start reading. </td></tr>
162 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>buffer</em>&nbsp;</td><td>Pointer to a buffer which is at least interval bytes in size. </td></tr>
163 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>interval</em>&nbsp;</td><td>Number of bytes to read before calling the callback function. </td></tr>
164 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>length</em>&nbsp;</td><td>Number of bytes to read altogether. </td></tr>
165 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>callback</em>&nbsp;</td><td>The function to call every interval bytes. </td></tr>
166 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>p</em>&nbsp;</td><td>An opaque pointer directly passed to the callback function. </td></tr>
167 </table>
168 </dl>
169 <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success </dd></dl>
170 <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__partition.html#g6a2b9c5359ec033470fc25b2626e56fc" title="A function pointer used to read from the partition.">device_read_t</a> </dd></dl>
171  
172 </div>
173 </div><p>
174 <a class="anchor" name="g6a2b9c5359ec033470fc25b2626e56fc"></a><!-- doxytag: member="partition.h::device_read_t" ref="g6a2b9c5359ec033470fc25b2626e56fc" args=")(uint32_t offset, uint8_t *buffer, uint16_t length)" -->
175 <div class="memitem">
176 <div class="memproto">
177 <table class="memname">
178 <tr>
179 <td class="memname">typedef uint8_t(* <a class="el" href="group__partition.html#g6a2b9c5359ec033470fc25b2626e56fc">device_read_t</a>)(uint32_t offset, uint8_t *buffer, uint16_t length) </td>
180 </tr>
181 </table>
182 </div>
183 <div class="memdoc">
184  
185 <p>
186 A function pointer used to read from the partition.
187 <p>
188 <dl compact><dt><b>Parameters:</b></dt><dd>
189 <table border="0" cellspacing="2" cellpadding="0">
190 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>offset</em>&nbsp;</td><td>The offset on the device where to start reading. </td></tr>
191 <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>buffer</em>&nbsp;</td><td>The buffer into which to place the data. </td></tr>
192 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>length</em>&nbsp;</td><td>The count of bytes to read. </td></tr>
193 </table>
194 </dl>
195  
196 </div>
197 </div><p>
198 <a class="anchor" name="g089849983ec009841429eb6a1d3cb4cc"></a><!-- doxytag: member="partition.h::device_write_callback_t" ref="g089849983ec009841429eb6a1d3cb4cc" args=")(uint8_t *buffer, uint32_t offset, void *p)" -->
199 <div class="memitem">
200 <div class="memproto">
201 <table class="memname">
202 <tr>
203 <td class="memname">typedef uint16_t(* <a class="el" href="group__partition.html#g089849983ec009841429eb6a1d3cb4cc">device_write_callback_t</a>)(uint8_t *buffer, uint32_t offset, void *p) </td>
204 </tr>
205 </table>
206 </div>
207 <div class="memdoc">
208  
209 <p>
210 A function pointer passed to a <code>device_write_interval_t</code>.
211 <p>
212 <dl compact><dt><b>Parameters:</b></dt><dd>
213 <table border="0" cellspacing="2" cellpadding="0">
214 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>buffer</em>&nbsp;</td><td>The buffer which receives the data to write. </td></tr>
215 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>offset</em>&nbsp;</td><td>The offset to which the data in <code>buffer</code> will be written. </td></tr>
216 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>p</em>&nbsp;</td><td>An opaque pointer. </td></tr>
217 </table>
218 </dl>
219 <dl class="return" compact><dt><b>Returns:</b></dt><dd>The number of bytes put into <code>buffer</code> </dd></dl>
220 <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__partition.html#g975ce8905536b4c1020eb18b5b640158" title="A function pointer used to continuously write a data stream obtained from a callback...">device_write_interval_t</a> </dd></dl>
221  
222 </div>
223 </div><p>
224 <a class="anchor" name="g975ce8905536b4c1020eb18b5b640158"></a><!-- doxytag: member="partition.h::device_write_interval_t" ref="g975ce8905536b4c1020eb18b5b640158" args=")(uint32_t offset, uint8_t *buffer, uint16_t length, device_write_callback_t callback, void *p)" -->
225 <div class="memitem">
226 <div class="memproto">
227 <table class="memname">
228 <tr>
229 <td class="memname">typedef uint8_t(* <a class="el" href="group__partition.html#g975ce8905536b4c1020eb18b5b640158">device_write_interval_t</a>)(uint32_t offset, uint8_t *buffer, uint16_t length, <a class="el" href="group__partition.html#g089849983ec009841429eb6a1d3cb4cc">device_write_callback_t</a> callback, void *p) </td>
230 </tr>
231 </table>
232 </div>
233 <div class="memdoc">
234  
235 <p>
236 A function pointer used to continuously write a data stream obtained from a callback function.
237 <p>
238 This function starts writing at the specified offset. To obtain the next bytes to write, it calls the callback function. The callback fills the provided data buffer and returns the number of bytes it has put into the buffer.<p>
239 By returning zero, the callback may stop writing.<p>
240 <dl compact><dt><b>Parameters:</b></dt><dd>
241 <table border="0" cellspacing="2" cellpadding="0">
242 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>offset</em>&nbsp;</td><td>Offset where to start writing. </td></tr>
243 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>buffer</em>&nbsp;</td><td>Pointer to a buffer which is used for the callback function. </td></tr>
244 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>length</em>&nbsp;</td><td>Number of bytes to write in total. May be zero for endless writes. </td></tr>
245 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>callback</em>&nbsp;</td><td>The function used to obtain the bytes to write. </td></tr>
246 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>p</em>&nbsp;</td><td>An opaque pointer directly passed to the callback function. </td></tr>
247 </table>
248 </dl>
249 <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success </dd></dl>
250 <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__partition.html#gc6ca9cbb79b5099d610e976365ee2e8e" title="A function pointer used to write to the partition.">device_write_t</a> </dd></dl>
251  
252 </div>
253 </div><p>
254 <a class="anchor" name="gc6ca9cbb79b5099d610e976365ee2e8e"></a><!-- doxytag: member="partition.h::device_write_t" ref="gc6ca9cbb79b5099d610e976365ee2e8e" args=")(uint32_t offset, const uint8_t *buffer, uint16_t length)" -->
255 <div class="memitem">
256 <div class="memproto">
257 <table class="memname">
258 <tr>
259 <td class="memname">typedef uint8_t(* <a class="el" href="group__partition.html#gc6ca9cbb79b5099d610e976365ee2e8e">device_write_t</a>)(uint32_t offset, const uint8_t *buffer, uint16_t length) </td>
260 </tr>
261 </table>
262 </div>
263 <div class="memdoc">
264  
265 <p>
266 A function pointer used to write to the partition.
267 <p>
268 <dl compact><dt><b>Parameters:</b></dt><dd>
269 <table border="0" cellspacing="2" cellpadding="0">
270 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>offset</em>&nbsp;</td><td>The offset on the device where to start writing. </td></tr>
271 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>buffer</em>&nbsp;</td><td>The buffer which to write. </td></tr>
272 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>length</em>&nbsp;</td><td>The count of bytes to write. </td></tr>
273 </table>
274 </dl>
275  
276 </div>
277 </div><p>
278 <hr><h2>Function Documentation</h2>
279 <a class="anchor" name="g128f4363de35c81a9ff8026d4db289d2"></a><!-- doxytag: member="partition.c::partition_close" ref="g128f4363de35c81a9ff8026d4db289d2" args="(struct partition_struct *partition)" -->
280 <div class="memitem">
281 <div class="memproto">
282 <table class="memname">
283 <tr>
284 <td class="memname">uint8_t partition_close </td>
285 <td>(</td>
286 <td class="paramtype">struct <a class="el" href="structpartition__struct.html">partition_struct</a> *&nbsp;</td>
287 <td class="paramname"> <em>partition</em> </td>
288 <td>&nbsp;)&nbsp;</td>
289 <td width="100%"></td>
290 </tr>
291 </table>
292 </div>
293 <div class="memdoc">
294  
295 <p>
296 Closes a partition.
297 <p>
298 This function destroys a partition descriptor which was previously obtained from a call to <a class="el" href="group__partition.html#g3125023db4e9d50adb8489c71fa1be68" title="Opens a partition.">partition_open()</a>. When this function returns, the given descriptor will be invalid.<p>
299 <dl compact><dt><b>Parameters:</b></dt><dd>
300 <table border="0" cellspacing="2" cellpadding="0">
301 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>partition</em>&nbsp;</td><td>The partition descriptor to destroy. </td></tr>
302 </table>
303 </dl>
304 <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl>
305 <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__partition.html#g3125023db4e9d50adb8489c71fa1be68" title="Opens a partition.">partition_open</a> </dd></dl>
306  
307 </div>
308 </div><p>
309 <a class="anchor" name="g3125023db4e9d50adb8489c71fa1be68"></a><!-- doxytag: member="partition.c::partition_open" ref="g3125023db4e9d50adb8489c71fa1be68" args="(device_read_t device_read, device_read_interval_t device_read_interval, device_write_t device_write, device_write_interval_t device_write_interval, int8_t index)" -->
310 <div class="memitem">
311 <div class="memproto">
312 <table class="memname">
313 <tr>
314 <td class="memname">struct <a class="el" href="structpartition__struct.html">partition_struct</a> * partition_open </td>
315 <td>(</td>
316 <td class="paramtype"><a class="el" href="group__partition.html#g6a2b9c5359ec033470fc25b2626e56fc">device_read_t</a>&nbsp;</td>
317 <td class="paramname"> <em>device_read</em>, </td>
318 </tr>
319 <tr>
320 <td class="paramkey"></td>
321 <td></td>
322 <td class="paramtype"><a class="el" href="group__partition.html#gebc277053a3361aaf4b67a486e24fa24">device_read_interval_t</a>&nbsp;</td>
323 <td class="paramname"> <em>device_read_interval</em>, </td>
324 </tr>
325 <tr>
326 <td class="paramkey"></td>
327 <td></td>
328 <td class="paramtype"><a class="el" href="group__partition.html#gc6ca9cbb79b5099d610e976365ee2e8e">device_write_t</a>&nbsp;</td>
329 <td class="paramname"> <em>device_write</em>, </td>
330 </tr>
331 <tr>
332 <td class="paramkey"></td>
333 <td></td>
334 <td class="paramtype"><a class="el" href="group__partition.html#g975ce8905536b4c1020eb18b5b640158">device_write_interval_t</a>&nbsp;</td>
335 <td class="paramname"> <em>device_write_interval</em>, </td>
336 </tr>
337 <tr>
338 <td class="paramkey"></td>
339 <td></td>
340 <td class="paramtype">int8_t&nbsp;</td>
341 <td class="paramname"> <em>index</em></td><td>&nbsp;</td>
342 </tr>
343 <tr>
344 <td></td>
345 <td>)</td>
346 <td></td><td></td><td width="100%"><code> [read]</code></td>
347 </tr>
348 </table>
349 </div>
350 <div class="memdoc">
351  
352 <p>
353 Opens a partition.
354 <p>
355 Opens a partition by its index number and returns a partition handle which describes the opened partition.<p>
356 <dl class="note" compact><dt><b>Note:</b></dt><dd>This function does not support extended partitions.</dd></dl>
357 <dl compact><dt><b>Parameters:</b></dt><dd>
358 <table border="0" cellspacing="2" cellpadding="0">
359 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>device_read</em>&nbsp;</td><td>A function pointer which is used to read from the disk. </td></tr>
360 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>device_read_interval</em>&nbsp;</td><td>A function pointer which is used to read in constant intervals from the disk. </td></tr>
361 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>device_write</em>&nbsp;</td><td>A function pointer which is used to write to the disk. </td></tr>
362 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>device_write_interval</em>&nbsp;</td><td>A function pointer which is used to write a data stream to disk. </td></tr>
363 <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>index</em>&nbsp;</td><td>The index of the partition which should be opened, range 0 to 3. A negative value is allowed as well. In this case, the partition opened is not checked for existance, begins at offset zero, has a length of zero and is of an unknown type. </td></tr>
364 </table>
365 </dl>
366 <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, a partition descriptor on success. </dd></dl>
367 <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__partition.html#g128f4363de35c81a9ff8026d4db289d2" title="Closes a partition.">partition_close</a> </dd></dl>
368  
369 </div>
370 </div><p>
371 <hr size="1"><address style="text-align: right;"><small>Generated on Thu Dec 13 19:38:48 2007 for sd-reader by&nbsp;
372 <a href="http://www.doxygen.org/index.html">
373 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3-20071008 </small></address>
374 </body>
375 </html>