This is a description of the zlib included in the CTR-SDK as well as a description of how to use zlib.
zlib is an open-source library for compressing and decompressing data using the deflate algorithm. It is distributed from http://www.zlib.net/.
The CTR-SDK uses a version of zlib, 1.2.7, modified to be compatible with the CTR-SDK.
The modified areas are listed below.
fcntl.h and sys/types.h, are not included.Z_PREFIX is enabled, the prefix is changed from z to nncxZlib.
All files that begin with gz are excluded from compilations.
The zlib included in the CTR-SDK can be used in the following two ways.
cx Library
The following functions in the cx library use zlib internally. You can easily use zlib by using these functions.
nn::cx::CompressDeflate nn::cx::CompressZlib nn::cx::CompressGzip nn::cx::UncompressDeflate nn::cx::UncompressZlib nn::cx::UncompressGzip nn::cx::InitUncompContextDeflate nn::cx::InitUncompContextZlib nn::cx::InitUncompContextGzip nn::cx::ReadUncompDeflate nn::cx::ReadUncompZlib nn::cx::ReadUncompGzip
To use these functions, you need to include the nn/cx.h file.
For those who understand the zlib API, you can use the original zlib API. However, gzip file access functions cannot be used.
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.
For this reason, to use the zlib API you must include the zlib.h file in the source code and then add either libzlib.fast.a or libzlib.small.a to the link targets.
When using the SDK build system, add libzlib to the LIBS variable with OMakefile.
LIBS += libzlib
CONFIDENTIAL