Mistake on this page?
Report an issue in GitHub or email us
pithy.h
1 //
2 // pithy.h
3 // http://github.com/johnezang/pithy
4 // Licensed under the terms of the BSD License, as specified below.
5 //
6 // SPDX-License-Identifier: BSD-3-Clause
7 
8 /*
9  Copyright (c) 2011, John Engelhart
10 
11  All rights reserved.
12 
13  Redistribution and use in source and binary forms, with or without
14  modification, are permitted provided that the following conditions are met:
15 
16  * Redistributions of source code must retain the above copyright
17  notice, this list of conditions and the following disclaimer.
18 
19  * Redistributions in binary form must reproduce the above copyright
20  notice, this list of conditions and the following disclaimer in the
21  documentation and/or other materials provided with the distribution.
22 
23  * Neither the name of the Zang Industries nor the names of its
24  contributors may be used to endorse or promote products derived from
25  this software without specific prior written permission.
26 
27  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
33  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
35  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
36  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
37  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 */
39 
40 #include <stdint.h>
41 #include <stddef.h>
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 #ifndef _PITHY_H_
48 #define _PITHY_H_
49 
50 // compressionLevel >= 0 && compressionLevel <= 9. Values out side this range will be clamped to this range.
51 size_t pithy_Compress (const char *uncompressed, size_t uncompressedLength, char *compressedOut,
52  size_t compressedOutLength, int compressionLevel);
53 int pithy_Decompress(const char *compressed, size_t compressedLength, char *decompressedOut,
54  size_t decompressedOutLength);
55 
56 size_t pithy_MaxCompressedLength(size_t inputLength);
57 int pithy_GetDecompressedLength(const char *compressed, size_t compressedLength,
58  size_t *decompressedOutLengthResult);
59 
60 #endif // _PITHY_H_
61 
62 #ifdef __cplusplus
63 } // extern "C"
64 #endif
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.