add csharp_generate_const option

This commit is contained in:
neuecc 2023-08-15 21:18:30 +09:00
parent 511053bb5c
commit 6e5a623352
17 changed files with 830 additions and 728 deletions

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@ use super::lz4;
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_versionNumber(
) -> c_int
{
lz4::LZ4_versionNumber(
@ -18,7 +18,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_versionNumber(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_versionString(
) -> *const c_char
{
lz4::LZ4_versionString(
@ -31,7 +31,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_default(
src: *const c_char,
dst: *mut c_char,
srcSize: c_int,
dstCapacity: c_int
dstCapacity: c_int
) -> c_int
{
lz4::LZ4_compress_default(
@ -47,7 +47,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_decompress_safe(
src: *const c_char,
dst: *mut c_char,
compressedSize: c_int,
dstCapacity: c_int
dstCapacity: c_int
) -> c_int
{
lz4::LZ4_decompress_safe(
@ -60,7 +60,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_decompress_safe(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_compressBound(
inputSize: c_int
inputSize: c_int
) -> c_int
{
lz4::LZ4_compressBound(
@ -74,7 +74,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_fast(
dst: *mut c_char,
srcSize: c_int,
dstCapacity: c_int,
acceleration: c_int
acceleration: c_int
) -> c_int
{
lz4::LZ4_compress_fast(
@ -88,7 +88,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_fast(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_sizeofState(
) -> c_int
{
lz4::LZ4_sizeofState(
@ -103,7 +103,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_fast_extState(
dst: *mut c_char,
srcSize: c_int,
dstCapacity: c_int,
acceleration: c_int
acceleration: c_int
) -> c_int
{
lz4::LZ4_compress_fast_extState(
@ -121,7 +121,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_destSize(
src: *const c_char,
dst: *mut c_char,
srcSizePtr: *mut c_int,
targetDstSize: c_int
targetDstSize: c_int
) -> c_int
{
lz4::LZ4_compress_destSize(
@ -138,7 +138,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_decompress_safe_partial(
dst: *mut c_char,
srcSize: c_int,
targetOutputSize: c_int,
dstCapacity: c_int
dstCapacity: c_int
) -> c_int
{
lz4::LZ4_decompress_safe_partial(
@ -152,7 +152,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_decompress_safe_partial(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_createStream(
) -> *mut lz4::LZ4_stream_t
{
lz4::LZ4_createStream(
@ -162,7 +162,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_createStream(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_freeStream(
streamPtr: *mut lz4::LZ4_stream_t
streamPtr: *mut lz4::LZ4_stream_t
) -> c_int
{
lz4::LZ4_freeStream(
@ -172,7 +172,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_freeStream(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_resetStream_fast(
streamPtr: *mut lz4::LZ4_stream_t
streamPtr: *mut lz4::LZ4_stream_t
)
{
lz4::LZ4_resetStream_fast(
@ -184,7 +184,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_resetStream_fast(
pub unsafe extern "C" fn csbindgen_LZ4_loadDict(
streamPtr: *mut lz4::LZ4_stream_t,
dictionary: *const c_char,
dictSize: c_int
dictSize: c_int
) -> c_int
{
lz4::LZ4_loadDict(
@ -201,7 +201,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_fast_continue(
dst: *mut c_char,
srcSize: c_int,
dstCapacity: c_int,
acceleration: c_int
acceleration: c_int
) -> c_int
{
lz4::LZ4_compress_fast_continue(
@ -218,7 +218,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_fast_continue(
pub unsafe extern "C" fn csbindgen_LZ4_saveDict(
streamPtr: *mut lz4::LZ4_stream_t,
safeBuffer: *mut c_char,
maxDictSize: c_int
maxDictSize: c_int
) -> c_int
{
lz4::LZ4_saveDict(
@ -230,7 +230,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_saveDict(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_createStreamDecode(
) -> *mut lz4::LZ4_streamDecode_t
{
lz4::LZ4_createStreamDecode(
@ -240,7 +240,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_createStreamDecode(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_freeStreamDecode(
LZ4_stream: *mut lz4::LZ4_streamDecode_t
LZ4_stream: *mut lz4::LZ4_streamDecode_t
) -> c_int
{
lz4::LZ4_freeStreamDecode(
@ -252,7 +252,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_freeStreamDecode(
pub unsafe extern "C" fn csbindgen_LZ4_setStreamDecode(
LZ4_streamDecode: *mut lz4::LZ4_streamDecode_t,
dictionary: *const c_char,
dictSize: c_int
dictSize: c_int
) -> c_int
{
lz4::LZ4_setStreamDecode(
@ -264,7 +264,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_setStreamDecode(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_decoderRingBufferSize(
maxBlockSize: c_int
maxBlockSize: c_int
) -> c_int
{
lz4::LZ4_decoderRingBufferSize(
@ -278,7 +278,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_decompress_safe_continue(
src: *const c_char,
dst: *mut c_char,
srcSize: c_int,
dstCapacity: c_int
dstCapacity: c_int
) -> c_int
{
lz4::LZ4_decompress_safe_continue(
@ -297,7 +297,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_decompress_safe_usingDict(
srcSize: c_int,
dstCapacity: c_int,
dictStart: *const c_char,
dictSize: c_int
dictSize: c_int
) -> c_int
{
lz4::LZ4_decompress_safe_usingDict(
@ -318,7 +318,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_decompress_safe_partial_usingDict(
targetOutputSize: c_int,
maxOutputSize: c_int,
dictStart: *const c_char,
dictSize: c_int
dictSize: c_int
) -> c_int
{
lz4::LZ4_decompress_safe_partial_usingDict(
@ -335,7 +335,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_decompress_safe_partial_usingDict(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_initStream(
buffer: *mut c_void,
size: usize
size: usize
) -> *mut lz4::LZ4_stream_t
{
lz4::LZ4_initStream(
@ -348,7 +348,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_initStream(
pub unsafe extern "C" fn csbindgen_LZ4_compress(
src: *const c_char,
dest: *mut c_char,
srcSize: c_int
srcSize: c_int
) -> c_int
{
lz4::LZ4_compress(
@ -363,7 +363,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_limitedOutput(
src: *const c_char,
dest: *mut c_char,
srcSize: c_int,
maxOutputSize: c_int
maxOutputSize: c_int
) -> c_int
{
lz4::LZ4_compress_limitedOutput(
@ -379,7 +379,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_withState(
state: *mut c_void,
source: *const c_char,
dest: *mut c_char,
inputSize: c_int
inputSize: c_int
) -> c_int
{
lz4::LZ4_compress_withState(
@ -396,7 +396,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_limitedOutput_withState(
source: *const c_char,
dest: *mut c_char,
inputSize: c_int,
maxOutputSize: c_int
maxOutputSize: c_int
) -> c_int
{
lz4::LZ4_compress_limitedOutput_withState(
@ -413,7 +413,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_continue(
LZ4_streamPtr: *mut lz4::LZ4_stream_t,
source: *const c_char,
dest: *mut c_char,
inputSize: c_int
inputSize: c_int
) -> c_int
{
lz4::LZ4_compress_continue(
@ -430,7 +430,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_limitedOutput_continue(
source: *const c_char,
dest: *mut c_char,
inputSize: c_int,
maxOutputSize: c_int
maxOutputSize: c_int
) -> c_int
{
lz4::LZ4_compress_limitedOutput_continue(
@ -446,7 +446,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_limitedOutput_continue(
pub unsafe extern "C" fn csbindgen_LZ4_uncompress(
source: *const c_char,
dest: *mut c_char,
outputSize: c_int
outputSize: c_int
) -> c_int
{
lz4::LZ4_uncompress(
@ -461,7 +461,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_uncompress_unknownOutputSize(
source: *const c_char,
dest: *mut c_char,
isize_: c_int,
maxOutputSize: c_int
maxOutputSize: c_int
) -> c_int
{
lz4::LZ4_uncompress_unknownOutputSize(
@ -474,7 +474,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_uncompress_unknownOutputSize(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_create(
inputBuffer: *mut c_char
inputBuffer: *mut c_char
) -> *mut c_void
{
lz4::LZ4_create(
@ -484,7 +484,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_create(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_sizeofStreamState(
) -> c_int
{
lz4::LZ4_sizeofStreamState(
@ -495,7 +495,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_sizeofStreamState(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_resetStreamState(
state: *mut c_void,
inputBuffer: *mut c_char
inputBuffer: *mut c_char
) -> c_int
{
lz4::LZ4_resetStreamState(
@ -506,7 +506,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_resetStreamState(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_slideInputBuffer(
state: *mut c_void
state: *mut c_void
) -> *mut c_char
{
lz4::LZ4_slideInputBuffer(
@ -519,7 +519,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_decompress_safe_withPrefix64k(
src: *const c_char,
dst: *mut c_char,
compressedSize: c_int,
maxDstSize: c_int
maxDstSize: c_int
) -> c_int
{
lz4::LZ4_decompress_safe_withPrefix64k(
@ -534,7 +534,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_decompress_safe_withPrefix64k(
pub unsafe extern "C" fn csbindgen_LZ4_decompress_fast_withPrefix64k(
src: *const c_char,
dst: *mut c_char,
originalSize: c_int
originalSize: c_int
) -> c_int
{
lz4::LZ4_decompress_fast_withPrefix64k(
@ -548,7 +548,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_decompress_fast_withPrefix64k(
pub unsafe extern "C" fn csbindgen_LZ4_decompress_fast(
src: *const c_char,
dst: *mut c_char,
originalSize: c_int
originalSize: c_int
) -> c_int
{
lz4::LZ4_decompress_fast(
@ -563,7 +563,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_decompress_fast_continue(
LZ4_streamDecode: *mut lz4::LZ4_streamDecode_t,
src: *const c_char,
dst: *mut c_char,
originalSize: c_int
originalSize: c_int
) -> c_int
{
lz4::LZ4_decompress_fast_continue(
@ -580,7 +580,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_decompress_fast_usingDict(
dst: *mut c_char,
originalSize: c_int,
dictStart: *const c_char,
dictSize: c_int
dictSize: c_int
) -> c_int
{
lz4::LZ4_decompress_fast_usingDict(
@ -594,7 +594,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_decompress_fast_usingDict(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_resetStream(
streamPtr: *mut lz4::LZ4_stream_t
streamPtr: *mut lz4::LZ4_stream_t
)
{
lz4::LZ4_resetStream(
@ -608,7 +608,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_HC(
dst: *mut c_char,
srcSize: c_int,
dstCapacity: c_int,
compressionLevel: c_int
compressionLevel: c_int
) -> c_int
{
lz4::LZ4_compress_HC(
@ -622,7 +622,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_HC(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_sizeofStateHC(
) -> c_int
{
lz4::LZ4_sizeofStateHC(
@ -637,7 +637,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_HC_extStateHC(
dst: *mut c_char,
srcSize: c_int,
maxDstSize: c_int,
compressionLevel: c_int
compressionLevel: c_int
) -> c_int
{
lz4::LZ4_compress_HC_extStateHC(
@ -657,7 +657,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_HC_destSize(
dst: *mut c_char,
srcSizePtr: *mut c_int,
targetDstSize: c_int,
compressionLevel: c_int
compressionLevel: c_int
) -> c_int
{
lz4::LZ4_compress_HC_destSize(
@ -672,7 +672,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_HC_destSize(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_createStreamHC(
) -> *mut lz4::LZ4_streamHC_t
{
lz4::LZ4_createStreamHC(
@ -682,7 +682,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_createStreamHC(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_freeStreamHC(
streamHCPtr: *mut lz4::LZ4_streamHC_t
streamHCPtr: *mut lz4::LZ4_streamHC_t
) -> c_int
{
lz4::LZ4_freeStreamHC(
@ -693,7 +693,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_freeStreamHC(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_resetStreamHC_fast(
streamHCPtr: *mut lz4::LZ4_streamHC_t,
compressionLevel: c_int
compressionLevel: c_int
)
{
lz4::LZ4_resetStreamHC_fast(
@ -706,7 +706,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_resetStreamHC_fast(
pub unsafe extern "C" fn csbindgen_LZ4_loadDictHC(
streamHCPtr: *mut lz4::LZ4_streamHC_t,
dictionary: *const c_char,
dictSize: c_int
dictSize: c_int
) -> c_int
{
lz4::LZ4_loadDictHC(
@ -722,7 +722,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_HC_continue(
src: *const c_char,
dst: *mut c_char,
srcSize: c_int,
maxDstSize: c_int
maxDstSize: c_int
) -> c_int
{
lz4::LZ4_compress_HC_continue(
@ -740,7 +740,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_HC_continue_destSize(
src: *const c_char,
dst: *mut c_char,
srcSizePtr: *mut c_int,
targetDstSize: c_int
targetDstSize: c_int
) -> c_int
{
lz4::LZ4_compress_HC_continue_destSize(
@ -756,7 +756,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compress_HC_continue_destSize(
pub unsafe extern "C" fn csbindgen_LZ4_saveDictHC(
streamHCPtr: *mut lz4::LZ4_streamHC_t,
safeBuffer: *mut c_char,
maxDictSize: c_int
maxDictSize: c_int
) -> c_int
{
lz4::LZ4_saveDictHC(
@ -769,7 +769,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_saveDictHC(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_initStreamHC(
buffer: *mut c_void,
size: usize
size: usize
) -> *mut lz4::LZ4_streamHC_t
{
lz4::LZ4_initStreamHC(
@ -782,7 +782,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_initStreamHC(
pub unsafe extern "C" fn csbindgen_LZ4_compressHC(
source: *const c_char,
dest: *mut c_char,
inputSize: c_int
inputSize: c_int
) -> c_int
{
lz4::LZ4_compressHC(
@ -797,7 +797,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compressHC_limitedOutput(
source: *const c_char,
dest: *mut c_char,
inputSize: c_int,
maxOutputSize: c_int
maxOutputSize: c_int
) -> c_int
{
lz4::LZ4_compressHC_limitedOutput(
@ -813,7 +813,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compressHC2(
source: *const c_char,
dest: *mut c_char,
inputSize: c_int,
compressionLevel: c_int
compressionLevel: c_int
) -> c_int
{
lz4::LZ4_compressHC2(
@ -830,7 +830,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compressHC2_limitedOutput(
dest: *mut c_char,
inputSize: c_int,
maxOutputSize: c_int,
compressionLevel: c_int
compressionLevel: c_int
) -> c_int
{
lz4::LZ4_compressHC2_limitedOutput(
@ -847,7 +847,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compressHC_withStateHC(
state: *mut c_void,
source: *const c_char,
dest: *mut c_char,
inputSize: c_int
inputSize: c_int
) -> c_int
{
lz4::LZ4_compressHC_withStateHC(
@ -864,7 +864,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compressHC_limitedOutput_withStateHC(
source: *const c_char,
dest: *mut c_char,
inputSize: c_int,
maxOutputSize: c_int
maxOutputSize: c_int
) -> c_int
{
lz4::LZ4_compressHC_limitedOutput_withStateHC(
@ -882,7 +882,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compressHC2_withStateHC(
source: *const c_char,
dest: *mut c_char,
inputSize: c_int,
compressionLevel: c_int
compressionLevel: c_int
) -> c_int
{
lz4::LZ4_compressHC2_withStateHC(
@ -901,7 +901,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compressHC2_limitedOutput_withStateHC(
dest: *mut c_char,
inputSize: c_int,
maxOutputSize: c_int,
compressionLevel: c_int
compressionLevel: c_int
) -> c_int
{
lz4::LZ4_compressHC2_limitedOutput_withStateHC(
@ -919,7 +919,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compressHC_continue(
LZ4_streamHCPtr: *mut lz4::LZ4_streamHC_t,
source: *const c_char,
dest: *mut c_char,
inputSize: c_int
inputSize: c_int
) -> c_int
{
lz4::LZ4_compressHC_continue(
@ -936,7 +936,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compressHC_limitedOutput_continue(
source: *const c_char,
dest: *mut c_char,
inputSize: c_int,
maxOutputSize: c_int
maxOutputSize: c_int
) -> c_int
{
lz4::LZ4_compressHC_limitedOutput_continue(
@ -950,7 +950,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compressHC_limitedOutput_continue(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_createHC(
inputBuffer: *const c_char
inputBuffer: *const c_char
) -> *mut c_void
{
lz4::LZ4_createHC(
@ -960,7 +960,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_createHC(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_freeHC(
LZ4HC_Data: *mut c_void
LZ4HC_Data: *mut c_void
) -> c_int
{
lz4::LZ4_freeHC(
@ -970,7 +970,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_freeHC(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_slideInputBufferHC(
LZ4HC_Data: *mut c_void
LZ4HC_Data: *mut c_void
) -> *mut c_char
{
lz4::LZ4_slideInputBufferHC(
@ -984,7 +984,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compressHC2_continue(
source: *const c_char,
dest: *mut c_char,
inputSize: c_int,
compressionLevel: c_int
compressionLevel: c_int
) -> c_int
{
lz4::LZ4_compressHC2_continue(
@ -1003,7 +1003,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compressHC2_limitedOutput_continue(
dest: *mut c_char,
inputSize: c_int,
maxOutputSize: c_int,
compressionLevel: c_int
compressionLevel: c_int
) -> c_int
{
lz4::LZ4_compressHC2_limitedOutput_continue(
@ -1018,7 +1018,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_compressHC2_limitedOutput_continue(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_sizeofStreamStateHC(
) -> c_int
{
lz4::LZ4_sizeofStreamStateHC(
@ -1029,7 +1029,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_sizeofStreamStateHC(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_resetStreamStateHC(
state: *mut c_void,
inputBuffer: *mut c_char
inputBuffer: *mut c_char
) -> c_int
{
lz4::LZ4_resetStreamStateHC(
@ -1041,7 +1041,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_resetStreamStateHC(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4_resetStreamHC(
streamHCPtr: *mut lz4::LZ4_streamHC_t,
compressionLevel: c_int
compressionLevel: c_int
)
{
lz4::LZ4_resetStreamHC(
@ -1052,7 +1052,7 @@ pub unsafe extern "C" fn csbindgen_LZ4_resetStreamHC(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4F_isError(
code: lz4::LZ4F_errorCode_t
code: lz4::LZ4F_errorCode_t
) -> c_uint
{
lz4::LZ4F_isError(
@ -1062,7 +1062,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_isError(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4F_getErrorName(
code: lz4::LZ4F_errorCode_t
code: lz4::LZ4F_errorCode_t
) -> *const c_char
{
lz4::LZ4F_getErrorName(
@ -1072,7 +1072,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_getErrorName(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4F_compressionLevel_max(
) -> c_int
{
lz4::LZ4F_compressionLevel_max(
@ -1083,7 +1083,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_compressionLevel_max(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4F_compressFrameBound(
srcSize: usize,
preferencesPtr: *const lz4::LZ4F_preferences_t
preferencesPtr: *const lz4::LZ4F_preferences_t
) -> usize
{
lz4::LZ4F_compressFrameBound(
@ -1098,7 +1098,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_compressFrame(
dstCapacity: usize,
srcBuffer: *const c_void,
srcSize: usize,
preferencesPtr: *const lz4::LZ4F_preferences_t
preferencesPtr: *const lz4::LZ4F_preferences_t
) -> usize
{
lz4::LZ4F_compressFrame(
@ -1112,7 +1112,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_compressFrame(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4F_getVersion(
) -> c_uint
{
lz4::LZ4F_getVersion(
@ -1123,7 +1123,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_getVersion(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4F_createCompressionContext(
cctxPtr: *mut *mut lz4::LZ4F_cctx,
version: c_uint
version: c_uint
) -> lz4::LZ4F_errorCode_t
{
lz4::LZ4F_createCompressionContext(
@ -1134,7 +1134,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_createCompressionContext(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4F_freeCompressionContext(
cctx: *mut lz4::LZ4F_cctx
cctx: *mut lz4::LZ4F_cctx
) -> lz4::LZ4F_errorCode_t
{
lz4::LZ4F_freeCompressionContext(
@ -1147,7 +1147,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_compressBegin(
cctx: *mut lz4::LZ4F_cctx,
dstBuffer: *mut c_void,
dstCapacity: usize,
prefsPtr: *const lz4::LZ4F_preferences_t
prefsPtr: *const lz4::LZ4F_preferences_t
) -> usize
{
lz4::LZ4F_compressBegin(
@ -1161,7 +1161,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_compressBegin(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4F_compressBound(
srcSize: usize,
prefsPtr: *const lz4::LZ4F_preferences_t
prefsPtr: *const lz4::LZ4F_preferences_t
) -> usize
{
lz4::LZ4F_compressBound(
@ -1177,7 +1177,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_compressUpdate(
dstCapacity: usize,
srcBuffer: *const c_void,
srcSize: usize,
cOptPtr: *const lz4::LZ4F_compressOptions_t
cOptPtr: *const lz4::LZ4F_compressOptions_t
) -> usize
{
lz4::LZ4F_compressUpdate(
@ -1195,7 +1195,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_flush(
cctx: *mut lz4::LZ4F_cctx,
dstBuffer: *mut c_void,
dstCapacity: usize,
cOptPtr: *const lz4::LZ4F_compressOptions_t
cOptPtr: *const lz4::LZ4F_compressOptions_t
) -> usize
{
lz4::LZ4F_flush(
@ -1211,7 +1211,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_compressEnd(
cctx: *mut lz4::LZ4F_cctx,
dstBuffer: *mut c_void,
dstCapacity: usize,
cOptPtr: *const lz4::LZ4F_compressOptions_t
cOptPtr: *const lz4::LZ4F_compressOptions_t
) -> usize
{
lz4::LZ4F_compressEnd(
@ -1225,7 +1225,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_compressEnd(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4F_createDecompressionContext(
dctxPtr: *mut *mut lz4::LZ4F_dctx,
version: c_uint
version: c_uint
) -> lz4::LZ4F_errorCode_t
{
lz4::LZ4F_createDecompressionContext(
@ -1236,7 +1236,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_createDecompressionContext(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4F_freeDecompressionContext(
dctx: *mut lz4::LZ4F_dctx
dctx: *mut lz4::LZ4F_dctx
) -> lz4::LZ4F_errorCode_t
{
lz4::LZ4F_freeDecompressionContext(
@ -1247,7 +1247,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_freeDecompressionContext(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4F_headerSize(
src: *const c_void,
srcSize: usize
srcSize: usize
) -> usize
{
lz4::LZ4F_headerSize(
@ -1261,7 +1261,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_getFrameInfo(
dctx: *mut lz4::LZ4F_dctx,
frameInfoPtr: *mut lz4::LZ4F_frameInfo_t,
srcBuffer: *const c_void,
srcSizePtr: *mut usize
srcSizePtr: *mut usize
) -> usize
{
lz4::LZ4F_getFrameInfo(
@ -1279,7 +1279,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_decompress(
dstSizePtr: *mut usize,
srcBuffer: *const c_void,
srcSizePtr: *mut usize,
dOptPtr: *const lz4::LZ4F_decompressOptions_t
dOptPtr: *const lz4::LZ4F_decompressOptions_t
) -> usize
{
lz4::LZ4F_decompress(
@ -1294,7 +1294,7 @@ pub unsafe extern "C" fn csbindgen_LZ4F_decompress(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_LZ4F_resetDecompressionContext(
dctx: *mut lz4::LZ4F_dctx
dctx: *mut lz4::LZ4F_dctx
)
{
lz4::LZ4F_resetDecompressionContext(

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@ use super::zstd::*;
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_versionNumber(
) -> c_uint
{
ZSTD_versionNumber(
@ -18,7 +18,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_versionNumber(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_versionString(
) -> *const c_char
{
ZSTD_versionString(
@ -32,7 +32,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_compress(
dstCapacity: usize,
src: *const c_void,
srcSize: usize,
compressionLevel: c_int
compressionLevel: c_int
) -> usize
{
ZSTD_compress(
@ -49,7 +49,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_decompress(
dst: *mut c_void,
dstCapacity: usize,
src: *const c_void,
compressedSize: usize
compressedSize: usize
) -> usize
{
ZSTD_decompress(
@ -63,7 +63,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_decompress(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_getFrameContentSize(
src: *const c_void,
srcSize: usize
srcSize: usize
) -> c_ulonglong
{
ZSTD_getFrameContentSize(
@ -75,7 +75,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_getFrameContentSize(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_getDecompressedSize(
src: *const c_void,
srcSize: usize
srcSize: usize
) -> c_ulonglong
{
ZSTD_getDecompressedSize(
@ -87,7 +87,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_getDecompressedSize(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_findFrameCompressedSize(
src: *const c_void,
srcSize: usize
srcSize: usize
) -> usize
{
ZSTD_findFrameCompressedSize(
@ -98,7 +98,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_findFrameCompressedSize(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_compressBound(
srcSize: usize
srcSize: usize
) -> usize
{
ZSTD_compressBound(
@ -108,7 +108,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_compressBound(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_isError(
code: usize
code: usize
) -> c_uint
{
ZSTD_isError(
@ -118,7 +118,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_isError(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_getErrorName(
code: usize
code: usize
) -> *const c_char
{
ZSTD_getErrorName(
@ -128,7 +128,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_getErrorName(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_minCLevel(
) -> c_int
{
ZSTD_minCLevel(
@ -138,7 +138,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_minCLevel(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_maxCLevel(
) -> c_int
{
ZSTD_maxCLevel(
@ -148,7 +148,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_maxCLevel(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_defaultCLevel(
) -> c_int
{
ZSTD_defaultCLevel(
@ -158,7 +158,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_defaultCLevel(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_createCCtx(
) -> *mut ZSTD_CCtx
{
ZSTD_createCCtx(
@ -168,7 +168,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_createCCtx(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_freeCCtx(
cctx: *mut ZSTD_CCtx
cctx: *mut ZSTD_CCtx
) -> usize
{
ZSTD_freeCCtx(
@ -183,7 +183,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_compressCCtx(
dstCapacity: usize,
src: *const c_void,
srcSize: usize,
compressionLevel: c_int
compressionLevel: c_int
) -> usize
{
ZSTD_compressCCtx(
@ -198,7 +198,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_compressCCtx(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_createDCtx(
) -> *mut ZSTD_DCtx
{
ZSTD_createDCtx(
@ -208,7 +208,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_createDCtx(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_freeDCtx(
dctx: *mut ZSTD_DCtx
dctx: *mut ZSTD_DCtx
) -> usize
{
ZSTD_freeDCtx(
@ -222,7 +222,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_decompressDCtx(
dst: *mut c_void,
dstCapacity: usize,
src: *const c_void,
srcSize: usize
srcSize: usize
) -> usize
{
ZSTD_decompressDCtx(
@ -236,7 +236,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_decompressDCtx(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_cParam_getBounds(
cParam: ZSTD_cParameter
cParam: ZSTD_cParameter
) -> ZSTD_bounds
{
ZSTD_cParam_getBounds(
@ -248,7 +248,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_cParam_getBounds(
pub unsafe extern "C" fn csbindgen_ZSTD_CCtx_setParameter(
cctx: *mut ZSTD_CCtx,
param: ZSTD_cParameter,
value: c_int
value: c_int
) -> usize
{
ZSTD_CCtx_setParameter(
@ -261,7 +261,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_CCtx_setParameter(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_CCtx_setPledgedSrcSize(
cctx: *mut ZSTD_CCtx,
pledgedSrcSize: c_ulonglong
pledgedSrcSize: c_ulonglong
) -> usize
{
ZSTD_CCtx_setPledgedSrcSize(
@ -273,7 +273,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_CCtx_setPledgedSrcSize(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_CCtx_reset(
cctx: *mut ZSTD_CCtx,
reset: ZSTD_ResetDirective
reset: ZSTD_ResetDirective
) -> usize
{
ZSTD_CCtx_reset(
@ -288,7 +288,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_compress2(
dst: *mut c_void,
dstCapacity: usize,
src: *const c_void,
srcSize: usize
srcSize: usize
) -> usize
{
ZSTD_compress2(
@ -302,7 +302,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_compress2(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_dParam_getBounds(
dParam: ZSTD_dParameter
dParam: ZSTD_dParameter
) -> ZSTD_bounds
{
ZSTD_dParam_getBounds(
@ -314,7 +314,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_dParam_getBounds(
pub unsafe extern "C" fn csbindgen_ZSTD_DCtx_setParameter(
dctx: *mut ZSTD_DCtx,
param: ZSTD_dParameter,
value: c_int
value: c_int
) -> usize
{
ZSTD_DCtx_setParameter(
@ -327,7 +327,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_DCtx_setParameter(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_DCtx_reset(
dctx: *mut ZSTD_DCtx,
reset: ZSTD_ResetDirective
reset: ZSTD_ResetDirective
) -> usize
{
ZSTD_DCtx_reset(
@ -338,7 +338,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_DCtx_reset(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_createCStream(
) -> *mut ZSTD_CStream
{
ZSTD_createCStream(
@ -348,7 +348,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_createCStream(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_freeCStream(
zcs: *mut ZSTD_CStream
zcs: *mut ZSTD_CStream
) -> usize
{
ZSTD_freeCStream(
@ -361,7 +361,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_compressStream2(
cctx: *mut ZSTD_CCtx,
output: *mut ZSTD_outBuffer,
input: *mut ZSTD_inBuffer,
endOp: ZSTD_EndDirective
endOp: ZSTD_EndDirective
) -> usize
{
ZSTD_compressStream2(
@ -374,7 +374,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_compressStream2(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_CStreamInSize(
) -> usize
{
ZSTD_CStreamInSize(
@ -384,7 +384,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_CStreamInSize(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_CStreamOutSize(
) -> usize
{
ZSTD_CStreamOutSize(
@ -395,7 +395,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_CStreamOutSize(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_initCStream(
zcs: *mut ZSTD_CStream,
compressionLevel: c_int
compressionLevel: c_int
) -> usize
{
ZSTD_initCStream(
@ -408,7 +408,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_initCStream(
pub unsafe extern "C" fn csbindgen_ZSTD_compressStream(
zcs: *mut ZSTD_CStream,
output: *mut ZSTD_outBuffer,
input: *mut ZSTD_inBuffer
input: *mut ZSTD_inBuffer
) -> usize
{
ZSTD_compressStream(
@ -421,7 +421,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_compressStream(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_flushStream(
zcs: *mut ZSTD_CStream,
output: *mut ZSTD_outBuffer
output: *mut ZSTD_outBuffer
) -> usize
{
ZSTD_flushStream(
@ -433,7 +433,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_flushStream(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_endStream(
zcs: *mut ZSTD_CStream,
output: *mut ZSTD_outBuffer
output: *mut ZSTD_outBuffer
) -> usize
{
ZSTD_endStream(
@ -444,7 +444,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_endStream(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_createDStream(
) -> *mut ZSTD_DStream
{
ZSTD_createDStream(
@ -454,7 +454,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_createDStream(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_freeDStream(
zds: *mut ZSTD_DStream
zds: *mut ZSTD_DStream
) -> usize
{
ZSTD_freeDStream(
@ -464,7 +464,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_freeDStream(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_initDStream(
zds: *mut ZSTD_DStream
zds: *mut ZSTD_DStream
) -> usize
{
ZSTD_initDStream(
@ -476,7 +476,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_initDStream(
pub unsafe extern "C" fn csbindgen_ZSTD_decompressStream(
zds: *mut ZSTD_DStream,
output: *mut ZSTD_outBuffer,
input: *mut ZSTD_inBuffer
input: *mut ZSTD_inBuffer
) -> usize
{
ZSTD_decompressStream(
@ -488,7 +488,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_decompressStream(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_DStreamInSize(
) -> usize
{
ZSTD_DStreamInSize(
@ -498,7 +498,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_DStreamInSize(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_DStreamOutSize(
) -> usize
{
ZSTD_DStreamOutSize(
@ -515,7 +515,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_compress_usingDict(
srcSize: usize,
dict: *const c_void,
dictSize: usize,
compressionLevel: c_int
compressionLevel: c_int
) -> usize
{
ZSTD_compress_usingDict(
@ -538,7 +538,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_decompress_usingDict(
src: *const c_void,
srcSize: usize,
dict: *const c_void,
dictSize: usize
dictSize: usize
) -> usize
{
ZSTD_decompress_usingDict(
@ -556,7 +556,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_decompress_usingDict(
pub unsafe extern "C" fn csbindgen_ZSTD_createCDict(
dictBuffer: *const c_void,
dictSize: usize,
compressionLevel: c_int
compressionLevel: c_int
) -> *mut ZSTD_CDict
{
ZSTD_createCDict(
@ -568,7 +568,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_createCDict(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_freeCDict(
CDict: *mut ZSTD_CDict
CDict: *mut ZSTD_CDict
) -> usize
{
ZSTD_freeCDict(
@ -583,7 +583,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_compress_usingCDict(
dstCapacity: usize,
src: *const c_void,
srcSize: usize,
cdict: *const ZSTD_CDict
cdict: *const ZSTD_CDict
) -> usize
{
ZSTD_compress_usingCDict(
@ -599,7 +599,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_compress_usingCDict(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_createDDict(
dictBuffer: *const c_void,
dictSize: usize
dictSize: usize
) -> *mut ZSTD_DDict
{
ZSTD_createDDict(
@ -610,7 +610,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_createDDict(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_freeDDict(
ddict: *mut ZSTD_DDict
ddict: *mut ZSTD_DDict
) -> usize
{
ZSTD_freeDDict(
@ -625,7 +625,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_decompress_usingDDict(
dstCapacity: usize,
src: *const c_void,
srcSize: usize,
ddict: *const ZSTD_DDict
ddict: *const ZSTD_DDict
) -> usize
{
ZSTD_decompress_usingDDict(
@ -641,7 +641,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_decompress_usingDDict(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_getDictID_fromDict(
dict: *const c_void,
dictSize: usize
dictSize: usize
) -> c_uint
{
ZSTD_getDictID_fromDict(
@ -652,7 +652,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_getDictID_fromDict(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_getDictID_fromCDict(
cdict: *const ZSTD_CDict
cdict: *const ZSTD_CDict
) -> c_uint
{
ZSTD_getDictID_fromCDict(
@ -662,7 +662,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_getDictID_fromCDict(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_getDictID_fromDDict(
ddict: *const ZSTD_DDict
ddict: *const ZSTD_DDict
) -> c_uint
{
ZSTD_getDictID_fromDDict(
@ -673,7 +673,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_getDictID_fromDDict(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_getDictID_fromFrame(
src: *const c_void,
srcSize: usize
srcSize: usize
) -> c_uint
{
ZSTD_getDictID_fromFrame(
@ -686,7 +686,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_getDictID_fromFrame(
pub unsafe extern "C" fn csbindgen_ZSTD_CCtx_loadDictionary(
cctx: *mut ZSTD_CCtx,
dict: *const c_void,
dictSize: usize
dictSize: usize
) -> usize
{
ZSTD_CCtx_loadDictionary(
@ -699,7 +699,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_CCtx_loadDictionary(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_CCtx_refCDict(
cctx: *mut ZSTD_CCtx,
cdict: *const ZSTD_CDict
cdict: *const ZSTD_CDict
) -> usize
{
ZSTD_CCtx_refCDict(
@ -712,7 +712,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_CCtx_refCDict(
pub unsafe extern "C" fn csbindgen_ZSTD_CCtx_refPrefix(
cctx: *mut ZSTD_CCtx,
prefix: *const c_void,
prefixSize: usize
prefixSize: usize
) -> usize
{
ZSTD_CCtx_refPrefix(
@ -726,7 +726,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_CCtx_refPrefix(
pub unsafe extern "C" fn csbindgen_ZSTD_DCtx_loadDictionary(
dctx: *mut ZSTD_DCtx,
dict: *const c_void,
dictSize: usize
dictSize: usize
) -> usize
{
ZSTD_DCtx_loadDictionary(
@ -739,7 +739,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_DCtx_loadDictionary(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_DCtx_refDDict(
dctx: *mut ZSTD_DCtx,
ddict: *const ZSTD_DDict
ddict: *const ZSTD_DDict
) -> usize
{
ZSTD_DCtx_refDDict(
@ -752,7 +752,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_DCtx_refDDict(
pub unsafe extern "C" fn csbindgen_ZSTD_DCtx_refPrefix(
dctx: *mut ZSTD_DCtx,
prefix: *const c_void,
prefixSize: usize
prefixSize: usize
) -> usize
{
ZSTD_DCtx_refPrefix(
@ -764,7 +764,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_DCtx_refPrefix(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_sizeof_CCtx(
cctx: *const ZSTD_CCtx
cctx: *const ZSTD_CCtx
) -> usize
{
ZSTD_sizeof_CCtx(
@ -774,7 +774,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_sizeof_CCtx(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_sizeof_DCtx(
dctx: *const ZSTD_DCtx
dctx: *const ZSTD_DCtx
) -> usize
{
ZSTD_sizeof_DCtx(
@ -784,7 +784,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_sizeof_DCtx(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_sizeof_CStream(
zcs: *const ZSTD_CStream
zcs: *const ZSTD_CStream
) -> usize
{
ZSTD_sizeof_CStream(
@ -794,7 +794,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_sizeof_CStream(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_sizeof_DStream(
zds: *const ZSTD_DStream
zds: *const ZSTD_DStream
) -> usize
{
ZSTD_sizeof_DStream(
@ -804,7 +804,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_sizeof_DStream(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_sizeof_CDict(
cdict: *const ZSTD_CDict
cdict: *const ZSTD_CDict
) -> usize
{
ZSTD_sizeof_CDict(
@ -814,7 +814,7 @@ pub unsafe extern "C" fn csbindgen_ZSTD_sizeof_CDict(
#[no_mangle]
pub unsafe extern "C" fn csbindgen_ZSTD_sizeof_DDict(
ddict: *const ZSTD_DDict
ddict: *const ZSTD_DDict
) -> usize
{
ZSTD_sizeof_DDict(

View File

@ -30,6 +30,7 @@ pub struct BindgenOptions {
pub csharp_if_dll_name: String,
pub csharp_use_function_pointer: bool,
pub csharp_imported_namespaces: Vec<String>,
pub csharp_generate_const: bool,
}
impl Default for Builder {
@ -53,6 +54,7 @@ impl Default for Builder {
csharp_if_dll_name: "".to_string(),
csharp_use_function_pointer: true,
csharp_imported_namespaces: vec![],
csharp_generate_const: false,
},
}
}
@ -181,6 +183,12 @@ impl Builder {
self
}
/// conifure C# generate const, default is false
pub fn csharp_generate_const(mut self, csharp_generate_const: bool) -> Builder {
self.options.csharp_generate_const = csharp_generate_const;
self
}
pub fn generate_csharp_file<P: AsRef<Path>>(
&self,
csharp_output_path: P,

View File

@ -79,6 +79,7 @@ pub fn emit_csharp(
aliases: &AliasMap,
structs: &Vec<RustStruct>,
enums: &Vec<RustEnum>,
consts: &Vec<RustConst>,
options: &BindgenOptions,
) -> String {
// configure
@ -290,6 +291,27 @@ pub fn emit_csharp(
enum_string.push('\n');
}
let mut const_string = String::new();
for item in consts {
let type_name = item.rust_type.to_csharp_string(
options,
aliases,
false,
&"".to_string(),
&"".to_string(),
);
const_string.push_str(
format!(
" public {} {} = {};",
type_name,
escape_name(item.const_name.as_str()),
item.value
)
.as_str(),
);
}
let mut imported_namespaces = String::new();
for name in &options.csharp_imported_namespaces {
imported_namespaces.push_str_ln(format!("using {name};").as_str());
@ -317,6 +339,7 @@ namespace {namespace}
{structs_string}
{enum_string}
{const_string}
}}
"
);

View File

@ -14,7 +14,7 @@ use emitter::*;
use field_map::FieldMap;
use parser::*;
use std::{collections::HashSet, error::Error};
use type_meta::{ExternMethod, RustEnum, RustStruct, RustType};
use type_meta::{ExternMethod, RustEnum, RustStruct, RustType, RustConst};
enum GenerateKind {
InputBindgen,
@ -34,6 +34,7 @@ pub(crate) fn generate(
let mut aliases = AliasMap::new();
let mut structs: Vec<RustStruct> = vec![];
let mut enums: Vec<RustEnum> = vec![];
let mut consts: Vec<RustConst> = vec![];
for path in paths {
let file_content = std::fs::read_to_string(path)
@ -47,6 +48,10 @@ pub(crate) fn generate(
collect_type_alias(&file_ast, &mut aliases);
collect_struct(&file_ast, &mut structs);
collect_enum(&file_ast, &mut enums);
if options.csharp_generate_const {
collect_const(&file_ast, &mut consts);
}
}
// collect using_types
@ -82,7 +87,7 @@ pub(crate) fn generate(
} else {
None
};
let csharp = emit_csharp(&methods, &aliases, &structs, &enums, options);
let csharp = emit_csharp(&methods, &aliases, &structs, &enums, &consts, options);
Ok((rust, csharp))
}

View File

@ -10,9 +10,9 @@ enum FnItem {
/// build a Vec of all Items, unless the Item is a Item::Mod, then append the Item contents of the vect
/// Do this recursively.
/// This is not memory-efficient, would work better with an iterator, but does not seem performance critical.
fn depth_first_module_walk<'a>(ast: &'a Vec<Item>) -> Vec<&'a syn::Item>{
let mut unwrapped_items : Vec<&syn::Item> = vec![];
/// This is not memory-efficient, would work better with an iterator, but does not seem performance critical.
fn depth_first_module_walk<'a>(ast: &'a Vec<Item>) -> Vec<&'a syn::Item> {
let mut unwrapped_items: Vec<&syn::Item> = vec![];
for item in ast {
match item {
Item::Mod(m) => match &m.content {
@ -26,7 +26,7 @@ fn depth_first_module_walk<'a>(ast: &'a Vec<Item>) -> Vec<&'a syn::Item>{
}
}
}
unwrapped_items
}
@ -232,6 +232,49 @@ fn collect_fields_unnamed(fields: &syn::FieldsUnnamed) -> Vec<FieldMember> {
result
}
pub fn collect_const(ast: &syn::File, result: &mut Vec<RustConst>) {
for item in depth_first_module_walk(&ast.items) {
if let Item::Const(ct) = item {
// pub const Ident: ty = expr
let const_name = ct.ident.to_string();
let t = parse_type(&ct.ty);
if let syn::Expr::Lit(lit_expr) = &*ct.expr {
let value = match &lit_expr.lit {
syn::Lit::Str(s) => {
format!("{}", s.value())
}
syn::Lit::ByteStr(bs) => {
format!("{:?}", bs.value())
}
syn::Lit::Byte(b) => {
format!("{:?}", b.value())
}
syn::Lit::Char(c) => {
format!("'{}'", c.value())
}
syn::Lit::Int(i) => {
format!("{}", i.base10_parse::<i64>().unwrap())
}
syn::Lit::Float(f) => {
format!("{}", f.base10_parse::<f64>().unwrap())
}
syn::Lit::Bool(b) => {
format!("{}", b.value)
}
_ => format!(""),
};
result.push(RustConst {
const_name: const_name,
rust_type: t,
value: value,
});
}
}
}
}
pub fn collect_enum(ast: &syn::File, result: &mut Vec<RustEnum>) {
for item in depth_first_module_walk(&ast.items) {
if let Item::Enum(t) = item {

View File

@ -101,6 +101,13 @@ pub struct RustEnum {
pub is_flags: bool,
}
#[derive(Clone, Debug)]
pub struct RustConst {
pub const_name: String,
pub rust_type: RustType,
pub value: String,
}
impl RustType {
pub fn to_rust_string(&self, type_path: &str) -> String {
let mut sb = String::new();

View File

@ -7,6 +7,7 @@
using System;
using System.Runtime.InteropServices;
namespace CsBindgen
{
internal static unsafe partial class NativeMethods
@ -247,5 +248,6 @@ namespace CsBindgen
}
}

View File

@ -7,6 +7,7 @@
using System;
using System.Runtime.InteropServices;
namespace CsBindgen
{
internal static unsafe partial class NestedModuleTests
@ -40,5 +41,6 @@ namespace CsBindgen
}
}

View File

@ -7,6 +7,7 @@
using System;
using System.Runtime.InteropServices;
namespace CsBindgen
{
internal static unsafe partial class LibBullet3
@ -1789,5 +1790,6 @@ namespace CsBindgen
}

View File

@ -7,6 +7,7 @@
using System;
using System.Runtime.InteropServices;
namespace Physx
{
internal static unsafe partial class LibPhysx
@ -11267,5 +11268,6 @@ namespace Physx
}
}

View File

@ -7,6 +7,7 @@
using System;
using System.Runtime.InteropServices;
namespace PixivApi.ImageFile
{
internal static unsafe partial class LibPng16
@ -1087,5 +1088,6 @@ namespace PixivApi.ImageFile
}

View File

@ -7,6 +7,7 @@
using System;
using System.Runtime.InteropServices;
namespace CsBindgen
{
public static unsafe partial class LibLz4
@ -450,5 +451,6 @@ namespace CsBindgen
}

View File

@ -7,6 +7,7 @@
using System;
using System.Runtime.InteropServices;
namespace CsBindgen
{
internal static unsafe partial class LibQuiche
@ -558,5 +559,6 @@ namespace CsBindgen
}

View File

@ -7,6 +7,7 @@
using System;
using System.Runtime.InteropServices;
namespace CsBindgen
{
internal static unsafe partial class LibZstd
@ -306,5 +307,6 @@ namespace CsBindgen
}