mirror of
https://github.com/cuberite/libdeflate.git
synced 2025-08-04 02:06:31 -04:00
Declare __stdcall correctly for MSVC
Unfortunately, MSVC only accepts __stdcall after the return type, while gcc only accepts __attribute__((visibility("default"))) before the return type. So we need a macro in each location. Also, MSVC doesn't define __i386__; that's gcc specific. So instead use '_WIN32 && !_WIN64' to detect 32-bit Windows.
This commit is contained in:
parent
91e972e864
commit
3acda56db0
@ -121,7 +121,7 @@ static u32 dispatch(u32 adler, const u8 *buffer, size_t size)
|
|||||||
# define adler32_impl DEFAULT_IMPL /* only one implementation, use it */
|
# define adler32_impl DEFAULT_IMPL /* only one implementation, use it */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LIBDEFLATEAPI u32
|
LIBDEFLATEEXPORT u32 LIBDEFLATEAPI
|
||||||
libdeflate_adler32(u32 adler, const void *buffer, size_t size)
|
libdeflate_adler32(u32 adler, const void *buffer, size_t size)
|
||||||
{
|
{
|
||||||
if (buffer == NULL) /* return initial value */
|
if (buffer == NULL) /* return initial value */
|
||||||
|
@ -304,7 +304,7 @@ static u32 dispatch(u32 remainder, const u8 *buffer, size_t size)
|
|||||||
# define crc32_impl DEFAULT_IMPL /* only one implementation, use it */
|
# define crc32_impl DEFAULT_IMPL /* only one implementation, use it */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LIBDEFLATEAPI u32
|
LIBDEFLATEEXPORT u32 LIBDEFLATEAPI
|
||||||
libdeflate_crc32(u32 remainder, const void *buffer, size_t size)
|
libdeflate_crc32(u32 remainder, const void *buffer, size_t size)
|
||||||
{
|
{
|
||||||
if (buffer == NULL) /* return initial value */
|
if (buffer == NULL) /* return initial value */
|
||||||
|
@ -2669,7 +2669,7 @@ deflate_init_offset_slot_fast(struct libdeflate_compressor *c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBDEFLATEAPI struct libdeflate_compressor *
|
LIBDEFLATEEXPORT struct libdeflate_compressor * LIBDEFLATEAPI
|
||||||
libdeflate_alloc_compressor(int compression_level)
|
libdeflate_alloc_compressor(int compression_level)
|
||||||
{
|
{
|
||||||
struct libdeflate_compressor *c;
|
struct libdeflate_compressor *c;
|
||||||
@ -2778,7 +2778,7 @@ libdeflate_alloc_compressor(int compression_level)
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBDEFLATEAPI size_t
|
LIBDEFLATEEXPORT size_t LIBDEFLATEAPI
|
||||||
libdeflate_deflate_compress(struct libdeflate_compressor *c,
|
libdeflate_deflate_compress(struct libdeflate_compressor *c,
|
||||||
const void *in, size_t in_nbytes,
|
const void *in, size_t in_nbytes,
|
||||||
void *out, size_t out_nbytes_avail)
|
void *out, size_t out_nbytes_avail)
|
||||||
@ -2799,7 +2799,7 @@ libdeflate_deflate_compress(struct libdeflate_compressor *c,
|
|||||||
return (*c->impl)(c, in, in_nbytes, out, out_nbytes_avail);
|
return (*c->impl)(c, in, in_nbytes, out, out_nbytes_avail);
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBDEFLATEAPI void
|
LIBDEFLATEEXPORT void LIBDEFLATEAPI
|
||||||
libdeflate_free_compressor(struct libdeflate_compressor *c)
|
libdeflate_free_compressor(struct libdeflate_compressor *c)
|
||||||
{
|
{
|
||||||
aligned_free(c);
|
aligned_free(c);
|
||||||
@ -2811,7 +2811,7 @@ deflate_get_compression_level(struct libdeflate_compressor *c)
|
|||||||
return c->compression_level;
|
return c->compression_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBDEFLATEAPI size_t
|
LIBDEFLATEEXPORT size_t LIBDEFLATEAPI
|
||||||
libdeflate_deflate_compress_bound(struct libdeflate_compressor *c,
|
libdeflate_deflate_compress_bound(struct libdeflate_compressor *c,
|
||||||
size_t in_nbytes)
|
size_t in_nbytes)
|
||||||
{
|
{
|
||||||
|
@ -947,7 +947,7 @@ dispatch(struct libdeflate_decompressor * restrict d,
|
|||||||
* handles calling the appropriate implementation depending on the CPU features
|
* handles calling the appropriate implementation depending on the CPU features
|
||||||
* at runtime.
|
* at runtime.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI enum libdeflate_result
|
LIBDEFLATEEXPORT enum libdeflate_result LIBDEFLATEAPI
|
||||||
libdeflate_deflate_decompress_ex(struct libdeflate_decompressor * restrict d,
|
libdeflate_deflate_decompress_ex(struct libdeflate_decompressor * restrict d,
|
||||||
const void * restrict in, size_t in_nbytes,
|
const void * restrict in, size_t in_nbytes,
|
||||||
void * restrict out, size_t out_nbytes_avail,
|
void * restrict out, size_t out_nbytes_avail,
|
||||||
@ -958,7 +958,7 @@ libdeflate_deflate_decompress_ex(struct libdeflate_decompressor * restrict d,
|
|||||||
actual_in_nbytes_ret, actual_out_nbytes_ret);
|
actual_in_nbytes_ret, actual_out_nbytes_ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBDEFLATEAPI enum libdeflate_result
|
LIBDEFLATEEXPORT enum libdeflate_result LIBDEFLATEAPI
|
||||||
libdeflate_deflate_decompress(struct libdeflate_decompressor * restrict d,
|
libdeflate_deflate_decompress(struct libdeflate_decompressor * restrict d,
|
||||||
const void * restrict in, size_t in_nbytes,
|
const void * restrict in, size_t in_nbytes,
|
||||||
void * restrict out, size_t out_nbytes_avail,
|
void * restrict out, size_t out_nbytes_avail,
|
||||||
@ -969,7 +969,7 @@ libdeflate_deflate_decompress(struct libdeflate_decompressor * restrict d,
|
|||||||
NULL, actual_out_nbytes_ret);
|
NULL, actual_out_nbytes_ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBDEFLATEAPI struct libdeflate_decompressor *
|
LIBDEFLATEEXPORT struct libdeflate_decompressor * LIBDEFLATEAPI
|
||||||
libdeflate_alloc_decompressor(void)
|
libdeflate_alloc_decompressor(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -990,7 +990,7 @@ libdeflate_alloc_decompressor(void)
|
|||||||
return calloc(1, sizeof(struct libdeflate_decompressor));
|
return calloc(1, sizeof(struct libdeflate_decompressor));
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBDEFLATEAPI void
|
LIBDEFLATEEXPORT void LIBDEFLATEAPI
|
||||||
libdeflate_free_decompressor(struct libdeflate_decompressor *d)
|
libdeflate_free_decompressor(struct libdeflate_decompressor *d)
|
||||||
{
|
{
|
||||||
free(d);
|
free(d);
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include "libdeflate.h"
|
#include "libdeflate.h"
|
||||||
|
|
||||||
LIBDEFLATEAPI size_t
|
LIBDEFLATEEXPORT size_t LIBDEFLATEAPI
|
||||||
libdeflate_gzip_compress(struct libdeflate_compressor *c,
|
libdeflate_gzip_compress(struct libdeflate_compressor *c,
|
||||||
const void *in, size_t in_size,
|
const void *in, size_t in_size,
|
||||||
void *out, size_t out_nbytes_avail)
|
void *out, size_t out_nbytes_avail)
|
||||||
@ -86,7 +86,7 @@ libdeflate_gzip_compress(struct libdeflate_compressor *c,
|
|||||||
return out_next - (u8 *)out;
|
return out_next - (u8 *)out;
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBDEFLATEAPI size_t
|
LIBDEFLATEEXPORT size_t LIBDEFLATEAPI
|
||||||
libdeflate_gzip_compress_bound(struct libdeflate_compressor *c,
|
libdeflate_gzip_compress_bound(struct libdeflate_compressor *c,
|
||||||
size_t in_nbytes)
|
size_t in_nbytes)
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include "libdeflate.h"
|
#include "libdeflate.h"
|
||||||
|
|
||||||
LIBDEFLATEAPI enum libdeflate_result
|
LIBDEFLATEEXPORT enum libdeflate_result LIBDEFLATEAPI
|
||||||
libdeflate_gzip_decompress_ex(struct libdeflate_decompressor *d,
|
libdeflate_gzip_decompress_ex(struct libdeflate_decompressor *d,
|
||||||
const void *in, size_t in_nbytes,
|
const void *in, size_t in_nbytes,
|
||||||
void *out, size_t out_nbytes_avail,
|
void *out, size_t out_nbytes_avail,
|
||||||
@ -136,7 +136,7 @@ libdeflate_gzip_decompress_ex(struct libdeflate_decompressor *d,
|
|||||||
return LIBDEFLATE_SUCCESS;
|
return LIBDEFLATE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBDEFLATEAPI enum libdeflate_result
|
LIBDEFLATEEXPORT enum libdeflate_result LIBDEFLATEAPI
|
||||||
libdeflate_gzip_decompress(struct libdeflate_decompressor *d,
|
libdeflate_gzip_decompress(struct libdeflate_decompressor *d,
|
||||||
const void *in, size_t in_nbytes,
|
const void *in, size_t in_nbytes,
|
||||||
void *out, size_t out_nbytes_avail,
|
void *out, size_t out_nbytes_avail,
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include "libdeflate.h"
|
#include "libdeflate.h"
|
||||||
|
|
||||||
LIBDEFLATEAPI size_t
|
LIBDEFLATEEXPORT size_t LIBDEFLATEAPI
|
||||||
libdeflate_zlib_compress(struct libdeflate_compressor *c,
|
libdeflate_zlib_compress(struct libdeflate_compressor *c,
|
||||||
const void *in, size_t in_size,
|
const void *in, size_t in_size,
|
||||||
void *out, size_t out_nbytes_avail)
|
void *out, size_t out_nbytes_avail)
|
||||||
@ -78,7 +78,7 @@ libdeflate_zlib_compress(struct libdeflate_compressor *c,
|
|||||||
return out_next - (u8 *)out;
|
return out_next - (u8 *)out;
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBDEFLATEAPI size_t
|
LIBDEFLATEEXPORT size_t LIBDEFLATEAPI
|
||||||
libdeflate_zlib_compress_bound(struct libdeflate_compressor *c,
|
libdeflate_zlib_compress_bound(struct libdeflate_compressor *c,
|
||||||
size_t in_nbytes)
|
size_t in_nbytes)
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include "libdeflate.h"
|
#include "libdeflate.h"
|
||||||
|
|
||||||
LIBDEFLATEAPI enum libdeflate_result
|
LIBDEFLATEEXPORT enum libdeflate_result LIBDEFLATEAPI
|
||||||
libdeflate_zlib_decompress(struct libdeflate_decompressor *d,
|
libdeflate_zlib_decompress(struct libdeflate_decompressor *d,
|
||||||
const void *in, size_t in_nbytes,
|
const void *in, size_t in_nbytes,
|
||||||
void *out, size_t out_nbytes_avail,
|
void *out, size_t out_nbytes_avail,
|
||||||
|
49
libdeflate.h
49
libdeflate.h
@ -22,23 +22,23 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#ifdef LIBDEFLATE_DLL
|
#ifdef LIBDEFLATE_DLL
|
||||||
# ifdef BUILDING_LIBDEFLATE
|
# ifdef BUILDING_LIBDEFLATE
|
||||||
# define LIBDEFLATEAPI_SYM_VISIBILITY LIBEXPORT
|
# define LIBDEFLATEEXPORT LIBEXPORT
|
||||||
# elif defined(_WIN32) || defined(__CYGWIN__)
|
# elif defined(_WIN32) || defined(__CYGWIN__)
|
||||||
# define LIBDEFLATEAPI_SYM_VISIBILITY __declspec(dllimport)
|
# define LIBDEFLATEEXPORT __declspec(dllimport)
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef LIBDEFLATEAPI_SYM_VISIBILITY
|
#ifndef LIBDEFLATEEXPORT
|
||||||
# define LIBDEFLATEAPI_SYM_VISIBILITY
|
# define LIBDEFLATEEXPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32) && defined(__i386__)
|
#if defined(_WIN32) && !defined(_WIN64)
|
||||||
# define LIBDEFLATEAPI_ABI __stdcall
|
# define LIBDEFLATEAPI_ABI __stdcall
|
||||||
#else
|
#else
|
||||||
# define LIBDEFLATEAPI_ABI
|
# define LIBDEFLATEAPI_ABI
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BUILDING_LIBDEFLATE) && defined(__GNUC__) && \
|
#if defined(BUILDING_LIBDEFLATE) && defined(__GNUC__) && \
|
||||||
defined(_WIN32) && defined(__i386__)
|
defined(_WIN32) && !defined(_WIN64)
|
||||||
/*
|
/*
|
||||||
* On 32-bit Windows, gcc assumes 16-byte stack alignment but MSVC only 4.
|
* On 32-bit Windows, gcc assumes 16-byte stack alignment but MSVC only 4.
|
||||||
* Realign the stack when entering libdeflate to avoid crashing in SSE/AVX
|
* Realign the stack when entering libdeflate to avoid crashing in SSE/AVX
|
||||||
@ -49,8 +49,7 @@ extern "C" {
|
|||||||
# define LIBDEFLATEAPI_STACKALIGN
|
# define LIBDEFLATEAPI_STACKALIGN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define LIBDEFLATEAPI LIBDEFLATEAPI_SYM_VISIBILITY LIBDEFLATEAPI_ABI \
|
#define LIBDEFLATEAPI LIBDEFLATEAPI_ABI LIBDEFLATEAPI_STACKALIGN
|
||||||
LIBDEFLATEAPI_STACKALIGN
|
|
||||||
|
|
||||||
/* ========================================================================== */
|
/* ========================================================================== */
|
||||||
/* Compression */
|
/* Compression */
|
||||||
@ -72,7 +71,7 @@ struct libdeflate_compressor;
|
|||||||
* A single compressor is not safe to use by multiple threads concurrently.
|
* A single compressor is not safe to use by multiple threads concurrently.
|
||||||
* However, different threads may use different compressors concurrently.
|
* However, different threads may use different compressors concurrently.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI struct libdeflate_compressor *
|
LIBDEFLATEEXPORT struct libdeflate_compressor * LIBDEFLATEAPI
|
||||||
libdeflate_alloc_compressor(int compression_level);
|
libdeflate_alloc_compressor(int compression_level);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -82,7 +81,7 @@ libdeflate_alloc_compressor(int compression_level);
|
|||||||
* bytes. The return value is the compressed size in bytes, or 0 if the data
|
* bytes. The return value is the compressed size in bytes, or 0 if the data
|
||||||
* could not be compressed to 'out_nbytes_avail' bytes or fewer.
|
* could not be compressed to 'out_nbytes_avail' bytes or fewer.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI size_t
|
LIBDEFLATEEXPORT size_t LIBDEFLATEAPI
|
||||||
libdeflate_deflate_compress(struct libdeflate_compressor *compressor,
|
libdeflate_deflate_compress(struct libdeflate_compressor *compressor,
|
||||||
const void *in, size_t in_nbytes,
|
const void *in, size_t in_nbytes,
|
||||||
void *out, size_t out_nbytes_avail);
|
void *out, size_t out_nbytes_avail);
|
||||||
@ -112,7 +111,7 @@ libdeflate_deflate_compress(struct libdeflate_compressor *compressor,
|
|||||||
* libdeflate_deflate_compress() returns 0, indicating that the compressed data
|
* libdeflate_deflate_compress() returns 0, indicating that the compressed data
|
||||||
* did not fit into the provided output buffer.
|
* did not fit into the provided output buffer.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI size_t
|
LIBDEFLATEEXPORT size_t LIBDEFLATEAPI
|
||||||
libdeflate_deflate_compress_bound(struct libdeflate_compressor *compressor,
|
libdeflate_deflate_compress_bound(struct libdeflate_compressor *compressor,
|
||||||
size_t in_nbytes);
|
size_t in_nbytes);
|
||||||
|
|
||||||
@ -120,7 +119,7 @@ libdeflate_deflate_compress_bound(struct libdeflate_compressor *compressor,
|
|||||||
* Like libdeflate_deflate_compress(), but stores the data in the zlib wrapper
|
* Like libdeflate_deflate_compress(), but stores the data in the zlib wrapper
|
||||||
* format.
|
* format.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI size_t
|
LIBDEFLATEEXPORT size_t LIBDEFLATEAPI
|
||||||
libdeflate_zlib_compress(struct libdeflate_compressor *compressor,
|
libdeflate_zlib_compress(struct libdeflate_compressor *compressor,
|
||||||
const void *in, size_t in_nbytes,
|
const void *in, size_t in_nbytes,
|
||||||
void *out, size_t out_nbytes_avail);
|
void *out, size_t out_nbytes_avail);
|
||||||
@ -130,7 +129,7 @@ libdeflate_zlib_compress(struct libdeflate_compressor *compressor,
|
|||||||
* compressed with libdeflate_zlib_compress() rather than with
|
* compressed with libdeflate_zlib_compress() rather than with
|
||||||
* libdeflate_deflate_compress().
|
* libdeflate_deflate_compress().
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI size_t
|
LIBDEFLATEEXPORT size_t LIBDEFLATEAPI
|
||||||
libdeflate_zlib_compress_bound(struct libdeflate_compressor *compressor,
|
libdeflate_zlib_compress_bound(struct libdeflate_compressor *compressor,
|
||||||
size_t in_nbytes);
|
size_t in_nbytes);
|
||||||
|
|
||||||
@ -138,7 +137,7 @@ libdeflate_zlib_compress_bound(struct libdeflate_compressor *compressor,
|
|||||||
* Like libdeflate_deflate_compress(), but stores the data in the gzip wrapper
|
* Like libdeflate_deflate_compress(), but stores the data in the gzip wrapper
|
||||||
* format.
|
* format.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI size_t
|
LIBDEFLATEEXPORT size_t LIBDEFLATEAPI
|
||||||
libdeflate_gzip_compress(struct libdeflate_compressor *compressor,
|
libdeflate_gzip_compress(struct libdeflate_compressor *compressor,
|
||||||
const void *in, size_t in_nbytes,
|
const void *in, size_t in_nbytes,
|
||||||
void *out, size_t out_nbytes_avail);
|
void *out, size_t out_nbytes_avail);
|
||||||
@ -148,7 +147,7 @@ libdeflate_gzip_compress(struct libdeflate_compressor *compressor,
|
|||||||
* compressed with libdeflate_gzip_compress() rather than with
|
* compressed with libdeflate_gzip_compress() rather than with
|
||||||
* libdeflate_deflate_compress().
|
* libdeflate_deflate_compress().
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI size_t
|
LIBDEFLATEEXPORT size_t LIBDEFLATEAPI
|
||||||
libdeflate_gzip_compress_bound(struct libdeflate_compressor *compressor,
|
libdeflate_gzip_compress_bound(struct libdeflate_compressor *compressor,
|
||||||
size_t in_nbytes);
|
size_t in_nbytes);
|
||||||
|
|
||||||
@ -157,7 +156,7 @@ libdeflate_gzip_compress_bound(struct libdeflate_compressor *compressor,
|
|||||||
* libdeflate_alloc_compressor(). If a NULL pointer is passed in, no action is
|
* libdeflate_alloc_compressor(). If a NULL pointer is passed in, no action is
|
||||||
* taken.
|
* taken.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI void
|
LIBDEFLATEEXPORT void LIBDEFLATEAPI
|
||||||
libdeflate_free_compressor(struct libdeflate_compressor *compressor);
|
libdeflate_free_compressor(struct libdeflate_compressor *compressor);
|
||||||
|
|
||||||
/* ========================================================================== */
|
/* ========================================================================== */
|
||||||
@ -178,7 +177,7 @@ struct libdeflate_decompressor;
|
|||||||
* A single decompressor is not safe to use by multiple threads concurrently.
|
* A single decompressor is not safe to use by multiple threads concurrently.
|
||||||
* However, different threads may use different decompressors concurrently.
|
* However, different threads may use different decompressors concurrently.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI struct libdeflate_decompressor *
|
LIBDEFLATEEXPORT struct libdeflate_decompressor * LIBDEFLATEAPI
|
||||||
libdeflate_alloc_decompressor(void);
|
libdeflate_alloc_decompressor(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -234,7 +233,7 @@ enum libdeflate_result {
|
|||||||
* not large enough but no other problems were encountered, or another
|
* not large enough but no other problems were encountered, or another
|
||||||
* nonzero result code if decompression failed for another reason.
|
* nonzero result code if decompression failed for another reason.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI enum libdeflate_result
|
LIBDEFLATEEXPORT enum libdeflate_result LIBDEFLATEAPI
|
||||||
libdeflate_deflate_decompress(struct libdeflate_decompressor *decompressor,
|
libdeflate_deflate_decompress(struct libdeflate_decompressor *decompressor,
|
||||||
const void *in, size_t in_nbytes,
|
const void *in, size_t in_nbytes,
|
||||||
void *out, size_t out_nbytes_avail,
|
void *out, size_t out_nbytes_avail,
|
||||||
@ -246,7 +245,7 @@ libdeflate_deflate_decompress(struct libdeflate_decompressor *decompressor,
|
|||||||
* then the actual compressed size of the DEFLATE stream (aligned to the next
|
* then the actual compressed size of the DEFLATE stream (aligned to the next
|
||||||
* byte boundary) is written to *actual_in_nbytes_ret.
|
* byte boundary) is written to *actual_in_nbytes_ret.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI enum libdeflate_result
|
LIBDEFLATEEXPORT enum libdeflate_result LIBDEFLATEAPI
|
||||||
libdeflate_deflate_decompress_ex(struct libdeflate_decompressor *decompressor,
|
libdeflate_deflate_decompress_ex(struct libdeflate_decompressor *decompressor,
|
||||||
const void *in, size_t in_nbytes,
|
const void *in, size_t in_nbytes,
|
||||||
void *out, size_t out_nbytes_avail,
|
void *out, size_t out_nbytes_avail,
|
||||||
@ -257,7 +256,7 @@ libdeflate_deflate_decompress_ex(struct libdeflate_decompressor *decompressor,
|
|||||||
* Like libdeflate_deflate_decompress(), but assumes the zlib wrapper format
|
* Like libdeflate_deflate_decompress(), but assumes the zlib wrapper format
|
||||||
* instead of raw DEFLATE.
|
* instead of raw DEFLATE.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI enum libdeflate_result
|
LIBDEFLATEEXPORT enum libdeflate_result LIBDEFLATEAPI
|
||||||
libdeflate_zlib_decompress(struct libdeflate_decompressor *decompressor,
|
libdeflate_zlib_decompress(struct libdeflate_decompressor *decompressor,
|
||||||
const void *in, size_t in_nbytes,
|
const void *in, size_t in_nbytes,
|
||||||
void *out, size_t out_nbytes_avail,
|
void *out, size_t out_nbytes_avail,
|
||||||
@ -271,7 +270,7 @@ libdeflate_zlib_decompress(struct libdeflate_decompressor *decompressor,
|
|||||||
* will be decompressed. Use libdeflate_gzip_decompress_ex() if you need
|
* will be decompressed. Use libdeflate_gzip_decompress_ex() if you need
|
||||||
* multi-member support.
|
* multi-member support.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI enum libdeflate_result
|
LIBDEFLATEEXPORT enum libdeflate_result LIBDEFLATEAPI
|
||||||
libdeflate_gzip_decompress(struct libdeflate_decompressor *decompressor,
|
libdeflate_gzip_decompress(struct libdeflate_decompressor *decompressor,
|
||||||
const void *in, size_t in_nbytes,
|
const void *in, size_t in_nbytes,
|
||||||
void *out, size_t out_nbytes_avail,
|
void *out, size_t out_nbytes_avail,
|
||||||
@ -284,7 +283,7 @@ libdeflate_gzip_decompress(struct libdeflate_decompressor *decompressor,
|
|||||||
* buffer was decompressed), then the actual number of input bytes consumed is
|
* buffer was decompressed), then the actual number of input bytes consumed is
|
||||||
* written to *actual_in_nbytes_ret.
|
* written to *actual_in_nbytes_ret.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI enum libdeflate_result
|
LIBDEFLATEEXPORT enum libdeflate_result LIBDEFLATEAPI
|
||||||
libdeflate_gzip_decompress_ex(struct libdeflate_decompressor *decompressor,
|
libdeflate_gzip_decompress_ex(struct libdeflate_decompressor *decompressor,
|
||||||
const void *in, size_t in_nbytes,
|
const void *in, size_t in_nbytes,
|
||||||
void *out, size_t out_nbytes_avail,
|
void *out, size_t out_nbytes_avail,
|
||||||
@ -296,7 +295,7 @@ libdeflate_gzip_decompress_ex(struct libdeflate_decompressor *decompressor,
|
|||||||
* libdeflate_alloc_decompressor(). If a NULL pointer is passed in, no action
|
* libdeflate_alloc_decompressor(). If a NULL pointer is passed in, no action
|
||||||
* is taken.
|
* is taken.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI void
|
LIBDEFLATEEXPORT void LIBDEFLATEAPI
|
||||||
libdeflate_free_decompressor(struct libdeflate_decompressor *decompressor);
|
libdeflate_free_decompressor(struct libdeflate_decompressor *decompressor);
|
||||||
|
|
||||||
/* ========================================================================== */
|
/* ========================================================================== */
|
||||||
@ -309,7 +308,7 @@ libdeflate_free_decompressor(struct libdeflate_decompressor *decompressor);
|
|||||||
* required initial value for 'adler' is 1. This value is also returned when
|
* required initial value for 'adler' is 1. This value is also returned when
|
||||||
* 'buffer' is specified as NULL.
|
* 'buffer' is specified as NULL.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI uint32_t
|
LIBDEFLATEEXPORT uint32_t LIBDEFLATEAPI
|
||||||
libdeflate_adler32(uint32_t adler32, const void *buffer, size_t len);
|
libdeflate_adler32(uint32_t adler32, const void *buffer, size_t len);
|
||||||
|
|
||||||
|
|
||||||
@ -319,7 +318,7 @@ libdeflate_adler32(uint32_t adler32, const void *buffer, size_t len);
|
|||||||
* initial value for 'crc' is 0. This value is also returned when 'buffer' is
|
* initial value for 'crc' is 0. This value is also returned when 'buffer' is
|
||||||
* specified as NULL.
|
* specified as NULL.
|
||||||
*/
|
*/
|
||||||
LIBDEFLATEAPI uint32_t
|
LIBDEFLATEEXPORT uint32_t LIBDEFLATEAPI
|
||||||
libdeflate_crc32(uint32_t crc, const void *buffer, size_t len);
|
libdeflate_crc32(uint32_t crc, const void *buffer, size_t len);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Loading…
x
Reference in New Issue
Block a user