Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > ca44e7e21c4b6cd5e0c5fdfbf12b4de7 > files > 74

libnjb-devel-2.2.6-6.fc12.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;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.5.9 -->
<div class="navigation" id="top">
  <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>
      <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="contents">
<h1>The datafile tag (metadata) retrieveal API</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g15b4b6c37cbed8c800f3a8d8283a213a"></a><!-- doxytag: member="datatagapi::NJB_Get_File" ref="g15b4b6c37cbed8c800f3a8d8283a213a" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>NJB_Get_File</b>&nbsp;&nbsp;&nbsp;NJB_Get_Track</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gc873a487b5117e272376a1adf0981aa6"></a><!-- doxytag: member="datatagapi::NJB_Get_File_fd" ref="gc873a487b5117e272376a1adf0981aa6" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>NJB_Get_File_fd</b>&nbsp;&nbsp;&nbsp;NJB_Get_Track_fd</td></tr>

<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__datatagapi.html#ge05722e976c41992fbb6323b9edd617a">NJB_Reset_Get_Datafile_Tag</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structnjb__datafile__struct.html">njb_datafile_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__datatagapi.html#gc7c33df215b2471b2d328a6347af6ab2">NJB_Get_Datafile_Tag</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__datatagapi.html#gf5614490c92803428e896967355431a5">NJB_Datafile_Destroy</a> (<a class="el" href="structnjb__datafile__struct.html">njb_datafile_t</a> *df)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__datatagapi.html#g31c21abd0c41827557fa14b13b496d5e">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#6efb672d692e39f52eb3589fde051ad2">NJB_Xfer_Callback</a> *callback, void *data, u_int32_t *fileid)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__datatagapi.html#gc6063d6550628ce9f25c49c24abd6ab1">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" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__datatagapi.html#gf0af37672d08dc62974925db7c7b6dfb">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" name="gf0af37672d08dc62974925db7c7b6dfb"></a><!-- doxytag: member="libnjb.h::NJB_Create_Folder" ref="gf0af37672d08dc62974925db7c7b6dfb" 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> *&nbsp;</td>
          <td class="paramname"> <em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int32_t *&nbsp;</td>
          <td class="paramname"> <em>folderid</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <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. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>njb</em>&nbsp;</td><td>a pointer to the <code>njb_t</code> jukebox object to use </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>the name of the new folder to create </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>folderid</em>&nbsp;</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>
</dl>
<dl class="return" compact><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="libnjb_8h_source.html#l00189">njb_struct::device_type</a>, and <a class="el" href="libnjb_8h_source.html#l00072">NJB_DEVICE_NJB1</a>.</p>

</div>
</div><p>
<a class="anchor" name="gf5614490c92803428e896967355431a5"></a><!-- doxytag: member="libnjb.h::NJB_Datafile_Destroy" ref="gf5614490c92803428e896967355431a5" 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> *&nbsp;</td>
          <td class="paramname"> <em>df</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destroys a datafile struct. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>df</em>&nbsp;</td><td>the datafile struct to destroy </td></tr>
  </table>
</dl>

<p>References <a class="el" href="libnjb_8h_source.html#l00277">njb_datafile_struct::filename</a>, and <a class="el" href="libnjb_8h_source.html#l00282">njb_datafile_struct::folder</a>.</p>

<p>Referenced by <a class="el" href="datafile_8c_source.html#l00164">datafile_unpack()</a>, and <a class="el" href="procedure_8c_source.html#l01723">NJB_Send_File()</a>.</p>

</div>
</div><p>
<a class="anchor" name="gc6063d6550628ce9f25c49c24abd6ab1"></a><!-- doxytag: member="libnjb.h::NJB_Delete_Datafile" ref="gc6063d6550628ce9f25c49c24abd6ab1" 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> *&nbsp;</td>
          <td class="paramname"> <em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int32_t&nbsp;</td>
          <td class="paramname"> <em>fileid</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This deletes a datafile from the device.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>njb</em>&nbsp;</td><td>a pointer to the <code>njb_t</code> jukebox object to use </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>fileid</em>&nbsp;</td><td>the file ID for the file to delete </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="delfile_8c-example.html#a7">delfile.c</a>.</dl>
<p>References <a class="el" href="libnjb_8h_source.html#l00189">njb_struct::device_type</a>, <a class="el" href="njb__error_8h_source.html#l00019">EO_BADCOUNT</a>, and <a class="el" href="libnjb_8h_source.html#l00072">NJB_DEVICE_NJB1</a>.</p>

</div>
</div><p>
<a class="anchor" name="gc7c33df215b2471b2d328a6347af6ab2"></a><!-- doxytag: member="libnjb.h::NJB_Get_Datafile_Tag" ref="gc7c33df215b2471b2d328a6347af6ab2" 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> *&nbsp;</td>
          <td class="paramname"> <em>njb</em>          </td>
          <td>&nbsp;)&nbsp;</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#ge05722e976c41992fbb6323b9edd617a">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#gf5614490c92803428e896967355431a5">NJB_Datafile_Destroy()</a></code> after use.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>njb</em>&nbsp;</td><td>a pointer to the <code>njb_t</code> object to get datafiles from </td></tr>
  </table>
</dl>
<dl class="return" compact><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" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__datatagapi.html#ge05722e976c41992fbb6323b9edd617a">NJB_Reset_Get_Datafile_Tag()</a> </dd></dl>
<dl compact><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>.</dl>
<p>References <a class="el" href="libnjb_8h_source.html#l00189">njb_struct::device_type</a>, <a class="el" href="libnjb_8h_source.html#l00072">NJB_DEVICE_NJB1</a>, and <a class="el" href="libnjb_8h_source.html#l00192">njb_struct::protocol_state</a>.</p>

</div>
</div><p>
<a class="anchor" name="ge05722e976c41992fbb6323b9edd617a"></a><!-- doxytag: member="libnjb.h::NJB_Reset_Get_Datafile_Tag" ref="ge05722e976c41992fbb6323b9edd617a" 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> *&nbsp;</td>
          <td class="paramname"> <em>njb</em>          </td>
          <td>&nbsp;)&nbsp;</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#gc7c33df215b2471b2d328a6347af6ab2">NJB_Get_Datafile_Tag()</a></code> function.<p>
Typical usage:<p>
<pre>
 njb_t *njb;
 njb_datafile_t *df;</pre><p>
<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><p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>njb</em>&nbsp;</td><td>a pointer to the <code>njb_t</code> object to reset the datafile retrieveal pointer for </td></tr>
  </table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__datatagapi.html#gc7c33df215b2471b2d328a6347af6ab2">NJB_Get_Datafile_Tag()</a> </dd></dl>
<dl compact><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>.</dl>
<p>References <a class="el" href="libnjb_8h_source.html#l00189">njb_struct::device_type</a>, <a class="el" href="protocol3_8c_source.html#l02908">njb3_reset_get_datafile_tag()</a>, <a class="el" href="libnjb_8h_source.html#l00072">NJB_DEVICE_NJB1</a>, and <a class="el" href="libnjb_8h_source.html#l00192">njb_struct::protocol_state</a>.</p>

</div>
</div><p>
<a class="anchor" name="g31c21abd0c41827557fa14b13b496d5e"></a><!-- doxytag: member="libnjb.h::NJB_Send_File" ref="g31c21abd0c41827557fa14b13b496d5e" 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> *&nbsp;</td>
          <td class="paramname"> <em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</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#6efb672d692e39f52eb3589fde051ad2">NJB_Xfer_Callback</a> *&nbsp;</td>
          <td class="paramname"> <em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int32_t *&nbsp;</td>
          <td class="paramname"> <em>fileid</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <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 compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>njb</em>&nbsp;</td><td>a pointer to the <code>njb_t</code> object to send the file to </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>path</em>&nbsp;</td><td>a path to the file that shall be downloaded. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</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 valign="top"></td><td valign="top"><em>folder</em>&nbsp;</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 valign="top"></td><td valign="top"><em>callback</em>&nbsp;</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 valign="top"></td><td valign="top"><em>data</em>&nbsp;</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 valign="top"></td><td valign="top"><em>fileid</em>&nbsp;</td><td>a pointer to a variable that will hold the new file ID when the operation is finished. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure. </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="sendfile_8c-example.html#a9">sendfile.c</a>.</dl>
<p>References <a class="el" href="procedure_8c_source.html#l02793">_file_size()</a>, <a class="el" href="procedure_8c_source.html#l02770">_file_time()</a>, <a class="el" href="datafile_8c_source.html#l00238">datafile_pack()</a>, <a class="el" href="datafile_8c_source.html#l00321">datafile_pack3()</a>, <a class="el" href="datafile_8c_source.html#l00142">datafile_set_folder()</a>, <a class="el" href="datafile_8c_source.html#l00118">datafile_set_name()</a>, <a class="el" href="datafile_8c_source.html#l00089">datafile_set_size()</a>, <a class="el" href="datafile_8c_source.html#l00103">datafile_set_time()</a>, <a class="el" href="libnjb_8h_source.html#l00189">njb_struct::device_type</a>, <a class="el" href="njb__error_8h_source.html#l00034">EO_INVALID</a>, <a class="el" href="njb__error_8h_source.html#l00033">EO_SRCFILE</a>, <a class="el" href="njb__error_8h_source.html#l00022">EO_TOOBIG</a>, <a class="el" href="njb__error_8h_source.html#l00030">EO_XFERDENIED</a>, <a class="el" href="datafile_8c_source.html#l00052">NJB_Datafile_Destroy()</a>, <a class="el" href="libnjb_8h_source.html#l00072">NJB_DEVICE_NJB1</a>, and <a class="el" href="protocol_8c_source.html#l00596">njb_get_disk_usage()</a>.</p>

</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Jul 26 17:17:29 2009 for libnjb by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>