Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > f2adb5ed02e83f2c51981c1b15594e22 > files > 76

libnjb-devel-2.2.7-1.fc14.x86_64.rpm

<!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>libnjb: The datafile tag (metadata) retrieveal API</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">libnjb&#160;<span id="projectnumber">2.2.7</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">The datafile tag (metadata) retrieveal API</div>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga15b4b6c37cbed8c800f3a8d8283a213a"></a><!-- doxytag: member="datatagapi::NJB_Get_File" ref="ga15b4b6c37cbed8c800f3a8d8283a213a" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>NJB_Get_File</b>&#160;&#160;&#160;NJB_Get_Track</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac873a487b5117e272376a1adf0981aa6"></a><!-- doxytag: member="datatagapi::NJB_Get_File_fd" ref="gac873a487b5117e272376a1adf0981aa6" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>NJB_Get_File_fd</b>&#160;&#160;&#160;NJB_Get_Track_fd</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__datatagapi.html#gae05722e976c41992fbb6323b9edd617a">NJB_Reset_Get_Datafile_Tag</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structnjb__datafile__struct.html">njb_datafile_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__datatagapi.html#gac7c33df215b2471b2d328a6347af6ab2">NJB_Get_Datafile_Tag</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__datatagapi.html#gaf5614490c92803428e896967355431a5">NJB_Datafile_Destroy</a> (<a class="el" href="structnjb__datafile__struct.html">njb_datafile_t</a> *df)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__datatagapi.html#ga31c21abd0c41827557fa14b13b496d5e">NJB_Send_File</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, const char *path, const char *name, const char *folder, <a class="el" href="libnjb_8h.html#a6efb672d692e39f52eb3589fde051ad2">NJB_Xfer_Callback</a> *callback, void *data, u_int32_t *fileid)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__datatagapi.html#gac6063d6550628ce9f25c49c24abd6ab1">NJB_Delete_Datafile</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, u_int32_t fileid)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__datatagapi.html#gaf0af37672d08dc62974925db7c7b6dfb">NJB_Create_Folder</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, const char *name, u_int32_t *folderid)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gaf0af37672d08dc62974925db7c7b6dfb"></a><!-- doxytag: member="libnjb.h::NJB_Create_Folder" ref="gaf0af37672d08dc62974925db7c7b6dfb" args="(njb_t *njb, const char *name, u_int32_t *folderid)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Create_Folder </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int32_t *&#160;</td>
          <td class="paramname"><em>folderid</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function creates a new folder on the device, if the device supports folder creation. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> jukebox object to use </td></tr>
    <tr><td class="paramname">name</td><td>the name of the new folder to create </td></tr>
    <tr><td class="paramname">folderid</td><td>a pointer to a variable that will hold the new item ID for the folder if it is successfully created. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure. Notice that a case of failure is when an NJB1 is used, so this should normally result in "not implemented" error. </dd></dl>

<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, and <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>.</p>

</div>
</div>
<a class="anchor" id="gaf5614490c92803428e896967355431a5"></a><!-- doxytag: member="libnjb.h::NJB_Datafile_Destroy" ref="gaf5614490c92803428e896967355431a5" args="(njb_datafile_t *df)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void NJB_Datafile_Destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__datafile__struct.html">njb_datafile_t</a> *&#160;</td>
          <td class="paramname"><em>df</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Destroys a datafile struct. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">df</td><td>the datafile struct to destroy </td></tr>
  </table>
  </dd>
</dl>

<p>References <a class="el" href="structnjb__datafile__struct.html#a1e69ed22f6d3ff77c3434390191cd764">njb_datafile_struct::filename</a>, and <a class="el" href="structnjb__datafile__struct.html#ac99996234eaf1ab83538c1fe1f9e53ab">njb_datafile_struct::folder</a>.</p>

<p>Referenced by <a class="el" href="datafile_8c.html#aa0767790f814895d8ddc310d933fb011">datafile_unpack()</a>, and <a class="el" href="group__datatagapi.html#ga31c21abd0c41827557fa14b13b496d5e">NJB_Send_File()</a>.</p>

</div>
</div>
<a class="anchor" id="gac6063d6550628ce9f25c49c24abd6ab1"></a><!-- doxytag: member="libnjb.h::NJB_Delete_Datafile" ref="gac6063d6550628ce9f25c49c24abd6ab1" args="(njb_t *njb, u_int32_t fileid)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Delete_Datafile </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int32_t&#160;</td>
          <td class="paramname"><em>fileid</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This deletes a datafile from the device.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> jukebox object to use </td></tr>
    <tr><td class="paramname">fileid</td><td>the file ID for the file to delete </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="delfile_8c-example.html#a7">delfile.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="group__errors.html#gaa77a4904813cac57221afb5a0374d91c">EO_BADCOUNT</a>, and <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>.</p>

</div>
</div>
<a class="anchor" id="gac7c33df215b2471b2d328a6347af6ab2"></a><!-- doxytag: member="libnjb.h::NJB_Get_Datafile_Tag" ref="gac7c33df215b2471b2d328a6347af6ab2" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structnjb__datafile__struct.html">njb_datafile_t</a>* NJB_Get_Datafile_Tag </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This gets a datafile tag from the device. The device should first be rewound using the <code><a class="el" href="group__datatagapi.html#gae05722e976c41992fbb6323b9edd617a">NJB_Reset_Get_Datafile_Tag()</a></code> function. The tag is newly allocated and should be destroyed with <code><a class="el" href="group__datatagapi.html#gaf5614490c92803428e896967355431a5">NJB_Datafile_Destroy()</a></code> after use.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to get datafiles from </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a datafile tag or NULL if the last datafile tag has already been returned </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__datatagapi.html#gae05722e976c41992fbb6323b9edd617a">NJB_Reset_Get_Datafile_Tag()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="files_8c-example.html#a16">files.c</a>, and <a class="el" href="getfile_8c-example.html#a9">getfile.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, and <a class="el" href="structnjb__struct.html#a9c34c2b8e18cdf2c494f2cfe2e1e4f5f">njb_struct::protocol_state</a>.</p>

</div>
</div>
<a class="anchor" id="gae05722e976c41992fbb6323b9edd617a"></a><!-- doxytag: member="libnjb.h::NJB_Reset_Get_Datafile_Tag" ref="gae05722e976c41992fbb6323b9edd617a" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void NJB_Reset_Get_Datafile_Tag </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This resets the datafile metadata retrieveal function. The datafile tags can then be retrieved one by one using the <code><a class="el" href="group__datatagapi.html#gac7c33df215b2471b2d328a6347af6ab2">NJB_Get_Datafile_Tag()</a></code> function.</p>
<p>Typical usage:</p>
<pre>
 njb_t *njb;
 njb_datafile_t *df;</pre><pre> NJB_Reset_Get_Datafile_Tag(njb);
 while ( (df = NJB_Get_Datafile_Tag(njb)) != NULL ) {
    // Do something with all the datafiles...
    NJB_Datafile_Destroy(df);
 }
 </pre><dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to reset the datafile retrieveal pointer for </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__datatagapi.html#gac7c33df215b2471b2d328a6347af6ab2">NJB_Get_Datafile_Tag()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="files_8c-example.html#a15">files.c</a>, and <a class="el" href="getfile_8c-example.html#a8">getfile.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="protocol3_8c.html#aed14b36adbbd0c6d045f0be3e86c5a37">njb3_reset_get_datafile_tag()</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, and <a class="el" href="structnjb__struct.html#a9c34c2b8e18cdf2c494f2cfe2e1e4f5f">njb_struct::protocol_state</a>.</p>

</div>
</div>
<a class="anchor" id="ga31c21abd0c41827557fa14b13b496d5e"></a><!-- doxytag: member="libnjb.h::NJB_Send_File" ref="ga31c21abd0c41827557fa14b13b496d5e" args="(njb_t *njb, const char *path, const char *name, const char *folder, NJB_Xfer_Callback *callback, void *data, u_int32_t *fileid)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Send_File </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>folder</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="libnjb_8h.html#a6efb672d692e39f52eb3589fde051ad2">NJB_Xfer_Callback</a> *&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int32_t *&#160;</td>
          <td class="paramname"><em>fileid</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function sends a datafile to the device (downloads), optionally using a folder name.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to send the file to </td></tr>
    <tr><td class="paramname">path</td><td>a path to the file that shall be downloaded. </td></tr>
    <tr><td class="paramname">name</td><td>a filename to use for this file on the device. Should only be the basename, excluding any folder name(s). </td></tr>
    <tr><td class="paramname">folder</td><td>a folder name to use for this file on the device. Not all devices support folders, so this might be ignored. A folder name must begin and end with backslash (\) and have levels of hierarchy separated by backslashes too, like this: "\foo\bar\fnord\". </td></tr>
    <tr><td class="paramname">callback</td><td>a function that will be called repeatedly to report progress during transfer, used for e.g. displaying progress bars. This may be NULL if you don't like callbacks. </td></tr>
    <tr><td class="paramname">data</td><td>a voluntary parameter that can associate some user-supplied data with each callback call. It is OK to set this to NULL of course. </td></tr>
    <tr><td class="paramname">fileid</td><td>a pointer to a variable that will hold the new file ID when the operation is finished. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="sendfile_8c-example.html#a9">sendfile.c</a>.</dd>
</dl>
<p>References <a class="el" href="procedure_8c.html#ad7ebab46fa81c69bd52ccc715f183d2e">_file_size()</a>, <a class="el" href="procedure_8c.html#aa37f1c6769ecf6e00ad0de0d27d4a0e1">_file_time()</a>, <a class="el" href="datafile_8c.html#aa580707078938ef2447d971a96638ce3">datafile_pack()</a>, <a class="el" href="datafile_8c.html#afc23fcd58e9e846ae7aa4ff500f5b198">datafile_pack3()</a>, <a class="el" href="datafile_8c.html#ad492fd31f9f4bce733c174e21862b5d5">datafile_set_folder()</a>, <a class="el" href="datafile_8c.html#ab8d6674a5aac213059d864b111f10b2d">datafile_set_name()</a>, <a class="el" href="datafile_8c.html#ad8cf05786cb9088cd9ae1bbb2100ea62">datafile_set_size()</a>, <a class="el" href="datafile_8c.html#a7bb708f3e8952b778446f2fcef87fe61">datafile_set_time()</a>, <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="group__errors.html#ga909b3766a05c3f22ba04e40a39efa581">EO_INVALID</a>, <a class="el" href="group__errors.html#gaccdcb6efe55a82e46b2a702edcc85781">EO_SRCFILE</a>, <a class="el" href="group__errors.html#gac3a1bc8a48d37a7e5266e61a38a9ac47">EO_TOOBIG</a>, <a class="el" href="group__errors.html#ga810365ab9a25b7a3c2221f91efc9fb72">EO_XFERDENIED</a>, <a class="el" href="group__datatagapi.html#gaf5614490c92803428e896967355431a5">NJB_Datafile_Destroy()</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, and <a class="el" href="protocol_8c.html#a7f0a8d1560f23483fe722fb51f634fe8">njb_get_disk_usage()</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Sat Jun 25 2011 for libnjb by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>