takashi kadono / Mbed OS Nucleo_446

Dependencies:   ssd1331

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pithy.h Source File

pithy.h

00001 //
00002 //  pithy.h
00003 //  http://github.com/johnezang/pithy
00004 //  Licensed under the terms of the BSD License, as specified below.
00005 //
00006 
00007 /*
00008  Copyright (c) 2011, John Engelhart
00009 
00010  All rights reserved.
00011 
00012  Redistribution and use in source and binary forms, with or without
00013  modification, are permitted provided that the following conditions are met:
00014 
00015  * Redistributions of source code must retain the above copyright
00016  notice, this list of conditions and the following disclaimer.
00017 
00018  * Redistributions in binary form must reproduce the above copyright
00019  notice, this list of conditions and the following disclaimer in the
00020  documentation and/or other materials provided with the distribution.
00021 
00022  * Neither the name of the Zang Industries nor the names of its
00023  contributors may be used to endorse or promote products derived from
00024  this software without specific prior written permission.
00025 
00026  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00027  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00028  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00029  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00030  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00031  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
00032  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00033  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00034  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00035  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00036  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 */
00038 
00039 #include <stdint.h>
00040 #include <stddef.h>
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00046 #ifndef _PITHY_H_
00047 #define _PITHY_H_
00048 
00049 // compressionLevel >= 0 && compressionLevel <= 9.  Values out side this range will be clamped to this range.
00050 size_t pithy_Compress  (const char *uncompressed, size_t uncompressedLength, char *compressedOut,
00051                         size_t compressedOutLength, int compressionLevel);
00052 int    pithy_Decompress(const char *compressed,   size_t compressedLength,   char *decompressedOut,
00053                         size_t decompressedOutLength);
00054 
00055 size_t pithy_MaxCompressedLength(size_t inputLength);
00056 int    pithy_GetDecompressedLength(const char *compressed, size_t compressedLength,
00057                                    size_t *decompressedOutLengthResult);
00058 
00059 #endif // _PITHY_H_
00060 
00061 #ifdef __cplusplus
00062 } // extern "C"
00063 #endif