csbindgen/dotnet-sandbox/zstd_bindgen.cs

274 lines
13 KiB
C#
Raw Normal View History

2023-02-27 11:06:18 +00:00
// <auto-generated>
// This code is generated via csbindgen.
// DON'T CHANGE THIS DIRECTLY.
// </auto-generated>
using System;
using System.Runtime.InteropServices;
namespace CsBindgen
{
2023-02-27 22:18:10 +00:00
public static unsafe partial class LibZstd
2023-02-27 11:06:18 +00:00
{
2023-02-27 22:18:10 +00:00
const string __DllName = "libzsd";
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern void __va_start(byte** arg1);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern void __security_init_cookie();
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern void __security_check_cookie(UIntPtr _StackCookie);
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern uint ZSTD_versionNumber();
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern byte* ZSTD_versionString();
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_compress(void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, int compressionLevel);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_decompress(void* dst, UIntPtr dstCapacity, void* src, UIntPtr compressedSize);
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern ulong ZSTD_getFrameContentSize(void* src, UIntPtr srcSize);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern ulong ZSTD_getDecompressedSize(void* src, UIntPtr srcSize);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_findFrameCompressedSize(void* src, UIntPtr srcSize);
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_compressBound(UIntPtr srcSize);
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern uint ZSTD_isError(UIntPtr code);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern byte* ZSTD_getErrorName(UIntPtr code);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern int ZSTD_minCLevel();
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern int ZSTD_maxCLevel();
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern int ZSTD_defaultCLevel();
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern ZSTD_CCtx_s* ZSTD_createCCtx();
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_freeCCtx(ZSTD_CCtx_s* cctx);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_compressCCtx(ZSTD_CCtx_s* cctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, int compressionLevel);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern ZSTD_DCtx_s* ZSTD_createDCtx();
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_freeDCtx(ZSTD_DCtx_s* dctx);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_decompressDCtx(ZSTD_DCtx_s* dctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern ZSTD_bounds ZSTD_cParam_getBounds(int cParam);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_CCtx_setParameter(ZSTD_CCtx_s* cctx, int param, int value);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx_s* cctx, ulong pledgedSrcSize);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_CCtx_reset(ZSTD_CCtx_s* cctx, int reset);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_compress2(ZSTD_CCtx_s* cctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern ZSTD_bounds ZSTD_dParam_getBounds(int dParam);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_DCtx_setParameter(ZSTD_DCtx_s* dctx, int param, int value);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_DCtx_reset(ZSTD_DCtx_s* dctx, int reset);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern ZSTD_CCtx_s* ZSTD_createCStream();
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_freeCStream(ZSTD_CCtx_s* zcs);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_compressStream2(ZSTD_CCtx_s* cctx, ZSTD_outBuffer_s* output, ZSTD_inBuffer_s* input, int endOp);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_CStreamInSize();
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_CStreamOutSize();
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_initCStream(ZSTD_CCtx_s* zcs, int compressionLevel);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_compressStream(ZSTD_CCtx_s* zcs, ZSTD_outBuffer_s* output, ZSTD_inBuffer_s* input);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_flushStream(ZSTD_CCtx_s* zcs, ZSTD_outBuffer_s* output);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_endStream(ZSTD_CCtx_s* zcs, ZSTD_outBuffer_s* output);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern ZSTD_DCtx_s* ZSTD_createDStream();
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_freeDStream(ZSTD_DCtx_s* zds);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_initDStream(ZSTD_DCtx_s* zds);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_decompressStream(ZSTD_DCtx_s* zds, ZSTD_outBuffer_s* output, ZSTD_inBuffer_s* input);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_DStreamInSize();
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_DStreamOutSize();
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_compress_usingDict(ZSTD_CCtx_s* ctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, void* dict, UIntPtr dictSize, int compressionLevel);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_decompress_usingDict(ZSTD_DCtx_s* dctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, void* dict, UIntPtr dictSize);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern ZSTD_CDict_s* ZSTD_createCDict(void* dictBuffer, UIntPtr dictSize, int compressionLevel);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_freeCDict(ZSTD_CDict_s* CDict);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_compress_usingCDict(ZSTD_CCtx_s* cctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, ZSTD_CDict_s* cdict);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern ZSTD_DDict_s* ZSTD_createDDict(void* dictBuffer, UIntPtr dictSize);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_freeDDict(ZSTD_DDict_s* ddict);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_decompress_usingDDict(ZSTD_DCtx_s* dctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, ZSTD_DDict_s* ddict);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern uint ZSTD_getDictID_fromDict(void* dict, UIntPtr dictSize);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern uint ZSTD_getDictID_fromCDict(ZSTD_CDict_s* cdict);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern uint ZSTD_getDictID_fromDDict(ZSTD_DDict_s* ddict);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern uint ZSTD_getDictID_fromFrame(void* src, UIntPtr srcSize);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_CCtx_loadDictionary(ZSTD_CCtx_s* cctx, void* dict, UIntPtr dictSize);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_CCtx_refCDict(ZSTD_CCtx_s* cctx, ZSTD_CDict_s* cdict);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_CCtx_refPrefix(ZSTD_CCtx_s* cctx, void* prefix, UIntPtr prefixSize);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_DCtx_loadDictionary(ZSTD_DCtx_s* dctx, void* dict, UIntPtr dictSize);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_DCtx_refDDict(ZSTD_DCtx_s* dctx, ZSTD_DDict_s* ddict);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_DCtx_refPrefix(ZSTD_DCtx_s* dctx, void* prefix, UIntPtr prefixSize);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_sizeof_CCtx(ZSTD_CCtx_s* cctx);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_sizeof_DCtx(ZSTD_DCtx_s* dctx);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_sizeof_CStream(ZSTD_CCtx_s* zcs);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_sizeof_DStream(ZSTD_DCtx_s* zds);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_sizeof_CDict(ZSTD_CDict_s* cdict);
2023-02-27 11:06:18 +00:00
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
2023-02-27 22:18:10 +00:00
public static extern UIntPtr ZSTD_sizeof_DDict(ZSTD_DDict_s* ddict);
2023-02-27 11:06:18 +00:00
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct ZSTD_CCtx_s
{
2023-02-27 22:18:10 +00:00
public fixed byte _unused[1];
2023-02-27 11:06:18 +00:00
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct ZSTD_DCtx_s
{
2023-02-27 22:18:10 +00:00
public fixed byte _unused[1];
2023-02-27 11:06:18 +00:00
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct ZSTD_bounds
{
public UIntPtr error;
2023-02-27 22:18:10 +00:00
public int lowerBound;
public int upperBound;
2023-02-27 11:06:18 +00:00
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct ZSTD_inBuffer_s
{
public void* src;
public UIntPtr size;
public UIntPtr pos;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct ZSTD_outBuffer_s
{
public void* dst;
public UIntPtr size;
public UIntPtr pos;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct ZSTD_CDict_s
{
2023-02-27 22:18:10 +00:00
public fixed byte _unused[1];
2023-02-27 11:06:18 +00:00
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct ZSTD_DDict_s
{
2023-02-27 22:18:10 +00:00
public fixed byte _unused[1];
2023-02-27 11:06:18 +00:00
}
}