Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/openclibzheader_8h.html
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 13 Aug 2010 16:47:46 +0100
changeset 14 578be2adaf3e
parent 6 43e37759235e
permissions -rw-r--r--
Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582

<!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>TB9.2 Example Applications: examples/PIPS/openclibz/inc/openclibzheader.h File Reference</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="contents">
<h1>examples/PIPS/openclibz/inc/openclibzheader.h File Reference</h1>
<p><a href="openclibzheader_8h_source.html">Go to the source code of this file.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af0358042fe986b270acfb8e365b2811e"></a><!-- doxytag: member="openclibzheader.h::GZ_SUFFIX" ref="af0358042fe986b270acfb8e365b2811e" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>GZ_SUFFIX</b>&nbsp;&nbsp;&nbsp;&quot;.gz&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5a10308ce506a5645ae1e8b5e18dfded"></a><!-- doxytag: member="openclibzheader.h::SUFFIX_LEN" ref="a5a10308ce506a5645ae1e8b5e18dfded" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>SUFFIX_LEN</b>&nbsp;&nbsp;&nbsp;(sizeof(GZ_SUFFIX)-1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad974fe981249f5e84fbf1683b012c9f8"></a><!-- doxytag: member="openclibzheader.h::BUFLEN" ref="ad974fe981249f5e84fbf1683b012c9f8" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>BUFLEN</b>&nbsp;&nbsp;&nbsp;16384</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afd709f201d7643c3909621f620ea648a"></a><!-- doxytag: member="openclibzheader.h::MAX_NAME_LEN" ref="afd709f201d7643c3909621f620ea648a" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>MAX_NAME_LEN</b>&nbsp;&nbsp;&nbsp;1024</td></tr>
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="openclibzheader_8h.html#ac31e38792dbbfc5e26d9dbccb33efe3d">StringCompress</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void Error&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="openclibzheader_8h.html#a31ef91dc889daf46c11b18576b77347c">OF</a> ((const char *msg))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void GzCompress&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="openclibzheader_8h.html#a3df66c06b3bc611be591987944cab8ff">OF</a> ((FILE *in, gzFile out))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void GzUnCompress&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="openclibzheader_8h.html#ac579673f62bd536288713fe045aa1350">OF</a> ((gzFile in, FILE *out))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void FileCompress&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="openclibzheader_8h.html#a4e879e61d2919fd75985cf9b06a566c6">OF</a> ((char *file, char *mode))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void FileUnCompress&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="openclibzheader_8h.html#abf7b4bee7cdd5520ba5587c635c9b2b2">OF</a> ((char *file))</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>

<p>Definition in file <a class="el" href="openclibzheader_8h_source.html">openclibzheader.h</a>.</p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ac31e38792dbbfc5e26d9dbccb33efe3d"></a><!-- doxytag: member="openclibzheader.h::StringCompress" ref="ac31e38792dbbfc5e26d9dbccb33efe3d" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void StringCompress </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Compresses the string This function compresses the string entered by the user and shows the compressed string and then decompressess it Actually This function will show the content on the screen and demonstarte how strings can be compressed </p>

<p>Definition at line <a class="el" href="compress_8c_source.html#l00174">174</a> of file <a class="el" href="compress_8c_source.html">compress.c</a>.</p>

</div>
</div>
<a class="anchor" id="a31ef91dc889daf46c11b18576b77347c"></a><!-- doxytag: member="openclibzheader.h::OF" ref="a31ef91dc889daf46c11b18576b77347c" args="((const char *msg))" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Error OF </td>
          <td>(</td>
          <td class="paramtype">(const char *msg)&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>In case of any error display the error message</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>msg</em>&nbsp;</td><td>will be displayed to the user</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>No return code ,application will terminate after displaying the error message. </dd></dl>

</div>
</div>
<a class="anchor" id="a3df66c06b3bc611be591987944cab8ff"></a><!-- doxytag: member="openclibzheader.h::OF" ref="a3df66c06b3bc611be591987944cab8ff" args="((FILE *in, gzFile out))" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GzCompress OF </td>
          <td>(</td>
          <td class="paramtype">(FILE *in, gzFile out)&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Compresses the input file First tries to compress using GzCompressMmap ,But if it fails it tries normal technique</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>in</em>&nbsp;</td><td>is the name of input file . </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>out</em>&nbsp;</td><td>is the name of output file. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a Symbian OS error code. </dd></dl>

</div>
</div>
<a class="anchor" id="ac579673f62bd536288713fe045aa1350"></a><!-- doxytag: member="openclibzheader.h::OF" ref="ac579673f62bd536288713fe045aa1350" args="((gzFile in, FILE *out))" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GzUnCompress OF </td>
          <td>(</td>
          <td class="paramtype">(gzFile in, FILE *out)&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>GzCompressMmap function compresses the file using mmap technique Compression can be done in a single step using mmap but it requires enough large buffers. I have implemented my code such that, EvenIn case of mmap failure (because of shortage of buffer space) It compresses using normal technique.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>in</em>&nbsp;</td><td>the name of input file. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>out</em>&nbsp;</td><td>is the name of output file. UnCompresses the file using libz api's</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>in</em>&nbsp;</td><td>is the name of input file . </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>out</em>&nbsp;</td><td>is the name of output file. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a4e879e61d2919fd75985cf9b06a566c6"></a><!-- doxytag: member="openclibzheader.h::OF" ref="a4e879e61d2919fd75985cf9b06a566c6" args="((char *file, char *mode))" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FileCompress OF </td>
          <td>(</td>
          <td class="paramtype">(char *file, char *mode)&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Compresses the File It creates the output filename . It checkes for the existence of input file. And then it calls GzCompress .</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>is the name of the file to be compressed </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>mode</em>&nbsp;</td><td>is for the technique used for opening the file. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="abf7b4bee7cdd5520ba5587c635c9b2b2"></a><!-- doxytag: member="openclibzheader.h::OF" ref="abf7b4bee7cdd5520ba5587c635c9b2b2" args="((char *file))" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FileUnCompress OF </td>
          <td>(</td>
          <td class="paramtype">(char *file)&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>It generates the output filename . It checks for the existence of the file and then calls GzUnCompress.</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>is the name of the compressed (.gz) file . </td></tr>
  </table>
  </dd>
</dl>

</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>