2013-06-05 01:56:07 +00:00
|
|
|
/*
|
|
|
|
exhal / inhal (de)compression routines
|
|
|
|
|
2013-11-15 21:40:53 +00:00
|
|
|
Copyright (c) 2013 Devin Acker
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
|
2013-06-05 01:56:07 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _COMPRESS_H
|
|
|
|
#define _COMPRESS_H
|
|
|
|
|
2013-10-26 18:25:23 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2013-06-05 01:56:07 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#define DATA_SIZE 65536
|
|
|
|
#define RUN_SIZE 32
|
|
|
|
#define LONG_RUN_SIZE 1024
|
|
|
|
|
2013-11-14 03:31:06 +00:00
|
|
|
size_t pack (uint8_t *unpacked, size_t inputsize, uint8_t *packed, int fast);
|
2013-06-05 01:56:07 +00:00
|
|
|
size_t unpack (uint8_t *packed, uint8_t *unpacked);
|
|
|
|
|
2013-11-14 03:31:06 +00:00
|
|
|
size_t unpack_from_file (FILE *file, size_t offset, uint8_t *unpacked);
|
2013-06-05 01:56:07 +00:00
|
|
|
|
2013-10-26 18:25:23 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// end include guard
|
2013-06-05 01:56:07 +00:00
|
|
|
#endif
|