diff --git a/csbindgen-tests/build.rs b/csbindgen-tests/build.rs index 99575c2..4299d7d 100644 --- a/csbindgen-tests/build.rs +++ b/csbindgen-tests/build.rs @@ -116,5 +116,14 @@ fn main() -> Result<(), Box> { // .csharp_dll_name("libbullet3") // .generate_to_file("src/bullet3_ffi.rs", "../dotnet-sandbox/bullet3_bindgen.cs")?; + + csbindgen::Builder::new() + .input_bindgen_file("src/libpng16.rs") + //.method_filter(|x| x.starts_with("png_")) + .csharp_namespace("PixivApi.ImageFile") + .csharp_class_name("LibPng16") + .csharp_dll_name("libpng16") + .generate_csharp_file("../dotnet-sandbox/libpng16_csbindgen.cs")?; + Ok(()) } diff --git a/csbindgen-tests/src/lib.rs b/csbindgen-tests/src/lib.rs index 74d34a7..def85cd 100644 --- a/csbindgen-tests/src/lib.rs +++ b/csbindgen-tests/src/lib.rs @@ -66,6 +66,13 @@ mod lz4_ffi; // println!("{:?}", hoge); // } + + +// #[no_mangle] +// pub extern "C" fn string_char(str: char) { +// println!("{}", str); +// } + #[repr(C)] pub struct NfcCard { pub delegate: unsafe extern "C" fn(ByteArray) -> ByteArray diff --git a/csbindgen-tests/src/libpng16.rs b/csbindgen-tests/src/libpng16.rs new file mode 100644 index 0000000..08e243a --- /dev/null +++ b/csbindgen-tests/src/libpng16.rs @@ -0,0 +1,4354 @@ +/* automatically generated by rust-bindgen 0.64.0 */ + +pub const PNG_LIBPNG_VER_STRING: &[u8; 7usize] = b"1.6.39\0"; +pub const PNG_HEADER_VERSION_STRING: &[u8; 44usize] = + b" libpng version 1.6.39 - November 20, 2022\n\0"; +pub const PNG_LIBPNG_VER_SONUM: u32 = 16; +pub const PNG_LIBPNG_VER_DLLNUM: u32 = 16; +pub const PNG_LIBPNG_VER_MAJOR: u32 = 1; +pub const PNG_LIBPNG_VER_MINOR: u32 = 6; +pub const PNG_LIBPNG_VER_RELEASE: u32 = 39; +pub const PNG_LIBPNG_VER_BUILD: u32 = 0; +pub const PNG_LIBPNG_BUILD_ALPHA: u32 = 1; +pub const PNG_LIBPNG_BUILD_BETA: u32 = 2; +pub const PNG_LIBPNG_BUILD_RC: u32 = 3; +pub const PNG_LIBPNG_BUILD_STABLE: u32 = 4; +pub const PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK: u32 = 7; +pub const PNG_LIBPNG_BUILD_PATCH: u32 = 8; +pub const PNG_LIBPNG_BUILD_PRIVATE: u32 = 16; +pub const PNG_LIBPNG_BUILD_SPECIAL: u32 = 32; +pub const PNG_LIBPNG_BUILD_BASE_TYPE: u32 = 4; +pub const PNG_LIBPNG_VER: u32 = 10639; +pub const PNG_API_RULE: u32 = 0; +pub const PNG_DEFAULT_READ_MACROS: u32 = 1; +pub const PNG_GAMMA_THRESHOLD_FIXED: u32 = 5000; +pub const PNG_INFLATE_BUF_SIZE: u32 = 1024; +pub const PNG_MAX_GAMMA_8: u32 = 11; +pub const PNG_QUANTIZE_BLUE_BITS: u32 = 5; +pub const PNG_QUANTIZE_GREEN_BITS: u32 = 5; +pub const PNG_QUANTIZE_RED_BITS: u32 = 5; +pub const PNG_TEXT_Z_DEFAULT_COMPRESSION: i32 = -1; +pub const PNG_TEXT_Z_DEFAULT_STRATEGY: u32 = 0; +pub const PNG_USER_CHUNK_CACHE_MAX: u32 = 1000; +pub const PNG_USER_CHUNK_MALLOC_MAX: u32 = 8000000; +pub const PNG_USER_HEIGHT_MAX: u32 = 1000000; +pub const PNG_USER_WIDTH_MAX: u32 = 1000000; +pub const PNG_ZBUF_SIZE: u32 = 8192; +pub const PNG_ZLIB_VERNUM: u32 = 0; +pub const PNG_Z_DEFAULT_COMPRESSION: i32 = -1; +pub const PNG_Z_DEFAULT_NOFILTER_STRATEGY: u32 = 0; +pub const PNG_Z_DEFAULT_STRATEGY: u32 = 1; +pub const PNG_sCAL_PRECISION: u32 = 5; +pub const PNG_sRGB_PROFILE_CHECKS: u32 = 2; +pub const _VCRT_COMPILER_PREPROCESSOR: u32 = 1; +pub const _SAL_VERSION: u32 = 20; +pub const __SAL_H_VERSION: u32 = 180000000; +pub const _USE_DECLSPECS_FOR_SAL: u32 = 0; +pub const _USE_ATTRIBUTES_FOR_SAL: u32 = 0; +pub const _CRT_PACKING: u32 = 8; +pub const _HAS_EXCEPTIONS: u32 = 1; +pub const _STL_LANG: u32 = 0; +pub const _HAS_CXX17: u32 = 0; +pub const _HAS_CXX20: u32 = 0; +pub const _HAS_CXX23: u32 = 0; +pub const _HAS_NODISCARD: u32 = 0; +pub const CHAR_BIT: u32 = 8; +pub const SCHAR_MIN: i32 = -128; +pub const SCHAR_MAX: u32 = 127; +pub const UCHAR_MAX: u32 = 255; +pub const CHAR_MIN: i32 = -128; +pub const CHAR_MAX: u32 = 127; +pub const MB_LEN_MAX: u32 = 5; +pub const SHRT_MIN: i32 = -32768; +pub const SHRT_MAX: u32 = 32767; +pub const USHRT_MAX: u32 = 65535; +pub const INT_MIN: i32 = -2147483648; +pub const INT_MAX: u32 = 2147483647; +pub const UINT_MAX: u32 = 4294967295; +pub const LONG_MIN: i32 = -2147483648; +pub const LONG_MAX: u32 = 2147483647; +pub const ULONG_MAX: u32 = 4294967295; +pub const _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE: u32 = 1; +pub const _CRT_BUILD_DESKTOP_APP: u32 = 1; +pub const _ARGMAX: u32 = 100; +pub const _CRT_INT_MAX: u32 = 2147483647; +pub const _CRT_FUNCTIONS_REQUIRED: u32 = 1; +pub const _CRT_HAS_CXX17: u32 = 0; +pub const _CRT_HAS_C11: u32 = 1; +pub const _CRT_INTERNAL_NONSTDC_NAMES: u32 = 1; +pub const __STDC_SECURE_LIB__: u32 = 200411; +pub const __GOT_SECURE_LIB__: u32 = 200411; +pub const __STDC_WANT_SECURE_LIB__: u32 = 1; +pub const _SECURECRT_FILL_BUFFER_PATTERN: u32 = 254; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES: u32 = 1; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY: u32 = 0; +pub const _CRT_INTERNAL_STDIO_SYMBOL_PREFIX: &[u8; 1usize] = b"\0"; +pub const _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION: u32 = 1; +pub const _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR: u32 = 2; +pub const _CRT_INTERNAL_PRINTF_LEGACY_WIDE_SPECIFIERS: u32 = 4; +pub const _CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY: u32 = 8; +pub const _CRT_INTERNAL_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS: u32 = 16; +pub const _CRT_INTERNAL_PRINTF_STANDARD_ROUNDING: u32 = 32; +pub const _CRT_INTERNAL_SCANF_SECURECRT: u32 = 1; +pub const _CRT_INTERNAL_SCANF_LEGACY_WIDE_SPECIFIERS: u32 = 2; +pub const _CRT_INTERNAL_SCANF_LEGACY_MSVCRT_COMPATIBILITY: u32 = 4; +pub const BUFSIZ: u32 = 512; +pub const _NSTREAM_: u32 = 512; +pub const _IOB_ENTRIES: u32 = 3; +pub const EOF: i32 = -1; +pub const _IOFBF: u32 = 0; +pub const _IOLBF: u32 = 64; +pub const _IONBF: u32 = 4; +pub const L_tmpnam: u32 = 260; +pub const L_tmpnam_s: u32 = 260; +pub const SEEK_CUR: u32 = 1; +pub const SEEK_END: u32 = 2; +pub const SEEK_SET: u32 = 0; +pub const FILENAME_MAX: u32 = 260; +pub const FOPEN_MAX: u32 = 20; +pub const _SYS_OPEN: u32 = 20; +pub const TMP_MAX: u32 = 2147483647; +pub const TMP_MAX_S: u32 = 2147483647; +pub const _TMP_MAX_S: u32 = 2147483647; +pub const SYS_OPEN: u32 = 20; +pub const _JBLEN: u32 = 16; +pub const _CRT_USE_CONFORMING_ANNEX_K_TIME: u32 = 0; +pub const TIME_UTC: u32 = 1; +pub const PNG_LIBPNG_BUILD_TYPE: u32 = 4; +pub const PNG_TEXT_COMPRESSION_NONE_WR: i32 = -3; +pub const PNG_TEXT_COMPRESSION_zTXt_WR: i32 = -2; +pub const PNG_TEXT_COMPRESSION_NONE: i32 = -1; +pub const PNG_TEXT_COMPRESSION_zTXt: u32 = 0; +pub const PNG_ITXT_COMPRESSION_NONE: u32 = 1; +pub const PNG_ITXT_COMPRESSION_zTXt: u32 = 2; +pub const PNG_TEXT_COMPRESSION_LAST: u32 = 3; +pub const PNG_HAVE_IHDR: u32 = 1; +pub const PNG_HAVE_PLTE: u32 = 2; +pub const PNG_AFTER_IDAT: u32 = 8; +pub const PNG_FP_1: u32 = 100000; +pub const PNG_FP_HALF: u32 = 50000; +pub const PNG_COLOR_MASK_PALETTE: u32 = 1; +pub const PNG_COLOR_MASK_COLOR: u32 = 2; +pub const PNG_COLOR_MASK_ALPHA: u32 = 4; +pub const PNG_COLOR_TYPE_GRAY: u32 = 0; +pub const PNG_COLOR_TYPE_PALETTE: u32 = 3; +pub const PNG_COLOR_TYPE_RGB: u32 = 2; +pub const PNG_COLOR_TYPE_RGB_ALPHA: u32 = 6; +pub const PNG_COLOR_TYPE_GRAY_ALPHA: u32 = 4; +pub const PNG_COLOR_TYPE_RGBA: u32 = 6; +pub const PNG_COLOR_TYPE_GA: u32 = 4; +pub const PNG_COMPRESSION_TYPE_BASE: u32 = 0; +pub const PNG_COMPRESSION_TYPE_DEFAULT: u32 = 0; +pub const PNG_FILTER_TYPE_BASE: u32 = 0; +pub const PNG_INTRAPIXEL_DIFFERENCING: u32 = 64; +pub const PNG_FILTER_TYPE_DEFAULT: u32 = 0; +pub const PNG_INTERLACE_NONE: u32 = 0; +pub const PNG_INTERLACE_ADAM7: u32 = 1; +pub const PNG_INTERLACE_LAST: u32 = 2; +pub const PNG_OFFSET_PIXEL: u32 = 0; +pub const PNG_OFFSET_MICROMETER: u32 = 1; +pub const PNG_OFFSET_LAST: u32 = 2; +pub const PNG_EQUATION_LINEAR: u32 = 0; +pub const PNG_EQUATION_BASE_E: u32 = 1; +pub const PNG_EQUATION_ARBITRARY: u32 = 2; +pub const PNG_EQUATION_HYPERBOLIC: u32 = 3; +pub const PNG_EQUATION_LAST: u32 = 4; +pub const PNG_SCALE_UNKNOWN: u32 = 0; +pub const PNG_SCALE_METER: u32 = 1; +pub const PNG_SCALE_RADIAN: u32 = 2; +pub const PNG_SCALE_LAST: u32 = 3; +pub const PNG_RESOLUTION_UNKNOWN: u32 = 0; +pub const PNG_RESOLUTION_METER: u32 = 1; +pub const PNG_RESOLUTION_LAST: u32 = 2; +pub const PNG_sRGB_INTENT_PERCEPTUAL: u32 = 0; +pub const PNG_sRGB_INTENT_RELATIVE: u32 = 1; +pub const PNG_sRGB_INTENT_SATURATION: u32 = 2; +pub const PNG_sRGB_INTENT_ABSOLUTE: u32 = 3; +pub const PNG_sRGB_INTENT_LAST: u32 = 4; +pub const PNG_KEYWORD_MAX_LENGTH: u32 = 79; +pub const PNG_MAX_PALETTE_LENGTH: u32 = 256; +pub const PNG_INFO_gAMA: u32 = 1; +pub const PNG_INFO_sBIT: u32 = 2; +pub const PNG_INFO_cHRM: u32 = 4; +pub const PNG_INFO_PLTE: u32 = 8; +pub const PNG_INFO_tRNS: u32 = 16; +pub const PNG_INFO_bKGD: u32 = 32; +pub const PNG_INFO_hIST: u32 = 64; +pub const PNG_INFO_pHYs: u32 = 128; +pub const PNG_INFO_oFFs: u32 = 256; +pub const PNG_INFO_tIME: u32 = 512; +pub const PNG_INFO_pCAL: u32 = 1024; +pub const PNG_INFO_sRGB: u32 = 2048; +pub const PNG_INFO_iCCP: u32 = 4096; +pub const PNG_INFO_sPLT: u32 = 8192; +pub const PNG_INFO_sCAL: u32 = 16384; +pub const PNG_INFO_IDAT: u32 = 32768; +pub const PNG_INFO_eXIf: u32 = 65536; +pub const PNG_TRANSFORM_IDENTITY: u32 = 0; +pub const PNG_TRANSFORM_STRIP_16: u32 = 1; +pub const PNG_TRANSFORM_STRIP_ALPHA: u32 = 2; +pub const PNG_TRANSFORM_PACKING: u32 = 4; +pub const PNG_TRANSFORM_PACKSWAP: u32 = 8; +pub const PNG_TRANSFORM_EXPAND: u32 = 16; +pub const PNG_TRANSFORM_INVERT_MONO: u32 = 32; +pub const PNG_TRANSFORM_SHIFT: u32 = 64; +pub const PNG_TRANSFORM_BGR: u32 = 128; +pub const PNG_TRANSFORM_SWAP_ALPHA: u32 = 256; +pub const PNG_TRANSFORM_SWAP_ENDIAN: u32 = 512; +pub const PNG_TRANSFORM_INVERT_ALPHA: u32 = 1024; +pub const PNG_TRANSFORM_STRIP_FILLER: u32 = 2048; +pub const PNG_TRANSFORM_STRIP_FILLER_BEFORE: u32 = 2048; +pub const PNG_TRANSFORM_STRIP_FILLER_AFTER: u32 = 4096; +pub const PNG_TRANSFORM_GRAY_TO_RGB: u32 = 8192; +pub const PNG_TRANSFORM_EXPAND_16: u32 = 16384; +pub const PNG_TRANSFORM_SCALE_16: u32 = 32768; +pub const PNG_FLAG_MNG_EMPTY_PLTE: u32 = 1; +pub const PNG_FLAG_MNG_FILTER_64: u32 = 4; +pub const PNG_ALL_MNG_FEATURES: u32 = 5; +pub const PNG_ERROR_ACTION_NONE: u32 = 1; +pub const PNG_ERROR_ACTION_WARN: u32 = 2; +pub const PNG_ERROR_ACTION_ERROR: u32 = 3; +pub const PNG_RGB_TO_GRAY_DEFAULT: i32 = -1; +pub const PNG_ALPHA_PNG: u32 = 0; +pub const PNG_ALPHA_STANDARD: u32 = 1; +pub const PNG_ALPHA_ASSOCIATED: u32 = 1; +pub const PNG_ALPHA_PREMULTIPLIED: u32 = 1; +pub const PNG_ALPHA_OPTIMIZED: u32 = 2; +pub const PNG_ALPHA_BROKEN: u32 = 3; +pub const PNG_DEFAULT_sRGB: i32 = -1; +pub const PNG_GAMMA_MAC_18: i32 = -2; +pub const PNG_GAMMA_sRGB: u32 = 220000; +pub const PNG_GAMMA_LINEAR: u32 = 100000; +pub const PNG_FILLER_BEFORE: u32 = 0; +pub const PNG_FILLER_AFTER: u32 = 1; +pub const PNG_BACKGROUND_GAMMA_UNKNOWN: u32 = 0; +pub const PNG_BACKGROUND_GAMMA_SCREEN: u32 = 1; +pub const PNG_BACKGROUND_GAMMA_FILE: u32 = 2; +pub const PNG_BACKGROUND_GAMMA_UNIQUE: u32 = 3; +pub const PNG_GAMMA_THRESHOLD: f64 = 0.05; +pub const PNG_CRC_DEFAULT: u32 = 0; +pub const PNG_CRC_ERROR_QUIT: u32 = 1; +pub const PNG_CRC_WARN_DISCARD: u32 = 2; +pub const PNG_CRC_WARN_USE: u32 = 3; +pub const PNG_CRC_QUIET_USE: u32 = 4; +pub const PNG_CRC_NO_CHANGE: u32 = 5; +pub const PNG_NO_FILTERS: u32 = 0; +pub const PNG_FILTER_NONE: u32 = 8; +pub const PNG_FILTER_SUB: u32 = 16; +pub const PNG_FILTER_UP: u32 = 32; +pub const PNG_FILTER_AVG: u32 = 64; +pub const PNG_FILTER_PAETH: u32 = 128; +pub const PNG_FAST_FILTERS: u32 = 56; +pub const PNG_ALL_FILTERS: u32 = 248; +pub const PNG_FILTER_VALUE_NONE: u32 = 0; +pub const PNG_FILTER_VALUE_SUB: u32 = 1; +pub const PNG_FILTER_VALUE_UP: u32 = 2; +pub const PNG_FILTER_VALUE_AVG: u32 = 3; +pub const PNG_FILTER_VALUE_PAETH: u32 = 4; +pub const PNG_FILTER_VALUE_LAST: u32 = 5; +pub const PNG_FILTER_HEURISTIC_DEFAULT: u32 = 0; +pub const PNG_FILTER_HEURISTIC_UNWEIGHTED: u32 = 1; +pub const PNG_FILTER_HEURISTIC_WEIGHTED: u32 = 2; +pub const PNG_FILTER_HEURISTIC_LAST: u32 = 3; +pub const PNG_DESTROY_WILL_FREE_DATA: u32 = 1; +pub const PNG_SET_WILL_FREE_DATA: u32 = 1; +pub const PNG_USER_WILL_FREE_DATA: u32 = 2; +pub const PNG_FREE_HIST: u32 = 8; +pub const PNG_FREE_ICCP: u32 = 16; +pub const PNG_FREE_SPLT: u32 = 32; +pub const PNG_FREE_ROWS: u32 = 64; +pub const PNG_FREE_PCAL: u32 = 128; +pub const PNG_FREE_SCAL: u32 = 256; +pub const PNG_FREE_UNKN: u32 = 512; +pub const PNG_FREE_PLTE: u32 = 4096; +pub const PNG_FREE_TRNS: u32 = 8192; +pub const PNG_FREE_TEXT: u32 = 16384; +pub const PNG_FREE_EXIF: u32 = 32768; +pub const PNG_FREE_ALL: u32 = 65535; +pub const PNG_FREE_MUL: u32 = 16928; +pub const PNG_HANDLE_CHUNK_AS_DEFAULT: u32 = 0; +pub const PNG_HANDLE_CHUNK_NEVER: u32 = 1; +pub const PNG_HANDLE_CHUNK_IF_SAFE: u32 = 2; +pub const PNG_HANDLE_CHUNK_ALWAYS: u32 = 3; +pub const PNG_HANDLE_CHUNK_LAST: u32 = 4; +pub const PNG_IO_NONE: u32 = 0; +pub const PNG_IO_READING: u32 = 1; +pub const PNG_IO_WRITING: u32 = 2; +pub const PNG_IO_SIGNATURE: u32 = 16; +pub const PNG_IO_CHUNK_HDR: u32 = 32; +pub const PNG_IO_CHUNK_DATA: u32 = 64; +pub const PNG_IO_CHUNK_CRC: u32 = 128; +pub const PNG_IO_MASK_OP: u32 = 15; +pub const PNG_IO_MASK_LOC: u32 = 240; +pub const PNG_INTERLACE_ADAM7_PASSES: u32 = 7; +pub const PNG_IMAGE_VERSION: u32 = 1; +pub const PNG_IMAGE_WARNING: u32 = 1; +pub const PNG_IMAGE_ERROR: u32 = 2; +pub const PNG_FORMAT_FLAG_ALPHA: u32 = 1; +pub const PNG_FORMAT_FLAG_COLOR: u32 = 2; +pub const PNG_FORMAT_FLAG_LINEAR: u32 = 4; +pub const PNG_FORMAT_FLAG_COLORMAP: u32 = 8; +pub const PNG_FORMAT_FLAG_BGR: u32 = 16; +pub const PNG_FORMAT_FLAG_AFIRST: u32 = 32; +pub const PNG_FORMAT_FLAG_ASSOCIATED_ALPHA: u32 = 64; +pub const PNG_FORMAT_GRAY: u32 = 0; +pub const PNG_FORMAT_GA: u32 = 1; +pub const PNG_FORMAT_AG: u32 = 33; +pub const PNG_FORMAT_RGB: u32 = 2; +pub const PNG_FORMAT_BGR: u32 = 18; +pub const PNG_FORMAT_RGBA: u32 = 3; +pub const PNG_FORMAT_ARGB: u32 = 35; +pub const PNG_FORMAT_BGRA: u32 = 19; +pub const PNG_FORMAT_ABGR: u32 = 51; +pub const PNG_FORMAT_LINEAR_Y: u32 = 4; +pub const PNG_FORMAT_LINEAR_Y_ALPHA: u32 = 5; +pub const PNG_FORMAT_LINEAR_RGB: u32 = 6; +pub const PNG_FORMAT_LINEAR_RGB_ALPHA: u32 = 7; +pub const PNG_FORMAT_RGB_COLORMAP: u32 = 10; +pub const PNG_FORMAT_BGR_COLORMAP: u32 = 26; +pub const PNG_FORMAT_RGBA_COLORMAP: u32 = 11; +pub const PNG_FORMAT_ARGB_COLORMAP: u32 = 43; +pub const PNG_FORMAT_BGRA_COLORMAP: u32 = 27; +pub const PNG_FORMAT_ABGR_COLORMAP: u32 = 59; +pub const PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB: u32 = 1; +pub const PNG_IMAGE_FLAG_FAST: u32 = 2; +pub const PNG_IMAGE_FLAG_16BIT_sRGB: u32 = 4; +pub const PNG_MAXIMUM_INFLATE_WINDOW: u32 = 2; +pub const PNG_SKIP_sRGB_CHECK_PROFILE: u32 = 4; +pub const PNG_IGNORE_ADLER32: u32 = 8; +pub const PNG_OPTION_NEXT: u32 = 12; +pub const PNG_OPTION_UNSET: u32 = 0; +pub const PNG_OPTION_INVALID: u32 = 1; +pub const PNG_OPTION_OFF: u32 = 2; +pub const PNG_OPTION_ON: u32 = 3; +pub type va_list = *mut ::std::os::raw::c_char; +extern "C" { + pub fn __va_start(arg1: *mut *mut ::std::os::raw::c_char, ...); +} +pub type __vcrt_bool = bool; +pub type wchar_t = ::std::os::raw::c_ushort; +extern "C" { + pub fn __security_init_cookie(); +} +extern "C" { + pub fn __security_check_cookie(_StackCookie: usize); +} +extern "C" { + pub fn __report_gsfailure(_StackCookie: usize) -> !; +} +extern "C" { + pub static mut __security_cookie: usize; +} +pub type __crt_bool = bool; +extern "C" { + pub fn _invalid_parameter_noinfo(); +} +extern "C" { + pub fn _invalid_parameter_noinfo_noreturn() -> !; +} +extern "C" { + pub fn _invoke_watson( + _Expression: *const wchar_t, + _FunctionName: *const wchar_t, + _FileName: *const wchar_t, + _LineNo: ::std::os::raw::c_uint, + _Reserved: usize, + ) -> !; +} +pub type errno_t = ::std::os::raw::c_int; +pub type wint_t = ::std::os::raw::c_ushort; +pub type wctype_t = ::std::os::raw::c_ushort; +pub type __time32_t = ::std::os::raw::c_long; +pub type __time64_t = ::std::os::raw::c_longlong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __crt_locale_data_public { + pub _locale_pctype: *const ::std::os::raw::c_ushort, + pub _locale_mb_cur_max: ::std::os::raw::c_int, + pub _locale_lc_codepage: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout___crt_locale_data_public() { + const UNINIT: ::std::mem::MaybeUninit<__crt_locale_data_public> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__crt_locale_data_public>(), + 16usize, + concat!("Size of: ", stringify!(__crt_locale_data_public)) + ); + assert_eq!( + ::std::mem::align_of::<__crt_locale_data_public>(), + 8usize, + concat!("Alignment of ", stringify!(__crt_locale_data_public)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._locale_pctype) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_data_public), + "::", + stringify!(_locale_pctype) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._locale_mb_cur_max) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_data_public), + "::", + stringify!(_locale_mb_cur_max) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._locale_lc_codepage) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_data_public), + "::", + stringify!(_locale_lc_codepage) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __crt_locale_pointers { + pub locinfo: *mut __crt_locale_data, + pub mbcinfo: *mut __crt_multibyte_data, +} +#[test] +fn bindgen_test_layout___crt_locale_pointers() { + const UNINIT: ::std::mem::MaybeUninit<__crt_locale_pointers> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__crt_locale_pointers>(), + 16usize, + concat!("Size of: ", stringify!(__crt_locale_pointers)) + ); + assert_eq!( + ::std::mem::align_of::<__crt_locale_pointers>(), + 8usize, + concat!("Alignment of ", stringify!(__crt_locale_pointers)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).locinfo) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_pointers), + "::", + stringify!(locinfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mbcinfo) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_pointers), + "::", + stringify!(mbcinfo) + ) + ); +} +pub type _locale_t = *mut __crt_locale_pointers; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _Mbstatet { + pub _Wchar: ::std::os::raw::c_ulong, + pub _Byte: ::std::os::raw::c_ushort, + pub _State: ::std::os::raw::c_ushort, +} +#[test] +fn bindgen_test_layout__Mbstatet() { + const UNINIT: ::std::mem::MaybeUninit<_Mbstatet> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_Mbstatet>(), + 8usize, + concat!("Size of: ", stringify!(_Mbstatet)) + ); + assert_eq!( + ::std::mem::align_of::<_Mbstatet>(), + 4usize, + concat!("Alignment of ", stringify!(_Mbstatet)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._Wchar) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_Mbstatet), + "::", + stringify!(_Wchar) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._Byte) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_Mbstatet), + "::", + stringify!(_Byte) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._State) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_Mbstatet), + "::", + stringify!(_State) + ) + ); +} +pub type mbstate_t = _Mbstatet; +pub type time_t = __time64_t; +pub type rsize_t = usize; +extern "C" { + pub fn _errno() -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn _set_errno(_Value: ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub fn _get_errno(_Value: *mut ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub fn __threadid() -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn __threadhandle() -> usize; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _iobuf { + pub _Placeholder: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout__iobuf() { + const UNINIT: ::std::mem::MaybeUninit<_iobuf> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_iobuf>(), + 8usize, + concat!("Size of: ", stringify!(_iobuf)) + ); + assert_eq!( + ::std::mem::align_of::<_iobuf>(), + 8usize, + concat!("Alignment of ", stringify!(_iobuf)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._Placeholder) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_iobuf), + "::", + stringify!(_Placeholder) + ) + ); +} +pub type FILE = _iobuf; +extern "C" { + pub fn __acrt_iob_func(_Ix: ::std::os::raw::c_uint) -> *mut FILE; +} +extern "C" { + pub fn fgetwc(_Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _fgetwchar() -> wint_t; +} +extern "C" { + pub fn fputwc(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _fputwchar(_Character: wchar_t) -> wint_t; +} +extern "C" { + pub fn getwc(_Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn getwchar() -> wint_t; +} +extern "C" { + pub fn fgetws( + _Buffer: *mut wchar_t, + _BufferCount: ::std::os::raw::c_int, + _Stream: *mut FILE, + ) -> *mut wchar_t; +} +extern "C" { + pub fn fputws(_Buffer: *const wchar_t, _Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _getws_s(_Buffer: *mut wchar_t, _BufferCount: usize) -> *mut wchar_t; +} +extern "C" { + pub fn putwc(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn putwchar(_Character: wchar_t) -> wint_t; +} +extern "C" { + pub fn _putws(_Buffer: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ungetwc(_Character: wint_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _wfdopen(_FileHandle: ::std::os::raw::c_int, _Mode: *const wchar_t) -> *mut FILE; +} +extern "C" { + pub fn _wfopen(_FileName: *const wchar_t, _Mode: *const wchar_t) -> *mut FILE; +} +extern "C" { + pub fn _wfopen_s( + _Stream: *mut *mut FILE, + _FileName: *const wchar_t, + _Mode: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wfreopen( + _FileName: *const wchar_t, + _Mode: *const wchar_t, + _OldStream: *mut FILE, + ) -> *mut FILE; +} +extern "C" { + pub fn _wfreopen_s( + _Stream: *mut *mut FILE, + _FileName: *const wchar_t, + _Mode: *const wchar_t, + _OldStream: *mut FILE, + ) -> errno_t; +} +extern "C" { + pub fn _wfsopen( + _FileName: *const wchar_t, + _Mode: *const wchar_t, + _ShFlag: ::std::os::raw::c_int, + ) -> *mut FILE; +} +extern "C" { + pub fn _wperror(_ErrorMessage: *const wchar_t); +} +extern "C" { + pub fn _wpopen(_Command: *const wchar_t, _Mode: *const wchar_t) -> *mut FILE; +} +extern "C" { + pub fn _wremove(_FileName: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtempnam(_Directory: *const wchar_t, _FilePrefix: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wtmpnam_s(_Buffer: *mut wchar_t, _BufferCount: usize) -> errno_t; +} +extern "C" { + pub fn _wtmpnam(_Buffer: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _fgetwc_nolock(_Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _fputwc_nolock(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _getwc_nolock(_Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _putwc_nolock(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _ungetwc_nolock(_Character: wint_t, _Stream: *mut FILE) -> wint_t; +} +extern "C" { + pub fn __stdio_common_vfwprintf( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vfwprintf_s( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vfwprintf_p( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vfwscanf( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vswprintf( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _BufferCount: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vswprintf_s( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _BufferCount: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vsnwprintf_s( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _BufferCount: usize, + _MaxCount: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vswprintf_p( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut wchar_t, + _BufferCount: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vswscanf( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *const wchar_t, + _BufferCount: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +pub type fpos_t = ::std::os::raw::c_longlong; +extern "C" { + pub fn _get_stream_buffer_pointers( + _Stream: *mut FILE, + _Base: *mut *mut *mut ::std::os::raw::c_char, + _Pointer: *mut *mut *mut ::std::os::raw::c_char, + _Count: *mut *mut ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn clearerr_s(_Stream: *mut FILE) -> errno_t; +} +extern "C" { + pub fn fopen_s( + _Stream: *mut *mut FILE, + _FileName: *const ::std::os::raw::c_char, + _Mode: *const ::std::os::raw::c_char, + ) -> errno_t; +} +extern "C" { + pub fn fread_s( + _Buffer: *mut ::std::os::raw::c_void, + _BufferSize: usize, + _ElementSize: usize, + _ElementCount: usize, + _Stream: *mut FILE, + ) -> usize; +} +extern "C" { + pub fn freopen_s( + _Stream: *mut *mut FILE, + _FileName: *const ::std::os::raw::c_char, + _Mode: *const ::std::os::raw::c_char, + _OldStream: *mut FILE, + ) -> errno_t; +} +extern "C" { + pub fn gets_s( + _Buffer: *mut ::std::os::raw::c_char, + _Size: rsize_t, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn tmpfile_s(_Stream: *mut *mut FILE) -> errno_t; +} +extern "C" { + pub fn tmpnam_s(_Buffer: *mut ::std::os::raw::c_char, _Size: rsize_t) -> errno_t; +} +extern "C" { + pub fn clearerr(_Stream: *mut FILE); +} +extern "C" { + pub fn fclose(_Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fcloseall() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fdopen( + _FileHandle: ::std::os::raw::c_int, + _Mode: *const ::std::os::raw::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn feof(_Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ferror(_Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fflush(_Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fgetc(_Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fgetchar() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fgetpos(_Stream: *mut FILE, _Position: *mut fpos_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fgets( + _Buffer: *mut ::std::os::raw::c_char, + _MaxCount: ::std::os::raw::c_int, + _Stream: *mut FILE, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _fileno(_Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _flushall() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fopen( + _FileName: *const ::std::os::raw::c_char, + _Mode: *const ::std::os::raw::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn fputc(_Character: ::std::os::raw::c_int, _Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fputchar(_Character: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fputs( + _Buffer: *const ::std::os::raw::c_char, + _Stream: *mut FILE, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fread( + _Buffer: *mut ::std::os::raw::c_void, + _ElementSize: ::std::os::raw::c_ulonglong, + _ElementCount: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn freopen( + _FileName: *const ::std::os::raw::c_char, + _Mode: *const ::std::os::raw::c_char, + _Stream: *mut FILE, + ) -> *mut FILE; +} +extern "C" { + pub fn _fsopen( + _FileName: *const ::std::os::raw::c_char, + _Mode: *const ::std::os::raw::c_char, + _ShFlag: ::std::os::raw::c_int, + ) -> *mut FILE; +} +extern "C" { + pub fn fsetpos(_Stream: *mut FILE, _Position: *const fpos_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fseek( + _Stream: *mut FILE, + _Offset: ::std::os::raw::c_long, + _Origin: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fseeki64( + _Stream: *mut FILE, + _Offset: ::std::os::raw::c_longlong, + _Origin: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ftell(_Stream: *mut FILE) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _ftelli64(_Stream: *mut FILE) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn fwrite( + _Buffer: *const ::std::os::raw::c_void, + _ElementSize: ::std::os::raw::c_ulonglong, + _ElementCount: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn getc(_Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getchar() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _getmaxstdio() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _getw(_Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn perror(_ErrorMessage: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn _pclose(_Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _popen( + _Command: *const ::std::os::raw::c_char, + _Mode: *const ::std::os::raw::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn putc(_Character: ::std::os::raw::c_int, _Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn putchar(_Character: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn puts(_Buffer: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _putw(_Word: ::std::os::raw::c_int, _Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn remove(_FileName: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn rename( + _OldFileName: *const ::std::os::raw::c_char, + _NewFileName: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _unlink(_FileName: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn unlink(_FileName: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn rewind(_Stream: *mut FILE); +} +extern "C" { + pub fn _rmtmp() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setbuf(_Stream: *mut FILE, _Buffer: *mut ::std::os::raw::c_char); +} +extern "C" { + pub fn _setmaxstdio(_Maximum: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setvbuf( + _Stream: *mut FILE, + _Buffer: *mut ::std::os::raw::c_char, + _Mode: ::std::os::raw::c_int, + _Size: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _tempnam( + _DirectoryName: *const ::std::os::raw::c_char, + _FilePrefix: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn tmpfile() -> *mut FILE; +} +extern "C" { + pub fn tmpnam(_Buffer: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn ungetc(_Character: ::std::os::raw::c_int, _Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _lock_file(_Stream: *mut FILE); +} +extern "C" { + pub fn _unlock_file(_Stream: *mut FILE); +} +extern "C" { + pub fn _fclose_nolock(_Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fflush_nolock(_Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fgetc_nolock(_Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fputc_nolock( + _Character: ::std::os::raw::c_int, + _Stream: *mut FILE, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fread_nolock( + _Buffer: *mut ::std::os::raw::c_void, + _ElementSize: usize, + _ElementCount: usize, + _Stream: *mut FILE, + ) -> usize; +} +extern "C" { + pub fn _fread_nolock_s( + _Buffer: *mut ::std::os::raw::c_void, + _BufferSize: usize, + _ElementSize: usize, + _ElementCount: usize, + _Stream: *mut FILE, + ) -> usize; +} +extern "C" { + pub fn _fseek_nolock( + _Stream: *mut FILE, + _Offset: ::std::os::raw::c_long, + _Origin: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fseeki64_nolock( + _Stream: *mut FILE, + _Offset: ::std::os::raw::c_longlong, + _Origin: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _ftell_nolock(_Stream: *mut FILE) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _ftelli64_nolock(_Stream: *mut FILE) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _fwrite_nolock( + _Buffer: *const ::std::os::raw::c_void, + _ElementSize: usize, + _ElementCount: usize, + _Stream: *mut FILE, + ) -> usize; +} +extern "C" { + pub fn _getc_nolock(_Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _putc_nolock( + _Character: ::std::os::raw::c_int, + _Stream: *mut FILE, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _ungetc_nolock( + _Character: ::std::os::raw::c_int, + _Stream: *mut FILE, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __p__commode() -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vfprintf( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vfprintf_s( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vfprintf_p( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _set_printf_count_output(_Value: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _get_printf_count_output() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vfscanf( + _Options: ::std::os::raw::c_ulonglong, + _Stream: *mut FILE, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _Arglist: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vsprintf( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut ::std::os::raw::c_char, + _BufferCount: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vsprintf_s( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut ::std::os::raw::c_char, + _BufferCount: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vsnprintf_s( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut ::std::os::raw::c_char, + _BufferCount: usize, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vsprintf_p( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *mut ::std::os::raw::c_char, + _BufferCount: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __stdio_common_vsscanf( + _Options: ::std::os::raw::c_ulonglong, + _Buffer: *const ::std::os::raw::c_char, + _BufferCount: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn tempnam( + _Directory: *const ::std::os::raw::c_char, + _FilePrefix: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn fcloseall() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fdopen( + _FileHandle: ::std::os::raw::c_int, + _Format: *const ::std::os::raw::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn fgetchar() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fileno(_Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn flushall() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fputchar(_Ch: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getw(_Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn putw(_Ch: ::std::os::raw::c_int, _Stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn rmtmp() -> ::std::os::raw::c_int; +} +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct _SETJMP_FLOAT128 { + pub Part: [::std::os::raw::c_ulonglong; 2usize], +} +#[test] +fn bindgen_test_layout__SETJMP_FLOAT128() { + const UNINIT: ::std::mem::MaybeUninit<_SETJMP_FLOAT128> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_SETJMP_FLOAT128>(), + 16usize, + concat!("Size of: ", stringify!(_SETJMP_FLOAT128)) + ); + assert_eq!( + ::std::mem::align_of::<_SETJMP_FLOAT128>(), + 16usize, + concat!("Alignment of ", stringify!(_SETJMP_FLOAT128)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Part) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_SETJMP_FLOAT128), + "::", + stringify!(Part) + ) + ); +} +pub type SETJMP_FLOAT128 = _SETJMP_FLOAT128; +pub type _JBTYPE = SETJMP_FLOAT128; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct _JUMP_BUFFER { + pub Frame: ::std::os::raw::c_ulonglong, + pub Rbx: ::std::os::raw::c_ulonglong, + pub Rsp: ::std::os::raw::c_ulonglong, + pub Rbp: ::std::os::raw::c_ulonglong, + pub Rsi: ::std::os::raw::c_ulonglong, + pub Rdi: ::std::os::raw::c_ulonglong, + pub R12: ::std::os::raw::c_ulonglong, + pub R13: ::std::os::raw::c_ulonglong, + pub R14: ::std::os::raw::c_ulonglong, + pub R15: ::std::os::raw::c_ulonglong, + pub Rip: ::std::os::raw::c_ulonglong, + pub MxCsr: ::std::os::raw::c_ulong, + pub FpCsr: ::std::os::raw::c_ushort, + pub Spare: ::std::os::raw::c_ushort, + pub Xmm6: SETJMP_FLOAT128, + pub Xmm7: SETJMP_FLOAT128, + pub Xmm8: SETJMP_FLOAT128, + pub Xmm9: SETJMP_FLOAT128, + pub Xmm10: SETJMP_FLOAT128, + pub Xmm11: SETJMP_FLOAT128, + pub Xmm12: SETJMP_FLOAT128, + pub Xmm13: SETJMP_FLOAT128, + pub Xmm14: SETJMP_FLOAT128, + pub Xmm15: SETJMP_FLOAT128, +} +#[test] +fn bindgen_test_layout__JUMP_BUFFER() { + const UNINIT: ::std::mem::MaybeUninit<_JUMP_BUFFER> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_JUMP_BUFFER>(), + 256usize, + concat!("Size of: ", stringify!(_JUMP_BUFFER)) + ); + assert_eq!( + ::std::mem::align_of::<_JUMP_BUFFER>(), + 16usize, + concat!("Alignment of ", stringify!(_JUMP_BUFFER)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Frame) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Frame) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Rbx) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Rbx) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Rsp) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Rsp) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Rbp) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Rbp) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Rsi) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Rsi) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Rdi) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Rdi) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).R12) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(R12) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).R13) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(R13) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).R14) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(R14) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).R15) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(R15) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Rip) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Rip) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).MxCsr) as usize - ptr as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(MxCsr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).FpCsr) as usize - ptr as usize }, + 92usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(FpCsr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Spare) as usize - ptr as usize }, + 94usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Spare) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Xmm6) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Xmm6) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Xmm7) as usize - ptr as usize }, + 112usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Xmm7) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Xmm8) as usize - ptr as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Xmm8) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Xmm9) as usize - ptr as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Xmm9) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Xmm10) as usize - ptr as usize }, + 160usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Xmm10) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Xmm11) as usize - ptr as usize }, + 176usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Xmm11) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Xmm12) as usize - ptr as usize }, + 192usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Xmm12) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Xmm13) as usize - ptr as usize }, + 208usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Xmm13) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Xmm14) as usize - ptr as usize }, + 224usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Xmm14) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).Xmm15) as usize - ptr as usize }, + 240usize, + concat!( + "Offset of field: ", + stringify!(_JUMP_BUFFER), + "::", + stringify!(Xmm15) + ) + ); +} +pub type jmp_buf = [_JBTYPE; 16usize]; +extern "C" { + pub fn _setjmp(_Buf: *mut _JBTYPE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn longjmp(_Buf: *mut _JBTYPE, _Value: ::std::os::raw::c_int) -> !; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tm { + pub tm_sec: ::std::os::raw::c_int, + pub tm_min: ::std::os::raw::c_int, + pub tm_hour: ::std::os::raw::c_int, + pub tm_mday: ::std::os::raw::c_int, + pub tm_mon: ::std::os::raw::c_int, + pub tm_year: ::std::os::raw::c_int, + pub tm_wday: ::std::os::raw::c_int, + pub tm_yday: ::std::os::raw::c_int, + pub tm_isdst: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_tm() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(tm)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(tm)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_sec) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_sec) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_min) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_min) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_hour) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_hour) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_mday) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_mday) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_mon) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_mon) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_year) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_year) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_wday) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_wday) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_yday) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_yday) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tm_isdst) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_isdst) + ) + ); +} +extern "C" { + pub fn _wasctime(_Tm: *const tm) -> *mut wchar_t; +} +extern "C" { + pub fn _wasctime_s(_Buffer: *mut wchar_t, _SizeInWords: usize, _Tm: *const tm) -> errno_t; +} +extern "C" { + pub fn wcsftime( + _Buffer: *mut wchar_t, + _SizeInWords: usize, + _Format: *const wchar_t, + _Tm: *const tm, + ) -> usize; +} +extern "C" { + pub fn _wcsftime_l( + _Buffer: *mut wchar_t, + _SizeInWords: usize, + _Format: *const wchar_t, + _Tm: *const tm, + _Locale: _locale_t, + ) -> usize; +} +extern "C" { + pub fn _wctime32(_Time: *const __time32_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wctime32_s( + _Buffer: *mut wchar_t, + _SizeInWords: usize, + _Time: *const __time32_t, + ) -> errno_t; +} +extern "C" { + pub fn _wctime64(_Time: *const __time64_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wctime64_s( + _Buffer: *mut wchar_t, + _SizeInWords: usize, + _Time: *const __time64_t, + ) -> errno_t; +} +extern "C" { + pub fn _wstrdate_s(_Buffer: *mut wchar_t, _SizeInWords: usize) -> errno_t; +} +extern "C" { + pub fn _wstrdate(_Buffer: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wstrtime_s(_Buffer: *mut wchar_t, _SizeInWords: usize) -> errno_t; +} +extern "C" { + pub fn _wstrtime(_Buffer: *mut wchar_t) -> *mut wchar_t; +} +pub type clock_t = ::std::os::raw::c_long; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _timespec32 { + pub tv_sec: __time32_t, + pub tv_nsec: ::std::os::raw::c_long, +} +#[test] +fn bindgen_test_layout__timespec32() { + const UNINIT: ::std::mem::MaybeUninit<_timespec32> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_timespec32>(), + 8usize, + concat!("Size of: ", stringify!(_timespec32)) + ); + assert_eq!( + ::std::mem::align_of::<_timespec32>(), + 4usize, + concat!("Alignment of ", stringify!(_timespec32)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_timespec32), + "::", + stringify!(tv_sec) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_timespec32), + "::", + stringify!(tv_nsec) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _timespec64 { + pub tv_sec: __time64_t, + pub tv_nsec: ::std::os::raw::c_long, +} +#[test] +fn bindgen_test_layout__timespec64() { + const UNINIT: ::std::mem::MaybeUninit<_timespec64> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_timespec64>(), + 16usize, + concat!("Size of: ", stringify!(_timespec64)) + ); + assert_eq!( + ::std::mem::align_of::<_timespec64>(), + 8usize, + concat!("Alignment of ", stringify!(_timespec64)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_timespec64), + "::", + stringify!(tv_sec) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_timespec64), + "::", + stringify!(tv_nsec) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timespec { + pub tv_sec: time_t, + pub tv_nsec: ::std::os::raw::c_long, +} +#[test] +fn bindgen_test_layout_timespec() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(timespec)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(timespec)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(timespec), + "::", + stringify!(tv_sec) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(timespec), + "::", + stringify!(tv_nsec) + ) + ); +} +extern "C" { + pub fn __daylight() -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn __dstbias() -> *mut ::std::os::raw::c_long; +} +extern "C" { + pub fn __timezone() -> *mut ::std::os::raw::c_long; +} +extern "C" { + pub fn __tzname() -> *mut *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _get_daylight(_Daylight: *mut ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub fn _get_dstbias(_DaylightSavingsBias: *mut ::std::os::raw::c_long) -> errno_t; +} +extern "C" { + pub fn _get_timezone(_TimeZone: *mut ::std::os::raw::c_long) -> errno_t; +} +extern "C" { + pub fn _get_tzname( + _ReturnValue: *mut usize, + _Buffer: *mut ::std::os::raw::c_char, + _SizeInBytes: usize, + _Index: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn asctime(_Tm: *const tm) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn asctime_s( + _Buffer: *mut ::std::os::raw::c_char, + _SizeInBytes: usize, + _Tm: *const tm, + ) -> errno_t; +} +extern "C" { + pub fn clock() -> clock_t; +} +extern "C" { + pub fn _ctime32(_Time: *const __time32_t) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _ctime32_s( + _Buffer: *mut ::std::os::raw::c_char, + _SizeInBytes: usize, + _Time: *const __time32_t, + ) -> errno_t; +} +extern "C" { + pub fn _ctime64(_Time: *const __time64_t) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _ctime64_s( + _Buffer: *mut ::std::os::raw::c_char, + _SizeInBytes: usize, + _Time: *const __time64_t, + ) -> errno_t; +} +extern "C" { + pub fn _difftime32(_Time1: __time32_t, _Time2: __time32_t) -> f64; +} +extern "C" { + pub fn _difftime64(_Time1: __time64_t, _Time2: __time64_t) -> f64; +} +extern "C" { + pub fn _gmtime32(_Time: *const __time32_t) -> *mut tm; +} +extern "C" { + pub fn _gmtime32_s(_Tm: *mut tm, _Time: *const __time32_t) -> errno_t; +} +extern "C" { + pub fn _gmtime64(_Time: *const __time64_t) -> *mut tm; +} +extern "C" { + pub fn _gmtime64_s(_Tm: *mut tm, _Time: *const __time64_t) -> errno_t; +} +extern "C" { + pub fn _localtime32(_Time: *const __time32_t) -> *mut tm; +} +extern "C" { + pub fn _localtime32_s(_Tm: *mut tm, _Time: *const __time32_t) -> errno_t; +} +extern "C" { + pub fn _localtime64(_Time: *const __time64_t) -> *mut tm; +} +extern "C" { + pub fn _localtime64_s(_Tm: *mut tm, _Time: *const __time64_t) -> errno_t; +} +extern "C" { + pub fn _mkgmtime32(_Tm: *mut tm) -> __time32_t; +} +extern "C" { + pub fn _mkgmtime64(_Tm: *mut tm) -> __time64_t; +} +extern "C" { + pub fn _mktime32(_Tm: *mut tm) -> __time32_t; +} +extern "C" { + pub fn _mktime64(_Tm: *mut tm) -> __time64_t; +} +extern "C" { + pub fn strftime( + _Buffer: *mut ::std::os::raw::c_char, + _SizeInBytes: usize, + _Format: *const ::std::os::raw::c_char, + _Tm: *const tm, + ) -> usize; +} +extern "C" { + pub fn _strftime_l( + _Buffer: *mut ::std::os::raw::c_char, + _MaxSize: usize, + _Format: *const ::std::os::raw::c_char, + _Tm: *const tm, + _Locale: _locale_t, + ) -> usize; +} +extern "C" { + pub fn _strdate_s(_Buffer: *mut ::std::os::raw::c_char, _SizeInBytes: usize) -> errno_t; +} +extern "C" { + pub fn _strdate(_Buffer: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _strtime_s(_Buffer: *mut ::std::os::raw::c_char, _SizeInBytes: usize) -> errno_t; +} +extern "C" { + pub fn _strtime(_Buffer: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _time32(_Time: *mut __time32_t) -> __time32_t; +} +extern "C" { + pub fn _time64(_Time: *mut __time64_t) -> __time64_t; +} +extern "C" { + pub fn _timespec32_get( + _Ts: *mut _timespec32, + _Base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _timespec64_get( + _Ts: *mut _timespec64, + _Base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _tzset(); +} +extern "C" { + pub fn _getsystime(_Tm: *mut tm) -> ::std::os::raw::c_uint; +} +extern "C" { + pub fn _setsystime( + _Tm: *mut tm, + _Milliseconds: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_uint; +} +extern "C" { + pub fn tzset(); +} +pub type png_byte = ::std::os::raw::c_uchar; +pub type png_int_16 = ::std::os::raw::c_short; +pub type png_uint_16 = ::std::os::raw::c_ushort; +pub type png_int_32 = ::std::os::raw::c_int; +pub type png_uint_32 = ::std::os::raw::c_uint; +pub type png_size_t = usize; +pub type png_ptrdiff_t = isize; +pub type png_alloc_size_t = usize; +pub type png_fixed_point = png_int_32; +pub type png_voidp = *mut ::std::os::raw::c_void; +pub type png_const_voidp = *const ::std::os::raw::c_void; +pub type png_bytep = *mut png_byte; +pub type png_const_bytep = *const png_byte; +pub type png_uint_32p = *mut png_uint_32; +pub type png_const_uint_32p = *const png_uint_32; +pub type png_int_32p = *mut png_int_32; +pub type png_const_int_32p = *const png_int_32; +pub type png_uint_16p = *mut png_uint_16; +pub type png_const_uint_16p = *const png_uint_16; +pub type png_int_16p = *mut png_int_16; +pub type png_const_int_16p = *const png_int_16; +pub type png_charp = *mut ::std::os::raw::c_char; +pub type png_const_charp = *const ::std::os::raw::c_char; +pub type png_fixed_point_p = *mut png_fixed_point; +pub type png_const_fixed_point_p = *const png_fixed_point; +pub type png_size_tp = *mut usize; +pub type png_const_size_tp = *const usize; +pub type png_FILE_p = *mut FILE; +pub type png_doublep = *mut f64; +pub type png_const_doublep = *const f64; +pub type png_bytepp = *mut *mut png_byte; +pub type png_uint_32pp = *mut *mut png_uint_32; +pub type png_int_32pp = *mut *mut png_int_32; +pub type png_uint_16pp = *mut *mut png_uint_16; +pub type png_int_16pp = *mut *mut png_int_16; +pub type png_const_charpp = *mut *const ::std::os::raw::c_char; +pub type png_charpp = *mut *mut ::std::os::raw::c_char; +pub type png_fixed_point_pp = *mut *mut png_fixed_point; +pub type png_doublepp = *mut *mut f64; +pub type png_charppp = *mut *mut *mut ::std::os::raw::c_char; +pub type png_libpng_version_1_6_39 = *mut ::std::os::raw::c_char; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct png_struct_def { + _unused: [u8; 0], +} +pub type png_struct = png_struct_def; +pub type png_const_structp = *const png_struct; +pub type png_structp = *mut png_struct; +pub type png_structpp = *mut *mut png_struct; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct png_info_def { + _unused: [u8; 0], +} +pub type png_info = png_info_def; +pub type png_infop = *mut png_info; +pub type png_const_infop = *const png_info; +pub type png_infopp = *mut *mut png_info; +pub type png_structrp = *mut png_struct; +pub type png_const_structrp = *const png_struct; +pub type png_inforp = *mut png_info; +pub type png_const_inforp = *const png_info; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct png_color_struct { + pub red: png_byte, + pub green: png_byte, + pub blue: png_byte, +} +#[test] +fn bindgen_test_layout_png_color_struct() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 3usize, + concat!("Size of: ", stringify!(png_color_struct)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(png_color_struct)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).red) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(png_color_struct), + "::", + stringify!(red) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).green) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(png_color_struct), + "::", + stringify!(green) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).blue) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(png_color_struct), + "::", + stringify!(blue) + ) + ); +} +pub type png_color = png_color_struct; +pub type png_colorp = *mut png_color; +pub type png_const_colorp = *const png_color; +pub type png_colorpp = *mut *mut png_color; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct png_color_16_struct { + pub index: png_byte, + pub red: png_uint_16, + pub green: png_uint_16, + pub blue: png_uint_16, + pub gray: png_uint_16, +} +#[test] +fn bindgen_test_layout_png_color_16_struct() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 10usize, + concat!("Size of: ", stringify!(png_color_16_struct)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(png_color_16_struct)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).index) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(png_color_16_struct), + "::", + stringify!(index) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).red) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(png_color_16_struct), + "::", + stringify!(red) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).green) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(png_color_16_struct), + "::", + stringify!(green) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).blue) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(png_color_16_struct), + "::", + stringify!(blue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).gray) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(png_color_16_struct), + "::", + stringify!(gray) + ) + ); +} +pub type png_color_16 = png_color_16_struct; +pub type png_color_16p = *mut png_color_16; +pub type png_const_color_16p = *const png_color_16; +pub type png_color_16pp = *mut *mut png_color_16; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct png_color_8_struct { + pub red: png_byte, + pub green: png_byte, + pub blue: png_byte, + pub gray: png_byte, + pub alpha: png_byte, +} +#[test] +fn bindgen_test_layout_png_color_8_struct() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 5usize, + concat!("Size of: ", stringify!(png_color_8_struct)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(png_color_8_struct)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).red) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(png_color_8_struct), + "::", + stringify!(red) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).green) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(png_color_8_struct), + "::", + stringify!(green) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).blue) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(png_color_8_struct), + "::", + stringify!(blue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).gray) as usize - ptr as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(png_color_8_struct), + "::", + stringify!(gray) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(png_color_8_struct), + "::", + stringify!(alpha) + ) + ); +} +pub type png_color_8 = png_color_8_struct; +pub type png_color_8p = *mut png_color_8; +pub type png_const_color_8p = *const png_color_8; +pub type png_color_8pp = *mut *mut png_color_8; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct png_sPLT_entry_struct { + pub red: png_uint_16, + pub green: png_uint_16, + pub blue: png_uint_16, + pub alpha: png_uint_16, + pub frequency: png_uint_16, +} +#[test] +fn bindgen_test_layout_png_sPLT_entry_struct() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 10usize, + concat!("Size of: ", stringify!(png_sPLT_entry_struct)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(png_sPLT_entry_struct)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).red) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(png_sPLT_entry_struct), + "::", + stringify!(red) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).green) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(png_sPLT_entry_struct), + "::", + stringify!(green) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).blue) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(png_sPLT_entry_struct), + "::", + stringify!(blue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(png_sPLT_entry_struct), + "::", + stringify!(alpha) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).frequency) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(png_sPLT_entry_struct), + "::", + stringify!(frequency) + ) + ); +} +pub type png_sPLT_entry = png_sPLT_entry_struct; +pub type png_sPLT_entryp = *mut png_sPLT_entry; +pub type png_const_sPLT_entryp = *const png_sPLT_entry; +pub type png_sPLT_entrypp = *mut *mut png_sPLT_entry; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct png_sPLT_struct { + pub name: png_charp, + pub depth: png_byte, + pub entries: png_sPLT_entryp, + pub nentries: png_int_32, +} +#[test] +fn bindgen_test_layout_png_sPLT_struct() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(png_sPLT_struct)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(png_sPLT_struct)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(png_sPLT_struct), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).depth) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(png_sPLT_struct), + "::", + stringify!(depth) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).entries) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(png_sPLT_struct), + "::", + stringify!(entries) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nentries) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(png_sPLT_struct), + "::", + stringify!(nentries) + ) + ); +} +pub type png_sPLT_t = png_sPLT_struct; +pub type png_sPLT_tp = *mut png_sPLT_t; +pub type png_const_sPLT_tp = *const png_sPLT_t; +pub type png_sPLT_tpp = *mut *mut png_sPLT_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct png_text_struct { + pub compression: ::std::os::raw::c_int, + pub key: png_charp, + pub text: png_charp, + pub text_length: usize, + pub itxt_length: usize, + pub lang: png_charp, + pub lang_key: png_charp, +} +#[test] +fn bindgen_test_layout_png_text_struct() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(png_text_struct)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(png_text_struct)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).compression) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(png_text_struct), + "::", + stringify!(compression) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(png_text_struct), + "::", + stringify!(key) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).text) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(png_text_struct), + "::", + stringify!(text) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).text_length) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(png_text_struct), + "::", + stringify!(text_length) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).itxt_length) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(png_text_struct), + "::", + stringify!(itxt_length) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lang) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(png_text_struct), + "::", + stringify!(lang) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lang_key) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(png_text_struct), + "::", + stringify!(lang_key) + ) + ); +} +pub type png_text = png_text_struct; +pub type png_textp = *mut png_text; +pub type png_const_textp = *const png_text; +pub type png_textpp = *mut *mut png_text; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct png_time_struct { + pub year: png_uint_16, + pub month: png_byte, + pub day: png_byte, + pub hour: png_byte, + pub minute: png_byte, + pub second: png_byte, +} +#[test] +fn bindgen_test_layout_png_time_struct() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(png_time_struct)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(png_time_struct)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).year) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(png_time_struct), + "::", + stringify!(year) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).month) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(png_time_struct), + "::", + stringify!(month) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).day) as usize - ptr as usize }, + 3usize, + concat!( + "Offset of field: ", + stringify!(png_time_struct), + "::", + stringify!(day) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hour) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(png_time_struct), + "::", + stringify!(hour) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).minute) as usize - ptr as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(png_time_struct), + "::", + stringify!(minute) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).second) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(png_time_struct), + "::", + stringify!(second) + ) + ); +} +pub type png_time = png_time_struct; +pub type png_timep = *mut png_time; +pub type png_const_timep = *const png_time; +pub type png_timepp = *mut *mut png_time; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct png_unknown_chunk_t { + pub name: [png_byte; 5usize], + pub data: *mut png_byte, + pub size: usize, + pub location: png_byte, +} +#[test] +fn bindgen_test_layout_png_unknown_chunk_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(png_unknown_chunk_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(png_unknown_chunk_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(png_unknown_chunk_t), + "::", + stringify!(name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(png_unknown_chunk_t), + "::", + stringify!(data) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(png_unknown_chunk_t), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).location) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(png_unknown_chunk_t), + "::", + stringify!(location) + ) + ); +} +pub type png_unknown_chunk = png_unknown_chunk_t; +pub type png_unknown_chunkp = *mut png_unknown_chunk; +pub type png_const_unknown_chunkp = *const png_unknown_chunk; +pub type png_unknown_chunkpp = *mut *mut png_unknown_chunk; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct png_row_info_struct { + pub width: png_uint_32, + pub rowbytes: usize, + pub color_type: png_byte, + pub bit_depth: png_byte, + pub channels: png_byte, + pub pixel_depth: png_byte, +} +#[test] +fn bindgen_test_layout_png_row_info_struct() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(png_row_info_struct)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(png_row_info_struct)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).width) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(png_row_info_struct), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rowbytes) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(png_row_info_struct), + "::", + stringify!(rowbytes) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).color_type) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(png_row_info_struct), + "::", + stringify!(color_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).bit_depth) as usize - ptr as usize }, + 17usize, + concat!( + "Offset of field: ", + stringify!(png_row_info_struct), + "::", + stringify!(bit_depth) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).channels) as usize - ptr as usize }, + 18usize, + concat!( + "Offset of field: ", + stringify!(png_row_info_struct), + "::", + stringify!(channels) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pixel_depth) as usize - ptr as usize }, + 19usize, + concat!( + "Offset of field: ", + stringify!(png_row_info_struct), + "::", + stringify!(pixel_depth) + ) + ); +} +pub type png_row_info = png_row_info_struct; +pub type png_row_infop = *mut png_row_info; +pub type png_row_infopp = *mut *mut png_row_info; +pub type png_error_ptr = + ::std::option::Option; +pub type png_rw_ptr = + ::std::option::Option; +pub type png_flush_ptr = ::std::option::Option; +pub type png_read_status_ptr = ::std::option::Option< + unsafe extern "C" fn(arg1: png_structp, arg2: png_uint_32, arg3: ::std::os::raw::c_int), +>; +pub type png_write_status_ptr = ::std::option::Option< + unsafe extern "C" fn(arg1: png_structp, arg2: png_uint_32, arg3: ::std::os::raw::c_int), +>; +pub type png_progressive_info_ptr = + ::std::option::Option; +pub type png_progressive_end_ptr = + ::std::option::Option; +pub type png_progressive_row_ptr = ::std::option::Option< + unsafe extern "C" fn( + arg1: png_structp, + arg2: png_bytep, + arg3: png_uint_32, + arg4: ::std::os::raw::c_int, + ), +>; +pub type png_user_transform_ptr = ::std::option::Option< + unsafe extern "C" fn(arg1: png_structp, arg2: png_row_infop, arg3: png_bytep), +>; +pub type png_user_chunk_ptr = ::std::option::Option< + unsafe extern "C" fn(arg1: png_structp, arg2: png_unknown_chunkp) -> ::std::os::raw::c_int, +>; +pub type png_longjmp_ptr = + ::std::option::Option; +pub type png_malloc_ptr = ::std::option::Option< + unsafe extern "C" fn(arg1: png_structp, arg2: png_alloc_size_t) -> png_voidp, +>; +pub type png_free_ptr = + ::std::option::Option; +extern "C" { + pub fn png_access_version_number() -> png_uint_32; +} +extern "C" { + pub fn png_set_sig_bytes(png_ptr: png_structrp, num_bytes: ::std::os::raw::c_int); +} +extern "C" { + pub fn png_sig_cmp( + sig: png_const_bytep, + start: usize, + num_to_check: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn png_create_read_struct( + user_png_ver: png_const_charp, + error_ptr: png_voidp, + error_fn: png_error_ptr, + warn_fn: png_error_ptr, + ) -> png_structp; +} +extern "C" { + pub fn png_create_write_struct( + user_png_ver: png_const_charp, + error_ptr: png_voidp, + error_fn: png_error_ptr, + warn_fn: png_error_ptr, + ) -> png_structp; +} +extern "C" { + pub fn png_get_compression_buffer_size(png_ptr: png_const_structrp) -> usize; +} +extern "C" { + pub fn png_set_compression_buffer_size(png_ptr: png_structrp, size: usize); +} +extern "C" { + pub fn png_set_longjmp_fn( + png_ptr: png_structrp, + longjmp_fn: png_longjmp_ptr, + jmp_buf_size: usize, + ) -> *mut jmp_buf; +} +extern "C" { + pub fn png_longjmp(png_ptr: png_const_structrp, val: ::std::os::raw::c_int) -> !; +} +extern "C" { + pub fn png_reset_zstream(png_ptr: png_structrp) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn png_create_read_struct_2( + user_png_ver: png_const_charp, + error_ptr: png_voidp, + error_fn: png_error_ptr, + warn_fn: png_error_ptr, + mem_ptr: png_voidp, + malloc_fn: png_malloc_ptr, + free_fn: png_free_ptr, + ) -> png_structp; +} +extern "C" { + pub fn png_create_write_struct_2( + user_png_ver: png_const_charp, + error_ptr: png_voidp, + error_fn: png_error_ptr, + warn_fn: png_error_ptr, + mem_ptr: png_voidp, + malloc_fn: png_malloc_ptr, + free_fn: png_free_ptr, + ) -> png_structp; +} +extern "C" { + pub fn png_write_sig(png_ptr: png_structrp); +} +extern "C" { + pub fn png_write_chunk( + png_ptr: png_structrp, + chunk_name: png_const_bytep, + data: png_const_bytep, + length: usize, + ); +} +extern "C" { + pub fn png_write_chunk_start( + png_ptr: png_structrp, + chunk_name: png_const_bytep, + length: png_uint_32, + ); +} +extern "C" { + pub fn png_write_chunk_data(png_ptr: png_structrp, data: png_const_bytep, length: usize); +} +extern "C" { + pub fn png_write_chunk_end(png_ptr: png_structrp); +} +extern "C" { + pub fn png_create_info_struct(png_ptr: png_const_structrp) -> png_infop; +} +extern "C" { + pub fn png_info_init_3(info_ptr: png_infopp, png_info_struct_size: usize); +} +extern "C" { + pub fn png_write_info_before_PLTE(png_ptr: png_structrp, info_ptr: png_const_inforp); +} +extern "C" { + pub fn png_write_info(png_ptr: png_structrp, info_ptr: png_const_inforp); +} +extern "C" { + pub fn png_read_info(png_ptr: png_structrp, info_ptr: png_inforp); +} +extern "C" { + pub fn png_convert_to_rfc1123(png_ptr: png_structrp, ptime: png_const_timep) + -> png_const_charp; +} +extern "C" { + pub fn png_convert_to_rfc1123_buffer( + out: *mut ::std::os::raw::c_char, + ptime: png_const_timep, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn png_convert_from_struct_tm(ptime: png_timep, ttime: *const tm); +} +extern "C" { + pub fn png_convert_from_time_t(ptime: png_timep, ttime: time_t); +} +extern "C" { + pub fn png_set_expand(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_expand_gray_1_2_4_to_8(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_palette_to_rgb(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_tRNS_to_alpha(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_expand_16(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_bgr(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_gray_to_rgb(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_rgb_to_gray( + png_ptr: png_structrp, + error_action: ::std::os::raw::c_int, + red: f64, + green: f64, + ); +} +extern "C" { + pub fn png_set_rgb_to_gray_fixed( + png_ptr: png_structrp, + error_action: ::std::os::raw::c_int, + red: png_fixed_point, + green: png_fixed_point, + ); +} +extern "C" { + pub fn png_get_rgb_to_gray_status(png_ptr: png_const_structrp) -> png_byte; +} +extern "C" { + pub fn png_build_grayscale_palette(bit_depth: ::std::os::raw::c_int, palette: png_colorp); +} +extern "C" { + pub fn png_set_alpha_mode( + png_ptr: png_structrp, + mode: ::std::os::raw::c_int, + output_gamma: f64, + ); +} +extern "C" { + pub fn png_set_alpha_mode_fixed( + png_ptr: png_structrp, + mode: ::std::os::raw::c_int, + output_gamma: png_fixed_point, + ); +} +extern "C" { + pub fn png_set_strip_alpha(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_swap_alpha(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_invert_alpha(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_filler(png_ptr: png_structrp, filler: png_uint_32, flags: ::std::os::raw::c_int); +} +extern "C" { + pub fn png_set_add_alpha( + png_ptr: png_structrp, + filler: png_uint_32, + flags: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_set_swap(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_packing(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_packswap(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_shift(png_ptr: png_structrp, true_bits: png_const_color_8p); +} +extern "C" { + pub fn png_set_interlace_handling(png_ptr: png_structrp) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn png_set_invert_mono(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_background( + png_ptr: png_structrp, + background_color: png_const_color_16p, + background_gamma_code: ::std::os::raw::c_int, + need_expand: ::std::os::raw::c_int, + background_gamma: f64, + ); +} +extern "C" { + pub fn png_set_background_fixed( + png_ptr: png_structrp, + background_color: png_const_color_16p, + background_gamma_code: ::std::os::raw::c_int, + need_expand: ::std::os::raw::c_int, + background_gamma: png_fixed_point, + ); +} +extern "C" { + pub fn png_set_scale_16(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_strip_16(png_ptr: png_structrp); +} +extern "C" { + pub fn png_set_quantize( + png_ptr: png_structrp, + palette: png_colorp, + num_palette: ::std::os::raw::c_int, + maximum_colors: ::std::os::raw::c_int, + histogram: png_const_uint_16p, + full_quantize: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_set_gamma(png_ptr: png_structrp, screen_gamma: f64, override_file_gamma: f64); +} +extern "C" { + pub fn png_set_gamma_fixed( + png_ptr: png_structrp, + screen_gamma: png_fixed_point, + override_file_gamma: png_fixed_point, + ); +} +extern "C" { + pub fn png_set_flush(png_ptr: png_structrp, nrows: ::std::os::raw::c_int); +} +extern "C" { + pub fn png_write_flush(png_ptr: png_structrp); +} +extern "C" { + pub fn png_start_read_image(png_ptr: png_structrp); +} +extern "C" { + pub fn png_read_update_info(png_ptr: png_structrp, info_ptr: png_inforp); +} +extern "C" { + pub fn png_read_rows( + png_ptr: png_structrp, + row: png_bytepp, + display_row: png_bytepp, + num_rows: png_uint_32, + ); +} +extern "C" { + pub fn png_read_row(png_ptr: png_structrp, row: png_bytep, display_row: png_bytep); +} +extern "C" { + pub fn png_read_image(png_ptr: png_structrp, image: png_bytepp); +} +extern "C" { + pub fn png_write_row(png_ptr: png_structrp, row: png_const_bytep); +} +extern "C" { + pub fn png_write_rows(png_ptr: png_structrp, row: png_bytepp, num_rows: png_uint_32); +} +extern "C" { + pub fn png_write_image(png_ptr: png_structrp, image: png_bytepp); +} +extern "C" { + pub fn png_write_end(png_ptr: png_structrp, info_ptr: png_inforp); +} +extern "C" { + pub fn png_read_end(png_ptr: png_structrp, info_ptr: png_inforp); +} +extern "C" { + pub fn png_destroy_info_struct(png_ptr: png_const_structrp, info_ptr_ptr: png_infopp); +} +extern "C" { + pub fn png_destroy_read_struct( + png_ptr_ptr: png_structpp, + info_ptr_ptr: png_infopp, + end_info_ptr_ptr: png_infopp, + ); +} +extern "C" { + pub fn png_destroy_write_struct(png_ptr_ptr: png_structpp, info_ptr_ptr: png_infopp); +} +extern "C" { + pub fn png_set_crc_action( + png_ptr: png_structrp, + crit_action: ::std::os::raw::c_int, + ancil_action: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_set_filter( + png_ptr: png_structrp, + method: ::std::os::raw::c_int, + filters: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_set_filter_heuristics( + png_ptr: png_structrp, + heuristic_method: ::std::os::raw::c_int, + num_weights: ::std::os::raw::c_int, + filter_weights: png_const_doublep, + filter_costs: png_const_doublep, + ); +} +extern "C" { + pub fn png_set_filter_heuristics_fixed( + png_ptr: png_structrp, + heuristic_method: ::std::os::raw::c_int, + num_weights: ::std::os::raw::c_int, + filter_weights: png_const_fixed_point_p, + filter_costs: png_const_fixed_point_p, + ); +} +extern "C" { + pub fn png_set_compression_level(png_ptr: png_structrp, level: ::std::os::raw::c_int); +} +extern "C" { + pub fn png_set_compression_mem_level(png_ptr: png_structrp, mem_level: ::std::os::raw::c_int); +} +extern "C" { + pub fn png_set_compression_strategy(png_ptr: png_structrp, strategy: ::std::os::raw::c_int); +} +extern "C" { + pub fn png_set_compression_window_bits( + png_ptr: png_structrp, + window_bits: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_set_compression_method(png_ptr: png_structrp, method: ::std::os::raw::c_int); +} +extern "C" { + pub fn png_set_text_compression_level(png_ptr: png_structrp, level: ::std::os::raw::c_int); +} +extern "C" { + pub fn png_set_text_compression_mem_level( + png_ptr: png_structrp, + mem_level: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_set_text_compression_strategy( + png_ptr: png_structrp, + strategy: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_set_text_compression_window_bits( + png_ptr: png_structrp, + window_bits: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_set_text_compression_method(png_ptr: png_structrp, method: ::std::os::raw::c_int); +} +extern "C" { + pub fn png_init_io(png_ptr: png_structrp, fp: png_FILE_p); +} +extern "C" { + pub fn png_set_error_fn( + png_ptr: png_structrp, + error_ptr: png_voidp, + error_fn: png_error_ptr, + warning_fn: png_error_ptr, + ); +} +extern "C" { + pub fn png_get_error_ptr(png_ptr: png_const_structrp) -> png_voidp; +} +extern "C" { + pub fn png_set_write_fn( + png_ptr: png_structrp, + io_ptr: png_voidp, + write_data_fn: png_rw_ptr, + output_flush_fn: png_flush_ptr, + ); +} +extern "C" { + pub fn png_set_read_fn(png_ptr: png_structrp, io_ptr: png_voidp, read_data_fn: png_rw_ptr); +} +extern "C" { + pub fn png_get_io_ptr(png_ptr: png_const_structrp) -> png_voidp; +} +extern "C" { + pub fn png_set_read_status_fn(png_ptr: png_structrp, read_row_fn: png_read_status_ptr); +} +extern "C" { + pub fn png_set_write_status_fn(png_ptr: png_structrp, write_row_fn: png_write_status_ptr); +} +extern "C" { + pub fn png_set_mem_fn( + png_ptr: png_structrp, + mem_ptr: png_voidp, + malloc_fn: png_malloc_ptr, + free_fn: png_free_ptr, + ); +} +extern "C" { + pub fn png_get_mem_ptr(png_ptr: png_const_structrp) -> png_voidp; +} +extern "C" { + pub fn png_set_read_user_transform_fn( + png_ptr: png_structrp, + read_user_transform_fn: png_user_transform_ptr, + ); +} +extern "C" { + pub fn png_set_write_user_transform_fn( + png_ptr: png_structrp, + write_user_transform_fn: png_user_transform_ptr, + ); +} +extern "C" { + pub fn png_set_user_transform_info( + png_ptr: png_structrp, + user_transform_ptr: png_voidp, + user_transform_depth: ::std::os::raw::c_int, + user_transform_channels: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_get_user_transform_ptr(png_ptr: png_const_structrp) -> png_voidp; +} +extern "C" { + pub fn png_get_current_row_number(arg1: png_const_structrp) -> png_uint_32; +} +extern "C" { + pub fn png_get_current_pass_number(arg1: png_const_structrp) -> png_byte; +} +extern "C" { + pub fn png_set_read_user_chunk_fn( + png_ptr: png_structrp, + user_chunk_ptr: png_voidp, + read_user_chunk_fn: png_user_chunk_ptr, + ); +} +extern "C" { + pub fn png_get_user_chunk_ptr(png_ptr: png_const_structrp) -> png_voidp; +} +extern "C" { + pub fn png_set_progressive_read_fn( + png_ptr: png_structrp, + progressive_ptr: png_voidp, + info_fn: png_progressive_info_ptr, + row_fn: png_progressive_row_ptr, + end_fn: png_progressive_end_ptr, + ); +} +extern "C" { + pub fn png_get_progressive_ptr(png_ptr: png_const_structrp) -> png_voidp; +} +extern "C" { + pub fn png_process_data( + png_ptr: png_structrp, + info_ptr: png_inforp, + buffer: png_bytep, + buffer_size: usize, + ); +} +extern "C" { + pub fn png_process_data_pause(arg1: png_structrp, save: ::std::os::raw::c_int) -> usize; +} +extern "C" { + pub fn png_process_data_skip(arg1: png_structrp) -> png_uint_32; +} +extern "C" { + pub fn png_progressive_combine_row( + png_ptr: png_const_structrp, + old_row: png_bytep, + new_row: png_const_bytep, + ); +} +extern "C" { + pub fn png_malloc(png_ptr: png_const_structrp, size: png_alloc_size_t) -> png_voidp; +} +extern "C" { + pub fn png_calloc(png_ptr: png_const_structrp, size: png_alloc_size_t) -> png_voidp; +} +extern "C" { + pub fn png_malloc_warn(png_ptr: png_const_structrp, size: png_alloc_size_t) -> png_voidp; +} +extern "C" { + pub fn png_free(png_ptr: png_const_structrp, ptr: png_voidp); +} +extern "C" { + pub fn png_free_data( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + free_me: png_uint_32, + num: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_data_freer( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + freer: ::std::os::raw::c_int, + mask: png_uint_32, + ); +} +extern "C" { + pub fn png_malloc_default(png_ptr: png_const_structrp, size: png_alloc_size_t) -> png_voidp; +} +extern "C" { + pub fn png_free_default(png_ptr: png_const_structrp, ptr: png_voidp); +} +extern "C" { + pub fn png_error(png_ptr: png_const_structrp, error_message: png_const_charp) -> !; +} +extern "C" { + pub fn png_chunk_error(png_ptr: png_const_structrp, error_message: png_const_charp) -> !; +} +extern "C" { + pub fn png_warning(png_ptr: png_const_structrp, warning_message: png_const_charp); +} +extern "C" { + pub fn png_chunk_warning(png_ptr: png_const_structrp, warning_message: png_const_charp); +} +extern "C" { + pub fn png_benign_error(png_ptr: png_const_structrp, warning_message: png_const_charp); +} +extern "C" { + pub fn png_chunk_benign_error(png_ptr: png_const_structrp, warning_message: png_const_charp); +} +extern "C" { + pub fn png_set_benign_errors(png_ptr: png_structrp, allowed: ::std::os::raw::c_int); +} +extern "C" { + pub fn png_get_valid( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + flag: png_uint_32, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_rowbytes(png_ptr: png_const_structrp, info_ptr: png_const_inforp) -> usize; +} +extern "C" { + pub fn png_get_rows(png_ptr: png_const_structrp, info_ptr: png_const_inforp) -> png_bytepp; +} +extern "C" { + pub fn png_set_rows( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + row_pointers: png_bytepp, + ); +} +extern "C" { + pub fn png_get_channels(png_ptr: png_const_structrp, info_ptr: png_const_inforp) -> png_byte; +} +extern "C" { + pub fn png_get_image_width( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_image_height( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_bit_depth(png_ptr: png_const_structrp, info_ptr: png_const_inforp) -> png_byte; +} +extern "C" { + pub fn png_get_color_type(png_ptr: png_const_structrp, info_ptr: png_const_inforp) -> png_byte; +} +extern "C" { + pub fn png_get_filter_type(png_ptr: png_const_structrp, info_ptr: png_const_inforp) + -> png_byte; +} +extern "C" { + pub fn png_get_interlace_type( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_byte; +} +extern "C" { + pub fn png_get_compression_type( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_byte; +} +extern "C" { + pub fn png_get_pixels_per_meter( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_x_pixels_per_meter( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_y_pixels_per_meter( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_pixel_aspect_ratio( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> f32; +} +extern "C" { + pub fn png_get_pixel_aspect_ratio_fixed( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_fixed_point; +} +extern "C" { + pub fn png_get_x_offset_pixels( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_int_32; +} +extern "C" { + pub fn png_get_y_offset_pixels( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_int_32; +} +extern "C" { + pub fn png_get_x_offset_microns( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_int_32; +} +extern "C" { + pub fn png_get_y_offset_microns( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_int_32; +} +extern "C" { + pub fn png_get_signature( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_const_bytep; +} +extern "C" { + pub fn png_get_bKGD( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + background: *mut png_color_16p, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_bKGD( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + background: png_const_color_16p, + ); +} +extern "C" { + pub fn png_get_cHRM( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + white_x: *mut f64, + white_y: *mut f64, + red_x: *mut f64, + red_y: *mut f64, + green_x: *mut f64, + green_y: *mut f64, + blue_x: *mut f64, + blue_y: *mut f64, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_cHRM_XYZ( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + red_X: *mut f64, + red_Y: *mut f64, + red_Z: *mut f64, + green_X: *mut f64, + green_Y: *mut f64, + green_Z: *mut f64, + blue_X: *mut f64, + blue_Y: *mut f64, + blue_Z: *mut f64, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_cHRM_fixed( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + int_white_x: *mut png_fixed_point, + int_white_y: *mut png_fixed_point, + int_red_x: *mut png_fixed_point, + int_red_y: *mut png_fixed_point, + int_green_x: *mut png_fixed_point, + int_green_y: *mut png_fixed_point, + int_blue_x: *mut png_fixed_point, + int_blue_y: *mut png_fixed_point, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_cHRM_XYZ_fixed( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + int_red_X: *mut png_fixed_point, + int_red_Y: *mut png_fixed_point, + int_red_Z: *mut png_fixed_point, + int_green_X: *mut png_fixed_point, + int_green_Y: *mut png_fixed_point, + int_green_Z: *mut png_fixed_point, + int_blue_X: *mut png_fixed_point, + int_blue_Y: *mut png_fixed_point, + int_blue_Z: *mut png_fixed_point, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_cHRM( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + white_x: f64, + white_y: f64, + red_x: f64, + red_y: f64, + green_x: f64, + green_y: f64, + blue_x: f64, + blue_y: f64, + ); +} +extern "C" { + pub fn png_set_cHRM_XYZ( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + red_X: f64, + red_Y: f64, + red_Z: f64, + green_X: f64, + green_Y: f64, + green_Z: f64, + blue_X: f64, + blue_Y: f64, + blue_Z: f64, + ); +} +extern "C" { + pub fn png_set_cHRM_fixed( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + int_white_x: png_fixed_point, + int_white_y: png_fixed_point, + int_red_x: png_fixed_point, + int_red_y: png_fixed_point, + int_green_x: png_fixed_point, + int_green_y: png_fixed_point, + int_blue_x: png_fixed_point, + int_blue_y: png_fixed_point, + ); +} +extern "C" { + pub fn png_set_cHRM_XYZ_fixed( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + int_red_X: png_fixed_point, + int_red_Y: png_fixed_point, + int_red_Z: png_fixed_point, + int_green_X: png_fixed_point, + int_green_Y: png_fixed_point, + int_green_Z: png_fixed_point, + int_blue_X: png_fixed_point, + int_blue_Y: png_fixed_point, + int_blue_Z: png_fixed_point, + ); +} +extern "C" { + pub fn png_get_eXIf( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + exif: *mut png_bytep, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_eXIf(png_ptr: png_const_structrp, info_ptr: png_inforp, exif: png_bytep); +} +extern "C" { + pub fn png_get_eXIf_1( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + num_exif: *mut png_uint_32, + exif: *mut png_bytep, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_eXIf_1( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + num_exif: png_uint_32, + exif: png_bytep, + ); +} +extern "C" { + pub fn png_get_gAMA( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + file_gamma: *mut f64, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_gAMA_fixed( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + int_file_gamma: *mut png_fixed_point, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_gAMA(png_ptr: png_const_structrp, info_ptr: png_inforp, file_gamma: f64); +} +extern "C" { + pub fn png_set_gAMA_fixed( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + int_file_gamma: png_fixed_point, + ); +} +extern "C" { + pub fn png_get_hIST( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + hist: *mut png_uint_16p, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_hIST( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + hist: png_const_uint_16p, + ); +} +extern "C" { + pub fn png_get_IHDR( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + width: *mut png_uint_32, + height: *mut png_uint_32, + bit_depth: *mut ::std::os::raw::c_int, + color_type: *mut ::std::os::raw::c_int, + interlace_method: *mut ::std::os::raw::c_int, + compression_method: *mut ::std::os::raw::c_int, + filter_method: *mut ::std::os::raw::c_int, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_IHDR( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + width: png_uint_32, + height: png_uint_32, + bit_depth: ::std::os::raw::c_int, + color_type: ::std::os::raw::c_int, + interlace_method: ::std::os::raw::c_int, + compression_method: ::std::os::raw::c_int, + filter_method: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_get_oFFs( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + offset_x: *mut png_int_32, + offset_y: *mut png_int_32, + unit_type: *mut ::std::os::raw::c_int, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_oFFs( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + offset_x: png_int_32, + offset_y: png_int_32, + unit_type: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_get_pCAL( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + purpose: *mut png_charp, + X0: *mut png_int_32, + X1: *mut png_int_32, + type_: *mut ::std::os::raw::c_int, + nparams: *mut ::std::os::raw::c_int, + units: *mut png_charp, + params: *mut png_charpp, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_pCAL( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + purpose: png_const_charp, + X0: png_int_32, + X1: png_int_32, + type_: ::std::os::raw::c_int, + nparams: ::std::os::raw::c_int, + units: png_const_charp, + params: png_charpp, + ); +} +extern "C" { + pub fn png_get_pHYs( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + res_x: *mut png_uint_32, + res_y: *mut png_uint_32, + unit_type: *mut ::std::os::raw::c_int, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_pHYs( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + res_x: png_uint_32, + res_y: png_uint_32, + unit_type: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_get_PLTE( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + palette: *mut png_colorp, + num_palette: *mut ::std::os::raw::c_int, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_PLTE( + png_ptr: png_structrp, + info_ptr: png_inforp, + palette: png_const_colorp, + num_palette: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_get_sBIT( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + sig_bit: *mut png_color_8p, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_sBIT( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + sig_bit: png_const_color_8p, + ); +} +extern "C" { + pub fn png_get_sRGB( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + file_srgb_intent: *mut ::std::os::raw::c_int, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_sRGB( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + srgb_intent: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_set_sRGB_gAMA_and_cHRM( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + srgb_intent: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_get_iCCP( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + name: png_charpp, + compression_type: *mut ::std::os::raw::c_int, + profile: png_bytepp, + proflen: *mut png_uint_32, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_iCCP( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + name: png_const_charp, + compression_type: ::std::os::raw::c_int, + profile: png_const_bytep, + proflen: png_uint_32, + ); +} +extern "C" { + pub fn png_get_sPLT( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + entries: png_sPLT_tpp, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn png_set_sPLT( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + entries: png_const_sPLT_tp, + nentries: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_get_text( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + text_ptr: *mut png_textp, + num_text: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn png_set_text( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + text_ptr: png_const_textp, + num_text: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_get_tIME( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + mod_time: *mut png_timep, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_tIME( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + mod_time: png_const_timep, + ); +} +extern "C" { + pub fn png_get_tRNS( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + trans_alpha: *mut png_bytep, + num_trans: *mut ::std::os::raw::c_int, + trans_color: *mut png_color_16p, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_tRNS( + png_ptr: png_structrp, + info_ptr: png_inforp, + trans_alpha: png_const_bytep, + num_trans: ::std::os::raw::c_int, + trans_color: png_const_color_16p, + ); +} +extern "C" { + pub fn png_get_sCAL( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + unit: *mut ::std::os::raw::c_int, + width: *mut f64, + height: *mut f64, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_sCAL_fixed( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + unit: *mut ::std::os::raw::c_int, + width: *mut png_fixed_point, + height: *mut png_fixed_point, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_sCAL_s( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + unit: *mut ::std::os::raw::c_int, + swidth: png_charpp, + sheight: png_charpp, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_sCAL( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + unit: ::std::os::raw::c_int, + width: f64, + height: f64, + ); +} +extern "C" { + pub fn png_set_sCAL_fixed( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + unit: ::std::os::raw::c_int, + width: png_fixed_point, + height: png_fixed_point, + ); +} +extern "C" { + pub fn png_set_sCAL_s( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + unit: ::std::os::raw::c_int, + swidth: png_const_charp, + sheight: png_const_charp, + ); +} +extern "C" { + pub fn png_set_keep_unknown_chunks( + png_ptr: png_structrp, + keep: ::std::os::raw::c_int, + chunk_list: png_const_bytep, + num_chunks: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_handle_as_unknown( + png_ptr: png_const_structrp, + chunk_name: png_const_bytep, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn png_set_unknown_chunks( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + unknowns: png_const_unknown_chunkp, + num_unknowns: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_set_unknown_chunk_location( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + chunk: ::std::os::raw::c_int, + location: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_get_unknown_chunks( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + entries: png_unknown_chunkpp, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn png_set_invalid( + png_ptr: png_const_structrp, + info_ptr: png_inforp, + mask: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn png_read_png( + png_ptr: png_structrp, + info_ptr: png_inforp, + transforms: ::std::os::raw::c_int, + params: png_voidp, + ); +} +extern "C" { + pub fn png_write_png( + png_ptr: png_structrp, + info_ptr: png_inforp, + transforms: ::std::os::raw::c_int, + params: png_voidp, + ); +} +extern "C" { + pub fn png_get_copyright(png_ptr: png_const_structrp) -> png_const_charp; +} +extern "C" { + pub fn png_get_header_ver(png_ptr: png_const_structrp) -> png_const_charp; +} +extern "C" { + pub fn png_get_header_version(png_ptr: png_const_structrp) -> png_const_charp; +} +extern "C" { + pub fn png_get_libpng_ver(png_ptr: png_const_structrp) -> png_const_charp; +} +extern "C" { + pub fn png_permit_mng_features( + png_ptr: png_structrp, + mng_features_permitted: png_uint_32, + ) -> png_uint_32; +} +extern "C" { + pub fn png_set_user_limits( + png_ptr: png_structrp, + user_width_max: png_uint_32, + user_height_max: png_uint_32, + ); +} +extern "C" { + pub fn png_get_user_width_max(png_ptr: png_const_structrp) -> png_uint_32; +} +extern "C" { + pub fn png_get_user_height_max(png_ptr: png_const_structrp) -> png_uint_32; +} +extern "C" { + pub fn png_set_chunk_cache_max(png_ptr: png_structrp, user_chunk_cache_max: png_uint_32); +} +extern "C" { + pub fn png_get_chunk_cache_max(png_ptr: png_const_structrp) -> png_uint_32; +} +extern "C" { + pub fn png_set_chunk_malloc_max(png_ptr: png_structrp, user_chunk_cache_max: png_alloc_size_t); +} +extern "C" { + pub fn png_get_chunk_malloc_max(png_ptr: png_const_structrp) -> png_alloc_size_t; +} +extern "C" { + pub fn png_get_pixels_per_inch( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_x_pixels_per_inch( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_y_pixels_per_inch( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_x_offset_inches(png_ptr: png_const_structrp, info_ptr: png_const_inforp) -> f32; +} +extern "C" { + pub fn png_get_x_offset_inches_fixed( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_fixed_point; +} +extern "C" { + pub fn png_get_y_offset_inches(png_ptr: png_const_structrp, info_ptr: png_const_inforp) -> f32; +} +extern "C" { + pub fn png_get_y_offset_inches_fixed( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + ) -> png_fixed_point; +} +extern "C" { + pub fn png_get_pHYs_dpi( + png_ptr: png_const_structrp, + info_ptr: png_const_inforp, + res_x: *mut png_uint_32, + res_y: *mut png_uint_32, + unit_type: *mut ::std::os::raw::c_int, + ) -> png_uint_32; +} +extern "C" { + pub fn png_get_io_state(png_ptr: png_const_structrp) -> png_uint_32; +} +extern "C" { + pub fn png_get_io_chunk_type(png_ptr: png_const_structrp) -> png_uint_32; +} +extern "C" { + pub fn png_get_uint_32(buf: png_const_bytep) -> png_uint_32; +} +extern "C" { + pub fn png_get_uint_16(buf: png_const_bytep) -> png_uint_16; +} +extern "C" { + pub fn png_get_int_32(buf: png_const_bytep) -> png_int_32; +} +extern "C" { + pub fn png_get_uint_31(png_ptr: png_const_structrp, buf: png_const_bytep) -> png_uint_32; +} +extern "C" { + pub fn png_save_uint_32(buf: png_bytep, i: png_uint_32); +} +extern "C" { + pub fn png_save_int_32(buf: png_bytep, i: png_int_32); +} +extern "C" { + pub fn png_save_uint_16(buf: png_bytep, i: ::std::os::raw::c_uint); +} +extern "C" { + pub fn png_set_check_for_invalid_index(png_ptr: png_structrp, allowed: ::std::os::raw::c_int); +} +extern "C" { + pub fn png_get_palette_max( + png_ptr: png_const_structp, + info_ptr: png_const_infop, + ) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct png_control { + _unused: [u8; 0], +} +pub type png_controlp = *mut png_control; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct png_image { + pub opaque: png_controlp, + pub version: png_uint_32, + pub width: png_uint_32, + pub height: png_uint_32, + pub format: png_uint_32, + pub flags: png_uint_32, + pub colormap_entries: png_uint_32, + pub warning_or_error: png_uint_32, + pub message: [::std::os::raw::c_char; 64usize], +} +#[test] +fn bindgen_test_layout_png_image() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 104usize, + concat!("Size of: ", stringify!(png_image)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(png_image)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(png_image), + "::", + stringify!(opaque) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(png_image), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).width) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(png_image), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).height) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(png_image), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).format) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(png_image), + "::", + stringify!(format) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(png_image), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).colormap_entries) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(png_image), + "::", + stringify!(colormap_entries) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).warning_or_error) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(png_image), + "::", + stringify!(warning_or_error) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).message) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(png_image), + "::", + stringify!(message) + ) + ); +} +pub type png_imagep = *mut png_image; +extern "C" { + pub fn png_image_begin_read_from_file( + image: png_imagep, + file_name: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn png_image_begin_read_from_stdio( + image: png_imagep, + file: *mut FILE, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn png_image_begin_read_from_memory( + image: png_imagep, + memory: png_const_voidp, + size: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn png_image_finish_read( + image: png_imagep, + background: png_const_colorp, + buffer: *mut ::std::os::raw::c_void, + row_stride: png_int_32, + colormap: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn png_image_free(image: png_imagep); +} +extern "C" { + pub fn png_image_write_to_file( + image: png_imagep, + file: *const ::std::os::raw::c_char, + convert_to_8bit: ::std::os::raw::c_int, + buffer: *const ::std::os::raw::c_void, + row_stride: png_int_32, + colormap: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn png_image_write_to_stdio( + image: png_imagep, + file: *mut FILE, + convert_to_8_bit: ::std::os::raw::c_int, + buffer: *const ::std::os::raw::c_void, + row_stride: png_int_32, + colormap: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn png_image_write_to_memory( + image: png_imagep, + memory: *mut ::std::os::raw::c_void, + memory_bytes: *mut png_alloc_size_t, + convert_to_8_bit: ::std::os::raw::c_int, + buffer: *const ::std::os::raw::c_void, + row_stride: png_int_32, + colormap: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn png_set_option( + png_ptr: png_structrp, + option: ::std::os::raw::c_int, + onoff: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __crt_locale_data { + pub _address: u8, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __crt_multibyte_data { + pub _address: u8, +} +pub type __builtin_va_list = *mut ::std::os::raw::c_char; diff --git a/csbindgen/src/alias_map.rs b/csbindgen/src/alias_map.rs index c065f5b..ae9479f 100644 --- a/csbindgen/src/alias_map.rs +++ b/csbindgen/src/alias_map.rs @@ -1,4 +1,4 @@ -use std::collections::HashMap; +use std::{collections::HashMap}; use crate::type_meta::{RustType, TypeKind}; @@ -38,12 +38,26 @@ impl AliasMap { } } - pub fn normalize(&self, name: &String) -> String { + pub fn normalize(&self, name: &String) -> (String, Option) { match self.type_aliases.get(name) { - Some(x) => self.normalize(&x.type_name), - None => name.to_owned(), + Some(x) => { + let d = self.normalize_deep(x); + (d.type_name.clone(), Some(d)) + } + None => (name.to_owned(), None) } } + + fn normalize_deep(&self, name: &RustType) -> RustType { + match self.type_aliases.get(&name.type_name) { + Some(x) => self.normalize_deep(x), + None => name.clone(), + } + } + + pub fn iter(&self) -> std::collections::hash_map::Iter { + self.type_aliases.iter() + } } #[cfg(test)] @@ -80,10 +94,10 @@ mod test { }, ); - assert_eq!(map.normalize(&"SSIZE_T".to_string()), "c_longlong"); - assert_eq!(map.normalize(&"SSIZE_T2".to_string()), "c_longlong"); - assert_eq!(map.normalize(&"c_longlong".to_string()), "c_longlong"); - assert_eq!(map.normalize(&"c_longlong".to_string()), "c_longlong"); + assert_eq!(map.normalize(&"SSIZE_T".to_string()).0, "c_longlong"); + assert_eq!(map.normalize(&"SSIZE_T2".to_string()).0, "c_longlong"); + assert_eq!(map.normalize(&"c_longlong".to_string()).0, "c_longlong"); + assert_eq!(map.normalize(&"c_longlong".to_string()).0, "c_longlong"); assert_eq!( map.get_mapped_value(&"SSIZE_T".to_string()) diff --git a/csbindgen/src/lib.rs b/csbindgen/src/lib.rs index f888dc0..afe7061 100644 --- a/csbindgen/src/lib.rs +++ b/csbindgen/src/lib.rs @@ -65,7 +65,7 @@ pub(crate) fn generate( let mut field_map = FieldMap::new(); for struct_type in &structs { for field in &struct_type.fields { - let struct_type_normalized = aliases.normalize(&struct_type.struct_name); + let (struct_type_normalized, _) = aliases.normalize(&struct_type.struct_name); collect_field_types( &mut field_map, &aliases, @@ -103,8 +103,12 @@ fn collect_using_types( collect_using_types(using_types, aliases, &p.rust_type); } } else { - let normalized = aliases.normalize(&rust_type.type_name); - using_types.insert(normalized.clone()); + let (normalized, normalized_rust_type) = aliases.normalize(&rust_type.type_name); + if let Some(x) = normalized_rust_type { + collect_using_types(using_types, aliases, &x); + } else { + using_types.insert(normalized.clone()); + } } } @@ -124,23 +128,27 @@ fn collect_field_types( collect_field_types(field_map, aliases, struct_type_normalized, &p.rust_type); } } else { - let normalized = aliases.normalize(&rust_type.type_name); - field_map.insert(struct_type_normalized, &normalized); + let (normalized, normalized_rust_type) = aliases.normalize(&rust_type.type_name); + if let Some(x) = normalized_rust_type { + collect_field_types(field_map, aliases, struct_type_normalized, &x); + } else { + field_map.insert(struct_type_normalized, &normalized); + } } } -// #[test] -// fn test() { -// let path = std::env::current_dir().unwrap(); -// println!("starting dir: {}", path.display()); // csbindgen/csbindgen +#[test] +fn test() { + let path = std::env::current_dir().unwrap(); + println!("starting dir: {}", path.display()); // csbindgen/csbindgen -// Builder::new() -// .input_bindgen_file("csbindgen-tests/src/lz4.rs") -// .csharp_class_name("LibLz4") -// .csharp_dll_name("csbindgen_tests") -// .generate_to_file( -// "csbindgen-tests/src/lz4_ffi.rs", -// "dotnet-sandbox/lz4_bindgen.cs", -// ) -// .unwrap(); -// } + Builder::new() + .input_bindgen_file("csbindgen-tests/src/liblz4.rs") + .csharp_class_name("LibLz4") + .csharp_dll_name("csbindgen_tests") + .generate_to_file( + "csbindgen-tests/src/lz4_ffi.rs", + "dotnet-sandbox/lz4_bindgen.cs", + ) + .unwrap(); +} diff --git a/dotnet-sandbox/libpng16_csbindgen.cs b/dotnet-sandbox/libpng16_csbindgen.cs new file mode 100644 index 0000000..3beb0d7 --- /dev/null +++ b/dotnet-sandbox/libpng16_csbindgen.cs @@ -0,0 +1,1090 @@ +// +// This code is generated by csbindgen. +// DON'T CHANGE THIS DIRECTLY. +// +#pragma warning disable CS8981 +using System; +using System.Runtime.InteropServices; + +namespace PixivApi.ImageFile +{ + internal static unsafe partial class LibPng16 + { + const string __DllName = "libpng16"; + + [DllImport(__DllName, EntryPoint = "fgetwc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ushort fgetwc(_iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "fputwc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ushort fputwc(ushort _Character, _iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "getwc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ushort getwc(_iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "getwchar", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ushort getwchar(); + + [DllImport(__DllName, EntryPoint = "fgetws", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ushort* fgetws(ushort* _Buffer, int _BufferCount, _iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "fputws", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int fputws(ushort* _Buffer, _iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "putwc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ushort putwc(ushort _Character, _iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "putwchar", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ushort putwchar(ushort _Character); + + [DllImport(__DllName, EntryPoint = "ungetwc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ushort ungetwc(ushort _Character, _iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "clearerr_s", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int clearerr_s(_iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "fopen_s", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int fopen_s(_iobuf** _Stream, byte* _FileName, byte* _Mode); + + [DllImport(__DllName, EntryPoint = "fread_s", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern nuint fread_s(void* _Buffer, nuint _BufferSize, nuint _ElementSize, nuint _ElementCount, _iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "freopen_s", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int freopen_s(_iobuf** _Stream, byte* _FileName, byte* _Mode, _iobuf* _OldStream); + + [DllImport(__DllName, EntryPoint = "gets_s", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte* gets_s(byte* _Buffer, nuint _Size); + + [DllImport(__DllName, EntryPoint = "tmpfile_s", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int tmpfile_s(_iobuf** _Stream); + + [DllImport(__DllName, EntryPoint = "tmpnam_s", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int tmpnam_s(byte* _Buffer, nuint _Size); + + [DllImport(__DllName, EntryPoint = "clearerr", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void clearerr(_iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "fclose", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int fclose(_iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "feof", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int feof(_iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "ferror", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int ferror(_iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "fflush", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int fflush(_iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "fgetc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int fgetc(_iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "fgetpos", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int fgetpos(_iobuf* _Stream, long* _Position); + + [DllImport(__DllName, EntryPoint = "fgets", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte* fgets(byte* _Buffer, int _MaxCount, _iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "fopen", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern _iobuf* fopen(byte* _FileName, byte* _Mode); + + [DllImport(__DllName, EntryPoint = "fputc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int fputc(int _Character, _iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "fputs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int fputs(byte* _Buffer, _iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "fread", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ulong fread(void* _Buffer, ulong _ElementSize, ulong _ElementCount, _iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "freopen", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern _iobuf* freopen(byte* _FileName, byte* _Mode, _iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "fsetpos", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int fsetpos(_iobuf* _Stream, long* _Position); + + [DllImport(__DllName, EntryPoint = "fseek", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int fseek(_iobuf* _Stream, CLong _Offset, int _Origin); + + [DllImport(__DllName, EntryPoint = "ftell", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern CLong ftell(_iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "fwrite", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ulong fwrite(void* _Buffer, ulong _ElementSize, ulong _ElementCount, _iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "getc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int getc(_iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "getchar", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int getchar(); + + [DllImport(__DllName, EntryPoint = "perror", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void perror(byte* _ErrorMessage); + + [DllImport(__DllName, EntryPoint = "putc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int putc(int _Character, _iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "putchar", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int putchar(int _Character); + + [DllImport(__DllName, EntryPoint = "puts", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int puts(byte* _Buffer); + + [DllImport(__DllName, EntryPoint = "remove", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int remove(byte* _FileName); + + [DllImport(__DllName, EntryPoint = "rename", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int rename(byte* _OldFileName, byte* _NewFileName); + + [DllImport(__DllName, EntryPoint = "unlink", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int unlink(byte* _FileName); + + [DllImport(__DllName, EntryPoint = "rewind", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void rewind(_iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "setbuf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void setbuf(_iobuf* _Stream, byte* _Buffer); + + [DllImport(__DllName, EntryPoint = "setvbuf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int setvbuf(_iobuf* _Stream, byte* _Buffer, int _Mode, nuint _Size); + + [DllImport(__DllName, EntryPoint = "tmpfile", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern _iobuf* tmpfile(); + + [DllImport(__DllName, EntryPoint = "tmpnam", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte* tmpnam(byte* _Buffer); + + [DllImport(__DllName, EntryPoint = "ungetc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int ungetc(int _Character, _iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "tempnam", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte* tempnam(byte* _Directory, byte* _FilePrefix); + + [DllImport(__DllName, EntryPoint = "fcloseall", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int fcloseall(); + + [DllImport(__DllName, EntryPoint = "fdopen", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern _iobuf* fdopen(int _FileHandle, byte* _Format); + + [DllImport(__DllName, EntryPoint = "fgetchar", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int fgetchar(); + + [DllImport(__DllName, EntryPoint = "fileno", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int fileno(_iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "flushall", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int flushall(); + + [DllImport(__DllName, EntryPoint = "fputchar", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int fputchar(int _Ch); + + [DllImport(__DllName, EntryPoint = "getw", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int getw(_iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "putw", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int putw(int _Ch, _iobuf* _Stream); + + [DllImport(__DllName, EntryPoint = "rmtmp", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int rmtmp(); + + [DllImport(__DllName, EntryPoint = "wcsftime", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern nuint wcsftime(ushort* _Buffer, nuint _SizeInWords, ushort* _Format, tm* _Tm); + + [DllImport(__DllName, EntryPoint = "asctime", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte* asctime(tm* _Tm); + + [DllImport(__DllName, EntryPoint = "asctime_s", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int asctime_s(byte* _Buffer, nuint _SizeInBytes, tm* _Tm); + + [DllImport(__DllName, EntryPoint = "clock", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern CLong clock(); + + [DllImport(__DllName, EntryPoint = "strftime", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern nuint strftime(byte* _Buffer, nuint _SizeInBytes, byte* _Format, tm* _Tm); + + [DllImport(__DllName, EntryPoint = "tzset", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void tzset(); + + [DllImport(__DllName, EntryPoint = "png_access_version_number", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_access_version_number(); + + [DllImport(__DllName, EntryPoint = "png_set_sig_bytes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_sig_bytes(png_struct_def* png_ptr, int num_bytes); + + [DllImport(__DllName, EntryPoint = "png_sig_cmp", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_sig_cmp(byte* sig, nuint start, nuint num_to_check); + + [DllImport(__DllName, EntryPoint = "png_create_read_struct", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern png_struct_def* png_create_read_struct(byte* user_png_ver, void* error_ptr, delegate* unmanaged[Cdecl] error_fn, delegate* unmanaged[Cdecl] warn_fn); + + [DllImport(__DllName, EntryPoint = "png_create_write_struct", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern png_struct_def* png_create_write_struct(byte* user_png_ver, void* error_ptr, delegate* unmanaged[Cdecl] error_fn, delegate* unmanaged[Cdecl] warn_fn); + + [DllImport(__DllName, EntryPoint = "png_get_compression_buffer_size", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern nuint png_get_compression_buffer_size(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_compression_buffer_size", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_compression_buffer_size(png_struct_def* png_ptr, nuint size); + + [DllImport(__DllName, EntryPoint = "png_set_longjmp_fn", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern _SETJMP_FLOAT128* png_set_longjmp_fn(png_struct_def* png_ptr, delegate* unmanaged[Cdecl]<_SETJMP_FLOAT128*, int, void> longjmp_fn, nuint jmp_buf_size); + + [DllImport(__DllName, EntryPoint = "png_reset_zstream", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_reset_zstream(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_create_read_struct_2", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern png_struct_def* png_create_read_struct_2(byte* user_png_ver, void* error_ptr, delegate* unmanaged[Cdecl] error_fn, delegate* unmanaged[Cdecl] warn_fn, void* mem_ptr, delegate* unmanaged[Cdecl] malloc_fn, delegate* unmanaged[Cdecl] free_fn); + + [DllImport(__DllName, EntryPoint = "png_create_write_struct_2", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern png_struct_def* png_create_write_struct_2(byte* user_png_ver, void* error_ptr, delegate* unmanaged[Cdecl] error_fn, delegate* unmanaged[Cdecl] warn_fn, void* mem_ptr, delegate* unmanaged[Cdecl] malloc_fn, delegate* unmanaged[Cdecl] free_fn); + + [DllImport(__DllName, EntryPoint = "png_write_sig", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_write_sig(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_write_chunk", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_write_chunk(png_struct_def* png_ptr, byte* chunk_name, byte* data, nuint length); + + [DllImport(__DllName, EntryPoint = "png_write_chunk_start", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_write_chunk_start(png_struct_def* png_ptr, byte* chunk_name, uint length); + + [DllImport(__DllName, EntryPoint = "png_write_chunk_data", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_write_chunk_data(png_struct_def* png_ptr, byte* data, nuint length); + + [DllImport(__DllName, EntryPoint = "png_write_chunk_end", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_write_chunk_end(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_create_info_struct", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern png_info_def* png_create_info_struct(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_info_init_3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_info_init_3(png_info_def** info_ptr, nuint png_info_struct_size); + + [DllImport(__DllName, EntryPoint = "png_write_info_before_PLTE", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_write_info_before_PLTE(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_write_info", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_write_info(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_read_info", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_read_info(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_convert_to_rfc1123", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte* png_convert_to_rfc1123(png_struct_def* png_ptr, png_time_struct* ptime); + + [DllImport(__DllName, EntryPoint = "png_convert_to_rfc1123_buffer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_convert_to_rfc1123_buffer(byte* @out, png_time_struct* ptime); + + [DllImport(__DllName, EntryPoint = "png_convert_from_struct_tm", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_convert_from_struct_tm(png_time_struct* ptime, tm* ttime); + + [DllImport(__DllName, EntryPoint = "png_convert_from_time_t", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_convert_from_time_t(png_time_struct* ptime, long ttime); + + [DllImport(__DllName, EntryPoint = "png_set_expand", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_expand(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_expand_gray_1_2_4_to_8", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_expand_gray_1_2_4_to_8(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_palette_to_rgb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_palette_to_rgb(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_tRNS_to_alpha", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_tRNS_to_alpha(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_expand_16", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_expand_16(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_bgr", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_bgr(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_gray_to_rgb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_gray_to_rgb(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_rgb_to_gray", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_rgb_to_gray(png_struct_def* png_ptr, int error_action, double red, double green); + + [DllImport(__DllName, EntryPoint = "png_set_rgb_to_gray_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_rgb_to_gray_fixed(png_struct_def* png_ptr, int error_action, int red, int green); + + [DllImport(__DllName, EntryPoint = "png_get_rgb_to_gray_status", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte png_get_rgb_to_gray_status(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_build_grayscale_palette", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_build_grayscale_palette(int bit_depth, png_color_struct* palette); + + [DllImport(__DllName, EntryPoint = "png_set_alpha_mode", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_alpha_mode(png_struct_def* png_ptr, int mode, double output_gamma); + + [DllImport(__DllName, EntryPoint = "png_set_alpha_mode_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_alpha_mode_fixed(png_struct_def* png_ptr, int mode, int output_gamma); + + [DllImport(__DllName, EntryPoint = "png_set_strip_alpha", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_strip_alpha(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_swap_alpha", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_swap_alpha(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_invert_alpha", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_invert_alpha(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_filler", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_filler(png_struct_def* png_ptr, uint filler, int flags); + + [DllImport(__DllName, EntryPoint = "png_set_add_alpha", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_add_alpha(png_struct_def* png_ptr, uint filler, int flags); + + [DllImport(__DllName, EntryPoint = "png_set_swap", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_swap(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_packing", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_packing(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_packswap", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_packswap(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_shift", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_shift(png_struct_def* png_ptr, png_color_8_struct* true_bits); + + [DllImport(__DllName, EntryPoint = "png_set_interlace_handling", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_set_interlace_handling(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_invert_mono", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_invert_mono(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_background", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_background(png_struct_def* png_ptr, png_color_16_struct* background_color, int background_gamma_code, int need_expand, double background_gamma); + + [DllImport(__DllName, EntryPoint = "png_set_background_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_background_fixed(png_struct_def* png_ptr, png_color_16_struct* background_color, int background_gamma_code, int need_expand, int background_gamma); + + [DllImport(__DllName, EntryPoint = "png_set_scale_16", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_scale_16(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_strip_16", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_strip_16(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_quantize", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_quantize(png_struct_def* png_ptr, png_color_struct* palette, int num_palette, int maximum_colors, ushort* histogram, int full_quantize); + + [DllImport(__DllName, EntryPoint = "png_set_gamma", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_gamma(png_struct_def* png_ptr, double screen_gamma, double override_file_gamma); + + [DllImport(__DllName, EntryPoint = "png_set_gamma_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_gamma_fixed(png_struct_def* png_ptr, int screen_gamma, int override_file_gamma); + + [DllImport(__DllName, EntryPoint = "png_set_flush", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_flush(png_struct_def* png_ptr, int nrows); + + [DllImport(__DllName, EntryPoint = "png_write_flush", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_write_flush(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_start_read_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_start_read_image(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_read_update_info", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_read_update_info(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_read_rows", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_read_rows(png_struct_def* png_ptr, byte** row, byte** display_row, uint num_rows); + + [DllImport(__DllName, EntryPoint = "png_read_row", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_read_row(png_struct_def* png_ptr, byte* row, byte* display_row); + + [DllImport(__DllName, EntryPoint = "png_read_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_read_image(png_struct_def* png_ptr, byte** image); + + [DllImport(__DllName, EntryPoint = "png_write_row", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_write_row(png_struct_def* png_ptr, byte* row); + + [DllImport(__DllName, EntryPoint = "png_write_rows", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_write_rows(png_struct_def* png_ptr, byte** row, uint num_rows); + + [DllImport(__DllName, EntryPoint = "png_write_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_write_image(png_struct_def* png_ptr, byte** image); + + [DllImport(__DllName, EntryPoint = "png_write_end", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_write_end(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_read_end", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_read_end(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_destroy_info_struct", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_destroy_info_struct(png_struct_def* png_ptr, png_info_def** info_ptr_ptr); + + [DllImport(__DllName, EntryPoint = "png_destroy_read_struct", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_destroy_read_struct(png_struct_def** png_ptr_ptr, png_info_def** info_ptr_ptr, png_info_def** end_info_ptr_ptr); + + [DllImport(__DllName, EntryPoint = "png_destroy_write_struct", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_destroy_write_struct(png_struct_def** png_ptr_ptr, png_info_def** info_ptr_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_crc_action", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_crc_action(png_struct_def* png_ptr, int crit_action, int ancil_action); + + [DllImport(__DllName, EntryPoint = "png_set_filter", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_filter(png_struct_def* png_ptr, int method, int filters); + + [DllImport(__DllName, EntryPoint = "png_set_filter_heuristics", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_filter_heuristics(png_struct_def* png_ptr, int heuristic_method, int num_weights, double* filter_weights, double* filter_costs); + + [DllImport(__DllName, EntryPoint = "png_set_filter_heuristics_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_filter_heuristics_fixed(png_struct_def* png_ptr, int heuristic_method, int num_weights, int* filter_weights, int* filter_costs); + + [DllImport(__DllName, EntryPoint = "png_set_compression_level", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_compression_level(png_struct_def* png_ptr, int level); + + [DllImport(__DllName, EntryPoint = "png_set_compression_mem_level", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_compression_mem_level(png_struct_def* png_ptr, int mem_level); + + [DllImport(__DllName, EntryPoint = "png_set_compression_strategy", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_compression_strategy(png_struct_def* png_ptr, int strategy); + + [DllImport(__DllName, EntryPoint = "png_set_compression_window_bits", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_compression_window_bits(png_struct_def* png_ptr, int window_bits); + + [DllImport(__DllName, EntryPoint = "png_set_compression_method", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_compression_method(png_struct_def* png_ptr, int method); + + [DllImport(__DllName, EntryPoint = "png_set_text_compression_level", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_text_compression_level(png_struct_def* png_ptr, int level); + + [DllImport(__DllName, EntryPoint = "png_set_text_compression_mem_level", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_text_compression_mem_level(png_struct_def* png_ptr, int mem_level); + + [DllImport(__DllName, EntryPoint = "png_set_text_compression_strategy", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_text_compression_strategy(png_struct_def* png_ptr, int strategy); + + [DllImport(__DllName, EntryPoint = "png_set_text_compression_window_bits", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_text_compression_window_bits(png_struct_def* png_ptr, int window_bits); + + [DllImport(__DllName, EntryPoint = "png_set_text_compression_method", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_text_compression_method(png_struct_def* png_ptr, int method); + + [DllImport(__DllName, EntryPoint = "png_init_io", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_init_io(png_struct_def* png_ptr, _iobuf* fp); + + [DllImport(__DllName, EntryPoint = "png_set_error_fn", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_error_fn(png_struct_def* png_ptr, void* error_ptr, delegate* unmanaged[Cdecl] error_fn, delegate* unmanaged[Cdecl] warning_fn); + + [DllImport(__DllName, EntryPoint = "png_get_error_ptr", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* png_get_error_ptr(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_write_fn", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_write_fn(png_struct_def* png_ptr, void* io_ptr, delegate* unmanaged[Cdecl] write_data_fn, delegate* unmanaged[Cdecl] output_flush_fn); + + [DllImport(__DllName, EntryPoint = "png_set_read_fn", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_read_fn(png_struct_def* png_ptr, void* io_ptr, delegate* unmanaged[Cdecl] read_data_fn); + + [DllImport(__DllName, EntryPoint = "png_get_io_ptr", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* png_get_io_ptr(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_read_status_fn", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_read_status_fn(png_struct_def* png_ptr, delegate* unmanaged[Cdecl] read_row_fn); + + [DllImport(__DllName, EntryPoint = "png_set_write_status_fn", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_write_status_fn(png_struct_def* png_ptr, delegate* unmanaged[Cdecl] write_row_fn); + + [DllImport(__DllName, EntryPoint = "png_set_mem_fn", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_mem_fn(png_struct_def* png_ptr, void* mem_ptr, delegate* unmanaged[Cdecl] malloc_fn, delegate* unmanaged[Cdecl] free_fn); + + [DllImport(__DllName, EntryPoint = "png_get_mem_ptr", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* png_get_mem_ptr(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_read_user_transform_fn", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_read_user_transform_fn(png_struct_def* png_ptr, delegate* unmanaged[Cdecl] read_user_transform_fn); + + [DllImport(__DllName, EntryPoint = "png_set_write_user_transform_fn", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_write_user_transform_fn(png_struct_def* png_ptr, delegate* unmanaged[Cdecl] write_user_transform_fn); + + [DllImport(__DllName, EntryPoint = "png_set_user_transform_info", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_user_transform_info(png_struct_def* png_ptr, void* user_transform_ptr, int user_transform_depth, int user_transform_channels); + + [DllImport(__DllName, EntryPoint = "png_get_user_transform_ptr", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* png_get_user_transform_ptr(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_current_row_number", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_current_row_number(png_struct_def* arg1); + + [DllImport(__DllName, EntryPoint = "png_get_current_pass_number", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte png_get_current_pass_number(png_struct_def* arg1); + + [DllImport(__DllName, EntryPoint = "png_set_read_user_chunk_fn", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_read_user_chunk_fn(png_struct_def* png_ptr, void* user_chunk_ptr, delegate* unmanaged[Cdecl] read_user_chunk_fn); + + [DllImport(__DllName, EntryPoint = "png_get_user_chunk_ptr", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* png_get_user_chunk_ptr(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_progressive_read_fn", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_progressive_read_fn(png_struct_def* png_ptr, void* progressive_ptr, delegate* unmanaged[Cdecl] info_fn, delegate* unmanaged[Cdecl] row_fn, delegate* unmanaged[Cdecl] end_fn); + + [DllImport(__DllName, EntryPoint = "png_get_progressive_ptr", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* png_get_progressive_ptr(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_process_data", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_process_data(png_struct_def* png_ptr, png_info_def* info_ptr, byte* buffer, nuint buffer_size); + + [DllImport(__DllName, EntryPoint = "png_process_data_pause", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern nuint png_process_data_pause(png_struct_def* arg1, int save); + + [DllImport(__DllName, EntryPoint = "png_process_data_skip", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_process_data_skip(png_struct_def* arg1); + + [DllImport(__DllName, EntryPoint = "png_progressive_combine_row", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_progressive_combine_row(png_struct_def* png_ptr, byte* old_row, byte* new_row); + + [DllImport(__DllName, EntryPoint = "png_malloc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* png_malloc(png_struct_def* png_ptr, nuint size); + + [DllImport(__DllName, EntryPoint = "png_calloc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* png_calloc(png_struct_def* png_ptr, nuint size); + + [DllImport(__DllName, EntryPoint = "png_malloc_warn", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* png_malloc_warn(png_struct_def* png_ptr, nuint size); + + [DllImport(__DllName, EntryPoint = "png_free", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_free(png_struct_def* png_ptr, void* ptr); + + [DllImport(__DllName, EntryPoint = "png_free_data", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_free_data(png_struct_def* png_ptr, png_info_def* info_ptr, uint free_me, int num); + + [DllImport(__DllName, EntryPoint = "png_data_freer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_data_freer(png_struct_def* png_ptr, png_info_def* info_ptr, int freer, uint mask); + + [DllImport(__DllName, EntryPoint = "png_malloc_default", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* png_malloc_default(png_struct_def* png_ptr, nuint size); + + [DllImport(__DllName, EntryPoint = "png_free_default", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_free_default(png_struct_def* png_ptr, void* ptr); + + [DllImport(__DllName, EntryPoint = "png_warning", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_warning(png_struct_def* png_ptr, byte* warning_message); + + [DllImport(__DllName, EntryPoint = "png_chunk_warning", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_chunk_warning(png_struct_def* png_ptr, byte* warning_message); + + [DllImport(__DllName, EntryPoint = "png_benign_error", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_benign_error(png_struct_def* png_ptr, byte* warning_message); + + [DllImport(__DllName, EntryPoint = "png_chunk_benign_error", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_chunk_benign_error(png_struct_def* png_ptr, byte* warning_message); + + [DllImport(__DllName, EntryPoint = "png_set_benign_errors", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_benign_errors(png_struct_def* png_ptr, int allowed); + + [DllImport(__DllName, EntryPoint = "png_get_valid", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_valid(png_struct_def* png_ptr, png_info_def* info_ptr, uint flag); + + [DllImport(__DllName, EntryPoint = "png_get_rowbytes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern nuint png_get_rowbytes(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_rows", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte** png_get_rows(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_rows", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_rows(png_struct_def* png_ptr, png_info_def* info_ptr, byte** row_pointers); + + [DllImport(__DllName, EntryPoint = "png_get_channels", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte png_get_channels(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_image_width", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_image_width(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_image_height", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_image_height(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_bit_depth", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte png_get_bit_depth(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_color_type", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte png_get_color_type(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_filter_type", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte png_get_filter_type(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_interlace_type", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte png_get_interlace_type(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_compression_type", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte png_get_compression_type(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_pixels_per_meter", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_pixels_per_meter(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_x_pixels_per_meter", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_x_pixels_per_meter(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_y_pixels_per_meter", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_y_pixels_per_meter(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_pixel_aspect_ratio", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern float png_get_pixel_aspect_ratio(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_pixel_aspect_ratio_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_get_pixel_aspect_ratio_fixed(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_x_offset_pixels", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_get_x_offset_pixels(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_y_offset_pixels", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_get_y_offset_pixels(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_x_offset_microns", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_get_x_offset_microns(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_y_offset_microns", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_get_y_offset_microns(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_signature", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte* png_get_signature(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_bKGD", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_bKGD(png_struct_def* png_ptr, png_info_def* info_ptr, png_color_16_struct** background); + + [DllImport(__DllName, EntryPoint = "png_set_bKGD", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_bKGD(png_struct_def* png_ptr, png_info_def* info_ptr, png_color_16_struct* background); + + [DllImport(__DllName, EntryPoint = "png_get_cHRM", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_cHRM(png_struct_def* png_ptr, png_info_def* info_ptr, double* white_x, double* white_y, double* red_x, double* red_y, double* green_x, double* green_y, double* blue_x, double* blue_y); + + [DllImport(__DllName, EntryPoint = "png_get_cHRM_XYZ", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_cHRM_XYZ(png_struct_def* png_ptr, png_info_def* info_ptr, double* red_X, double* red_Y, double* red_Z, double* green_X, double* green_Y, double* green_Z, double* blue_X, double* blue_Y, double* blue_Z); + + [DllImport(__DllName, EntryPoint = "png_get_cHRM_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_cHRM_fixed(png_struct_def* png_ptr, png_info_def* info_ptr, int* int_white_x, int* int_white_y, int* int_red_x, int* int_red_y, int* int_green_x, int* int_green_y, int* int_blue_x, int* int_blue_y); + + [DllImport(__DllName, EntryPoint = "png_get_cHRM_XYZ_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_cHRM_XYZ_fixed(png_struct_def* png_ptr, png_info_def* info_ptr, int* int_red_X, int* int_red_Y, int* int_red_Z, int* int_green_X, int* int_green_Y, int* int_green_Z, int* int_blue_X, int* int_blue_Y, int* int_blue_Z); + + [DllImport(__DllName, EntryPoint = "png_set_cHRM", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_cHRM(png_struct_def* png_ptr, png_info_def* info_ptr, double white_x, double white_y, double red_x, double red_y, double green_x, double green_y, double blue_x, double blue_y); + + [DllImport(__DllName, EntryPoint = "png_set_cHRM_XYZ", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_cHRM_XYZ(png_struct_def* png_ptr, png_info_def* info_ptr, double red_X, double red_Y, double red_Z, double green_X, double green_Y, double green_Z, double blue_X, double blue_Y, double blue_Z); + + [DllImport(__DllName, EntryPoint = "png_set_cHRM_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_cHRM_fixed(png_struct_def* png_ptr, png_info_def* info_ptr, int int_white_x, int int_white_y, int int_red_x, int int_red_y, int int_green_x, int int_green_y, int int_blue_x, int int_blue_y); + + [DllImport(__DllName, EntryPoint = "png_set_cHRM_XYZ_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_cHRM_XYZ_fixed(png_struct_def* png_ptr, png_info_def* info_ptr, int int_red_X, int int_red_Y, int int_red_Z, int int_green_X, int int_green_Y, int int_green_Z, int int_blue_X, int int_blue_Y, int int_blue_Z); + + [DllImport(__DllName, EntryPoint = "png_get_eXIf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_eXIf(png_struct_def* png_ptr, png_info_def* info_ptr, byte** exif); + + [DllImport(__DllName, EntryPoint = "png_set_eXIf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_eXIf(png_struct_def* png_ptr, png_info_def* info_ptr, byte* exif); + + [DllImport(__DllName, EntryPoint = "png_get_eXIf_1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_eXIf_1(png_struct_def* png_ptr, png_info_def* info_ptr, uint* num_exif, byte** exif); + + [DllImport(__DllName, EntryPoint = "png_set_eXIf_1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_eXIf_1(png_struct_def* png_ptr, png_info_def* info_ptr, uint num_exif, byte* exif); + + [DllImport(__DllName, EntryPoint = "png_get_gAMA", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_gAMA(png_struct_def* png_ptr, png_info_def* info_ptr, double* file_gamma); + + [DllImport(__DllName, EntryPoint = "png_get_gAMA_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_gAMA_fixed(png_struct_def* png_ptr, png_info_def* info_ptr, int* int_file_gamma); + + [DllImport(__DllName, EntryPoint = "png_set_gAMA", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_gAMA(png_struct_def* png_ptr, png_info_def* info_ptr, double file_gamma); + + [DllImport(__DllName, EntryPoint = "png_set_gAMA_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_gAMA_fixed(png_struct_def* png_ptr, png_info_def* info_ptr, int int_file_gamma); + + [DllImport(__DllName, EntryPoint = "png_get_hIST", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_hIST(png_struct_def* png_ptr, png_info_def* info_ptr, ushort** hist); + + [DllImport(__DllName, EntryPoint = "png_set_hIST", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_hIST(png_struct_def* png_ptr, png_info_def* info_ptr, ushort* hist); + + [DllImport(__DllName, EntryPoint = "png_get_IHDR", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_IHDR(png_struct_def* png_ptr, png_info_def* info_ptr, uint* width, uint* height, int* bit_depth, int* color_type, int* interlace_method, int* compression_method, int* filter_method); + + [DllImport(__DllName, EntryPoint = "png_set_IHDR", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_IHDR(png_struct_def* png_ptr, png_info_def* info_ptr, uint width, uint height, int bit_depth, int color_type, int interlace_method, int compression_method, int filter_method); + + [DllImport(__DllName, EntryPoint = "png_get_oFFs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_oFFs(png_struct_def* png_ptr, png_info_def* info_ptr, int* offset_x, int* offset_y, int* unit_type); + + [DllImport(__DllName, EntryPoint = "png_set_oFFs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_oFFs(png_struct_def* png_ptr, png_info_def* info_ptr, int offset_x, int offset_y, int unit_type); + + [DllImport(__DllName, EntryPoint = "png_get_pCAL", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_pCAL(png_struct_def* png_ptr, png_info_def* info_ptr, byte** purpose, int* X0, int* X1, int* type_, int* nparams, byte** units, byte*** @params); + + [DllImport(__DllName, EntryPoint = "png_set_pCAL", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_pCAL(png_struct_def* png_ptr, png_info_def* info_ptr, byte* purpose, int X0, int X1, int type_, int nparams, byte* units, byte** @params); + + [DllImport(__DllName, EntryPoint = "png_get_pHYs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_pHYs(png_struct_def* png_ptr, png_info_def* info_ptr, uint* res_x, uint* res_y, int* unit_type); + + [DllImport(__DllName, EntryPoint = "png_set_pHYs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_pHYs(png_struct_def* png_ptr, png_info_def* info_ptr, uint res_x, uint res_y, int unit_type); + + [DllImport(__DllName, EntryPoint = "png_get_PLTE", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_PLTE(png_struct_def* png_ptr, png_info_def* info_ptr, png_color_struct** palette, int* num_palette); + + [DllImport(__DllName, EntryPoint = "png_set_PLTE", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_PLTE(png_struct_def* png_ptr, png_info_def* info_ptr, png_color_struct* palette, int num_palette); + + [DllImport(__DllName, EntryPoint = "png_get_sBIT", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_sBIT(png_struct_def* png_ptr, png_info_def* info_ptr, png_color_8_struct** sig_bit); + + [DllImport(__DllName, EntryPoint = "png_set_sBIT", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_sBIT(png_struct_def* png_ptr, png_info_def* info_ptr, png_color_8_struct* sig_bit); + + [DllImport(__DllName, EntryPoint = "png_get_sRGB", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_sRGB(png_struct_def* png_ptr, png_info_def* info_ptr, int* file_srgb_intent); + + [DllImport(__DllName, EntryPoint = "png_set_sRGB", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_sRGB(png_struct_def* png_ptr, png_info_def* info_ptr, int srgb_intent); + + [DllImport(__DllName, EntryPoint = "png_set_sRGB_gAMA_and_cHRM", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_sRGB_gAMA_and_cHRM(png_struct_def* png_ptr, png_info_def* info_ptr, int srgb_intent); + + [DllImport(__DllName, EntryPoint = "png_get_iCCP", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_iCCP(png_struct_def* png_ptr, png_info_def* info_ptr, byte** name, int* compression_type, byte** profile, uint* proflen); + + [DllImport(__DllName, EntryPoint = "png_set_iCCP", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_iCCP(png_struct_def* png_ptr, png_info_def* info_ptr, byte* name, int compression_type, byte* profile, uint proflen); + + [DllImport(__DllName, EntryPoint = "png_get_sPLT", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_get_sPLT(png_struct_def* png_ptr, png_info_def* info_ptr, png_sPLT_struct** entries); + + [DllImport(__DllName, EntryPoint = "png_set_sPLT", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_sPLT(png_struct_def* png_ptr, png_info_def* info_ptr, png_sPLT_struct* entries, int nentries); + + [DllImport(__DllName, EntryPoint = "png_get_text", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_get_text(png_struct_def* png_ptr, png_info_def* info_ptr, png_text_struct** text_ptr, int* num_text); + + [DllImport(__DllName, EntryPoint = "png_set_text", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_text(png_struct_def* png_ptr, png_info_def* info_ptr, png_text_struct* text_ptr, int num_text); + + [DllImport(__DllName, EntryPoint = "png_get_tIME", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_tIME(png_struct_def* png_ptr, png_info_def* info_ptr, png_time_struct** mod_time); + + [DllImport(__DllName, EntryPoint = "png_set_tIME", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_tIME(png_struct_def* png_ptr, png_info_def* info_ptr, png_time_struct* mod_time); + + [DllImport(__DllName, EntryPoint = "png_get_tRNS", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_tRNS(png_struct_def* png_ptr, png_info_def* info_ptr, byte** trans_alpha, int* num_trans, png_color_16_struct** trans_color); + + [DllImport(__DllName, EntryPoint = "png_set_tRNS", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_tRNS(png_struct_def* png_ptr, png_info_def* info_ptr, byte* trans_alpha, int num_trans, png_color_16_struct* trans_color); + + [DllImport(__DllName, EntryPoint = "png_get_sCAL", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_sCAL(png_struct_def* png_ptr, png_info_def* info_ptr, int* unit, double* width, double* height); + + [DllImport(__DllName, EntryPoint = "png_get_sCAL_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_sCAL_fixed(png_struct_def* png_ptr, png_info_def* info_ptr, int* unit, int* width, int* height); + + [DllImport(__DllName, EntryPoint = "png_get_sCAL_s", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_sCAL_s(png_struct_def* png_ptr, png_info_def* info_ptr, int* unit, byte** swidth, byte** sheight); + + [DllImport(__DllName, EntryPoint = "png_set_sCAL", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_sCAL(png_struct_def* png_ptr, png_info_def* info_ptr, int unit, double width, double height); + + [DllImport(__DllName, EntryPoint = "png_set_sCAL_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_sCAL_fixed(png_struct_def* png_ptr, png_info_def* info_ptr, int unit, int width, int height); + + [DllImport(__DllName, EntryPoint = "png_set_sCAL_s", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_sCAL_s(png_struct_def* png_ptr, png_info_def* info_ptr, int unit, byte* swidth, byte* sheight); + + [DllImport(__DllName, EntryPoint = "png_set_keep_unknown_chunks", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_keep_unknown_chunks(png_struct_def* png_ptr, int keep, byte* chunk_list, int num_chunks); + + [DllImport(__DllName, EntryPoint = "png_handle_as_unknown", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_handle_as_unknown(png_struct_def* png_ptr, byte* chunk_name); + + [DllImport(__DllName, EntryPoint = "png_set_unknown_chunks", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_unknown_chunks(png_struct_def* png_ptr, png_info_def* info_ptr, png_unknown_chunk_t* unknowns, int num_unknowns); + + [DllImport(__DllName, EntryPoint = "png_set_unknown_chunk_location", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_unknown_chunk_location(png_struct_def* png_ptr, png_info_def* info_ptr, int chunk, int location); + + [DllImport(__DllName, EntryPoint = "png_get_unknown_chunks", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_get_unknown_chunks(png_struct_def* png_ptr, png_info_def* info_ptr, png_unknown_chunk_t** entries); + + [DllImport(__DllName, EntryPoint = "png_set_invalid", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_invalid(png_struct_def* png_ptr, png_info_def* info_ptr, int mask); + + [DllImport(__DllName, EntryPoint = "png_read_png", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_read_png(png_struct_def* png_ptr, png_info_def* info_ptr, int transforms, void* @params); + + [DllImport(__DllName, EntryPoint = "png_write_png", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_write_png(png_struct_def* png_ptr, png_info_def* info_ptr, int transforms, void* @params); + + [DllImport(__DllName, EntryPoint = "png_get_copyright", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte* png_get_copyright(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_header_ver", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte* png_get_header_ver(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_header_version", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte* png_get_header_version(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_libpng_ver", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte* png_get_libpng_ver(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_permit_mng_features", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_permit_mng_features(png_struct_def* png_ptr, uint mng_features_permitted); + + [DllImport(__DllName, EntryPoint = "png_set_user_limits", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_user_limits(png_struct_def* png_ptr, uint user_width_max, uint user_height_max); + + [DllImport(__DllName, EntryPoint = "png_get_user_width_max", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_user_width_max(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_user_height_max", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_user_height_max(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_chunk_cache_max", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_chunk_cache_max(png_struct_def* png_ptr, uint user_chunk_cache_max); + + [DllImport(__DllName, EntryPoint = "png_get_chunk_cache_max", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_chunk_cache_max(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_set_chunk_malloc_max", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_chunk_malloc_max(png_struct_def* png_ptr, nuint user_chunk_cache_max); + + [DllImport(__DllName, EntryPoint = "png_get_chunk_malloc_max", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern nuint png_get_chunk_malloc_max(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_pixels_per_inch", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_pixels_per_inch(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_x_pixels_per_inch", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_x_pixels_per_inch(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_y_pixels_per_inch", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_y_pixels_per_inch(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_x_offset_inches", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern float png_get_x_offset_inches(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_x_offset_inches_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_get_x_offset_inches_fixed(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_y_offset_inches", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern float png_get_y_offset_inches(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_y_offset_inches_fixed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_get_y_offset_inches_fixed(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_pHYs_dpi", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_pHYs_dpi(png_struct_def* png_ptr, png_info_def* info_ptr, uint* res_x, uint* res_y, int* unit_type); + + [DllImport(__DllName, EntryPoint = "png_get_io_state", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_io_state(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_io_chunk_type", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_io_chunk_type(png_struct_def* png_ptr); + + [DllImport(__DllName, EntryPoint = "png_get_uint_32", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_uint_32(byte* buf); + + [DllImport(__DllName, EntryPoint = "png_get_uint_16", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ushort png_get_uint_16(byte* buf); + + [DllImport(__DllName, EntryPoint = "png_get_int_32", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_get_int_32(byte* buf); + + [DllImport(__DllName, EntryPoint = "png_get_uint_31", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint png_get_uint_31(png_struct_def* png_ptr, byte* buf); + + [DllImport(__DllName, EntryPoint = "png_save_uint_32", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_save_uint_32(byte* buf, uint i); + + [DllImport(__DllName, EntryPoint = "png_save_int_32", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_save_int_32(byte* buf, int i); + + [DllImport(__DllName, EntryPoint = "png_save_uint_16", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_save_uint_16(byte* buf, uint i); + + [DllImport(__DllName, EntryPoint = "png_set_check_for_invalid_index", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_set_check_for_invalid_index(png_struct_def* png_ptr, int allowed); + + [DllImport(__DllName, EntryPoint = "png_get_palette_max", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_get_palette_max(png_struct_def* png_ptr, png_info_def* info_ptr); + + [DllImport(__DllName, EntryPoint = "png_image_begin_read_from_file", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_image_begin_read_from_file(png_image* image, byte* file_name); + + [DllImport(__DllName, EntryPoint = "png_image_begin_read_from_stdio", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_image_begin_read_from_stdio(png_image* image, _iobuf* file); + + [DllImport(__DllName, EntryPoint = "png_image_begin_read_from_memory", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_image_begin_read_from_memory(png_image* image, void* memory, nuint size); + + [DllImport(__DllName, EntryPoint = "png_image_finish_read", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_image_finish_read(png_image* image, png_color_struct* background, void* buffer, int row_stride, void* colormap); + + [DllImport(__DllName, EntryPoint = "png_image_free", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void png_image_free(png_image* image); + + [DllImport(__DllName, EntryPoint = "png_image_write_to_file", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_image_write_to_file(png_image* image, byte* file, int convert_to_8bit, void* buffer, int row_stride, void* colormap); + + [DllImport(__DllName, EntryPoint = "png_image_write_to_stdio", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_image_write_to_stdio(png_image* image, _iobuf* file, int convert_to_8_bit, void* buffer, int row_stride, void* colormap); + + [DllImport(__DllName, EntryPoint = "png_image_write_to_memory", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_image_write_to_memory(png_image* image, void* memory, nuint* memory_bytes, int convert_to_8_bit, void* buffer, int row_stride, void* colormap); + + [DllImport(__DllName, EntryPoint = "png_set_option", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int png_set_option(png_struct_def* png_ptr, int option, int onoff); + + + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct _iobuf + { + public void* _Placeholder; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct _SETJMP_FLOAT128 + { + public fixed ulong Part[2]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct tm + { + public int tm_sec; + public int tm_min; + public int tm_hour; + public int tm_mday; + public int tm_mon; + public int tm_year; + public int tm_wday; + public int tm_yday; + public int tm_isdst; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct png_struct_def + { + public fixed byte _unused[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct png_info_def + { + public fixed byte _unused[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct png_color_struct + { + public byte red; + public byte green; + public byte blue; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct png_color_16_struct + { + public byte index; + public ushort red; + public ushort green; + public ushort blue; + public ushort gray; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct png_color_8_struct + { + public byte red; + public byte green; + public byte blue; + public byte gray; + public byte alpha; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct png_sPLT_entry_struct + { + public ushort red; + public ushort green; + public ushort blue; + public ushort alpha; + public ushort frequency; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct png_sPLT_struct + { + public byte* name; + public byte depth; + public png_sPLT_entry_struct* entries; + public int nentries; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct png_text_struct + { + public int compression; + public byte* key; + public byte* text; + public nuint text_length; + public nuint itxt_length; + public byte* lang; + public byte* lang_key; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct png_time_struct + { + public ushort year; + public byte month; + public byte day; + public byte hour; + public byte minute; + public byte second; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct png_unknown_chunk_t + { + public fixed byte name[5]; + public byte* data; + public nuint size; + public byte location; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct png_row_info_struct + { + public uint width; + public nuint rowbytes; + public byte color_type; + public byte bit_depth; + public byte channels; + public byte pixel_depth; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct png_control + { + public fixed byte _unused[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct png_image + { + public png_control* opaque; + public uint version; + public uint width; + public uint height; + public uint format; + public uint flags; + public uint colormap_entries; + public uint warning_or_error; + public fixed byte message[64]; + } + + + +} + \ No newline at end of file