1<?xml version="1.0" encoding="utf-8"?> 2<html><head> 3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 4 <meta http-equiv="Content-Style-Type" content="text/css" /> 5 <title>CTR-SDK API</title> 6 <link rel="stylesheet" href="../css/page.css" type="text/css" /> 7 <style> 8 h4 9 { 10 margin-left: 0.8em; 11 padding-left: 0.3em; 12 border-bottom: solid 1px #4499FF; 13 width: 20em; 14 } 15 code 16 { 17 display: inline; 18 } 19 pre 20 { 21 margin-left: 2em; 22 } 23 </style> 24</head><body> 25 26 <h1>zlib</h1> 27 28 <h2>Overview</h2> 29 <p> 30 This is a description of the zlib included in the CTR-SDK as well as a description of how to use zlib. 31 </p> 32 33 34 <h2>About zlib</h2> 35 <p> 36 zlib is an open-source library for compressing and decompressing data using the deflate algorithm. It is distributed from <a href="http://www.zlib.net/">http://www.zlib.net/</a>. 37 </p> 38 39 40 <h2>The zlib included in the CTR-SDK</h2> 41 <p> 42 The CTR-SDK uses a version of zlib, 1.2.7, modified to be compatible with the CTR-SDK. 43 </p> 44 <p> 45 The modified areas are listed below. 46 </p> 47 <ul> 48 <li>The following two files, <CODE>fcntl.h</CODE> and <CODE>sys/types.h</CODE>, are not included.</li> 49 <li>Padding warnings are suppressed with pragmas.</li> 50 <li>When <CODE>Z_PREFIX</CODE> is enabled, the prefix is changed from <CODE>z</CODE> to <CODE>nncxZlib</CODE>.</li> 51 <li>There is support for detection with CTR MasterEditor.</li> 52 <li>Changed the version number. (Change based on license conditions.)</li> 53 </ul> 54 <p> 55 All files that begin with <CODE>gz</CODE> are excluded from compilations. 56 </p> 57 58 59 <h2>Using zlib</h2> 60 <p> 61 The zlib included in the CTR-SDK can be used in the following two ways. 62 </p> 63 64 <h3>Using via the <CODE>cx</CODE> Library</h3> 65 <p> 66 The following functions in the <CODE>cx</CODE> library use zlib internally. You can easily use zlib by using these functions. 67 </p> 68 <ul> 69 <li><a href="../nn/cx/CompressDeflate.html"><CODE>nn::cx::CompressDeflate</CODE> </a></li> 70 <li><a href="../nn/cx/CompressZlib.html"><CODE>nn::cx::CompressZlib</CODE> </a></li> 71 <li><a href="../nn/cx/CompressGzip.html"><CODE>nn::cx::CompressGzip</CODE> </a></li> 72 <li><a href="../nn/cx/UncompressDeflate.html"><CODE>nn::cx::UncompressDeflate</CODE> </a></li> 73 <li><a href="../nn/cx/UncompressZlib.html"><CODE>nn::cx::UncompressZlib</CODE> </a></li> 74 <li><a href="../nn/cx/UncompressGzip.html"><CODE>nn::cx::UncompressGzip</CODE> </a></li> 75 <li><a href="../nn/cx/InitUncompContextDeflate.html"><CODE>nn::cx::InitUncompContextDeflate</CODE> </a></li> 76 <li><a href="../nn/cx/InitUncompContextZlib.html"><CODE>nn::cx::InitUncompContextZlib</CODE> </a></li> 77 <li><a href="../nn/cx/InitUncompContextGzip.html"><CODE>nn::cx::InitUncompContextGzip</CODE> </a></li> 78 <li><a href="../nn/cx/ReadUncompDeflate.html"><CODE>nn::cx::ReadUncompDeflate</CODE> </a></li> 79 <li><a href="../nn/cx/ReadUncompZlib.html"><CODE>nn::cx::ReadUncompZlib</CODE> </a></li> 80 <li><a href="../nn/cx/ReadUncompGzip.html"><CODE>nn::cx::ReadUncompGzip</CODE> </a></li> 81 </ul> 82 <p> 83 To use these functions, you need to include the <code>nn/cx.h</code> file. 84 </p> 85 86 <h3>Directly using the zlib API</h3> 87 <p> 88 For those who understand the zlib API, you can use the original zlib API. However, gzip file access functions cannot be used. 89 </p> 90 <p> 91 To prevent conflicts with a zlib that may have been prepared for an application, the existing zlib API is not enabled for use by default. <br /> 92 For this reason, to use the zlib API you must include the <code>zlib.h</code> file in the source code and then add either <code>libzlib.fast.a</code> or <code>libzlib.small.a</code> to the link targets. </p> 93 <p> 94 When using the SDK build system, add <code>libzlib</code> to the <code>LIBS</code> variable with <code>OMakefile</code>. 95 </p> 96<pre> 97LIBS += libzlib 98</pre> 99 100 101 <h2>Revision History</h2> 102 <div class="section"> 103 <dl class="history"> 104 <dt>2012/05/25</dt> 105 <dd>Initial version.</dd> 106 </dl> 107 </div> 108 109 110<hr><p>CONFIDENTIAL</p></body></html>