Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > 23fdeec2afeeb035357795bcffb419c6 > files > 44

libmtp-doc-1.0.2-1mdv2010.1.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>libmtp: The file management 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.6.2 -->
<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 file management API.</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#ga731f7260b77aec5b77c72dd9dd8165ce">LIBMTP_new_file_t</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#ga0fed9e491256fb80b323bdd030b162e9">LIBMTP_destroy_file_t</a> (<a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a> *)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char const *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#ga9d920e6a6a80d9497076798c0f54ce34">LIBMTP_Get_Filetype_Description</a> (<a class="el" href="group__types.html#ga34d45fa6ab19cc024029d239250a8c64">LIBMTP_filetype_t</a>)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#ga0d890b8c6b771e6e29055bcd062c8bc9">LIBMTP_Get_Filelisting</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#ga701850b1f5e7d52694aa3eefa1a3582d">LIBMTP_Get_Filelisting_With_Callback</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, <a class="el" href="group__types.html#ga5d7782ad666c4c73186a8dce8ddda207">LIBMTP_progressfunc_t</a> const, void const *const)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#gaf93ae9da83db3182e9aac2753a899b86">LIBMTP_Get_Filemetadata</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, uint32_t const)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#ga7c7d210d89a8ce35220914346db56e1b">LIBMTP_Get_File_To_File</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, uint32_t, char const *const, <a class="el" href="group__types.html#ga5d7782ad666c4c73186a8dce8ddda207">LIBMTP_progressfunc_t</a> const, void const *const)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#ga4cce388a9b114cc73112d3fcd7ff1340">LIBMTP_Get_File_To_File_Descriptor</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, uint32_t const, int const, <a class="el" href="group__types.html#ga5d7782ad666c4c73186a8dce8ddda207">LIBMTP_progressfunc_t</a> const, void const *const)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#ga03c55d8e1b162ca7b9ec546b276bc038">LIBMTP_Get_File_To_Handler</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, uint32_t const, <a class="el" href="group__types.html#ga09e82583ed001223ab37032719d732c8">MTPDataPutFunc</a>, void *, <a class="el" href="group__types.html#ga5d7782ad666c4c73186a8dce8ddda207">LIBMTP_progressfunc_t</a> const, void const *const)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#ga552e760a429b0e47a593b8ade20bb763">LIBMTP_Send_File_From_File</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, char const *const, <a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a> *const, <a class="el" href="group__types.html#ga5d7782ad666c4c73186a8dce8ddda207">LIBMTP_progressfunc_t</a> const, void const *const)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#ga1784d5bd971a354c6d7ec10d6e532ccf">LIBMTP_Send_File_From_File_Descriptor</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, int const, <a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a> *const, <a class="el" href="group__types.html#ga5d7782ad666c4c73186a8dce8ddda207">LIBMTP_progressfunc_t</a> const, void const *const)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#gab2c26272deb5ba7a18644282ebc12782">LIBMTP_Send_File_From_Handler</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, <a class="el" href="group__types.html#gac98a3ffb03ff220f92953e6d92f33146">MTPDataGetFunc</a>, void *, <a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a> *const, <a class="el" href="group__types.html#ga5d7782ad666c4c73186a8dce8ddda207">LIBMTP_progressfunc_t</a> const, void const *const)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#ga15c6f7bf338e9da55dc6317f6b35d749">LIBMTP_Set_File_Name</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, <a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a> *, const char *)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structLIBMTP__filesampledata__struct.html">LIBMTP_filesampledata_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#ga57b4aae2dc47be67571b8fd83f4a3c67">LIBMTP_new_filesampledata_t</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#gaea06c7244116bd2eb036ccda03e0b714">LIBMTP_destroy_filesampledata_t</a> (<a class="el" href="structLIBMTP__filesampledata__struct.html">LIBMTP_filesampledata_t</a> *)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#gad4f872c85dfbe0dc870edbc1ec1ddedf">LIBMTP_Get_Representative_Sample_Format</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, <a class="el" href="group__types.html#ga34d45fa6ab19cc024029d239250a8c64">LIBMTP_filetype_t</a> const, <a class="el" href="structLIBMTP__filesampledata__struct.html">LIBMTP_filesampledata_t</a> **)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#gabd4c4d6ec90a27929336983f78f590f3">LIBMTP_Send_Representative_Sample</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, uint32_t const, <a class="el" href="structLIBMTP__filesampledata__struct.html">LIBMTP_filesampledata_t</a> *)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__files.html#ga0de960b7e44e29d706699251972a5f9f">LIBMTP_Get_Representative_Sample</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, uint32_t const, <a class="el" href="structLIBMTP__filesampledata__struct.html">LIBMTP_filesampledata_t</a> *)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga0fed9e491256fb80b323bdd030b162e9"></a><!-- doxytag: member="libmtp.h::LIBMTP_destroy_file_t" ref="ga0fed9e491256fb80b323bdd030b162e9" args="(LIBMTP_file_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void LIBMTP_destroy_file_t </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a> *&nbsp;</td>
          <td class="paramname"> <em>file</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This destroys a file metadata structure and deallocates the memory used by it, including any strings. Never use a file metadata structure again after calling this function on it. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>file</em>&nbsp;</td><td>the file metadata to destroy. </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__files.html#ga731f7260b77aec5b77c72dd9dd8165ce">LIBMTP_new_file_t()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00630">LIBMTP_file_struct::filename</a>.</p>

<p>Referenced by <a class="el" href="libmtp_8c_source.html#l05278">LIBMTP_Send_File_From_File_Descriptor()</a>, and <a class="el" href="libmtp_8c_source.html#l05382">LIBMTP_Send_File_From_Handler()</a>.</p>

</div>
</div>
<a class="anchor" id="gaea06c7244116bd2eb036ccda03e0b714"></a><!-- doxytag: member="libmtp.h::LIBMTP_destroy_filesampledata_t" ref="gaea06c7244116bd2eb036ccda03e0b714" args="(LIBMTP_filesampledata_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void LIBMTP_destroy_filesampledata_t </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__filesampledata__struct.html">LIBMTP_filesampledata_t</a> *&nbsp;</td>
          <td class="paramname"> <em>sample</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This destroys a file sample metadata type. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>sample</em>&nbsp;</td><td>the file sample metadata to be destroyed. </td></tr>
  </table>
  </dd>
</dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00716">LIBMTP_filesampledata_struct::data</a>.</p>

</div>
</div>
<a class="anchor" id="ga7c7d210d89a8ce35220914346db56e1b"></a><!-- doxytag: member="libmtp.h::LIBMTP_Get_File_To_File" ref="ga7c7d210d89a8ce35220914346db56e1b" args="(LIBMTP_mtpdevice_t *, uint32_t, char const *const, LIBMTP_progressfunc_t const, void const *const)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int LIBMTP_Get_File_To_File </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t const &nbsp;</td>
          <td class="paramname"> <em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *const &nbsp;</td>
          <td class="paramname"> <em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#ga5d7782ad666c4c73186a8dce8ddda207">LIBMTP_progressfunc_t</a> const &nbsp;</td>
          <td class="paramname"> <em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void const *const &nbsp;</td>
          <td class="paramname"> <em>data</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 gets a file off the device to a local file identified by a filename. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device to get the track from. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>the file ID of the file to retrieve. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>path</em>&nbsp;</td><td>a filename to use for the retrieved file. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>callback</em>&nbsp;</td><td>a progress indicator function or NULL to ignore. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>a user-defined pointer that is passed along to the <code>progress</code> function in order to pass along some user defined data to the progress updates. If not used, set this to NULL. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the transfer was successful, any other value means failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__files.html#ga4cce388a9b114cc73112d3fcd7ff1340">LIBMTP_Get_File_To_File_Descriptor()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8c_source.html#l04627">LIBMTP_Get_File_To_File_Descriptor()</a>.</p>

<p>Referenced by <a class="el" href="libmtp_8c_source.html#l04766">LIBMTP_Get_Track_To_File()</a>.</p>

</div>
</div>
<a class="anchor" id="ga4cce388a9b114cc73112d3fcd7ff1340"></a><!-- doxytag: member="libmtp.h::LIBMTP_Get_File_To_File_Descriptor" ref="ga4cce388a9b114cc73112d3fcd7ff1340" args="(LIBMTP_mtpdevice_t *, uint32_t const, int const, LIBMTP_progressfunc_t const, void const *const)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int LIBMTP_Get_File_To_File_Descriptor </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t const &nbsp;</td>
          <td class="paramname"> <em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int const &nbsp;</td>
          <td class="paramname"> <em>fd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#ga5d7782ad666c4c73186a8dce8ddda207">LIBMTP_progressfunc_t</a> const &nbsp;</td>
          <td class="paramname"> <em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void const *const &nbsp;</td>
          <td class="paramname"> <em>data</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 gets a file off the device to a file identified by a file descriptor.</p>
<p>This function can potentially be used for streaming files off the device for playback or broadcast for example, by downloading the file into a stream sink e.g. a socket.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device to get the file from. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>the file ID of the file to retrieve. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>fd</em>&nbsp;</td><td>a local file descriptor to write the file to. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>callback</em>&nbsp;</td><td>a progress indicator function or NULL to ignore. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>a user-defined pointer that is passed along to the <code>progress</code> function in order to pass along some user defined data to the progress updates. If not used, set this to NULL. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the transfer was successful, any other value means failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__files.html#ga7c7d210d89a8ce35220914346db56e1b">LIBMTP_Get_File_To_File()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00580">LIBMTP_mtpdevice_struct::params</a>, and <a class="el" href="libmtp_8h_source.html#l00585">LIBMTP_mtpdevice_struct::usbinfo</a>.</p>

<p>Referenced by <a class="el" href="libmtp_8c_source.html#l04567">LIBMTP_Get_File_To_File()</a>, and <a class="el" href="libmtp_8c_source.html#l04790">LIBMTP_Get_Track_To_File_Descriptor()</a>.</p>

</div>
</div>
<a class="anchor" id="ga03c55d8e1b162ca7b9ec546b276bc038"></a><!-- doxytag: member="libmtp.h::LIBMTP_Get_File_To_Handler" ref="ga03c55d8e1b162ca7b9ec546b276bc038" args="(LIBMTP_mtpdevice_t *, uint32_t const, MTPDataPutFunc, void *, LIBMTP_progressfunc_t const, void const *const)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int LIBMTP_Get_File_To_Handler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t const &nbsp;</td>
          <td class="paramname"> <em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#ga09e82583ed001223ab37032719d732c8">MTPDataPutFunc</a>&nbsp;</td>
          <td class="paramname"> <em>put_func</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>priv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#ga5d7782ad666c4c73186a8dce8ddda207">LIBMTP_progressfunc_t</a> const &nbsp;</td>
          <td class="paramname"> <em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void const *const &nbsp;</td>
          <td class="paramname"> <em>data</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 gets a file off the device and calls put_func with chunks of data</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device to get the file from. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>the file ID of the file to retrieve. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>put_func</em>&nbsp;</td><td>the function to call when we have data. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>priv</em>&nbsp;</td><td>the user-defined pointer that is passed to <code>put_func</code>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>callback</em>&nbsp;</td><td>a progress indicator function or NULL to ignore. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>a user-defined pointer that is passed along to the <code>progress</code> function in order to pass along some user defined data to the progress updates. If not used, set this to NULL. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the transfer was successful, any other value means failure. </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00580">LIBMTP_mtpdevice_struct::params</a>, and <a class="el" href="libmtp_8h_source.html#l00585">LIBMTP_mtpdevice_struct::usbinfo</a>.</p>

<p>Referenced by <a class="el" href="libmtp_8c_source.html#l04817">LIBMTP_Get_Track_To_Handler()</a>.</p>

</div>
</div>
<a class="anchor" id="ga0d890b8c6b771e6e29055bcd062c8bc9"></a><!-- doxytag: member="libmtp.h::LIBMTP_Get_Filelisting" ref="ga0d890b8c6b771e6e29055bcd062c8bc9" args="(LIBMTP_mtpdevice_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a>* LIBMTP_Get_Filelisting </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>THIS FUNCTION IS DEPRECATED. PLEASE UPDATE YOUR CODE IN ORDER NOT TO USE IT. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__files.html#ga701850b1f5e7d52694aa3eefa1a3582d">LIBMTP_Get_Filelisting_With_Callback()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8c_source.html#l03706">LIBMTP_Get_Filelisting_With_Callback()</a>.</p>

</div>
</div>
<a class="anchor" id="ga701850b1f5e7d52694aa3eefa1a3582d"></a><!-- doxytag: member="libmtp.h::LIBMTP_Get_Filelisting_With_Callback" ref="ga701850b1f5e7d52694aa3eefa1a3582d" args="(LIBMTP_mtpdevice_t *, LIBMTP_progressfunc_t const, void const *const)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a>* LIBMTP_Get_Filelisting_With_Callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#ga5d7782ad666c4c73186a8dce8ddda207">LIBMTP_progressfunc_t</a> const &nbsp;</td>
          <td class="paramname"> <em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void const *const &nbsp;</td>
          <td class="paramname"> <em>data</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 returns a long list of all files available on the current MTP device. Folders will not be returned, but abstract entities like playlists and albums will show up as "files". Typical usage:</p>
<pre>
 LIBMTP_file_t *filelist;</pre><pre> filelist = LIBMTP_Get_Filelisting_With_Callback(device, callback, data);
 while (filelist != NULL) {
   LIBMTP_file_t *tmp;</pre><pre>   // Do something on each element in the list here...
   tmp = filelist;
   filelist = filelist-&gt;next;
   LIBMTP_destroy_file_t(tmp);
 }
 </pre><p>If you want to group your file listing by storage (per storage unit) or arrange files into folders, you must dereference the <code>storage_id</code> and/or <code>parent_id</code> field of the returned <code>LIBMTP_file_t</code> struct. To arrange by folders or files you typically have to create the proper trees by calls to <code><a class="el" href="group__basic.html#ga7a72804e7a444ca4f185f078369c41b1">LIBMTP_Get_Storage()</a></code> and/or <code><a class="el" href="group__folders.html#ga37f9714e570baccaf7af42070ad3025f">LIBMTP_Get_Folder_List()</a></code> first.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device to get the file listing for. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>callback</em>&nbsp;</td><td>a function to be called during the tracklisting retrieveal for displaying progress bars etc, or NULL if you don't want any callbacks. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>a user-defined pointer that is passed along to the <code>progress</code> function in order to pass along some user defined data to the progress updates. If not used, set this to NULL. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a list of files that can be followed using the <code>next</code> field of the <code>LIBMTP_file_t</code> data structure. Each of the metadata tags must be freed after use, and may contain only partial metadata information, i.e. one or several fields may be NULL or 0. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__files.html#gaf93ae9da83db3182e9aac2753a899b86">LIBMTP_Get_Filemetadata()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00630">LIBMTP_file_struct::filename</a>, <a class="el" href="libmtp_8h_source.html#l00631">LIBMTP_file_struct::filesize</a>, <a class="el" href="libmtp_8h_source.html#l00633">LIBMTP_file_struct::filetype</a>, <a class="el" href="libmtp_8h_source.html#l00627">LIBMTP_file_struct::item_id</a>, <a class="el" href="libmtp_8c_source.html#l03618">LIBMTP_new_file_t()</a>, <a class="el" href="libmtp_8h_source.html#l00632">LIBMTP_file_struct::modificationdate</a>, <a class="el" href="libmtp_8h_source.html#l00634">LIBMTP_file_struct::next</a>, <a class="el" href="libmtp_8h_source.html#l00575">LIBMTP_mtpdevice_struct::object_bitsize</a>, <a class="el" href="libmtp_8h_source.html#l00580">LIBMTP_mtpdevice_struct::params</a>, <a class="el" href="libmtp_8h_source.html#l00628">LIBMTP_file_struct::parent_id</a>, <a class="el" href="libmtp_8h_source.html#l00629">LIBMTP_file_struct::storage_id</a>, and <a class="el" href="libmtp_8h_source.html#l00585">LIBMTP_mtpdevice_struct::usbinfo</a>.</p>

<p>Referenced by <a class="el" href="libmtp_8c_source.html#l03658">LIBMTP_Get_Filelisting()</a>.</p>

</div>
</div>
<a class="anchor" id="gaf93ae9da83db3182e9aac2753a899b86"></a><!-- doxytag: member="libmtp.h::LIBMTP_Get_Filemetadata" ref="gaf93ae9da83db3182e9aac2753a899b86" args="(LIBMTP_mtpdevice_t *, uint32_t const)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a>* LIBMTP_Get_Filemetadata </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t const &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 retrieves the metadata for a single file off the device.</p>
<p>Do not call this function repeatedly! The file handles are linearly searched O(n) and the call may involve (slow) USB traffic, so use <code><a class="el" href="group__files.html#ga0d890b8c6b771e6e29055bcd062c8bc9">LIBMTP_Get_Filelisting()</a></code> and cache the file, preferably as an efficient data structure such as a hash list.</p>
<p>Incidentally this function will return metadata for a folder (association) as well, but this is not a proper use of it, it is intended for file manipulation, not folder manipulation.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device to get the file metadata from. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>fileid</em>&nbsp;</td><td>the object ID of the file that you want the metadata for. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a metadata entry on success or NULL on failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__files.html#ga0d890b8c6b771e6e29055bcd062c8bc9">LIBMTP_Get_Filelisting()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8c_source.html#l03618">LIBMTP_new_file_t()</a>, <a class="el" href="libmtp_8h_source.html#l00575">LIBMTP_mtpdevice_struct::object_bitsize</a>, and <a class="el" href="libmtp_8h_source.html#l00580">LIBMTP_mtpdevice_struct::params</a>.</p>

<p>Referenced by <a class="el" href="libmtp_8c_source.html#l05278">LIBMTP_Send_File_From_File_Descriptor()</a>, <a class="el" href="libmtp_8c_source.html#l05382">LIBMTP_Send_File_From_Handler()</a>, and <a class="el" href="libmtp_8c_source.html#l06407">LIBMTP_Set_Object_Filename()</a>.</p>

</div>
</div>
<a class="anchor" id="ga9d920e6a6a80d9497076798c0f54ce34"></a><!-- doxytag: member="libmtp.h::LIBMTP_Get_Filetype_Description" ref="ga9d920e6a6a80d9497076798c0f54ce34" args="(LIBMTP_filetype_t)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char const* LIBMTP_Get_Filetype_Description </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga34d45fa6ab19cc024029d239250a8c64">LIBMTP_filetype_t</a>&nbsp;</td>
          <td class="paramname"> <em>intype</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This helper function returns a textual description for a libmtp file type to be used in dialog boxes etc. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>intype</em>&nbsp;</td><td>the libmtp internal filetype to get a description for. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a string representing the filetype, this must <b>NOT</b> be free():ed by the caller! </dd></dl>

<p>References <a class="el" href="libmtp_8c_source.html#l00082">filemap_struct::description</a>, and <a class="el" href="libmtp_8c_source.html#l00083">filemap_struct::id</a>.</p>

</div>
</div>
<a class="anchor" id="ga0de960b7e44e29d706699251972a5f9f"></a><!-- doxytag: member="libmtp.h::LIBMTP_Get_Representative_Sample" ref="ga0de960b7e44e29d706699251972a5f9f" args="(LIBMTP_mtpdevice_t *, uint32_t const, LIBMTP_filesampledata_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int LIBMTP_Get_Representative_Sample </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t const &nbsp;</td>
          <td class="paramname"> <em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structLIBMTP__filesampledata__struct.html">LIBMTP_filesampledata_t</a> *&nbsp;</td>
          <td class="paramname"> <em>sampledata</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 routine gets representative sample data for an object. This uses the RepresentativeSampleData property of the album, if the device supports it. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device which the object is on. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>unique id of the object to get data for. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pointer</em>&nbsp;</td><td>to LIBMTP_filesampledata_t struct to receive data </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, any other value means failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__files.html#gabd4c4d6ec90a27929336983f78f590f3">LIBMTP_Send_Representative_Sample()</a> </dd>
<dd>
<a class="el" href="group__files.html#gad4f872c85dfbe0dc870edbc1ec1ddedf">LIBMTP_Get_Representative_Sample_Format()</a> </dd>
<dd>
<a class="el" href="group__albums.html#ga588192a48fdfc772dfe02a9c54b94109">LIBMTP_Create_New_Album()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00716">LIBMTP_filesampledata_struct::data</a>, <a class="el" href="libmtp_8h_source.html#l00713">LIBMTP_filesampledata_struct::duration</a>, <a class="el" href="libmtp_8h_source.html#l00714">LIBMTP_filesampledata_struct::filetype</a>, <a class="el" href="libmtp_8h_source.html#l00712">LIBMTP_filesampledata_struct::height</a>, <a class="el" href="libmtp_8h_source.html#l00580">LIBMTP_mtpdevice_struct::params</a>, <a class="el" href="libmtp_8h_source.html#l00715">LIBMTP_filesampledata_struct::size</a>, and <a class="el" href="libmtp_8h_source.html#l00711">LIBMTP_filesampledata_struct::width</a>.</p>

</div>
</div>
<a class="anchor" id="gad4f872c85dfbe0dc870edbc1ec1ddedf"></a><!-- doxytag: member="libmtp.h::LIBMTP_Get_Representative_Sample_Format" ref="gad4f872c85dfbe0dc870edbc1ec1ddedf" args="(LIBMTP_mtpdevice_t *, LIBMTP_filetype_t const, LIBMTP_filesampledata_t **)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int LIBMTP_Get_Representative_Sample_Format </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#ga34d45fa6ab19cc024029d239250a8c64">LIBMTP_filetype_t</a> const &nbsp;</td>
          <td class="paramname"> <em>filetype</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structLIBMTP__filesampledata__struct.html">LIBMTP_filesampledata_t</a> **&nbsp;</td>
          <td class="paramname"> <em>sample</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 routine figures out whether a certain filetype supports representative samples (small thumbnail images) or not. This typically applies to JPEG files, MP3 files and Album abstract playlists, but in theory any filetype could support representative samples. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device which is to be examined. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>filetype</em>&nbsp;</td><td>the fileype to examine, and return the representative sample properties for. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>sample</em>&nbsp;</td><td>this will contain a new sample type with the fields filled in with suitable default values. For example, the supported sample type will be set, the supported height and width will be set to max values if it is an image sample, and duration will also be given some suitable default value which should not be exceeded on audio samples. If the device does not support samples for this filetype, this pointer will be NULL. If it is not NULL, the user must destroy this struct with <code><a class="el" href="group__files.html#gaea06c7244116bd2eb036ccda03e0b714">LIBMTP_destroy_filesampledata_t()</a></code> after use. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, any other value means failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__files.html#gabd4c4d6ec90a27929336983f78f590f3">LIBMTP_Send_Representative_Sample()</a> </dd>
<dd>
<a class="el" href="group__albums.html#ga588192a48fdfc772dfe02a9c54b94109">LIBMTP_Create_New_Album()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00713">LIBMTP_filesampledata_struct::duration</a>, <a class="el" href="libmtp_8h_source.html#l00714">LIBMTP_filesampledata_struct::filetype</a>, <a class="el" href="libmtp_8h_source.html#l00712">LIBMTP_filesampledata_struct::height</a>, <a class="el" href="libmtp_8c_source.html#l07934">LIBMTP_new_filesampledata_t()</a>, <a class="el" href="libmtp_8h_source.html#l00580">LIBMTP_mtpdevice_struct::params</a>, <a class="el" href="libmtp_8h_source.html#l00715">LIBMTP_filesampledata_struct::size</a>, and <a class="el" href="libmtp_8h_source.html#l00711">LIBMTP_filesampledata_struct::width</a>.</p>

</div>
</div>
<a class="anchor" id="ga731f7260b77aec5b77c72dd9dd8165ce"></a><!-- doxytag: member="libmtp.h::LIBMTP_new_file_t" ref="ga731f7260b77aec5b77c72dd9dd8165ce" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a>* LIBMTP_new_file_t </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This creates a new file metadata structure and allocates memory for it. Notice that if you add strings to this structure they will be freed by the corresponding <code>LIBMTP_destroy_file_t</code> operation later, so be careful of using strdup() when assigning strings, e.g.:</p>
<pre>
 LIBMTP_file_t *file = <a class="el" href="group__files.html#ga731f7260b77aec5b77c72dd9dd8165ce">LIBMTP_new_file_t()</a>;
 file-&gt;filename = strdup(namestr);
 ....
 LIBMTP_destroy_file_t(file);
 </pre><dl class="return"><dt><b>Returns:</b></dt><dd>a pointer to the newly allocated metadata structure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__files.html#ga0fed9e491256fb80b323bdd030b162e9">LIBMTP_destroy_file_t()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00630">LIBMTP_file_struct::filename</a>.</p>

<p>Referenced by <a class="el" href="libmtp_8c_source.html#l03706">LIBMTP_Get_Filelisting_With_Callback()</a>, and <a class="el" href="libmtp_8c_source.html#l03860">LIBMTP_Get_Filemetadata()</a>.</p>

</div>
</div>
<a class="anchor" id="ga57b4aae2dc47be67571b8fd83f4a3c67"></a><!-- doxytag: member="libmtp.h::LIBMTP_new_filesampledata_t" ref="ga57b4aae2dc47be67571b8fd83f4a3c67" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structLIBMTP__filesampledata__struct.html">LIBMTP_filesampledata_t</a>* LIBMTP_new_filesampledata_t </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This creates a new sample data metadata structure and allocates memory for it. Notice that if you add strings to this structure they will be freed by the corresponding <code>LIBMTP_destroy_sampledata_t</code> operation later, so be careful of using strdup() when assigning strings.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>a pointer to the newly allocated metadata structure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd>LIBMTP_destroy_sampledata_t() </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00712">LIBMTP_filesampledata_struct::height</a>.</p>

<p>Referenced by <a class="el" href="libmtp_8c_source.html#l07986">LIBMTP_Get_Representative_Sample_Format()</a>.</p>

</div>
</div>
<a class="anchor" id="ga552e760a429b0e47a593b8ade20bb763"></a><!-- doxytag: member="libmtp.h::LIBMTP_Send_File_From_File" ref="ga552e760a429b0e47a593b8ade20bb763" args="(LIBMTP_mtpdevice_t *, char const *const, LIBMTP_file_t *const, LIBMTP_progressfunc_t const, void const *const)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int LIBMTP_Send_File_From_File </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *const &nbsp;</td>
          <td class="paramname"> <em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a> *const &nbsp;</td>
          <td class="paramname"> <em>filedata</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#ga5d7782ad666c4c73186a8dce8ddda207">LIBMTP_progressfunc_t</a> const &nbsp;</td>
          <td class="paramname"> <em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void const *const &nbsp;</td>
          <td class="paramname"> <em>data</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 local file to an MTP device. A filename and a set of metadata must be given as input. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device to send the track to. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>path</em>&nbsp;</td><td>the filename of a local file which will be sent. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>filedata</em>&nbsp;</td><td>a file metadata set to be written along with the file. After this call the field <code>filedata-&gt;item_id</code> will contain the new file ID. Other fields such as the <code>filedata-&gt;filename</code>, <code>filedata-&gt;parent_id</code> or <code>filedata-&gt;storage_id</code> may also change during this operation due to device restrictions, so do not rely on the contents of this struct to be preserved in any way. </p>
<ul>
<li>
<code>filedata-&gt;parent_id</code> should be set to the parent (e.g. folder) to store this file in. If this is 0, the file will be stored in the root folder. </li>
<li>
<code>filedata-&gt;storage_id</code> should be set to the desired storage (e.g. memory card or whatever your device presents) to store this file in. Setting this to 0 will store the file on the primary storage. </li>
</ul>
</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>callback</em>&nbsp;</td><td>a progress indicator function or NULL to ignore. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>a user-defined pointer that is passed along to the <code>progress</code> function in order to pass along some user defined data to the progress updates. If not used, set this to NULL. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the transfer was successful, any other value means failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__files.html#ga1784d5bd971a354c6d7ec10d6e532ccf">LIBMTP_Send_File_From_File_Descriptor()</a> </dd>
<dd>
<a class="el" href="group__objects.html#gac867594319fa48a0d6077d17aaf66222">LIBMTP_Delete_Object()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8c_source.html#l05278">LIBMTP_Send_File_From_File_Descriptor()</a>.</p>

</div>
</div>
<a class="anchor" id="ga1784d5bd971a354c6d7ec10d6e532ccf"></a><!-- doxytag: member="libmtp.h::LIBMTP_Send_File_From_File_Descriptor" ref="ga1784d5bd971a354c6d7ec10d6e532ccf" args="(LIBMTP_mtpdevice_t *, int const, LIBMTP_file_t *const, LIBMTP_progressfunc_t const, void const *const)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int LIBMTP_Send_File_From_File_Descriptor </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int const &nbsp;</td>
          <td class="paramname"> <em>fd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a> *const &nbsp;</td>
          <td class="paramname"> <em>filedata</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#ga5d7782ad666c4c73186a8dce8ddda207">LIBMTP_progressfunc_t</a> const &nbsp;</td>
          <td class="paramname"> <em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void const *const &nbsp;</td>
          <td class="paramname"> <em>data</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 generic file from a file descriptor to an MTP device. A filename and a set of metadata must be given as input.</p>
<p>This can potentially be used for sending in a stream of unknown length. Send music files with <code><a class="el" href="group__tracks.html#ga982264bb96f5e90be2cba708346e8a1c">LIBMTP_Send_Track_From_File_Descriptor()</a></code></p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device to send the file to. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>fd</em>&nbsp;</td><td>the filedescriptor for a local file which will be sent. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>filedata</em>&nbsp;</td><td>a file metadata set to be written along with the file. After this call the field <code>filedata-&gt;item_id</code> will contain the new file ID. Other fields such as the <code>filedata-&gt;filename</code>, <code>filedata-&gt;parent_id</code> or <code>filedata-&gt;storage_id</code> may also change during this operation due to device restrictions, so do not rely on the contents of this struct to be preserved in any way. </p>
<ul>
<li>
<code>filedata-&gt;parent_id</code> should be set to the parent (e.g. folder) to store this file in. If this is 0, the file will be stored in the root folder. </li>
<li>
<code>filedata-&gt;storage_id</code> should be set to the desired storage (e.g. memory card or whatever your device presents) to store this file in. Setting this to 0 will store the file on the primary storage. </li>
</ul>
</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>callback</em>&nbsp;</td><td>a progress indicator function or NULL to ignore. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>a user-defined pointer that is passed along to the <code>progress</code> function in order to pass along some user defined data to the progress updates. If not used, set this to NULL. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the transfer was successful, any other value means failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__files.html#ga552e760a429b0e47a593b8ade20bb763">LIBMTP_Send_File_From_File()</a> </dd>
<dd>
<a class="el" href="group__tracks.html#ga982264bb96f5e90be2cba708346e8a1c">LIBMTP_Send_Track_From_File_Descriptor()</a> </dd>
<dd>
<a class="el" href="group__objects.html#gac867594319fa48a0d6077d17aaf66222">LIBMTP_Delete_Object()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00631">LIBMTP_file_struct::filesize</a>, <a class="el" href="libmtp_8h_source.html#l00627">LIBMTP_file_struct::item_id</a>, <a class="el" href="libmtp_8c_source.html#l03642">LIBMTP_destroy_file_t()</a>, <a class="el" href="libmtp_8c_source.html#l03860">LIBMTP_Get_Filemetadata()</a>, <a class="el" href="libmtp_8h_source.html#l00580">LIBMTP_mtpdevice_struct::params</a>, <a class="el" href="libmtp_8h_source.html#l00628">LIBMTP_file_struct::parent_id</a>, <a class="el" href="libmtp_8h_source.html#l00629">LIBMTP_file_struct::storage_id</a>, and <a class="el" href="libmtp_8h_source.html#l00585">LIBMTP_mtpdevice_struct::usbinfo</a>.</p>

<p>Referenced by <a class="el" href="libmtp_8c_source.html#l05200">LIBMTP_Send_File_From_File()</a>, and <a class="el" href="libmtp_8c_source.html#l04997">LIBMTP_Send_Track_From_File_Descriptor()</a>.</p>

</div>
</div>
<a class="anchor" id="gab2c26272deb5ba7a18644282ebc12782"></a><!-- doxytag: member="libmtp.h::LIBMTP_Send_File_From_Handler" ref="gab2c26272deb5ba7a18644282ebc12782" args="(LIBMTP_mtpdevice_t *, MTPDataGetFunc, void *, LIBMTP_file_t *const, LIBMTP_progressfunc_t const, void const *const)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int LIBMTP_Send_File_From_Handler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#gac98a3ffb03ff220f92953e6d92f33146">MTPDataGetFunc</a>&nbsp;</td>
          <td class="paramname"> <em>get_func</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>priv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a> *const &nbsp;</td>
          <td class="paramname"> <em>filedata</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#ga5d7782ad666c4c73186a8dce8ddda207">LIBMTP_progressfunc_t</a> const &nbsp;</td>
          <td class="paramname"> <em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void const *const &nbsp;</td>
          <td class="paramname"> <em>data</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 generic file from a handler function to an MTP device. A filename and a set of metadata must be given as input.</p>
<p>This can potentially be used for sending in a stream of unknown length. Send music files with <code><a class="el" href="group__tracks.html#gad571c96d1d45dfb824b466da3715dccd">LIBMTP_Send_Track_From_Handler()</a></code></p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device to send the file to. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>get_func</em>&nbsp;</td><td>the function to call to get data to write </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>priv</em>&nbsp;</td><td>a user-defined pointer that is passed along to <code>get_func</code>. If not used, this is set to NULL. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>filedata</em>&nbsp;</td><td>a file metadata set to be written along with the file. After this call the field <code>filedata-&gt;item_id</code> will contain the new file ID. Other fields such as the <code>filedata-&gt;filename</code>, <code>filedata-&gt;parent_id</code> or <code>filedata-&gt;storage_id</code> may also change during this operation due to device restrictions, so do not rely on the contents of this struct to be preserved in any way. </p>
<ul>
<li>
<code>filedata-&gt;parent_id</code> should be set to the parent (e.g. folder) to store this file in. If this is 0, the file will be stored in the root folder. </li>
<li>
<code>filedata-&gt;storage_id</code> should be set to the desired storage (e.g. memory card or whatever your device presents) to store this file in. Setting this to 0 will store the file on the primary storage. </li>
</ul>
</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>callback</em>&nbsp;</td><td>a progress indicator function or NULL to ignore. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>a user-defined pointer that is passed along to the <code>progress</code> function in order to pass along some user defined data to the progress updates. If not used, set this to NULL. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the transfer was successful, any other value means failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__files.html#ga552e760a429b0e47a593b8ade20bb763">LIBMTP_Send_File_From_File()</a> </dd>
<dd>
<a class="el" href="group__tracks.html#ga982264bb96f5e90be2cba708346e8a1c">LIBMTP_Send_Track_From_File_Descriptor()</a> </dd>
<dd>
<a class="el" href="group__objects.html#gac867594319fa48a0d6077d17aaf66222">LIBMTP_Delete_Object()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00631">LIBMTP_file_struct::filesize</a>, <a class="el" href="libmtp_8h_source.html#l00627">LIBMTP_file_struct::item_id</a>, <a class="el" href="libmtp_8c_source.html#l03642">LIBMTP_destroy_file_t()</a>, <a class="el" href="libmtp_8c_source.html#l03860">LIBMTP_Get_Filemetadata()</a>, <a class="el" href="libmtp_8h_source.html#l00580">LIBMTP_mtpdevice_struct::params</a>, <a class="el" href="libmtp_8h_source.html#l00628">LIBMTP_file_struct::parent_id</a>, <a class="el" href="libmtp_8h_source.html#l00629">LIBMTP_file_struct::storage_id</a>, and <a class="el" href="libmtp_8h_source.html#l00585">LIBMTP_mtpdevice_struct::usbinfo</a>.</p>

<p>Referenced by <a class="el" href="libmtp_8c_source.html#l05101">LIBMTP_Send_Track_From_Handler()</a>.</p>

</div>
</div>
<a class="anchor" id="gabd4c4d6ec90a27929336983f78f590f3"></a><!-- doxytag: member="libmtp.h::LIBMTP_Send_Representative_Sample" ref="gabd4c4d6ec90a27929336983f78f590f3" args="(LIBMTP_mtpdevice_t *, uint32_t const, LIBMTP_filesampledata_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int LIBMTP_Send_Representative_Sample </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t const &nbsp;</td>
          <td class="paramname"> <em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structLIBMTP__filesampledata__struct.html">LIBMTP_filesampledata_t</a> *&nbsp;</td>
          <td class="paramname"> <em>sampledata</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 routine sends representative sample data for an object. This uses the RepresentativeSampleData property of the album, if the device supports it. The data should be of a format acceptable to the player (for iRiver and Creative, this seems to be JPEG) and must not be too large. (for a Creative, max seems to be about 20KB.) Check by calling <a class="el" href="group__files.html#gad4f872c85dfbe0dc870edbc1ec1ddedf">LIBMTP_Get_Representative_Sample_Format()</a> to get maximum size, dimensions, etc.. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device which the object is on. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>unique id of the object to set artwork for. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pointer</em>&nbsp;</td><td>to LIBMTP_filesampledata_t struct containing data </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, any other value means failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__files.html#ga0de960b7e44e29d706699251972a5f9f">LIBMTP_Get_Representative_Sample()</a> </dd>
<dd>
<a class="el" href="group__files.html#gad4f872c85dfbe0dc870edbc1ec1ddedf">LIBMTP_Get_Representative_Sample_Format()</a> </dd>
<dd>
<a class="el" href="group__albums.html#ga588192a48fdfc772dfe02a9c54b94109">LIBMTP_Create_New_Album()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00716">LIBMTP_filesampledata_struct::data</a>, <a class="el" href="libmtp_8h_source.html#l00713">LIBMTP_filesampledata_struct::duration</a>, <a class="el" href="libmtp_8h_source.html#l00714">LIBMTP_filesampledata_struct::filetype</a>, <a class="el" href="libmtp_8h_source.html#l00712">LIBMTP_filesampledata_struct::height</a>, <a class="el" href="libmtp_8h_source.html#l00580">LIBMTP_mtpdevice_struct::params</a>, <a class="el" href="libmtp_8h_source.html#l00715">LIBMTP_filesampledata_struct::size</a>, <a class="el" href="libmtp_8h_source.html#l00585">LIBMTP_mtpdevice_struct::usbinfo</a>, and <a class="el" href="libmtp_8h_source.html#l00711">LIBMTP_filesampledata_struct::width</a>.</p>

</div>
</div>
<a class="anchor" id="ga15c6f7bf338e9da55dc6317f6b35d749"></a><!-- doxytag: member="libmtp.h::LIBMTP_Set_File_Name" ref="ga15c6f7bf338e9da55dc6317f6b35d749" args="(LIBMTP_mtpdevice_t *, LIBMTP_file_t *, const char *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int LIBMTP_Set_File_Name </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structLIBMTP__file__struct.html">LIBMTP_file_t</a> *&nbsp;</td>
          <td class="paramname"> <em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>newname</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 renames a single file. This simply means that the PTP_OPC_ObjectFileName property is updated, if this is supported by the device.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device that contains the file. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>file</em>&nbsp;</td><td>the file metadata of the file to rename. On success, the filename member is updated. Be aware, that this name can be different than newname depending of device restrictions. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>newname</em>&nbsp;</td><td>the new filename for this object. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, any other value means failure. </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00630">LIBMTP_file_struct::filename</a>, <a class="el" href="libmtp_8h_source.html#l00633">LIBMTP_file_struct::filetype</a>, and <a class="el" href="libmtp_8h_source.html#l00627">LIBMTP_file_struct::item_id</a>.</p>

</div>
</div>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
</body>
</html>