Files
source/sgp/Compression.h
T
Marco Antonio J. Costaandmajcosta 86ad401186 add newline at end of file where it's lacking
.editorconfig already enforces it but it's getting changed piecemeal in
every commit. just get it done with.

the script:
```

find . -type f -not -path "./.git/*" -not -path "./.vs/*" | while read -r file; do
	isFile=$(file -0 "$file" | cut -d $'\0' -f2)
	case "$isFile" in
		(*text*)
			echo "$file is text"
			if [[ $(tail -c 1 "$file" | wc -l) -ne 1 ]]; then
				echo "" >> "$file"
			fi
			;;
		(*)
			echo "file isn't text"
			;;
	esac
done
```
2024-12-14 19:05:48 -03:00

53 lines
2.2 KiB
C

#if !defined( COMPRESSION_H )
#define COMPRESSION_H
#include "types.h"
// Notes on how to use these functions without getting your hands dirty:
// To decompress:
//
// 1) call DecompressInit() with a pointer to your compressed data, and the
// size of that compressed data. DecompressInit() returns a "decompression
// pointer" that you should pass to Decompress() and DecompressFini()
//
// 2) call Decompress() with the decompression pointer, a pointer to a
// buffer for decompressed data, and the length of that buffer. If the
// buffer is not large enough to hold all of the decompressed data,
// Decompress() will fill it completely, and you can call Decompress() again
// to continue your decompression. You are responsible for knowing the
// size your data will be after decompression. (The STI/STCI file format
// records your original data size for you...) Decompress() returns the
// number of bytes of output.
//
// 3) call DecompressFini() with the decompression pointer when you're done
PTR DecompressInit( PTR pCompressedData, UINT32 uiDataSize );
UINT32 Decompress( PTR pDecompPtr, BYTE * pBuffer, UINT32 uiBufferLen );
void DecompressFini( PTR pDecompPtr );
// To compress:
//
// 1) call CompressInit() with a pointer to your uncompressed data, and the
// size of that uncompressed data. CompressInit() returns a "compression
// pointer" that you should pass to Compress() and CompressFini()
//
// 2) call Compress() with the compression pointer, a pointer to a
// buffer for compressed data, and the length of that buffer. If the
// buffer is not large enough to hold all of the compressed data,
// Compress() will fill it completely, and you can call Compress() again
// with a new or emptied buffer to continue your compression later. You
// can call CompressedBufferSize() to determine the largest buffer size you
// should need for a certain number of bytes. Ccompress() returns the number
// of bytes of output.
//
// 3) call CompressFini() with the compression pointer when you're done
UINT32 CompressedBufferSize( UINT32 uiDataSize );
PTR CompressInit( BYTE * pUncompressedData, UINT32 uiDataSize );
UINT32 Compress( PTR pCompPtr, BYTE * pBuffer, UINT32 uiBufferLen );
void CompressFini( PTR pCompPtr );
#endif