git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

gbdk-support/gbcompress/zx0/zx0_expand.h

      1 /*
      2  * expand.h - decompressor definitions
      3  *
      4  * Copyright (C) 2021 Emmanuel Marty
      5  *
      6  * This software is provided 'as-is', without any express or implied
      7  * warranty.  In no event will the authors be held liable for any damages
      8  * arising from the use of this software.
      9  *
     10  * Permission is granted to anyone to use this software for any purpose,
     11  * including commercial applications, and to alter it and redistribute it
     12  * freely, subject to the following restrictions:
     13  *
     14  * 1. The origin of this software must not be misrepresented; you must not
     15  *    claim that you wrote the original software. If you use this software
     16  *    in a product, an acknowledgment in the product documentation would be
     17  *    appreciated but is not required.
     18  * 2. Altered source versions must be plainly marked as such, and must not be
     19  *    misrepresented as being the original software.
     20  * 3. This notice may not be removed or altered from any source distribution.
     21  */
     22 
     23 /*
     24  * Uses the libdivsufsort library Copyright (c) 2003-2008 Yuta Mori
     25  *
     26  * Implements the ZX0 encoding designed by Einar Saukas. https://github.com/einar-saukas/ZX0
     27  * Also inspired by Charles Bloom's compression blog. http://cbloomrants.blogspot.com/
     28  *
     29  */
     30 
     31 #ifndef _EXPAND_H
     32 #define _EXPAND_H
     33 
     34 #include <stdlib.h>
     35 
     36 #ifdef __cplusplus
     37 extern "C" {
     38 #endif
     39 
     40 /**
     41  * Get maximum decompressed size of compressed data
     42  *
     43  * @param pInputData compressed data
     44  * @param nInputSize compressed size in bytes
     45  * @param nFlags compression flags (set to FLG_IS_INVERTED)
     46  *
     47  * @return maximum decompressed size
     48  */
     49 size_t salvador_get_max_decompressed_size(const unsigned char *pInputData, size_t nInputSize, const unsigned int nFlags);
     50 
     51 /**
     52  * Decompress data in memory
     53  *
     54  * @param pInputData compressed data
     55  * @param pOutData buffer for decompressed data
     56  * @param nInputSize compressed size in bytes
     57  * @param nMaxOutBufferSize maximum capacity of decompression buffer
     58  * @param nDictionarySize size of dictionary in front of input data (0 for none)
     59  * @param nFlags compression flags (set to FLG_IS_INVERTED)
     60  *
     61  * @return actual decompressed size, or -1 for error
     62  */
     63 size_t salvador_decompress(const unsigned char *pInputData, unsigned char *pOutData, size_t nInputSize, size_t nMaxOutBufferSize, size_t nDictionarySize, const unsigned int nFlags);
     64 
     65 #ifdef __cplusplus
     66 }
     67 #endif
     68 
     69 #endif /* _EXPAND_H */

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.