<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>libisofs: iso_data_source Struct Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">libisofs  <span id="projectnumber">1.1.6</span> </div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.7.5 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="functions.html"><span>Data Fields</span></a></li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-attribs">Data Fields</a> </div> <div class="headertitle"> <div class="title">iso_data_source Struct Reference</div> </div> </div> <div class="contents"> <!-- doxytag: class="iso_data_source" --> <p>Data source used by libisofs for reading an existing image. <a href="structiso__data__source.html#details">More...</a></p> <p><code>#include <<a class="el" href="libisofs_8h_source.html">libisofs.h</a>></code></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-attribs"></a> Data Fields</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structiso__data__source.html#ac2b10df9ee30998e7c6222f8c2ec676c">version</a></td></tr> <tr><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="structiso__data__source.html#a89605c83df9201a0932f9f69423fc3d2">refcount</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Reference count for the data source. <a href="#a89605c83df9201a0932f9f69423fc3d2"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="structiso__data__source.html#a0d466e2535183b8873d4050ba18d62f9">open</a> )(<a class="el" href="libisofs_8h.html#a8551dbcc0053e79bef8b2de4e35905f0">IsoDataSource</a> *src)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Opens the given source. <a href="#a0d466e2535183b8873d4050ba18d62f9"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="structiso__data__source.html#a9e43be3dbcd3554acdda59286349ef78">close</a> )(<a class="el" href="libisofs_8h.html#a8551dbcc0053e79bef8b2de4e35905f0">IsoDataSource</a> *src)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Close a given source, freeing all system resources previously grabbed in <a class="el" href="structiso__data__source.html#a0d466e2535183b8873d4050ba18d62f9" title="Opens the given source.">open()</a>. <a href="#a9e43be3dbcd3554acdda59286349ef78"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="structiso__data__source.html#a17f91979ac80c31d32c8d8a608dce75c">read_block</a> )(<a class="el" href="libisofs_8h.html#a8551dbcc0053e79bef8b2de4e35905f0">IsoDataSource</a> *src, uint32_t lba, uint8_t *buffer)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Read an arbitrary block (2048 bytes) of data from the source. <a href="#a17f91979ac80c31d32c8d8a608dce75c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="structiso__data__source.html#a9093c564285385ebbd3b5549ead26c7e">free_data</a> )(<a class="el" href="libisofs_8h.html#a8551dbcc0053e79bef8b2de4e35905f0">IsoDataSource</a> *src)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Clean up the source specific data. <a href="#a9093c564285385ebbd3b5549ead26c7e"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="structiso__data__source.html#ac198caeef0c60e7c6ce88efa38748cd2">data</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Source specific data. <a href="#ac198caeef0c60e7c6ce88efa38748cd2"></a><br/></td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>Data source used by libisofs for reading an existing image. </p> <p>It offers homogeneous read access to arbitrary blocks to different sources for images, such as .iso files, CD/DVD drives, etc...</p> <p>To create a multisession image, libisofs needs a IsoDataSource, that the user must provide. The function <a class="el" href="libisofs_8h.html#ad1ca16468fe0f71ad5a2d00d6838af33" title="Create a new IsoDataSource from a local file.">iso_data_source_new_from_file()</a> constructs an IsoDataSource that uses POSIX I/O functions to access data. You can use it with regular .iso images, and also with block devices that represent a drive.</p> <dl class="since"><dt><b>Since:</b></dt><dd>0.6.2 </dd></dl> </div><hr/><h2>Field Documentation</h2> <a class="anchor" id="a9e43be3dbcd3554acdda59286349ef78"></a><!-- doxytag: member="iso_data_source::close" ref="a9e43be3dbcd3554acdda59286349ef78" args=")(IsoDataSource *src)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int(* <a class="el" href="structiso__data__source.html#a9e43be3dbcd3554acdda59286349ef78">iso_data_source::close</a>)(<a class="el" href="libisofs_8h.html#a8551dbcc0053e79bef8b2de4e35905f0">IsoDataSource</a> *src)</td> </tr> </table> </div> <div class="memdoc"> <p>Close a given source, freeing all system resources previously grabbed in <a class="el" href="structiso__data__source.html#a0d466e2535183b8873d4050ba18d62f9" title="Opens the given source.">open()</a>. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>1 if success, < 0 on error (has to be a valid libisofs error code) </dd></dl> <p>Definition at line <a class="el" href="libisofs_8h_source.html#l00422">422</a> of file <a class="el" href="libisofs_8h_source.html">libisofs.h</a>.</p> </div> </div> <a class="anchor" id="ac198caeef0c60e7c6ce88efa38748cd2"></a><!-- doxytag: member="iso_data_source::data" ref="ac198caeef0c60e7c6ce88efa38748cd2" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void* <a class="el" href="structiso__data__source.html#ac198caeef0c60e7c6ce88efa38748cd2">iso_data_source::data</a></td> </tr> </table> </div> <div class="memdoc"> <p>Source specific data. </p> <p>Definition at line <a class="el" href="libisofs_8h_source.html#l00449">449</a> of file <a class="el" href="libisofs_8h_source.html">libisofs.h</a>.</p> </div> </div> <a class="anchor" id="a9093c564285385ebbd3b5549ead26c7e"></a><!-- doxytag: member="iso_data_source::free_data" ref="a9093c564285385ebbd3b5549ead26c7e" args=")(IsoDataSource *src)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void(* <a class="el" href="structiso__data__source.html#a9093c564285385ebbd3b5549ead26c7e">iso_data_source::free_data</a>)(<a class="el" href="libisofs_8h.html#a8551dbcc0053e79bef8b2de4e35905f0">IsoDataSource</a> *src)</td> </tr> </table> </div> <div class="memdoc"> <p>Clean up the source specific data. </p> <p>Never call this directly, it is automatically called by <a class="el" href="libisofs_8h.html#a384a8dcfeda64afd40e9b51ab2b7acdf" title="Decrements the reference counting of the given IsoDataSource, freeing it if refcount reach 0...">iso_data_source_unref()</a> when refcount reach 0. </p> <p>Definition at line <a class="el" href="libisofs_8h_source.html#l00446">446</a> of file <a class="el" href="libisofs_8h_source.html">libisofs.h</a>.</p> </div> </div> <a class="anchor" id="a0d466e2535183b8873d4050ba18d62f9"></a><!-- doxytag: member="iso_data_source::open" ref="a0d466e2535183b8873d4050ba18d62f9" args=")(IsoDataSource *src)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int(* <a class="el" href="structiso__data__source.html#a0d466e2535183b8873d4050ba18d62f9">iso_data_source::open</a>)(<a class="el" href="libisofs_8h.html#a8551dbcc0053e79bef8b2de4e35905f0">IsoDataSource</a> *src)</td> </tr> </table> </div> <div class="memdoc"> <p>Opens the given source. </p> <p>You must <a class="el" href="structiso__data__source.html#a0d466e2535183b8873d4050ba18d62f9" title="Opens the given source.">open()</a> the source before any attempt to read data from it. The open is the right place for grabbing the underlying resources.</p> <dl class="return"><dt><b>Returns:</b></dt><dd>1 if success, < 0 on error (has to be a valid libisofs error code) </dd></dl> <p>Definition at line <a class="el" href="libisofs_8h_source.html#l00413">413</a> of file <a class="el" href="libisofs_8h_source.html">libisofs.h</a>.</p> </div> </div> <a class="anchor" id="a17f91979ac80c31d32c8d8a608dce75c"></a><!-- doxytag: member="iso_data_source::read_block" ref="a17f91979ac80c31d32c8d8a608dce75c" args=")(IsoDataSource *src, uint32_t lba, uint8_t *buffer)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int(* <a class="el" href="structiso__data__source.html#a17f91979ac80c31d32c8d8a608dce75c">iso_data_source::read_block</a>)(<a class="el" href="libisofs_8h.html#a8551dbcc0053e79bef8b2de4e35905f0">IsoDataSource</a> *src, uint32_t lba, uint8_t *buffer)</td> </tr> </table> </div> <div class="memdoc"> <p>Read an arbitrary block (2048 bytes) of data from the source. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">lba</td><td>Block to be read. </td></tr> <tr><td class="paramname">buffer</td><td>Buffer where the data will be written. It should have at least 2048 bytes. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>1 if success, < 0 if error. This function has to emit a valid libisofs error code. Predifined (but not mandatory) for this purpose are: ISO_DATA_SOURCE_SORRY , ISO_DATA_SOURCE_MISHAP, ISO_DATA_SOURCE_FAILURE , ISO_DATA_SOURCE_FATAL </dd></dl> <p>Definition at line <a class="el" href="libisofs_8h_source.html#l00439">439</a> of file <a class="el" href="libisofs_8h_source.html">libisofs.h</a>.</p> </div> </div> <a class="anchor" id="a89605c83df9201a0932f9f69423fc3d2"></a><!-- doxytag: member="iso_data_source::refcount" ref="a89605c83df9201a0932f9f69423fc3d2" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned int <a class="el" href="structiso__data__source.html#a89605c83df9201a0932f9f69423fc3d2">iso_data_source::refcount</a></td> </tr> </table> </div> <div class="memdoc"> <p>Reference count for the data source. </p> <p>Should be 1 when a new source is created. Don't access it directly, but with <a class="el" href="libisofs_8h.html#a3efa2506d710f045cb12123440b2a5f9" title="Increments the reference counting of the given IsoDataSource.">iso_data_source_ref()</a> and <a class="el" href="libisofs_8h.html#a384a8dcfeda64afd40e9b51ab2b7acdf" title="Decrements the reference counting of the given IsoDataSource, freeing it if refcount reach 0...">iso_data_source_unref()</a> functions. </p> <p>Definition at line <a class="el" href="libisofs_8h_source.html#l00403">403</a> of file <a class="el" href="libisofs_8h_source.html">libisofs.h</a>.</p> </div> </div> <a class="anchor" id="ac2b10df9ee30998e7c6222f8c2ec676c"></a><!-- doxytag: member="iso_data_source::version" ref="ac2b10df9ee30998e7c6222f8c2ec676c" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="structiso__data__source.html#ac2b10df9ee30998e7c6222f8c2ec676c">iso_data_source::version</a></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="libisofs_8h_source.html#l00396">396</a> of file <a class="el" href="libisofs_8h_source.html">libisofs.h</a>.</p> </div> </div> <hr/>The documentation for this struct was generated from the following file:<ul> <li>libisofs-1.1.6/libisofs/<a class="el" href="libisofs_8h_source.html">libisofs.h</a></li> </ul> </div> <hr size="1"><address style="text-align: right;"><small>Generated for libisofs by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.7.5 </small></address> </body> </html>