diff options
| author | spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> | 2021-09-27 22:27:17 +0200 |
|---|---|---|
| committer | spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> | 2021-09-27 22:27:17 +0200 |
| commit | 49ea4e7561980d79ec3bed869982852b45b597e8 (patch) | |
| tree | 187f00972a4280dd4ae01512714e6b35b21bec92 /libpsn00b/include | |
| parent | 0e3278a087daa25cba541d7c1dae19dfd4e2d422 (diff) | |
| download | psn00bsdk-49ea4e7561980d79ec3bed869982852b45b597e8.tar.gz | |
Updated changelog and files missing from last commit
Diffstat (limited to 'libpsn00b/include')
| -rw-r--r-- | libpsn00b/include/lzp/lzp.h | 18 | ||||
| -rw-r--r-- | libpsn00b/include/lzp/lzqlp.h | 23 |
2 files changed, 23 insertions, 18 deletions
diff --git a/libpsn00b/include/lzp/lzp.h b/libpsn00b/include/lzp/lzp.h index ffd7933..cfeeb72 100644 --- a/libpsn00b/include/lzp/lzp.h +++ b/libpsn00b/include/lzp/lzp.h @@ -111,7 +111,7 @@ extern "C" { * * \returns The size of the compressed data in bytes. */ -int lzCompress(void* outBuff, void* inBuff, int inSize, int level); +int lzCompress(void* outBuff, const void* inBuff, int inSize, int level); /*! Decompress a compressed block of data. * @@ -130,9 +130,9 @@ int lzCompress(void* outBuff, void* inBuff, int inSize, int level); * \returns Size of decompressed data in bytes or LZP_ERR_DECOMPRESS if a * decompression error occurred. */ -int lzDecompress(void* outBuff, void* inBuff, int inSize); +int lzDecompress(void* outBuff, const void* inBuff, int inSize); -int lzDecompressLen(void* outBuff, int outSize, void* inBuff, int inSize); +int lzDecompressLen(void* outBuff, int outSize, const void* inBuff, int inSize); /*! Sets the sizes of hash tables for data compression. * @@ -162,7 +162,7 @@ void lzResetHashSizes(); * * \returns CRC16 hash of specified buffer. */ -unsigned short lzCRC16(void* buff, int bytes, unsigned short crc); +unsigned short lzCRC16(const void* buff, int bytes, unsigned short crc); /*! Calculates a CRC32 hash of the specified buffer. * @@ -172,7 +172,7 @@ unsigned short lzCRC16(void* buff, int bytes, unsigned short crc); * * \returns CRC32 hash of specified buffer. */ -unsigned int lzCRC32(void* buff, int bytes, unsigned int crc); +unsigned int lzCRC32(const void* buff, int bytes, unsigned int crc); /*! @} */ @@ -189,9 +189,9 @@ unsigned int lzCRC32(void* buff, int bytes, unsigned int crc); * * \returns File index of found file or one of \ref libraryErrorCodes if an error occurred. */ -int lzpSearchFile(const char* fileName, void* lzpack); +int lzpSearchFile(const char* fileName, const LZP_HEAD* lzpack); -int lzpFileSize(void* lzpack, int fileNum); +int lzpFileSize(const LZP_HEAD* lzpack, int fileNum); /*! Get a pointer to a file entry inside of an LZP archive. * @@ -200,7 +200,7 @@ int lzpFileSize(void* lzpack, int fileNum); * * \returns A pointer to an LZP_FILE struct or NULL if an error occurred. */ -LZP_FILE* lzpFileEntry(void* lzpack, int fileNum); +const LZP_FILE* lzpFileEntry(const LZP_HEAD* lzpack, int fileNum); /*! Unpacks a file from an LZP archive to the specified memory buffer. * @@ -210,7 +210,7 @@ LZP_FILE* lzpFileEntry(void* lzpack, int fileNum); * * \returns Size of decompressed file in bytes or one of \ref libraryErrorCodes if an error occurred. */ -int lzpUnpackFile(void* buff, void* lzpack, int fileNum); +int lzpUnpackFile(void* buff, const LZP_HEAD* lzpack, int fileNum); /*! @} */ diff --git a/libpsn00b/include/lzp/lzqlp.h b/libpsn00b/include/lzp/lzqlp.h index fae6438..5b70b40 100644 --- a/libpsn00b/include/lzp/lzqlp.h +++ b/libpsn00b/include/lzp/lzqlp.h @@ -1,6 +1,11 @@ #ifndef _QLP_H #define _QLP_H +#include <sys/types.h> +#ifdef _WIN32 +#include <windows.h> +#endif + #define PACK_ERR_NONE 0 #define PACK_ERR_INVALID -1 #define PACK_ERR_NOTFOUND -2 @@ -8,19 +13,19 @@ #define PACK_ERR_READ_FAULT -4 typedef struct { - char id[3]; - unsigned char numfiles; + char id[3]; + u_char numfiles; } QLP_HEAD; typedef struct { - char name[16]; - unsigned int size; - unsigned int offs; + char name[16]; + u_int size; + u_int offs; } QLP_FILE; -int qlpFileCount(void* qlpfile); -QLP_FILE* qlpFileEntry(int index, void* qlpfile); -void* qlpFileAddr(int index, void* qlpfile); -int qlpFindFile(char* fileName, void* qlpfile); +int qlpFileCount(const QLP_HEAD* qlpfile); +const QLP_FILE* qlpFileEntry(int index, const QLP_HEAD* qlpfile); +const void* qlpFileAddr(int index, const QLP_HEAD* qlpfile); +int qlpFindFile(char* fileName, const QLP_HEAD* qlpfile); #endif // _QLP_H
\ No newline at end of file |
