diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 307f12d..3ef2698 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,6 +96,12 @@ jobs: - name: Tests shell: bash run: | + ls /home/runner/work/pq-sys/pq-sys/ + ls /home/runner/work/pq-sys/pq-sys/pq-src/ + ls /home/runner/work/pq-sys/pq-sys/pq-src/source/ + ls /home/runner/work/pq-sys/pq-sys/pq-src/source/src/ + ls /home/runner/work/pq-sys/pq-sys/pq-src/source/src/interfaces/ + ls /home/runner/work/pq-sys/pq-sys/pq-src/source/src/interfaces/libpq cargo test --no-default-features --features "${{ matrix.features }}" - name: Test compile diesel diff --git a/Cargo.toml b/Cargo.toml index dc8c302..eba9d15 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0" repository = "https://github.com/sgrif/pq-sys" links = "pq" build = "build.rs" +edition = "2021" [workspace] members = ["pq-src"] @@ -15,14 +16,19 @@ name = "pq_sys" [dependencies] pq-src = { path = "pq-src", version = ">=0.2, <0.4", optional = true , default-features = false } +libc = "0.2.100" [build-dependencies] pkg-config = { version = "0.3.0", optional = true } -bindgen = { version = "0.69.1", optional = true } +bindgen = { version = "0.71.0", optional = true } [target.'cfg(target_env = "msvc")'.build-dependencies] vcpkg = "0.2.6" +[dev-dependencies] +similar-asserts = "1.6.0" +bindgen = "0.71.0" + [features] default = [] bundled = ["bundled_without_openssl", "pq-src/with-openssl"] diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..2a925d8 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,27 @@ +# DEVELOPMENT NOTES + +Use the following command to generate a new bindings file: +```sh +# keep the command in sync with the command in `src/make_bindings.rs" +bindgen wrapper.h \ + --rustified-enum ".*" + --no-derive-default \ + --generate "functions,types,vars,methods,constructors,destructors" \ + --allowlist-var "PG_.*" \ + --allowlist-var "LIBPQ_.*" \ + --allowlist-var "PQ.*" \ + --allowlist-type "Oid" \ + --allowlist-type "ConnStatusType" \ + --allowlist-type "Postgres.*" \ + --allowlist-type "pg.*" \ + --allowlist-type "PG.*" \ + --allowlist-type "PQ.*" \ + --allowlist-type "pq.*" \ + --allowlist-function "PQ.*" \ + --allowlist-function "lo_.*" \ + --allowlist-function "pg_.*" \ + --opaque-type "FILE" \ + --blocklist-type "FILE" \ + --raw-line "use libc::FILE;" \ + -- -I pq-src/source/src/interfaces/libpq/ +``` diff --git a/build.rs b/build.rs index cbc4ea8..484c079 100644 --- a/build.rs +++ b/build.rs @@ -92,9 +92,7 @@ fn main() { } #[cfg(feature = "buildtime_bindgen")] { - let bindings = bindgen::Builder::default() - .rustified_enum(".*") - .header("wrapper.h") + let bindings = include!("src/make_bindings.rs") .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) .generate() .expect("Unable to generate bindings"); diff --git a/src/bindings.rs b/src/bindings.rs index e680cf8..e09ebcd 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -1,102 +1,7 @@ -/* automatically generated by rust-bindgen 0.69.1 */ +/* automatically generated by rust-bindgen 0.71.1 */ + +use libc::FILE; -pub const _STDIO_H: u32 = 1; -pub const _FEATURES_H: u32 = 1; -pub const _DEFAULT_SOURCE: u32 = 1; -pub const __GLIBC_USE_ISOC2X: u32 = 0; -pub const __USE_ISOC11: u32 = 1; -pub const __USE_ISOC99: u32 = 1; -pub const __USE_ISOC95: u32 = 1; -pub const __USE_POSIX_IMPLICITLY: u32 = 1; -pub const _POSIX_SOURCE: u32 = 1; -pub const _POSIX_C_SOURCE: u32 = 200809; -pub const __USE_POSIX: u32 = 1; -pub const __USE_POSIX2: u32 = 1; -pub const __USE_POSIX199309: u32 = 1; -pub const __USE_POSIX199506: u32 = 1; -pub const __USE_XOPEN2K: u32 = 1; -pub const __USE_XOPEN2K8: u32 = 1; -pub const _ATFILE_SOURCE: u32 = 1; -pub const __WORDSIZE: u32 = 64; -pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; -pub const __SYSCALL_WORDSIZE: u32 = 64; -pub const __TIMESIZE: u32 = 64; -pub const __USE_MISC: u32 = 1; -pub const __USE_ATFILE: u32 = 1; -pub const __USE_FORTIFY_LEVEL: u32 = 0; -pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; -pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; -pub const __GLIBC_USE_C2X_STRTOL: u32 = 0; -pub const _STDC_PREDEF_H: u32 = 1; -pub const __STDC_IEC_559__: u32 = 1; -pub const __STDC_IEC_60559_BFP__: u32 = 201404; -pub const __STDC_IEC_559_COMPLEX__: u32 = 1; -pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404; -pub const __STDC_ISO_10646__: u32 = 201706; -pub const __GNU_LIBRARY__: u32 = 6; -pub const __GLIBC__: u32 = 2; -pub const __GLIBC_MINOR__: u32 = 38; -pub const _SYS_CDEFS_H: u32 = 1; -pub const __glibc_c99_flexarr_available: u32 = 1; -pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0; -pub const __HAVE_GENERIC_SELECTION: u32 = 1; -pub const __GLIBC_USE_LIB_EXT2: u32 = 0; -pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0; -pub const __GLIBC_USE_IEC_60559_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0; -pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0; -pub const _BITS_TYPES_H: u32 = 1; -pub const _BITS_TYPESIZES_H: u32 = 1; -pub const __OFF_T_MATCHES_OFF64_T: u32 = 1; -pub const __INO_T_MATCHES_INO64_T: u32 = 1; -pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1; -pub const __STATFS_MATCHES_STATFS64: u32 = 1; -pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1; -pub const __FD_SETSIZE: u32 = 1024; -pub const _BITS_TIME64_H: u32 = 1; -pub const _____fpos_t_defined: u32 = 1; -pub const ____mbstate_t_defined: u32 = 1; -pub const _____fpos64_t_defined: u32 = 1; -pub const ____FILE_defined: u32 = 1; -pub const __FILE_defined: u32 = 1; -pub const __struct_FILE_defined: u32 = 1; -pub const _IO_EOF_SEEN: u32 = 16; -pub const _IO_ERR_SEEN: u32 = 32; -pub const _IO_USER_LOCK: u32 = 32768; -pub const __cookie_io_functions_t_defined: u32 = 1; -pub const _IOFBF: u32 = 0; -pub const _IOLBF: u32 = 1; -pub const _IONBF: u32 = 2; -pub const BUFSIZ: u32 = 8192; -pub const EOF: i32 = -1; -pub const SEEK_SET: u32 = 0; -pub const SEEK_CUR: u32 = 1; -pub const SEEK_END: u32 = 2; -pub const P_tmpdir: &[u8; 5] = b"/tmp\0"; -pub const L_tmpnam: u32 = 20; -pub const TMP_MAX: u32 = 238328; -pub const _BITS_STDIO_LIM_H: u32 = 1; -pub const FILENAME_MAX: u32 = 4096; -pub const L_ctermid: u32 = 9; -pub const FOPEN_MAX: u32 = 16; -pub const __HAVE_FLOAT128: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT128: u32 = 0; -pub const __HAVE_FLOAT64X: u32 = 1; -pub const __HAVE_FLOAT64X_LONG_DOUBLE: u32 = 1; -pub const __HAVE_FLOAT16: u32 = 0; -pub const __HAVE_FLOAT32: u32 = 1; -pub const __HAVE_FLOAT64: u32 = 1; -pub const __HAVE_FLOAT32X: u32 = 1; -pub const __HAVE_FLOAT128X: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT16: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT32: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT64: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT32X: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT64X: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT128X: u32 = 0; -pub const __HAVE_FLOATN_NOT_TYPEDEF: u32 = 0; pub const PG_DIAG_SEVERITY: u8 = 83u8; pub const PG_DIAG_SEVERITY_NONLOCALIZED: u8 = 86u8; pub const PG_DIAG_SQLSTATE: u8 = 67u8; @@ -118,6 +23,12 @@ pub const PG_DIAG_SOURCE_FUNCTION: u8 = 82u8; pub const LIBPQ_HAS_PIPELINING: u32 = 1; pub const LIBPQ_HAS_TRACE_FLAGS: u32 = 1; pub const LIBPQ_HAS_SSL_LIBRARY_DETECTION: u32 = 1; +pub const LIBPQ_HAS_ASYNC_CANCEL: u32 = 1; +pub const LIBPQ_HAS_CHANGE_PASSWORD: u32 = 1; +pub const LIBPQ_HAS_CHUNK_MODE: u32 = 1; +pub const LIBPQ_HAS_CLOSE_PREPARED: u32 = 1; +pub const LIBPQ_HAS_SEND_PIPELINE_SYNC: u32 = 1; +pub const LIBPQ_HAS_SOCKET_POLL: u32 = 1; pub const PG_COPYRES_ATTRS: u32 = 1; pub const PG_COPYRES_TUPLES: u32 = 2; pub const PG_COPYRES_EVENTS: u32 = 4; @@ -126,1187 +37,6 @@ pub const PQTRACE_SUPPRESS_TIMESTAMPS: u32 = 1; pub const PQTRACE_REGRESS_MODE: u32 = 2; pub const PQ_QUERY_PARAM_MAX_LIMIT: u32 = 65535; pub const PQnoPasswordSupplied: &[u8; 35] = b"fe_sendauth: no password supplied\n\0"; -pub type __gnuc_va_list = __builtin_va_list; -pub type __u_char = ::std::os::raw::c_uchar; -pub type __u_short = ::std::os::raw::c_ushort; -pub type __u_int = ::std::os::raw::c_uint; -pub type __u_long = ::std::os::raw::c_ulong; -pub type __int8_t = ::std::os::raw::c_schar; -pub type __uint8_t = ::std::os::raw::c_uchar; -pub type __int16_t = ::std::os::raw::c_short; -pub type __uint16_t = ::std::os::raw::c_ushort; -pub type __int32_t = ::std::os::raw::c_int; -pub type __uint32_t = ::std::os::raw::c_uint; -pub type __int64_t = ::std::os::raw::c_long; -pub type __uint64_t = ::std::os::raw::c_ulong; -pub type __int_least8_t = __int8_t; -pub type __uint_least8_t = __uint8_t; -pub type __int_least16_t = __int16_t; -pub type __uint_least16_t = __uint16_t; -pub type __int_least32_t = __int32_t; -pub type __uint_least32_t = __uint32_t; -pub type __int_least64_t = __int64_t; -pub type __uint_least64_t = __uint64_t; -pub type __quad_t = ::std::os::raw::c_long; -pub type __u_quad_t = ::std::os::raw::c_ulong; -pub type __intmax_t = ::std::os::raw::c_long; -pub type __uintmax_t = ::std::os::raw::c_ulong; -pub type __dev_t = ::std::os::raw::c_ulong; -pub type __uid_t = ::std::os::raw::c_uint; -pub type __gid_t = ::std::os::raw::c_uint; -pub type __ino_t = ::std::os::raw::c_ulong; -pub type __ino64_t = ::std::os::raw::c_ulong; -pub type __mode_t = ::std::os::raw::c_uint; -pub type __nlink_t = ::std::os::raw::c_ulong; -pub type __off_t = ::std::os::raw::c_long; -pub type __off64_t = ::std::os::raw::c_long; -pub type __pid_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __fsid_t { - pub __val: [::std::os::raw::c_int; 2usize], -} -#[test] -fn bindgen_test_layout___fsid_t() { - const UNINIT: ::std::mem::MaybeUninit<__fsid_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__fsid_t>(), - 8usize, - concat!("Size of: ", stringify!(__fsid_t)) - ); - assert_eq!( - ::std::mem::align_of::<__fsid_t>(), - 4usize, - concat!("Alignment of ", stringify!(__fsid_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__fsid_t), - "::", - stringify!(__val) - ) - ); -} -pub type __clock_t = ::std::os::raw::c_long; -pub type __rlim_t = ::std::os::raw::c_ulong; -pub type __rlim64_t = ::std::os::raw::c_ulong; -pub type __id_t = ::std::os::raw::c_uint; -pub type __time_t = ::std::os::raw::c_long; -pub type __useconds_t = ::std::os::raw::c_uint; -pub type __suseconds_t = ::std::os::raw::c_long; -pub type __suseconds64_t = ::std::os::raw::c_long; -pub type __daddr_t = ::std::os::raw::c_int; -pub type __key_t = ::std::os::raw::c_int; -pub type __clockid_t = ::std::os::raw::c_int; -pub type __timer_t = *mut ::std::os::raw::c_void; -pub type __blksize_t = ::std::os::raw::c_long; -pub type __blkcnt_t = ::std::os::raw::c_long; -pub type __blkcnt64_t = ::std::os::raw::c_long; -pub type __fsblkcnt_t = ::std::os::raw::c_ulong; -pub type __fsblkcnt64_t = ::std::os::raw::c_ulong; -pub type __fsfilcnt_t = ::std::os::raw::c_ulong; -pub type __fsfilcnt64_t = ::std::os::raw::c_ulong; -pub type __fsword_t = ::std::os::raw::c_long; -pub type __ssize_t = ::std::os::raw::c_long; -pub type __syscall_slong_t = ::std::os::raw::c_long; -pub type __syscall_ulong_t = ::std::os::raw::c_ulong; -pub type __loff_t = __off64_t; -pub type __caddr_t = *mut ::std::os::raw::c_char; -pub type __intptr_t = ::std::os::raw::c_long; -pub type __socklen_t = ::std::os::raw::c_uint; -pub type __sig_atomic_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct __mbstate_t { - pub __count: ::std::os::raw::c_int, - pub __value: __mbstate_t__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union __mbstate_t__bindgen_ty_1 { - pub __wch: ::std::os::raw::c_uint, - pub __wchb: [::std::os::raw::c_char; 4usize], -} -#[test] -fn bindgen_test_layout___mbstate_t__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__mbstate_t__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__mbstate_t__bindgen_ty_1>(), - 4usize, - concat!("Size of: ", stringify!(__mbstate_t__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t__bindgen_ty_1>(), - 4usize, - concat!("Alignment of ", stringify!(__mbstate_t__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wch) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t__bindgen_ty_1), - "::", - stringify!(__wch) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wchb) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t__bindgen_ty_1), - "::", - stringify!(__wchb) - ) - ); -} -#[test] -fn bindgen_test_layout___mbstate_t() { - const UNINIT: ::std::mem::MaybeUninit<__mbstate_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__mbstate_t>(), - 8usize, - concat!("Size of: ", stringify!(__mbstate_t)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t>(), - 4usize, - concat!("Alignment of ", stringify!(__mbstate_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__value) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__value) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct _G_fpos_t { - pub __pos: __off_t, - pub __state: __mbstate_t, -} -#[test] -fn bindgen_test_layout__G_fpos_t() { - const UNINIT: ::std::mem::MaybeUninit<_G_fpos_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_G_fpos_t>(), - 16usize, - concat!("Size of: ", stringify!(_G_fpos_t)) - ); - assert_eq!( - ::std::mem::align_of::<_G_fpos_t>(), - 8usize, - concat!("Alignment of ", stringify!(_G_fpos_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pos) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos_t), - "::", - stringify!(__pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__state) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos_t), - "::", - stringify!(__state) - ) - ); -} -pub type __fpos_t = _G_fpos_t; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct _G_fpos64_t { - pub __pos: __off64_t, - pub __state: __mbstate_t, -} -#[test] -fn bindgen_test_layout__G_fpos64_t() { - const UNINIT: ::std::mem::MaybeUninit<_G_fpos64_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_G_fpos64_t>(), - 16usize, - concat!("Size of: ", stringify!(_G_fpos64_t)) - ); - assert_eq!( - ::std::mem::align_of::<_G_fpos64_t>(), - 8usize, - concat!("Alignment of ", stringify!(_G_fpos64_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pos) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos64_t), - "::", - stringify!(__pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__state) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos64_t), - "::", - stringify!(__state) - ) - ); -} -pub type __fpos64_t = _G_fpos64_t; -pub type __FILE = _IO_FILE; -pub type FILE = _IO_FILE; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_marker { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_codecvt { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_wide_data { - _unused: [u8; 0], -} -pub type _IO_lock_t = ::std::os::raw::c_void; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_FILE { - pub _flags: ::std::os::raw::c_int, - pub _IO_read_ptr: *mut ::std::os::raw::c_char, - pub _IO_read_end: *mut ::std::os::raw::c_char, - pub _IO_read_base: *mut ::std::os::raw::c_char, - pub _IO_write_base: *mut ::std::os::raw::c_char, - pub _IO_write_ptr: *mut ::std::os::raw::c_char, - pub _IO_write_end: *mut ::std::os::raw::c_char, - pub _IO_buf_base: *mut ::std::os::raw::c_char, - pub _IO_buf_end: *mut ::std::os::raw::c_char, - pub _IO_save_base: *mut ::std::os::raw::c_char, - pub _IO_backup_base: *mut ::std::os::raw::c_char, - pub _IO_save_end: *mut ::std::os::raw::c_char, - pub _markers: *mut _IO_marker, - pub _chain: *mut _IO_FILE, - pub _fileno: ::std::os::raw::c_int, - pub _flags2: ::std::os::raw::c_int, - pub _old_offset: __off_t, - pub _cur_column: ::std::os::raw::c_ushort, - pub _vtable_offset: ::std::os::raw::c_schar, - pub _shortbuf: [::std::os::raw::c_char; 1usize], - pub _lock: *mut _IO_lock_t, - pub _offset: __off64_t, - pub _codecvt: *mut _IO_codecvt, - pub _wide_data: *mut _IO_wide_data, - pub _freeres_list: *mut _IO_FILE, - pub _freeres_buf: *mut ::std::os::raw::c_void, - pub __pad5: usize, - pub _mode: ::std::os::raw::c_int, - pub _unused2: [::std::os::raw::c_char; 20usize], -} -#[test] -fn bindgen_test_layout__IO_FILE() { - const UNINIT: ::std::mem::MaybeUninit<_IO_FILE> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_IO_FILE>(), - 216usize, - concat!("Size of: ", stringify!(_IO_FILE)) - ); - assert_eq!( - ::std::mem::align_of::<_IO_FILE>(), - 8usize, - concat!("Alignment of ", stringify!(_IO_FILE)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_ptr) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_end) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_base) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_base) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_ptr) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_end) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_base) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_end) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_base) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_backup_base) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_backup_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_end) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._markers) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_markers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._chain) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_chain) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._fileno) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_fileno) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags2) as usize - ptr as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._old_offset) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_old_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._cur_column) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_cur_column) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._vtable_offset) as usize - ptr as usize }, - 130usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_vtable_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._shortbuf) as usize - ptr as usize }, - 131usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_shortbuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lock) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._codecvt) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_codecvt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._wide_data) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_wide_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._freeres_list) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_list) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._freeres_buf) as usize - ptr as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_buf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad5) as usize - ptr as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(__pad5) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._mode) as usize - ptr as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_mode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._unused2) as usize - ptr as usize }, - 196usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_unused2) - ) - ); -} -pub type cookie_read_function_t = ::std::option::Option< - unsafe extern "C" fn( - __cookie: *mut ::std::os::raw::c_void, - __buf: *mut ::std::os::raw::c_char, - __nbytes: usize, - ) -> __ssize_t, ->; -pub type cookie_write_function_t = ::std::option::Option< - unsafe extern "C" fn( - __cookie: *mut ::std::os::raw::c_void, - __buf: *const ::std::os::raw::c_char, - __nbytes: usize, - ) -> __ssize_t, ->; -pub type cookie_seek_function_t = ::std::option::Option< - unsafe extern "C" fn( - __cookie: *mut ::std::os::raw::c_void, - __pos: *mut __off64_t, - __w: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int, ->; -pub type cookie_close_function_t = ::std::option::Option< - unsafe extern "C" fn(__cookie: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, ->; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_cookie_io_functions_t { - pub read: cookie_read_function_t, - pub write: cookie_write_function_t, - pub seek: cookie_seek_function_t, - pub close: cookie_close_function_t, -} -#[test] -fn bindgen_test_layout__IO_cookie_io_functions_t() { - const UNINIT: ::std::mem::MaybeUninit<_IO_cookie_io_functions_t> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_IO_cookie_io_functions_t>(), - 32usize, - concat!("Size of: ", stringify!(_IO_cookie_io_functions_t)) - ); - assert_eq!( - ::std::mem::align_of::<_IO_cookie_io_functions_t>(), - 8usize, - concat!("Alignment of ", stringify!(_IO_cookie_io_functions_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_cookie_io_functions_t), - "::", - stringify!(read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).write) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_cookie_io_functions_t), - "::", - stringify!(write) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).seek) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_cookie_io_functions_t), - "::", - stringify!(seek) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).close) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_IO_cookie_io_functions_t), - "::", - stringify!(close) - ) - ); -} -pub type cookie_io_functions_t = _IO_cookie_io_functions_t; -pub type va_list = __gnuc_va_list; -pub type off_t = __off_t; -pub type fpos_t = __fpos_t; -extern "C" { - pub static mut stdin: *mut FILE; -} -extern "C" { - pub static mut stdout: *mut FILE; -} -extern "C" { - pub static mut stderr: *mut FILE; -} -extern "C" { - pub fn remove(__filename: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rename( - __old: *const ::std::os::raw::c_char, - __new: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn renameat( - __oldfd: ::std::os::raw::c_int, - __old: *const ::std::os::raw::c_char, - __newfd: ::std::os::raw::c_int, - __new: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fclose(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn tmpfile() -> *mut FILE; -} -extern "C" { - pub fn tmpnam(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn tmpnam_r(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn tempnam( - __dir: *const ::std::os::raw::c_char, - __pfx: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn fflush(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fflush_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fopen( - __filename: *const ::std::os::raw::c_char, - __modes: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn freopen( - __filename: *const ::std::os::raw::c_char, - __modes: *const ::std::os::raw::c_char, - __stream: *mut FILE, - ) -> *mut FILE; -} -extern "C" { - pub fn fdopen(__fd: ::std::os::raw::c_int, __modes: *const ::std::os::raw::c_char) - -> *mut FILE; -} -extern "C" { - pub fn fopencookie( - __magic_cookie: *mut ::std::os::raw::c_void, - __modes: *const ::std::os::raw::c_char, - __io_funcs: cookie_io_functions_t, - ) -> *mut FILE; -} -extern "C" { - pub fn fmemopen( - __s: *mut ::std::os::raw::c_void, - __len: usize, - __modes: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn open_memstream( - __bufloc: *mut *mut ::std::os::raw::c_char, - __sizeloc: *mut usize, - ) -> *mut FILE; -} -extern "C" { - pub fn setbuf(__stream: *mut FILE, __buf: *mut ::std::os::raw::c_char); -} -extern "C" { - pub fn setvbuf( - __stream: *mut FILE, - __buf: *mut ::std::os::raw::c_char, - __modes: ::std::os::raw::c_int, - __n: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setbuffer(__stream: *mut FILE, __buf: *mut ::std::os::raw::c_char, __size: usize); -} -extern "C" { - pub fn setlinebuf(__stream: *mut FILE); -} -extern "C" { - pub fn fprintf( - __stream: *mut FILE, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn printf(__format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sprintf( - __s: *mut ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vfprintf( - __s: *mut FILE, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vprintf( - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsprintf( - __s: *mut ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn snprintf( - __s: *mut ::std::os::raw::c_char, - __maxlen: ::std::os::raw::c_ulong, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsnprintf( - __s: *mut ::std::os::raw::c_char, - __maxlen: ::std::os::raw::c_ulong, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vasprintf( - __ptr: *mut *mut ::std::os::raw::c_char, - __f: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __asprintf( - __ptr: *mut *mut ::std::os::raw::c_char, - __fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn asprintf( - __ptr: *mut *mut ::std::os::raw::c_char, - __fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vdprintf( - __fd: ::std::os::raw::c_int, - __fmt: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn dprintf( - __fd: ::std::os::raw::c_int, - __fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fscanf( - __stream: *mut FILE, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn scanf(__format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sscanf( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -pub type _Float32 = f32; -pub type _Float64 = f64; -pub type _Float32x = f64; -pub type _Float64x = u128; -extern "C" { - #[link_name = "\u{1}__isoc99_fscanf"] - pub fn fscanf1( - __stream: *mut FILE, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_scanf"] - pub fn scanf1(__format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_sscanf"] - pub fn sscanf1( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vfscanf( - __s: *mut FILE, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vscanf( - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsscanf( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_vfscanf"] - pub fn vfscanf1( - __s: *mut FILE, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_vscanf"] - pub fn vscanf1( - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_vsscanf"] - pub fn vsscanf1( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetc(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -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 getc_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getchar_unlocked() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetc_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fputc(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putc(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putchar(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fputc_unlocked(__c: ::std::os::raw::c_int, __stream: *mut FILE) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putc_unlocked(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putchar_unlocked(__c: ::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(__w: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgets( - __s: *mut ::std::os::raw::c_char, - __n: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn __getdelim( - __lineptr: *mut *mut ::std::os::raw::c_char, - __n: *mut usize, - __delimiter: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> __ssize_t; -} -extern "C" { - pub fn getdelim( - __lineptr: *mut *mut ::std::os::raw::c_char, - __n: *mut usize, - __delimiter: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> __ssize_t; -} -extern "C" { - pub fn getline( - __lineptr: *mut *mut ::std::os::raw::c_char, - __n: *mut usize, - __stream: *mut FILE, - ) -> __ssize_t; -} -extern "C" { - pub fn fputs(__s: *const ::std::os::raw::c_char, __stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn puts(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ungetc(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fread( - __ptr: *mut ::std::os::raw::c_void, - __size: ::std::os::raw::c_ulong, - __n: ::std::os::raw::c_ulong, - __stream: *mut FILE, - ) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn fwrite( - __ptr: *const ::std::os::raw::c_void, - __size: ::std::os::raw::c_ulong, - __n: ::std::os::raw::c_ulong, - __s: *mut FILE, - ) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn fread_unlocked( - __ptr: *mut ::std::os::raw::c_void, - __size: usize, - __n: usize, - __stream: *mut FILE, - ) -> usize; -} -extern "C" { - pub fn fwrite_unlocked( - __ptr: *const ::std::os::raw::c_void, - __size: usize, - __n: usize, - __stream: *mut FILE, - ) -> usize; -} -extern "C" { - pub fn fseek( - __stream: *mut FILE, - __off: ::std::os::raw::c_long, - __whence: ::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 rewind(__stream: *mut FILE); -} -extern "C" { - pub fn fseeko( - __stream: *mut FILE, - __off: __off_t, - __whence: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ftello(__stream: *mut FILE) -> __off_t; -} -extern "C" { - pub fn fgetpos(__stream: *mut FILE, __pos: *mut fpos_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fsetpos(__stream: *mut FILE, __pos: *const fpos_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clearerr(__stream: *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 clearerr_unlocked(__stream: *mut FILE); -} -extern "C" { - pub fn feof_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ferror_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn perror(__s: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn fileno(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fileno_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -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, - __modes: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn ctermid(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn flockfile(__stream: *mut FILE); -} -extern "C" { - pub fn ftrylockfile(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn funlockfile(__stream: *mut FILE); -} -extern "C" { - pub fn __uflow(arg1: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __overflow(arg1: *mut FILE, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} pub type Oid = ::std::os::raw::c_uint; pub type pg_int64 = ::std::os::raw::c_long; #[repr(u32)] @@ -1326,6 +56,7 @@ pub enum ConnStatusType { CONNECTION_GSS_STARTUP = 11, CONNECTION_CHECK_TARGET = 12, CONNECTION_CHECK_STANDBY = 13, + CONNECTION_ALLOCATED = 14, } #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] @@ -1351,6 +82,7 @@ pub enum ExecStatusType { PGRES_SINGLE_TUPLE = 9, PGRES_PIPELINE_SYNC = 10, PGRES_PIPELINE_ABORTED = 11, + PGRES_TUPLES_CHUNK = 12, } #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] @@ -1399,6 +131,12 @@ pub struct pg_conn { pub type PGconn = pg_conn; #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct pg_cancel_conn { + _unused: [u8; 0], +} +pub type PGcancelConn = pg_cancel_conn; +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct pg_result { _unused: [u8; 0], } @@ -1417,62 +155,17 @@ pub struct pgNotify { pub extra: *mut ::std::os::raw::c_char, pub next: *mut pgNotify, } -#[test] -fn bindgen_test_layout_pgNotify() { - 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!(pgNotify)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pgNotify)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).relname) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pgNotify), - "::", - stringify!(relname) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).be_pid) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(pgNotify), - "::", - stringify!(be_pid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).extra) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(pgNotify), - "::", - stringify!(extra) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(pgNotify), - "::", - stringify!(next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of pgNotify"][::std::mem::size_of::() - 32usize]; + ["Alignment of pgNotify"][::std::mem::align_of::() - 8usize]; + ["Offset of field: pgNotify::relname"][::std::mem::offset_of!(pgNotify, relname) - 0usize]; + ["Offset of field: pgNotify::be_pid"][::std::mem::offset_of!(pgNotify, be_pid) - 8usize]; + ["Offset of field: pgNotify::extra"][::std::mem::offset_of!(pgNotify, extra) - 16usize]; + ["Offset of field: pgNotify::next"][::std::mem::offset_of!(pgNotify, next) - 24usize]; +}; pub type PGnotify = pgNotify; +pub type pg_usec_time_t = pg_int64; pub type PQnoticeReceiver = ::std::option::Option< unsafe extern "C" fn(arg: *mut ::std::os::raw::c_void, res: *const PGresult), >; @@ -1494,121 +187,27 @@ pub struct _PQprintOpt { pub caption: *mut ::std::os::raw::c_char, pub fieldName: *mut *mut ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout__PQprintOpt() { - const UNINIT: ::std::mem::MaybeUninit<_PQprintOpt> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_PQprintOpt>(), - 40usize, - concat!("Size of: ", stringify!(_PQprintOpt)) - ); - assert_eq!( - ::std::mem::align_of::<_PQprintOpt>(), - 8usize, - concat!("Alignment of ", stringify!(_PQprintOpt)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).header) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(header) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).align) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(align) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).standard) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(standard) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).html3) as usize - ptr as usize }, - 3usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(html3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).expanded) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(expanded) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pager) as usize - ptr as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(pager) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fieldSep) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(fieldSep) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tableOpt) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(tableOpt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).caption) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(caption) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fieldName) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(fieldName) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _PQprintOpt"][::std::mem::size_of::<_PQprintOpt>() - 40usize]; + ["Alignment of _PQprintOpt"][::std::mem::align_of::<_PQprintOpt>() - 8usize]; + ["Offset of field: _PQprintOpt::header"][::std::mem::offset_of!(_PQprintOpt, header) - 0usize]; + ["Offset of field: _PQprintOpt::align"][::std::mem::offset_of!(_PQprintOpt, align) - 1usize]; + ["Offset of field: _PQprintOpt::standard"] + [::std::mem::offset_of!(_PQprintOpt, standard) - 2usize]; + ["Offset of field: _PQprintOpt::html3"][::std::mem::offset_of!(_PQprintOpt, html3) - 3usize]; + ["Offset of field: _PQprintOpt::expanded"] + [::std::mem::offset_of!(_PQprintOpt, expanded) - 4usize]; + ["Offset of field: _PQprintOpt::pager"][::std::mem::offset_of!(_PQprintOpt, pager) - 5usize]; + ["Offset of field: _PQprintOpt::fieldSep"] + [::std::mem::offset_of!(_PQprintOpt, fieldSep) - 8usize]; + ["Offset of field: _PQprintOpt::tableOpt"] + [::std::mem::offset_of!(_PQprintOpt, tableOpt) - 16usize]; + ["Offset of field: _PQprintOpt::caption"] + [::std::mem::offset_of!(_PQprintOpt, caption) - 24usize]; + ["Offset of field: _PQprintOpt::fieldName"] + [::std::mem::offset_of!(_PQprintOpt, fieldName) - 32usize]; +}; pub type PQprintOpt = _PQprintOpt; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1621,91 +220,25 @@ pub struct _PQconninfoOption { pub dispchar: *mut ::std::os::raw::c_char, pub dispsize: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout__PQconninfoOption() { - const UNINIT: ::std::mem::MaybeUninit<_PQconninfoOption> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_PQconninfoOption>(), - 56usize, - concat!("Size of: ", stringify!(_PQconninfoOption)) - ); - assert_eq!( - ::std::mem::align_of::<_PQconninfoOption>(), - 8usize, - concat!("Alignment of ", stringify!(_PQconninfoOption)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyword) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_PQconninfoOption), - "::", - stringify!(keyword) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).envvar) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_PQconninfoOption), - "::", - stringify!(envvar) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).compiled) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_PQconninfoOption), - "::", - stringify!(compiled) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_PQconninfoOption), - "::", - stringify!(val) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_PQconninfoOption), - "::", - stringify!(label) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dispchar) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_PQconninfoOption), - "::", - stringify!(dispchar) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dispsize) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_PQconninfoOption), - "::", - stringify!(dispsize) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _PQconninfoOption"][::std::mem::size_of::<_PQconninfoOption>() - 56usize]; + ["Alignment of _PQconninfoOption"][::std::mem::align_of::<_PQconninfoOption>() - 8usize]; + ["Offset of field: _PQconninfoOption::keyword"] + [::std::mem::offset_of!(_PQconninfoOption, keyword) - 0usize]; + ["Offset of field: _PQconninfoOption::envvar"] + [::std::mem::offset_of!(_PQconninfoOption, envvar) - 8usize]; + ["Offset of field: _PQconninfoOption::compiled"] + [::std::mem::offset_of!(_PQconninfoOption, compiled) - 16usize]; + ["Offset of field: _PQconninfoOption::val"] + [::std::mem::offset_of!(_PQconninfoOption, val) - 24usize]; + ["Offset of field: _PQconninfoOption::label"] + [::std::mem::offset_of!(_PQconninfoOption, label) - 32usize]; + ["Offset of field: _PQconninfoOption::dispchar"] + [::std::mem::offset_of!(_PQconninfoOption, dispchar) - 40usize]; + ["Offset of field: _PQconninfoOption::dispsize"] + [::std::mem::offset_of!(_PQconninfoOption, dispsize) - 48usize]; +}; pub type PQconninfoOption = _PQconninfoOption; #[repr(C)] #[derive(Copy, Clone)] @@ -1720,87 +253,25 @@ pub union PQArgBlock__bindgen_ty_1 { pub ptr: *mut ::std::os::raw::c_int, pub integer: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_PQArgBlock__bindgen_ty_1() { - 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!(PQArgBlock__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(PQArgBlock__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(PQArgBlock__bindgen_ty_1), - "::", - stringify!(ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).integer) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(PQArgBlock__bindgen_ty_1), - "::", - stringify!(integer) - ) - ); -} -#[test] -fn bindgen_test_layout_PQArgBlock() { - 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!(PQArgBlock)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(PQArgBlock)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(PQArgBlock), - "::", - stringify!(len) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).isint) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(PQArgBlock), - "::", - stringify!(isint) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(PQArgBlock), - "::", - stringify!(u) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of PQArgBlock__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of PQArgBlock__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: PQArgBlock__bindgen_ty_1::ptr"] + [::std::mem::offset_of!(PQArgBlock__bindgen_ty_1, ptr) - 0usize]; + ["Offset of field: PQArgBlock__bindgen_ty_1::integer"] + [::std::mem::offset_of!(PQArgBlock__bindgen_ty_1, integer) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of PQArgBlock"][::std::mem::size_of::() - 16usize]; + ["Alignment of PQArgBlock"][::std::mem::align_of::() - 8usize]; + ["Offset of field: PQArgBlock::len"][::std::mem::offset_of!(PQArgBlock, len) - 0usize]; + ["Offset of field: PQArgBlock::isint"][::std::mem::offset_of!(PQArgBlock, isint) - 4usize]; + ["Offset of field: PQArgBlock::u"][::std::mem::offset_of!(PQArgBlock, u) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct pgresAttDesc { @@ -1812,116 +283,48 @@ pub struct pgresAttDesc { pub typlen: ::std::os::raw::c_int, pub atttypmod: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_pgresAttDesc() { - 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!(pgresAttDesc)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pgresAttDesc)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pgresAttDesc), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tableid) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(pgresAttDesc), - "::", - stringify!(tableid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).columnid) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(pgresAttDesc), - "::", - stringify!(columnid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).format) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(pgresAttDesc), - "::", - stringify!(format) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).typid) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(pgresAttDesc), - "::", - stringify!(typid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).typlen) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(pgresAttDesc), - "::", - stringify!(typlen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).atttypmod) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(pgresAttDesc), - "::", - stringify!(atttypmod) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of pgresAttDesc"][::std::mem::size_of::() - 32usize]; + ["Alignment of pgresAttDesc"][::std::mem::align_of::() - 8usize]; + ["Offset of field: pgresAttDesc::name"][::std::mem::offset_of!(pgresAttDesc, name) - 0usize]; + ["Offset of field: pgresAttDesc::tableid"] + [::std::mem::offset_of!(pgresAttDesc, tableid) - 8usize]; + ["Offset of field: pgresAttDesc::columnid"] + [::std::mem::offset_of!(pgresAttDesc, columnid) - 12usize]; + ["Offset of field: pgresAttDesc::format"] + [::std::mem::offset_of!(pgresAttDesc, format) - 16usize]; + ["Offset of field: pgresAttDesc::typid"][::std::mem::offset_of!(pgresAttDesc, typid) - 20usize]; + ["Offset of field: pgresAttDesc::typlen"] + [::std::mem::offset_of!(pgresAttDesc, typlen) - 24usize]; + ["Offset of field: pgresAttDesc::atttypmod"] + [::std::mem::offset_of!(pgresAttDesc, atttypmod) - 28usize]; +}; pub type PGresAttDesc = pgresAttDesc; -extern "C" { +unsafe extern "C" { pub fn PQconnectStart(conninfo: *const ::std::os::raw::c_char) -> *mut PGconn; } -extern "C" { +unsafe extern "C" { pub fn PQconnectStartParams( keywords: *const *const ::std::os::raw::c_char, values: *const *const ::std::os::raw::c_char, expand_dbname: ::std::os::raw::c_int, ) -> *mut PGconn; } -extern "C" { +unsafe extern "C" { pub fn PQconnectPoll(conn: *mut PGconn) -> PostgresPollingStatusType; } -extern "C" { +unsafe extern "C" { pub fn PQconnectdb(conninfo: *const ::std::os::raw::c_char) -> *mut PGconn; } -extern "C" { +unsafe extern "C" { pub fn PQconnectdbParams( keywords: *const *const ::std::os::raw::c_char, values: *const *const ::std::os::raw::c_char, expand_dbname: ::std::os::raw::c_int, ) -> *mut PGconn; } -extern "C" { +unsafe extern "C" { pub fn PQsetdbLogin( pghost: *const ::std::os::raw::c_char, pgport: *const ::std::os::raw::c_char, @@ -1932,171 +335,198 @@ extern "C" { pwd: *const ::std::os::raw::c_char, ) -> *mut PGconn; } -extern "C" { +unsafe extern "C" { pub fn PQfinish(conn: *mut PGconn); } -extern "C" { +unsafe extern "C" { pub fn PQconndefaults() -> *mut PQconninfoOption; } -extern "C" { +unsafe extern "C" { pub fn PQconninfoParse( conninfo: *const ::std::os::raw::c_char, errmsg: *mut *mut ::std::os::raw::c_char, ) -> *mut PQconninfoOption; } -extern "C" { +unsafe extern "C" { pub fn PQconninfo(conn: *mut PGconn) -> *mut PQconninfoOption; } -extern "C" { +unsafe extern "C" { pub fn PQconninfoFree(connOptions: *mut PQconninfoOption); } -extern "C" { +unsafe extern "C" { pub fn PQresetStart(conn: *mut PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQresetPoll(conn: *mut PGconn) -> PostgresPollingStatusType; } -extern "C" { +unsafe extern "C" { pub fn PQreset(conn: *mut PGconn); } -extern "C" { +unsafe extern "C" { + pub fn PQcancelCreate(conn: *mut PGconn) -> *mut PGcancelConn; +} +unsafe extern "C" { + pub fn PQcancelStart(cancelConn: *mut PGcancelConn) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + pub fn PQcancelBlocking(cancelConn: *mut PGcancelConn) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + pub fn PQcancelPoll(cancelConn: *mut PGcancelConn) -> PostgresPollingStatusType; +} +unsafe extern "C" { + pub fn PQcancelStatus(cancelConn: *const PGcancelConn) -> ConnStatusType; +} +unsafe extern "C" { + pub fn PQcancelSocket(cancelConn: *const PGcancelConn) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + pub fn PQcancelErrorMessage(cancelConn: *const PGcancelConn) -> *mut ::std::os::raw::c_char; +} +unsafe extern "C" { + pub fn PQcancelReset(cancelConn: *mut PGcancelConn); +} +unsafe extern "C" { + pub fn PQcancelFinish(cancelConn: *mut PGcancelConn); +} +unsafe extern "C" { pub fn PQgetCancel(conn: *mut PGconn) -> *mut PGcancel; } -extern "C" { +unsafe extern "C" { pub fn PQfreeCancel(cancel: *mut PGcancel); } -extern "C" { +unsafe extern "C" { pub fn PQcancel( cancel: *mut PGcancel, errbuf: *mut ::std::os::raw::c_char, errbufsize: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQrequestCancel(conn: *mut PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQdb(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQuser(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQpass(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQhost(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQhostaddr(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQport(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQtty(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQoptions(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQstatus(conn: *const PGconn) -> ConnStatusType; } -extern "C" { +unsafe extern "C" { pub fn PQtransactionStatus(conn: *const PGconn) -> PGTransactionStatusType; } -extern "C" { +unsafe extern "C" { pub fn PQparameterStatus( conn: *const PGconn, paramName: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQprotocolVersion(conn: *const PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQserverVersion(conn: *const PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQerrorMessage(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQsocket(conn: *const PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQbackendPID(conn: *const PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQpipelineStatus(conn: *const PGconn) -> PGpipelineStatus; } -extern "C" { +unsafe extern "C" { pub fn PQconnectionNeedsPassword(conn: *const PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQconnectionUsedPassword(conn: *const PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQconnectionUsedGSSAPI(conn: *const PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQclientEncoding(conn: *const PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQsetClientEncoding( conn: *mut PGconn, encoding: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQsslInUse(conn: *mut PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQsslStruct( conn: *mut PGconn, struct_name: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { pub fn PQsslAttribute( conn: *mut PGconn, attribute_name: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQsslAttributeNames(conn: *mut PGconn) -> *const *const ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQgetssl(conn: *mut PGconn) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { pub fn PQinitSSL(do_init: ::std::os::raw::c_int); } -extern "C" { +unsafe extern "C" { pub fn PQinitOpenSSL(do_ssl: ::std::os::raw::c_int, do_crypto: ::std::os::raw::c_int); } -extern "C" { +unsafe extern "C" { pub fn PQgssEncInUse(conn: *mut PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQgetgssctx(conn: *mut PGconn) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { pub fn PQsetErrorVerbosity(conn: *mut PGconn, verbosity: PGVerbosity) -> PGVerbosity; } -extern "C" { +unsafe extern "C" { pub fn PQsetErrorContextVisibility( conn: *mut PGconn, show_context: PGContextVisibility, ) -> PGContextVisibility; } -extern "C" { +unsafe extern "C" { pub fn PQsetNoticeReceiver( conn: *mut PGconn, proc_: PQnoticeReceiver, arg: *mut ::std::os::raw::c_void, ) -> PQnoticeReceiver; } -extern "C" { +unsafe extern "C" { pub fn PQsetNoticeProcessor( conn: *mut PGconn, proc_: PQnoticeProcessor, @@ -2105,22 +535,22 @@ extern "C" { } pub type pgthreadlock_t = ::std::option::Option; -extern "C" { +unsafe extern "C" { pub fn PQregisterThreadLock(newhandler: pgthreadlock_t) -> pgthreadlock_t; } -extern "C" { +unsafe extern "C" { pub fn PQtrace(conn: *mut PGconn, debug_port: *mut FILE); } -extern "C" { +unsafe extern "C" { pub fn PQuntrace(conn: *mut PGconn); } -extern "C" { +unsafe extern "C" { pub fn PQsetTraceFlags(conn: *mut PGconn, flags: ::std::os::raw::c_int); } -extern "C" { +unsafe extern "C" { pub fn PQexec(conn: *mut PGconn, query: *const ::std::os::raw::c_char) -> *mut PGresult; } -extern "C" { +unsafe extern "C" { pub fn PQexecParams( conn: *mut PGconn, command: *const ::std::os::raw::c_char, @@ -2132,7 +562,7 @@ extern "C" { resultFormat: ::std::os::raw::c_int, ) -> *mut PGresult; } -extern "C" { +unsafe extern "C" { pub fn PQprepare( conn: *mut PGconn, stmtName: *const ::std::os::raw::c_char, @@ -2141,7 +571,7 @@ extern "C" { paramTypes: *const Oid, ) -> *mut PGresult; } -extern "C" { +unsafe extern "C" { pub fn PQexecPrepared( conn: *mut PGconn, stmtName: *const ::std::os::raw::c_char, @@ -2152,13 +582,13 @@ extern "C" { resultFormat: ::std::os::raw::c_int, ) -> *mut PGresult; } -extern "C" { +unsafe extern "C" { pub fn PQsendQuery( conn: *mut PGconn, query: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQsendQueryParams( conn: *mut PGconn, command: *const ::std::os::raw::c_char, @@ -2170,7 +600,7 @@ extern "C" { resultFormat: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQsendPrepare( conn: *mut PGconn, stmtName: *const ::std::os::raw::c_char, @@ -2179,7 +609,7 @@ extern "C" { paramTypes: *const Oid, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQsendQueryPrepared( conn: *mut PGconn, stmtName: *const ::std::os::raw::c_char, @@ -2190,107 +620,116 @@ extern "C" { resultFormat: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQsetSingleRowMode(conn: *mut PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { + pub fn PQsetChunkedRowsMode( + conn: *mut PGconn, + chunkSize: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { pub fn PQgetResult(conn: *mut PGconn) -> *mut PGresult; } -extern "C" { +unsafe extern "C" { pub fn PQisBusy(conn: *mut PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQconsumeInput(conn: *mut PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQenterPipelineMode(conn: *mut PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQexitPipelineMode(conn: *mut PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQpipelineSync(conn: *mut PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQsendFlushRequest(conn: *mut PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { + pub fn PQsendPipelineSync(conn: *mut PGconn) -> ::std::os::raw::c_int; +} +unsafe extern "C" { pub fn PQnotifies(conn: *mut PGconn) -> *mut PGnotify; } -extern "C" { +unsafe extern "C" { pub fn PQputCopyData( conn: *mut PGconn, buffer: *const ::std::os::raw::c_char, nbytes: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQputCopyEnd( conn: *mut PGconn, errormsg: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQgetCopyData( conn: *mut PGconn, buffer: *mut *mut ::std::os::raw::c_char, async_: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQgetline( conn: *mut PGconn, buffer: *mut ::std::os::raw::c_char, length: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQputline( conn: *mut PGconn, string: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQgetlineAsync( conn: *mut PGconn, buffer: *mut ::std::os::raw::c_char, bufsize: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQputnbytes( conn: *mut PGconn, buffer: *const ::std::os::raw::c_char, nbytes: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQendcopy(conn: *mut PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQsetnonblocking(conn: *mut PGconn, arg: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQisnonblocking(conn: *const PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQisthreadsafe() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQping(conninfo: *const ::std::os::raw::c_char) -> PGPing; } -extern "C" { +unsafe extern "C" { pub fn PQpingParams( keywords: *const *const ::std::os::raw::c_char, values: *const *const ::std::os::raw::c_char, expand_dbname: ::std::os::raw::c_int, ) -> PGPing; } -extern "C" { +unsafe extern "C" { pub fn PQflush(conn: *mut PGconn) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQfn( conn: *mut PGconn, fnid: ::std::os::raw::c_int, @@ -2301,163 +740,183 @@ extern "C" { nargs: ::std::os::raw::c_int, ) -> *mut PGresult; } -extern "C" { +unsafe extern "C" { pub fn PQresultStatus(res: *const PGresult) -> ExecStatusType; } -extern "C" { +unsafe extern "C" { pub fn PQresStatus(status: ExecStatusType) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQresultErrorMessage(res: *const PGresult) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQresultVerboseErrorMessage( res: *const PGresult, verbosity: PGVerbosity, show_context: PGContextVisibility, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQresultErrorField( res: *const PGresult, fieldcode: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQntuples(res: *const PGresult) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQnfields(res: *const PGresult) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQbinaryTuples(res: *const PGresult) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQfname( res: *const PGresult, field_num: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQfnumber( res: *const PGresult, field_name: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQftable(res: *const PGresult, field_num: ::std::os::raw::c_int) -> Oid; } -extern "C" { +unsafe extern "C" { pub fn PQftablecol( res: *const PGresult, field_num: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQfformat( res: *const PGresult, field_num: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQftype(res: *const PGresult, field_num: ::std::os::raw::c_int) -> Oid; } -extern "C" { +unsafe extern "C" { pub fn PQfsize(res: *const PGresult, field_num: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQfmod(res: *const PGresult, field_num: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQcmdStatus(res: *mut PGresult) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQoidStatus(res: *const PGresult) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQoidValue(res: *const PGresult) -> Oid; } -extern "C" { +unsafe extern "C" { pub fn PQcmdTuples(res: *mut PGresult) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQgetvalue( res: *const PGresult, tup_num: ::std::os::raw::c_int, field_num: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQgetlength( res: *const PGresult, tup_num: ::std::os::raw::c_int, field_num: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQgetisnull( res: *const PGresult, tup_num: ::std::os::raw::c_int, field_num: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQnparams(res: *const PGresult) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQparamtype(res: *const PGresult, param_num: ::std::os::raw::c_int) -> Oid; } -extern "C" { +unsafe extern "C" { pub fn PQdescribePrepared( conn: *mut PGconn, stmt: *const ::std::os::raw::c_char, ) -> *mut PGresult; } -extern "C" { +unsafe extern "C" { pub fn PQdescribePortal( conn: *mut PGconn, portal: *const ::std::os::raw::c_char, ) -> *mut PGresult; } -extern "C" { +unsafe extern "C" { pub fn PQsendDescribePrepared( conn: *mut PGconn, stmt: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQsendDescribePortal( conn: *mut PGconn, portal: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { + pub fn PQclosePrepared(conn: *mut PGconn, stmt: *const ::std::os::raw::c_char) + -> *mut PGresult; +} +unsafe extern "C" { + pub fn PQclosePortal(conn: *mut PGconn, portal: *const ::std::os::raw::c_char) + -> *mut PGresult; +} +unsafe extern "C" { + pub fn PQsendClosePrepared( + conn: *mut PGconn, + stmt: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + pub fn PQsendClosePortal( + conn: *mut PGconn, + portal: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { pub fn PQclear(res: *mut PGresult); } -extern "C" { +unsafe extern "C" { pub fn PQfreemem(ptr: *mut ::std::os::raw::c_void); } -extern "C" { +unsafe extern "C" { pub fn PQmakeEmptyPGresult(conn: *mut PGconn, status: ExecStatusType) -> *mut PGresult; } -extern "C" { +unsafe extern "C" { pub fn PQcopyResult(src: *const PGresult, flags: ::std::os::raw::c_int) -> *mut PGresult; } -extern "C" { +unsafe extern "C" { pub fn PQsetResultAttrs( res: *mut PGresult, numAttributes: ::std::os::raw::c_int, attDescs: *mut PGresAttDesc, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQresultAlloc(res: *mut PGresult, nBytes: usize) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { pub fn PQresultMemorySize(res: *const PGresult) -> usize; } -extern "C" { +unsafe extern "C" { pub fn PQsetvalue( res: *mut PGresult, tup_num: ::std::os::raw::c_int, @@ -2466,7 +925,7 @@ extern "C" { len: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQescapeStringConn( conn: *mut PGconn, to: *mut ::std::os::raw::c_char, @@ -2475,21 +934,21 @@ extern "C" { error: *mut ::std::os::raw::c_int, ) -> usize; } -extern "C" { +unsafe extern "C" { pub fn PQescapeLiteral( conn: *mut PGconn, str_: *const ::std::os::raw::c_char, len: usize, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQescapeIdentifier( conn: *mut PGconn, str_: *const ::std::os::raw::c_char, len: usize, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQescapeByteaConn( conn: *mut PGconn, from: *const ::std::os::raw::c_uchar, @@ -2497,30 +956,30 @@ extern "C" { to_length: *mut usize, ) -> *mut ::std::os::raw::c_uchar; } -extern "C" { +unsafe extern "C" { pub fn PQunescapeBytea( strtext: *const ::std::os::raw::c_uchar, retbuflen: *mut usize, ) -> *mut ::std::os::raw::c_uchar; } -extern "C" { +unsafe extern "C" { pub fn PQescapeString( to: *mut ::std::os::raw::c_char, from: *const ::std::os::raw::c_char, length: usize, ) -> usize; } -extern "C" { +unsafe extern "C" { pub fn PQescapeBytea( from: *const ::std::os::raw::c_uchar, from_length: usize, to_length: *mut usize, ) -> *mut ::std::os::raw::c_uchar; } -extern "C" { +unsafe extern "C" { pub fn PQprint(fout: *mut FILE, res: *const PGresult, po: *const PQprintOpt); } -extern "C" { +unsafe extern "C" { pub fn PQdisplayTuples( res: *const PGresult, fp: *mut FILE, @@ -2530,7 +989,7 @@ extern "C" { quiet: ::std::os::raw::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn PQprintTuples( res: *const PGresult, fout: *mut FILE, @@ -2539,17 +998,17 @@ extern "C" { colWidth: ::std::os::raw::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn lo_open( conn: *mut PGconn, lobjId: Oid, mode: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn lo_close(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn lo_read( conn: *mut PGconn, fd: ::std::os::raw::c_int, @@ -2557,7 +1016,7 @@ extern "C" { len: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn lo_write( conn: *mut PGconn, fd: ::std::os::raw::c_int, @@ -2565,7 +1024,7 @@ extern "C" { len: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn lo_lseek( conn: *mut PGconn, fd: ::std::os::raw::c_int, @@ -2573,7 +1032,7 @@ extern "C" { whence: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn lo_lseek64( conn: *mut PGconn, fd: ::std::os::raw::c_int, @@ -2581,83 +1040,94 @@ extern "C" { whence: ::std::os::raw::c_int, ) -> pg_int64; } -extern "C" { +unsafe extern "C" { pub fn lo_creat(conn: *mut PGconn, mode: ::std::os::raw::c_int) -> Oid; } -extern "C" { +unsafe extern "C" { pub fn lo_create(conn: *mut PGconn, lobjId: Oid) -> Oid; } -extern "C" { +unsafe extern "C" { pub fn lo_tell(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn lo_tell64(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> pg_int64; } -extern "C" { +unsafe extern "C" { pub fn lo_truncate( conn: *mut PGconn, fd: ::std::os::raw::c_int, len: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn lo_truncate64( conn: *mut PGconn, fd: ::std::os::raw::c_int, len: pg_int64, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn lo_unlink(conn: *mut PGconn, lobjId: Oid) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn lo_import(conn: *mut PGconn, filename: *const ::std::os::raw::c_char) -> Oid; } -extern "C" { +unsafe extern "C" { pub fn lo_import_with_oid( conn: *mut PGconn, filename: *const ::std::os::raw::c_char, lobjId: Oid, ) -> Oid; } -extern "C" { +unsafe extern "C" { pub fn lo_export( conn: *mut PGconn, lobjId: Oid, filename: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQlibVersion() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { + pub fn PQsocketPoll( + sock: ::std::os::raw::c_int, + forRead: ::std::os::raw::c_int, + forWrite: ::std::os::raw::c_int, + end_time: pg_usec_time_t, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + pub fn PQgetCurrentTimeUSec() -> pg_usec_time_t; +} +unsafe extern "C" { pub fn PQmblen( s: *const ::std::os::raw::c_char, encoding: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQmblenBounded( s: *const ::std::os::raw::c_char, encoding: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQdsplen( s: *const ::std::os::raw::c_char, encoding: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQenv2encoding() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn PQencryptPassword( passwd: *const ::std::os::raw::c_char, user: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn PQencryptPasswordConn( conn: *mut PGconn, passwd: *const ::std::os::raw::c_char, @@ -2665,13 +1135,20 @@ extern "C" { algorithm: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { + pub fn PQchangePassword( + conn: *mut PGconn, + user: *const ::std::os::raw::c_char, + passwd: *const ::std::os::raw::c_char, + ) -> *mut PGresult; +} +unsafe extern "C" { pub fn pg_char_to_encoding(name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn pg_encoding_to_char(encoding: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn pg_valid_server_encoding_id(encoding: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } pub type PQsslKeyPassHook_OpenSSL_type = ::std::option::Option< @@ -2681,80 +1158,16 @@ pub type PQsslKeyPassHook_OpenSSL_type = ::std::option::Option< conn: *mut PGconn, ) -> ::std::os::raw::c_int, >; -extern "C" { +unsafe extern "C" { pub fn PQgetSSLKeyPassHook_OpenSSL() -> PQsslKeyPassHook_OpenSSL_type; } -extern "C" { +unsafe extern "C" { pub fn PQsetSSLKeyPassHook_OpenSSL(hook: PQsslKeyPassHook_OpenSSL_type); } -extern "C" { +unsafe extern "C" { pub fn PQdefaultSSLKeyPassHook_OpenSSL( buf: *mut ::std::os::raw::c_char, size: ::std::os::raw::c_int, conn: *mut PGconn, ) -> ::std::os::raw::c_int; } -pub type __builtin_va_list = [__va_list_tag; 1usize]; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __va_list_tag { - pub gp_offset: ::std::os::raw::c_uint, - pub fp_offset: ::std::os::raw::c_uint, - pub overflow_arg_area: *mut ::std::os::raw::c_void, - pub reg_save_area: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout___va_list_tag() { - const UNINIT: ::std::mem::MaybeUninit<__va_list_tag> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__va_list_tag>(), - 24usize, - concat!("Size of: ", stringify!(__va_list_tag)) - ); - assert_eq!( - ::std::mem::align_of::<__va_list_tag>(), - 8usize, - concat!("Alignment of ", stringify!(__va_list_tag)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gp_offset) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(gp_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fp_offset) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(fp_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).overflow_arg_area) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(overflow_arg_area) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reg_save_area) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(reg_save_area) - ) - ); -} diff --git a/src/lib.rs b/src/lib.rs index c328d25..ab4c33f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,7 +3,6 @@ extern crate pq_src; #[cfg(not(feature = "buildtime_bindgen"))] #[allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] -#[cfg_attr(target_os = "windows", path = "windows_bindings.rs")] mod bindings; #[cfg(feature = "buildtime_bindgen")] @@ -13,3 +12,27 @@ mod bindings { } pub use bindings::*; + +#[test] +fn check_generated_bindings_match() { + let bindings_name = "bindings.rs"; + + let include_path = concat!( + env!("CARGO_MANIFEST_DIR"), + "/pq-src/source/src/interfaces/libpq/" + ); + + let builder = include!("make_bindings.rs").clang_args(["-I", include_path]); + dbg!(builder.command_line_flags()); + + let generated_bindings = builder.generate().expect("Unable to generate bindings"); + + let mut out = Vec::::new(); + generated_bindings.write(Box::new(&mut out)).unwrap(); + let generated_bindings = String::from_utf8(out).unwrap(); + + let bundled_bindings = + std::fs::read_to_string(String::from(env!("CARGO_MANIFEST_DIR")) + "/src/" + bindings_name) + .unwrap(); + similar_asserts::assert_eq!(generated_bindings, bundled_bindings,) +} diff --git a/src/make_bindings.rs b/src/make_bindings.rs new file mode 100644 index 0000000..d4b1cb1 --- /dev/null +++ b/src/make_bindings.rs @@ -0,0 +1,20 @@ +/* keep in sync with the command in DEVELOPMENT.md */ +bindgen::Builder::default() + .rustified_enum(".*") + .header("wrapper.h") + .allowlist_var("PG_.*") + .allowlist_var("LIBPQ_.*") + .allowlist_var("PQ.*") + .allowlist_type("Oid") + .allowlist_type("ConnStatusType") + .allowlist_type("Postgres.*") + .allowlist_type("pg.*") + .allowlist_type("PG.*") + .allowlist_type("PQ.*") + .allowlist_type("pq.*") + .allowlist_function("PQ.*") + .allowlist_function("lo_.*") + .allowlist_function("pg_.*") + .opaque_type("FILE") + .blocklist_type("FILE") + .raw_line("use libc::FILE;") diff --git a/src/windows_bindings.rs b/src/windows_bindings.rs deleted file mode 100644 index f51a74c..0000000 --- a/src/windows_bindings.rs +++ /dev/null @@ -1,3759 +0,0 @@ -/* automatically generated by rust-bindgen 0.69.1 */ - -pub const __MINGW64_VERSION_MAJOR: u32 = 11; -pub const __MINGW64_VERSION_MINOR: u32 = 0; -pub const __MINGW64_VERSION_BUGFIX: u32 = 0; -pub const __MINGW64_VERSION_RC: u32 = 0; -pub const __MINGW64_VERSION_STATE: &[u8; 6] = b"alpha\0"; -pub const __MINGW32_MAJOR_VERSION: u32 = 3; -pub const __MINGW32_MINOR_VERSION: u32 = 11; -pub const _M_AMD64: u32 = 100; -pub const _M_X64: u32 = 100; -pub const __: u32 = 1; -pub const __MINGW_USE_UNDERSCORE_PREFIX: u32 = 0; -pub const __MINGW_HAVE_ANSI_C99_PRINTF: u32 = 1; -pub const __MINGW_HAVE_WIDE_C99_PRINTF: u32 = 1; -pub const __MINGW_HAVE_ANSI_C99_SCANF: u32 = 1; -pub const __MINGW_HAVE_WIDE_C99_SCANF: u32 = 1; -pub const __MINGW_SEC_WARN_STR : & [u8 ; 92] = b"This function or variable may be unsafe, use _CRT_SECURE_NO_WARNINGS to disable deprecation\0" ; -pub const __MINGW_MSVC2005_DEPREC_STR : & [u8 ; 117] = b"This POSIX function is deprecated beginning in Visual C++ 2005, use _CRT_NONSTDC_NO_DEPRECATE to disable deprecation\0" ; -pub const __MINGW_FORTIFY_LEVEL: u32 = 0; -pub const __MINGW_FORTIFY_VA_ARG: u32 = 0; -pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES: u32 = 0; -pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY: u32 = 0; -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_STANDARD_NAMES_MEMORY: u32 = 0; -pub const __USE_CRTIMP: u32 = 1; -pub const USE___UUIDOF: u32 = 0; -pub const __CRT__NO_INLINE: u32 = 1; -pub const __MSVCRT_VERSION__: u32 = 1792; -pub const _WIN32_WINNT: u32 = 2560; -pub const MINGW_HAS_SECURE_API: u32 = 1; -pub const __STDC_SECURE_LIB__: u32 = 200411; -pub const __GOT_SECURE_LIB__: u32 = 200411; -pub const MINGW_HAS_DDK_H: u32 = 1; -pub const _CRT_PACKING: u32 = 8; -pub const _SECURECRT_FILL_BUFFER_PATTERN: u32 = 253; -pub const _ARGMAX: u32 = 100; -pub const __USE_MINGW_ANSI_STDIO: u32 = 1; -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_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 _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS: u32 = 4; -pub const _CRT_INTERNAL_LOCAL_SCANF_OPTIONS: u32 = 2; -pub const BUFSIZ: u32 = 512; -pub const _NSTREAM_: u32 = 512; -pub const _IOB_ENTRIES: u32 = 20; -pub const EOF: i32 = -1; -pub const _P_tmpdir: &[u8; 2] = b"\\\0"; -pub const _wP_tmpdir: &[u8; 2] = b"\\\0"; -pub const SEEK_CUR: u32 = 1; -pub const SEEK_END: u32 = 2; -pub const SEEK_SET: u32 = 0; -pub const STDIN_FILENO: u32 = 0; -pub const STDOUT_FILENO: u32 = 1; -pub const STDERR_FILENO: u32 = 2; -pub const FILENAME_MAX: u32 = 260; -pub const FOPEN_MAX: u32 = 20; -pub const _SYS_OPEN: u32 = 20; -pub const TMP_MAX: u32 = 32767; -pub const _IOFBF: u32 = 0; -pub const _IOLBF: u32 = 64; -pub const _IONBF: u32 = 4; -pub const _IOREAD: u32 = 1; -pub const _IOWRT: u32 = 2; -pub const _IOMYBUF: u32 = 8; -pub const _IOEOF: u32 = 16; -pub const _IOERR: u32 = 32; -pub const _IOSTRG: u32 = 64; -pub const _IORW: u32 = 128; -pub const _TWO_DIGIT_EXPONENT: u32 = 1; -pub const P_tmpdir: &[u8; 2] = b"\\\0"; -pub const SYS_OPEN: u32 = 20; -pub const _P_WAIT: u32 = 0; -pub const _P_NOWAIT: u32 = 1; -pub const _OLD_P_OVERLAY: u32 = 2; -pub const _P_NOWAITO: u32 = 3; -pub const _P_DETACH: u32 = 4; -pub const _P_OVERLAY: u32 = 2; -pub const _WAIT_CHILD: u32 = 0; -pub const _WAIT_GRANDCHILD: u32 = 1; -pub const TMP_MAX_S: u32 = 32767; -pub const PG_DIAG_SEVERITY: u8 = 83u8; -pub const PG_DIAG_SEVERITY_NONLOCALIZED: u8 = 86u8; -pub const PG_DIAG_SQLSTATE: u8 = 67u8; -pub const PG_DIAG_MESSAGE_PRIMARY: u8 = 77u8; -pub const PG_DIAG_MESSAGE_DETAIL: u8 = 68u8; -pub const PG_DIAG_MESSAGE_HINT: u8 = 72u8; -pub const PG_DIAG_STATEMENT_POSITION: u8 = 80u8; -pub const PG_DIAG_INTERNAL_POSITION: u8 = 112u8; -pub const PG_DIAG_INTERNAL_QUERY: u8 = 113u8; -pub const PG_DIAG_CONTEXT: u8 = 87u8; -pub const PG_DIAG_SCHEMA_NAME: u8 = 115u8; -pub const PG_DIAG_TABLE_NAME: u8 = 116u8; -pub const PG_DIAG_COLUMN_NAME: u8 = 99u8; -pub const PG_DIAG_DATATYPE_NAME: u8 = 100u8; -pub const PG_DIAG_CONSTRAINT_NAME: u8 = 110u8; -pub const PG_DIAG_SOURCE_FILE: u8 = 70u8; -pub const PG_DIAG_SOURCE_LINE: u8 = 76u8; -pub const PG_DIAG_SOURCE_FUNCTION: u8 = 82u8; -pub const LIBPQ_HAS_PIPELINING: u32 = 1; -pub const LIBPQ_HAS_TRACE_FLAGS: u32 = 1; -pub const LIBPQ_HAS_SSL_LIBRARY_DETECTION: u32 = 1; -pub const PG_COPYRES_ATTRS: u32 = 1; -pub const PG_COPYRES_TUPLES: u32 = 2; -pub const PG_COPYRES_EVENTS: u32 = 4; -pub const PG_COPYRES_NOTICEHOOKS: u32 = 8; -pub const PQTRACE_SUPPRESS_TIMESTAMPS: u32 = 1; -pub const PQTRACE_REGRESS_MODE: u32 = 2; -pub const PQ_QUERY_PARAM_MAX_LIMIT: u32 = 65535; -pub const PQnoPasswordSupplied: &[u8; 35] = b"fe_sendauth: no password supplied\n\0"; -pub type __gnuc_va_list = __builtin_va_list; -pub type va_list = __gnuc_va_list; -extern "C" { - pub fn __mingw_get_crt_info() -> *const ::std::os::raw::c_char; -} -pub type rsize_t = usize; -pub type wchar_t = ::std::os::raw::c_ushort; -pub type wint_t = ::std::os::raw::c_ushort; -pub type wctype_t = ::std::os::raw::c_ushort; -pub type errno_t = ::std::os::raw::c_int; -pub type __time32_t = ::std::os::raw::c_long; -pub type __time64_t = ::std::os::raw::c_longlong; -pub type time_t = __time64_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct threadmbcinfostruct { - _unused: [u8; 0], -} -pub type pthreadlocinfo = *mut threadlocaleinfostruct; -pub type pthreadmbcinfo = *mut threadmbcinfostruct; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __lc_time_data { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct localeinfo_struct { - pub locinfo: pthreadlocinfo, - pub mbcinfo: pthreadmbcinfo, -} -#[test] -fn bindgen_test_layout_localeinfo_struct() { - 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!(localeinfo_struct)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(localeinfo_struct)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).locinfo) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(localeinfo_struct), - "::", - stringify!(locinfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mbcinfo) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(localeinfo_struct), - "::", - stringify!(mbcinfo) - ) - ); -} -pub type _locale_tstruct = localeinfo_struct; -pub type _locale_t = *mut localeinfo_struct; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct tagLC_ID { - pub wLanguage: ::std::os::raw::c_ushort, - pub wCountry: ::std::os::raw::c_ushort, - pub wCodePage: ::std::os::raw::c_ushort, -} -#[test] -fn bindgen_test_layout_tagLC_ID() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 6usize, - concat!("Size of: ", stringify!(tagLC_ID)) - ); - assert_eq!( - ::std::mem::align_of::(), - 2usize, - concat!("Alignment of ", stringify!(tagLC_ID)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wLanguage) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(tagLC_ID), - "::", - stringify!(wLanguage) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wCountry) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(tagLC_ID), - "::", - stringify!(wCountry) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wCodePage) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(tagLC_ID), - "::", - stringify!(wCodePage) - ) - ); -} -pub type LC_ID = tagLC_ID; -pub type LPLC_ID = *mut tagLC_ID; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct threadlocaleinfostruct { - pub refcount: ::std::os::raw::c_int, - pub lc_codepage: ::std::os::raw::c_uint, - pub lc_collate_cp: ::std::os::raw::c_uint, - pub lc_handle: [::std::os::raw::c_ulong; 6usize], - pub lc_id: [LC_ID; 6usize], - pub lc_category: [threadlocaleinfostruct__bindgen_ty_1; 6usize], - pub lc_clike: ::std::os::raw::c_int, - pub mb_cur_max: ::std::os::raw::c_int, - pub lconv_intl_refcount: *mut ::std::os::raw::c_int, - pub lconv_num_refcount: *mut ::std::os::raw::c_int, - pub lconv_mon_refcount: *mut ::std::os::raw::c_int, - pub lconv: *mut lconv, - pub ctype1_refcount: *mut ::std::os::raw::c_int, - pub ctype1: *mut ::std::os::raw::c_ushort, - pub pctype: *const ::std::os::raw::c_ushort, - pub pclmap: *const ::std::os::raw::c_uchar, - pub pcumap: *const ::std::os::raw::c_uchar, - pub lc_time_curr: *mut __lc_time_data, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct threadlocaleinfostruct__bindgen_ty_1 { - pub locale: *mut ::std::os::raw::c_char, - pub wlocale: *mut wchar_t, - pub refcount: *mut ::std::os::raw::c_int, - pub wrefcount: *mut ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_threadlocaleinfostruct__bindgen_ty_1() { - 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!(threadlocaleinfostruct__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(threadlocaleinfostruct__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).locale) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct__bindgen_ty_1), - "::", - stringify!(locale) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wlocale) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct__bindgen_ty_1), - "::", - stringify!(wlocale) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).refcount) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct__bindgen_ty_1), - "::", - stringify!(refcount) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wrefcount) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct__bindgen_ty_1), - "::", - stringify!(wrefcount) - ) - ); -} -#[test] -fn bindgen_test_layout_threadlocaleinfostruct() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 352usize, - concat!("Size of: ", stringify!(threadlocaleinfostruct)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(threadlocaleinfostruct)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).refcount) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(refcount) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lc_codepage) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(lc_codepage) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lc_collate_cp) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(lc_collate_cp) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lc_handle) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(lc_handle) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lc_id) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(lc_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lc_category) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(lc_category) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lc_clike) as usize - ptr as usize }, - 264usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(lc_clike) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mb_cur_max) as usize - ptr as usize }, - 268usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(mb_cur_max) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lconv_intl_refcount) as usize - ptr as usize }, - 272usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(lconv_intl_refcount) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lconv_num_refcount) as usize - ptr as usize }, - 280usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(lconv_num_refcount) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lconv_mon_refcount) as usize - ptr as usize }, - 288usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(lconv_mon_refcount) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lconv) as usize - ptr as usize }, - 296usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(lconv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype1_refcount) as usize - ptr as usize }, - 304usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(ctype1_refcount) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctype1) as usize - ptr as usize }, - 312usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(ctype1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pctype) as usize - ptr as usize }, - 320usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(pctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pclmap) as usize - ptr as usize }, - 328usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(pclmap) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pcumap) as usize - ptr as usize }, - 336usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(pcumap) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lc_time_curr) as usize - ptr as usize }, - 344usize, - concat!( - "Offset of field: ", - stringify!(threadlocaleinfostruct), - "::", - stringify!(lc_time_curr) - ) - ); -} -pub type threadlocinfo = threadlocaleinfostruct; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _iobuf { - pub _ptr: *mut ::std::os::raw::c_char, - pub _cnt: ::std::os::raw::c_int, - pub _base: *mut ::std::os::raw::c_char, - pub _flag: ::std::os::raw::c_int, - pub _file: ::std::os::raw::c_int, - pub _charbuf: ::std::os::raw::c_int, - pub _bufsiz: ::std::os::raw::c_int, - pub _tmpfname: *mut ::std::os::raw::c_char, -} -#[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>(), - 48usize, - 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)._ptr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_iobuf), - "::", - stringify!(_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._cnt) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_iobuf), - "::", - stringify!(_cnt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._base) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_iobuf), - "::", - stringify!(_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flag) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_iobuf), - "::", - stringify!(_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._file) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(_iobuf), - "::", - stringify!(_file) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._charbuf) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_iobuf), - "::", - stringify!(_charbuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._bufsiz) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(_iobuf), - "::", - stringify!(_bufsiz) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._tmpfname) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_iobuf), - "::", - stringify!(_tmpfname) - ) - ); -} -pub type FILE = _iobuf; -pub type _off_t = ::std::os::raw::c_long; -pub type off32_t = ::std::os::raw::c_long; -pub type _off64_t = ::std::os::raw::c_longlong; -pub type off64_t = ::std::os::raw::c_longlong; -pub type off_t = off32_t; -extern "C" { - pub fn __acrt_iob_func(index: ::std::os::raw::c_uint) -> *mut FILE; -} -extern "C" { - pub fn __iob_func() -> *mut FILE; -} -pub type fpos_t = ::std::os::raw::c_longlong; -extern "C" { - pub fn __mingw_sscanf( - _Src: *const ::std::os::raw::c_char, - _Format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_vsscanf( - _Str: *const ::std::os::raw::c_char, - Format: *const ::std::os::raw::c_char, - argp: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_scanf(_Format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_vscanf( - Format: *const ::std::os::raw::c_char, - argp: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_fscanf( - _File: *mut FILE, - _Format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_vfscanf( - fp: *mut FILE, - Format: *const ::std::os::raw::c_char, - argp: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_vsnprintf( - _DstBuf: *mut ::std::os::raw::c_char, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_snprintf( - s: *mut ::std::os::raw::c_char, - n: usize, - format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_printf(arg1: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_vprintf( - arg1: *const ::std::os::raw::c_char, - arg2: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_fprintf( - arg1: *mut FILE, - arg2: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_vfprintf( - arg1: *mut FILE, - arg2: *const ::std::os::raw::c_char, - arg3: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_sprintf( - arg1: *mut ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_vsprintf( - arg1: *mut ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - arg3: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_asprintf( - arg1: *mut *mut ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_vasprintf( - arg1: *mut *mut ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - arg3: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_sscanf( - _Src: *const ::std::os::raw::c_char, - _Format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_scanf(_Format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_fscanf( - _File: *mut FILE, - _Format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_printf(arg1: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_vprintf( - arg1: *const ::std::os::raw::c_char, - arg2: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_fprintf( - arg1: *mut FILE, - arg2: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_vfprintf( - arg1: *mut FILE, - arg2: *const ::std::os::raw::c_char, - arg3: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_sprintf( - arg1: *mut ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_vsprintf( - arg1: *mut ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - arg3: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _filbuf(_File: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _flsbuf(_Ch: ::std::os::raw::c_int, _File: *mut FILE) -> ::std::os::raw::c_int; -} -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 clearerr(_File: *mut FILE); -} -extern "C" { - pub fn fclose(_File: *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(_File: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ferror(_File: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fflush(_File: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetc(_File: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fgetchar() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetpos(_File: *mut FILE, _Pos: *mut fpos_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetpos64(_File: *mut FILE, _Pos: *mut fpos_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgets( - _Buf: *mut ::std::os::raw::c_char, - _MaxCount: ::std::os::raw::c_int, - _File: *mut FILE, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _fileno(_File: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _tempnam( - _DirName: *const ::std::os::raw::c_char, - _FilePrefix: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -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 fopen64( - filename: *const ::std::os::raw::c_char, - mode: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn fputc(_Ch: ::std::os::raw::c_int, _File: *mut FILE) -> ::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 fputs(_Str: *const ::std::os::raw::c_char, _File: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fread( - _DstBuf: *mut ::std::os::raw::c_void, - _ElementSize: ::std::os::raw::c_ulonglong, - _Count: ::std::os::raw::c_ulonglong, - _File: *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, - _File: *mut FILE, - ) -> *mut FILE; -} -extern "C" { - pub fn fsetpos(_File: *mut FILE, _Pos: *const fpos_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fsetpos64(_File: *mut FILE, _Pos: *const fpos_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fseek( - _File: *mut FILE, - _Offset: ::std::os::raw::c_long, - _Origin: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ftell(_File: *mut FILE) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn _fseeki64( - _File: *mut FILE, - _Offset: ::std::os::raw::c_longlong, - _Origin: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _ftelli64(_File: *mut FILE) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn fseeko64( - stream: *mut FILE, - offset: _off64_t, - whence: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fseeko( - stream: *mut FILE, - offset: _off_t, - whence: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ftello(stream: *mut FILE) -> _off_t; -} -extern "C" { - pub fn ftello64(stream: *mut FILE) -> _off64_t; -} -extern "C" { - pub fn fwrite( - _Str: *const ::std::os::raw::c_void, - _Size: ::std::os::raw::c_ulonglong, - _Count: ::std::os::raw::c_ulonglong, - _File: *mut FILE, - ) -> ::std::os::raw::c_ulonglong; -} -extern "C" { - pub fn getc(_File: *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 gets(_Buffer: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _getw(_File: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn perror(_ErrMsg: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn _pclose(_File: *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(_Ch: ::std::os::raw::c_int, _File: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putchar(_Ch: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn puts(_Str: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _putw(_Word: ::std::os::raw::c_int, _File: *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(_File: *mut FILE); -} -extern "C" { - pub fn _rmtmp() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setbuf(_File: *mut FILE, _Buffer: *mut ::std::os::raw::c_char); -} -extern "C" { - pub fn _setmaxstdio(_Max: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _set_output_format(_Format: ::std::os::raw::c_uint) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn _get_output_format() -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn setvbuf( - _File: *mut FILE, - _Buf: *mut ::std::os::raw::c_char, - _Mode: ::std::os::raw::c_int, - _Size: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _scprintf(_Format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snscanf( - _Src: *const ::std::os::raw::c_char, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vscprintf( - _Format: *const ::std::os::raw::c_char, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -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(_Ch: ::std::os::raw::c_int, _File: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snprintf( - _Dest: *mut ::std::os::raw::c_char, - _Count: usize, - _Format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vsnprintf( - _Dest: *mut ::std::os::raw::c_char, - _Count: usize, - _Format: *const ::std::os::raw::c_char, - _Args: 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 __mingw_swscanf( - _Src: *const wchar_t, - _Format: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_vswscanf( - _Str: *const wchar_t, - Format: *const wchar_t, - argp: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_wscanf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_vwscanf(Format: *const wchar_t, argp: va_list) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_fwscanf(_File: *mut FILE, _Format: *const wchar_t, ...) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_vfwscanf( - fp: *mut FILE, - Format: *const wchar_t, - argp: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_fwprintf( - _File: *mut FILE, - _Format: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_wprintf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_vfwprintf( - _File: *mut FILE, - _Format: *const wchar_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_vwprintf(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_snwprintf( - s: *mut wchar_t, - n: usize, - format: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_vsnwprintf( - arg1: *mut wchar_t, - arg2: usize, - arg3: *const wchar_t, - arg4: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_swprintf(arg1: *mut wchar_t, arg2: *const wchar_t, ...) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_vswprintf( - arg1: *mut wchar_t, - arg2: *const wchar_t, - arg3: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_swscanf( - _Src: *const wchar_t, - _Format: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_wscanf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_fwscanf(_File: *mut FILE, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_fwprintf(_File: *mut FILE, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_wprintf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_vfwprintf( - _File: *mut FILE, - _Format: *const wchar_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_vwprintf(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_swprintf(arg1: *mut wchar_t, arg2: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ms_vswprintf( - arg1: *mut wchar_t, - arg2: *const wchar_t, - arg3: va_list, - ) -> ::std::os::raw::c_int; -} -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 fgetwc(_File: *mut FILE) -> wint_t; -} -extern "C" { - pub fn _fgetwchar() -> wint_t; -} -extern "C" { - pub fn fputwc(_Ch: wchar_t, _File: *mut FILE) -> wint_t; -} -extern "C" { - pub fn _fputwchar(_Ch: wchar_t) -> wint_t; -} -extern "C" { - pub fn getwc(_File: *mut FILE) -> wint_t; -} -extern "C" { - pub fn getwchar() -> wint_t; -} -extern "C" { - pub fn putwc(_Ch: wchar_t, _File: *mut FILE) -> wint_t; -} -extern "C" { - pub fn putwchar(_Ch: wchar_t) -> wint_t; -} -extern "C" { - pub fn ungetwc(_Ch: wint_t, _File: *mut FILE) -> wint_t; -} -extern "C" { - pub fn fgetws( - _Dst: *mut wchar_t, - _SizeInWords: ::std::os::raw::c_int, - _File: *mut FILE, - ) -> *mut wchar_t; -} -extern "C" { - pub fn fputws(_Str: *const wchar_t, _File: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _getws(_String: *mut wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn _putws(_Str: *const wchar_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _scwprintf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _swprintf_c( - _DstBuf: *mut wchar_t, - _SizeInWords: usize, - _Format: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vswprintf_c( - _DstBuf: *mut wchar_t, - _SizeInWords: usize, - _Format: *const wchar_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snwprintf( - _Dest: *mut wchar_t, - _Count: usize, - _Format: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vsnwprintf( - _Dest: *mut wchar_t, - _Count: usize, - _Format: *const wchar_t, - _Args: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vscwprintf(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _swprintf(_Dest: *mut wchar_t, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vswprintf( - _Dest: *mut wchar_t, - _Format: *const wchar_t, - _Args: va_list, - ) -> ::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 _snwscanf( - _Src: *const wchar_t, - _MaxCount: usize, - _Format: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; -} -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 _wfreopen( - _Filename: *const wchar_t, - _Mode: *const wchar_t, - _OldFile: *mut FILE, - ) -> *mut FILE; -} -extern "C" { - pub fn _wperror(_ErrMsg: *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 _wtmpnam(_Buffer: *mut wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn _lock_file(_File: *mut FILE); -} -extern "C" { - pub fn _unlock_file(_File: *mut FILE); -} -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(_File: *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(_File: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putw(_Ch: ::std::os::raw::c_int, _File: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rmtmp() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_str_wide_utf8( - wptr: *const wchar_t, - mbptr: *mut *mut ::std::os::raw::c_char, - buflen: *mut usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_str_utf8_wide( - mbptr: *const ::std::os::raw::c_char, - wptr: *mut *mut wchar_t, - buflen: *mut usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __mingw_str_free(ptr: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn _wspawnl( - _Mode: ::std::os::raw::c_int, - _Filename: *const wchar_t, - _ArgList: *const wchar_t, - ... - ) -> isize; -} -extern "C" { - pub fn _wspawnle( - _Mode: ::std::os::raw::c_int, - _Filename: *const wchar_t, - _ArgList: *const wchar_t, - ... - ) -> isize; -} -extern "C" { - pub fn _wspawnlp( - _Mode: ::std::os::raw::c_int, - _Filename: *const wchar_t, - _ArgList: *const wchar_t, - ... - ) -> isize; -} -extern "C" { - pub fn _wspawnlpe( - _Mode: ::std::os::raw::c_int, - _Filename: *const wchar_t, - _ArgList: *const wchar_t, - ... - ) -> isize; -} -extern "C" { - pub fn _wspawnv( - _Mode: ::std::os::raw::c_int, - _Filename: *const wchar_t, - _ArgList: *const *const wchar_t, - ) -> isize; -} -extern "C" { - pub fn _wspawnve( - _Mode: ::std::os::raw::c_int, - _Filename: *const wchar_t, - _ArgList: *const *const wchar_t, - _Env: *const *const wchar_t, - ) -> isize; -} -extern "C" { - pub fn _wspawnvp( - _Mode: ::std::os::raw::c_int, - _Filename: *const wchar_t, - _ArgList: *const *const wchar_t, - ) -> isize; -} -extern "C" { - pub fn _wspawnvpe( - _Mode: ::std::os::raw::c_int, - _Filename: *const wchar_t, - _ArgList: *const *const wchar_t, - _Env: *const *const wchar_t, - ) -> isize; -} -extern "C" { - pub fn _spawnv( - _Mode: ::std::os::raw::c_int, - _Filename: *const ::std::os::raw::c_char, - _ArgList: *const *const ::std::os::raw::c_char, - ) -> isize; -} -extern "C" { - pub fn _spawnve( - _Mode: ::std::os::raw::c_int, - _Filename: *const ::std::os::raw::c_char, - _ArgList: *const *const ::std::os::raw::c_char, - _Env: *const *const ::std::os::raw::c_char, - ) -> isize; -} -extern "C" { - pub fn _spawnvp( - _Mode: ::std::os::raw::c_int, - _Filename: *const ::std::os::raw::c_char, - _ArgList: *const *const ::std::os::raw::c_char, - ) -> isize; -} -extern "C" { - pub fn _spawnvpe( - _Mode: ::std::os::raw::c_int, - _Filename: *const ::std::os::raw::c_char, - _ArgList: *const *const ::std::os::raw::c_char, - _Env: *const *const ::std::os::raw::c_char, - ) -> isize; -} -extern "C" { - pub fn clearerr_s(_File: *mut FILE) -> errno_t; -} -extern "C" { - pub fn fread_s( - _DstBuf: *mut ::std::os::raw::c_void, - _DstSize: usize, - _ElementSize: usize, - _Count: usize, - _File: *mut FILE, - ) -> usize; -} -extern "C" { - pub fn fprintf_s( - _File: *mut FILE, - _Format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fscanf_s_l( - _File: *mut FILE, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fscanf_s( - _File: *mut FILE, - _Format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn printf_s(_Format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _scanf_l( - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _scanf_s_l( - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn scanf_s(_Format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snprintf_c( - _DstBuf: *mut ::std::os::raw::c_char, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vsnprintf_c( - _DstBuf: *mut ::std::os::raw::c_char, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fscanf_l( - _File: *mut FILE, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _sscanf_l( - _Src: *const ::std::os::raw::c_char, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _sscanf_s_l( - _Src: *const ::std::os::raw::c_char, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sscanf_s( - _Src: *const ::std::os::raw::c_char, - _Format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snscanf_s( - _Src: *const ::std::os::raw::c_char, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snscanf_l( - _Src: *const ::std::os::raw::c_char, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snscanf_s_l( - _Src: *const ::std::os::raw::c_char, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vfprintf_s( - _File: *mut FILE, - _Format: *const ::std::os::raw::c_char, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vprintf_s( - _Format: *const ::std::os::raw::c_char, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsnprintf_s( - _DstBuf: *mut ::std::os::raw::c_char, - _DstSize: usize, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vsnprintf_s( - _DstBuf: *mut ::std::os::raw::c_char, - _DstSize: usize, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsprintf_s( - _DstBuf: *mut ::std::os::raw::c_char, - _Size: usize, - _Format: *const ::std::os::raw::c_char, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sprintf_s( - _DstBuf: *mut ::std::os::raw::c_char, - _DstSize: usize, - _Format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snprintf_s( - _DstBuf: *mut ::std::os::raw::c_char, - _DstSize: usize, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fprintf_p( - _File: *mut FILE, - _Format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _printf_p(_Format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _sprintf_p( - _Dst: *mut ::std::os::raw::c_char, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vfprintf_p( - _File: *mut FILE, - _Format: *const ::std::os::raw::c_char, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vprintf_p( - _Format: *const ::std::os::raw::c_char, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vsprintf_p( - _Dst: *mut ::std::os::raw::c_char, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _scprintf_p(_Format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vscprintf_p( - _Format: *const ::std::os::raw::c_char, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _printf_l( - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _printf_p_l( - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vprintf_l( - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vprintf_p_l( - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fprintf_l( - _File: *mut FILE, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fprintf_p_l( - _File: *mut FILE, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vfprintf_l( - _File: *mut FILE, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vfprintf_p_l( - _File: *mut FILE, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _sprintf_l( - _DstBuf: *mut ::std::os::raw::c_char, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _sprintf_p_l( - _DstBuf: *mut ::std::os::raw::c_char, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vsprintf_l( - _DstBuf: *mut ::std::os::raw::c_char, - _Format: *const ::std::os::raw::c_char, - arg1: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vsprintf_p_l( - _DstBuf: *mut ::std::os::raw::c_char, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _scprintf_l( - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _scprintf_p_l( - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vscprintf_l( - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vscprintf_p_l( - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _printf_s_l( - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vprintf_s_l( - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fprintf_s_l( - _File: *mut FILE, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vfprintf_s_l( - _File: *mut FILE, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _sprintf_s_l( - _DstBuf: *mut ::std::os::raw::c_char, - _DstSize: usize, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vsprintf_s_l( - _DstBuf: *mut ::std::os::raw::c_char, - _DstSize: usize, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snprintf_s_l( - _DstBuf: *mut ::std::os::raw::c_char, - _DstSize: usize, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vsnprintf_s_l( - _DstBuf: *mut ::std::os::raw::c_char, - _DstSize: 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 _snprintf_l( - _DstBuf: *mut ::std::os::raw::c_char, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snprintf_c_l( - _DstBuf: *mut ::std::os::raw::c_char, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vsnprintf_l( - _DstBuf: *mut ::std::os::raw::c_char, - _MaxCount: usize, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vsnprintf_c_l( - _DstBuf: *mut ::std::os::raw::c_char, - _MaxCount: usize, - arg1: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fopen_s( - _File: *mut *mut FILE, - _Filename: *const ::std::os::raw::c_char, - _Mode: *const ::std::os::raw::c_char, - ) -> errno_t; -} -extern "C" { - pub fn freopen_s( - _File: *mut *mut FILE, - _Filename: *const ::std::os::raw::c_char, - _Mode: *const ::std::os::raw::c_char, - _Stream: *mut FILE, - ) -> errno_t; -} -extern "C" { - pub fn gets_s(arg1: *mut ::std::os::raw::c_char, arg2: rsize_t) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn tmpfile_s(_File: *mut *mut FILE) -> errno_t; -} -extern "C" { - pub fn tmpnam_s(arg1: *mut ::std::os::raw::c_char, arg2: rsize_t) -> errno_t; -} -extern "C" { - pub fn _getws_s(_Str: *mut wchar_t, _SizeInWords: usize) -> *mut wchar_t; -} -extern "C" { - pub fn fwprintf_s(_File: *mut FILE, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wprintf_s(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vfwprintf_s( - _File: *mut FILE, - _Format: *const wchar_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vwprintf_s(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vswprintf_s( - _Dst: *mut wchar_t, - _SizeInWords: usize, - _Format: *const wchar_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn swprintf_s( - _Dst: *mut wchar_t, - _SizeInWords: usize, - _Format: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vsnwprintf_s( - _DstBuf: *mut wchar_t, - _DstSizeInWords: usize, - _MaxCount: usize, - _Format: *const wchar_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snwprintf_s( - _DstBuf: *mut wchar_t, - _DstSizeInWords: usize, - _MaxCount: usize, - _Format: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wprintf_s_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vwprintf_s_l( - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fwprintf_s_l( - _File: *mut FILE, - _Format: *const wchar_t, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vfwprintf_s_l( - _File: *mut FILE, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _swprintf_s_l( - _DstBuf: *mut wchar_t, - _DstSize: usize, - _Format: *const wchar_t, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vswprintf_s_l( - _DstBuf: *mut wchar_t, - _DstSize: usize, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snwprintf_s_l( - _DstBuf: *mut wchar_t, - _DstSize: usize, - _MaxCount: usize, - _Format: *const wchar_t, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vsnwprintf_s_l( - _DstBuf: *mut wchar_t, - _DstSize: usize, - _MaxCount: usize, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fwscanf_s_l( - _File: *mut FILE, - _Format: *const wchar_t, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fwscanf_s(_File: *mut FILE, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _swscanf_s_l( - _Src: *const wchar_t, - _Format: *const wchar_t, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn swscanf_s(_Src: *const wchar_t, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snwscanf_s( - _Src: *const wchar_t, - _MaxCount: usize, - _Format: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snwscanf_s_l( - _Src: *const wchar_t, - _MaxCount: usize, - _Format: *const wchar_t, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wscanf_s_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wscanf_s(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wfopen_s( - _File: *mut *mut FILE, - _Filename: *const wchar_t, - _Mode: *const wchar_t, - ) -> errno_t; -} -extern "C" { - pub fn _wfreopen_s( - _File: *mut *mut FILE, - _Filename: *const wchar_t, - _Mode: *const wchar_t, - _OldFile: *mut FILE, - ) -> errno_t; -} -extern "C" { - pub fn _wtmpnam_s(_DstBuf: *mut wchar_t, _SizeInWords: usize) -> errno_t; -} -extern "C" { - pub fn _fwprintf_p(_File: *mut FILE, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wprintf_p(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vfwprintf_p( - _File: *mut FILE, - _Format: *const wchar_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vwprintf_p(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _swprintf_p( - _DstBuf: *mut wchar_t, - _MaxCount: usize, - _Format: *const wchar_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vswprintf_p( - _DstBuf: *mut wchar_t, - _MaxCount: usize, - _Format: *const wchar_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _scwprintf_p(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vscwprintf_p(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wprintf_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wprintf_p_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vwprintf_l( - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vwprintf_p_l( - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fwprintf_l( - _File: *mut FILE, - _Format: *const wchar_t, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fwprintf_p_l( - _File: *mut FILE, - _Format: *const wchar_t, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vfwprintf_l( - _File: *mut FILE, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vfwprintf_p_l( - _File: *mut FILE, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _swprintf_c_l( - _DstBuf: *mut wchar_t, - _MaxCount: usize, - _Format: *const wchar_t, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _swprintf_p_l( - _DstBuf: *mut wchar_t, - _MaxCount: usize, - _Format: *const wchar_t, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vswprintf_c_l( - _DstBuf: *mut wchar_t, - _MaxCount: usize, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vswprintf_p_l( - _DstBuf: *mut wchar_t, - _MaxCount: usize, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _scwprintf_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _scwprintf_p_l( - _Format: *const wchar_t, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vscwprintf_p_l( - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snwprintf_l( - _DstBuf: *mut wchar_t, - _MaxCount: usize, - _Format: *const wchar_t, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vsnwprintf_l( - _DstBuf: *mut wchar_t, - _MaxCount: usize, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __swprintf_l( - _Dest: *mut wchar_t, - _Format: *const wchar_t, - _Plocinfo: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __vswprintf_l( - _Dest: *mut wchar_t, - _Format: *const wchar_t, - _Plocinfo: _locale_t, - _Args: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _vscwprintf_l( - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fwscanf_l( - _File: *mut FILE, - _Format: *const wchar_t, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _swscanf_l( - _Src: *const wchar_t, - _Format: *const wchar_t, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _snwscanf_l( - _Src: *const wchar_t, - _MaxCount: usize, - _Format: *const wchar_t, - _Locale: _locale_t, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wscanf_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; -} -pub type Oid = ::std::os::raw::c_uint; -pub type pg_int64 = ::std::os::raw::c_long; -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum ConnStatusType { - CONNECTION_OK = 0, - CONNECTION_BAD = 1, - CONNECTION_STARTED = 2, - CONNECTION_MADE = 3, - CONNECTION_AWAITING_RESPONSE = 4, - CONNECTION_AUTH_OK = 5, - CONNECTION_SETENV = 6, - CONNECTION_SSL_STARTUP = 7, - CONNECTION_NEEDED = 8, - CONNECTION_CHECK_WRITABLE = 9, - CONNECTION_CONSUME = 10, - CONNECTION_GSS_STARTUP = 11, - CONNECTION_CHECK_TARGET = 12, - CONNECTION_CHECK_STANDBY = 13, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum PostgresPollingStatusType { - PGRES_POLLING_FAILED = 0, - PGRES_POLLING_READING = 1, - PGRES_POLLING_WRITING = 2, - PGRES_POLLING_OK = 3, - PGRES_POLLING_ACTIVE = 4, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum ExecStatusType { - PGRES_EMPTY_QUERY = 0, - PGRES_COMMAND_OK = 1, - PGRES_TUPLES_OK = 2, - PGRES_COPY_OUT = 3, - PGRES_COPY_IN = 4, - PGRES_BAD_RESPONSE = 5, - PGRES_NONFATAL_ERROR = 6, - PGRES_FATAL_ERROR = 7, - PGRES_COPY_BOTH = 8, - PGRES_SINGLE_TUPLE = 9, - PGRES_PIPELINE_SYNC = 10, - PGRES_PIPELINE_ABORTED = 11, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum PGTransactionStatusType { - PQTRANS_IDLE = 0, - PQTRANS_ACTIVE = 1, - PQTRANS_INTRANS = 2, - PQTRANS_INERROR = 3, - PQTRANS_UNKNOWN = 4, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum PGVerbosity { - PQERRORS_TERSE = 0, - PQERRORS_DEFAULT = 1, - PQERRORS_VERBOSE = 2, - PQERRORS_SQLSTATE = 3, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum PGContextVisibility { - PQSHOW_CONTEXT_NEVER = 0, - PQSHOW_CONTEXT_ERRORS = 1, - PQSHOW_CONTEXT_ALWAYS = 2, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum PGPing { - PQPING_OK = 0, - PQPING_REJECT = 1, - PQPING_NO_RESPONSE = 2, - PQPING_NO_ATTEMPT = 3, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum PGpipelineStatus { - PQ_PIPELINE_OFF = 0, - PQ_PIPELINE_ON = 1, - PQ_PIPELINE_ABORTED = 2, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pg_conn { - _unused: [u8; 0], -} -pub type PGconn = pg_conn; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pg_result { - _unused: [u8; 0], -} -pub type PGresult = pg_result; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pg_cancel { - _unused: [u8; 0], -} -pub type PGcancel = pg_cancel; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pgNotify { - pub relname: *mut ::std::os::raw::c_char, - pub be_pid: ::std::os::raw::c_int, - pub extra: *mut ::std::os::raw::c_char, - pub next: *mut pgNotify, -} -#[test] -fn bindgen_test_layout_pgNotify() { - 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!(pgNotify)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pgNotify)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).relname) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pgNotify), - "::", - stringify!(relname) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).be_pid) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(pgNotify), - "::", - stringify!(be_pid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).extra) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(pgNotify), - "::", - stringify!(extra) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(pgNotify), - "::", - stringify!(next) - ) - ); -} -pub type PGnotify = pgNotify; -pub type PQnoticeReceiver = ::std::option::Option< - unsafe extern "C" fn(arg: *mut ::std::os::raw::c_void, res: *const PGresult), ->; -pub type PQnoticeProcessor = ::std::option::Option< - unsafe extern "C" fn(arg: *mut ::std::os::raw::c_void, message: *const ::std::os::raw::c_char), ->; -pub type pqbool = ::std::os::raw::c_char; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _PQprintOpt { - pub header: pqbool, - pub align: pqbool, - pub standard: pqbool, - pub html3: pqbool, - pub expanded: pqbool, - pub pager: pqbool, - pub fieldSep: *mut ::std::os::raw::c_char, - pub tableOpt: *mut ::std::os::raw::c_char, - pub caption: *mut ::std::os::raw::c_char, - pub fieldName: *mut *mut ::std::os::raw::c_char, -} -#[test] -fn bindgen_test_layout__PQprintOpt() { - const UNINIT: ::std::mem::MaybeUninit<_PQprintOpt> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_PQprintOpt>(), - 40usize, - concat!("Size of: ", stringify!(_PQprintOpt)) - ); - assert_eq!( - ::std::mem::align_of::<_PQprintOpt>(), - 8usize, - concat!("Alignment of ", stringify!(_PQprintOpt)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).header) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(header) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).align) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(align) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).standard) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(standard) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).html3) as usize - ptr as usize }, - 3usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(html3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).expanded) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(expanded) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pager) as usize - ptr as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(pager) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fieldSep) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(fieldSep) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tableOpt) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(tableOpt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).caption) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(caption) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fieldName) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_PQprintOpt), - "::", - stringify!(fieldName) - ) - ); -} -pub type PQprintOpt = _PQprintOpt; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _PQconninfoOption { - pub keyword: *mut ::std::os::raw::c_char, - pub envvar: *mut ::std::os::raw::c_char, - pub compiled: *mut ::std::os::raw::c_char, - pub val: *mut ::std::os::raw::c_char, - pub label: *mut ::std::os::raw::c_char, - pub dispchar: *mut ::std::os::raw::c_char, - pub dispsize: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout__PQconninfoOption() { - const UNINIT: ::std::mem::MaybeUninit<_PQconninfoOption> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_PQconninfoOption>(), - 56usize, - concat!("Size of: ", stringify!(_PQconninfoOption)) - ); - assert_eq!( - ::std::mem::align_of::<_PQconninfoOption>(), - 8usize, - concat!("Alignment of ", stringify!(_PQconninfoOption)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyword) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_PQconninfoOption), - "::", - stringify!(keyword) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).envvar) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_PQconninfoOption), - "::", - stringify!(envvar) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).compiled) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_PQconninfoOption), - "::", - stringify!(compiled) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_PQconninfoOption), - "::", - stringify!(val) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_PQconninfoOption), - "::", - stringify!(label) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dispchar) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_PQconninfoOption), - "::", - stringify!(dispchar) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dispsize) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_PQconninfoOption), - "::", - stringify!(dispsize) - ) - ); -} -pub type PQconninfoOption = _PQconninfoOption; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct PQArgBlock { - pub len: ::std::os::raw::c_int, - pub isint: ::std::os::raw::c_int, - pub u: PQArgBlock__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union PQArgBlock__bindgen_ty_1 { - pub ptr: *mut ::std::os::raw::c_int, - pub integer: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_PQArgBlock__bindgen_ty_1() { - 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!(PQArgBlock__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(PQArgBlock__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(PQArgBlock__bindgen_ty_1), - "::", - stringify!(ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).integer) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(PQArgBlock__bindgen_ty_1), - "::", - stringify!(integer) - ) - ); -} -#[test] -fn bindgen_test_layout_PQArgBlock() { - 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!(PQArgBlock)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(PQArgBlock)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(PQArgBlock), - "::", - stringify!(len) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).isint) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(PQArgBlock), - "::", - stringify!(isint) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(PQArgBlock), - "::", - stringify!(u) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pgresAttDesc { - pub name: *mut ::std::os::raw::c_char, - pub tableid: Oid, - pub columnid: ::std::os::raw::c_int, - pub format: ::std::os::raw::c_int, - pub typid: Oid, - pub typlen: ::std::os::raw::c_int, - pub atttypmod: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_pgresAttDesc() { - 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!(pgresAttDesc)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pgresAttDesc)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pgresAttDesc), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tableid) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(pgresAttDesc), - "::", - stringify!(tableid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).columnid) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(pgresAttDesc), - "::", - stringify!(columnid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).format) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(pgresAttDesc), - "::", - stringify!(format) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).typid) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(pgresAttDesc), - "::", - stringify!(typid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).typlen) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(pgresAttDesc), - "::", - stringify!(typlen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).atttypmod) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(pgresAttDesc), - "::", - stringify!(atttypmod) - ) - ); -} -pub type PGresAttDesc = pgresAttDesc; -extern "C" { - pub fn PQconnectStart(conninfo: *const ::std::os::raw::c_char) -> *mut PGconn; -} -extern "C" { - pub fn PQconnectStartParams( - keywords: *const *const ::std::os::raw::c_char, - values: *const *const ::std::os::raw::c_char, - expand_dbname: ::std::os::raw::c_int, - ) -> *mut PGconn; -} -extern "C" { - pub fn PQconnectPoll(conn: *mut PGconn) -> PostgresPollingStatusType; -} -extern "C" { - pub fn PQconnectdb(conninfo: *const ::std::os::raw::c_char) -> *mut PGconn; -} -extern "C" { - pub fn PQconnectdbParams( - keywords: *const *const ::std::os::raw::c_char, - values: *const *const ::std::os::raw::c_char, - expand_dbname: ::std::os::raw::c_int, - ) -> *mut PGconn; -} -extern "C" { - pub fn PQsetdbLogin( - pghost: *const ::std::os::raw::c_char, - pgport: *const ::std::os::raw::c_char, - pgoptions: *const ::std::os::raw::c_char, - pgtty: *const ::std::os::raw::c_char, - dbName: *const ::std::os::raw::c_char, - login: *const ::std::os::raw::c_char, - pwd: *const ::std::os::raw::c_char, - ) -> *mut PGconn; -} -extern "C" { - pub fn PQfinish(conn: *mut PGconn); -} -extern "C" { - pub fn PQconndefaults() -> *mut PQconninfoOption; -} -extern "C" { - pub fn PQconninfoParse( - conninfo: *const ::std::os::raw::c_char, - errmsg: *mut *mut ::std::os::raw::c_char, - ) -> *mut PQconninfoOption; -} -extern "C" { - pub fn PQconninfo(conn: *mut PGconn) -> *mut PQconninfoOption; -} -extern "C" { - pub fn PQconninfoFree(connOptions: *mut PQconninfoOption); -} -extern "C" { - pub fn PQresetStart(conn: *mut PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQresetPoll(conn: *mut PGconn) -> PostgresPollingStatusType; -} -extern "C" { - pub fn PQreset(conn: *mut PGconn); -} -extern "C" { - pub fn PQgetCancel(conn: *mut PGconn) -> *mut PGcancel; -} -extern "C" { - pub fn PQfreeCancel(cancel: *mut PGcancel); -} -extern "C" { - pub fn PQcancel( - cancel: *mut PGcancel, - errbuf: *mut ::std::os::raw::c_char, - errbufsize: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQrequestCancel(conn: *mut PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQdb(conn: *const PGconn) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQuser(conn: *const PGconn) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQpass(conn: *const PGconn) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQhost(conn: *const PGconn) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQhostaddr(conn: *const PGconn) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQport(conn: *const PGconn) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQtty(conn: *const PGconn) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQoptions(conn: *const PGconn) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQstatus(conn: *const PGconn) -> ConnStatusType; -} -extern "C" { - pub fn PQtransactionStatus(conn: *const PGconn) -> PGTransactionStatusType; -} -extern "C" { - pub fn PQparameterStatus( - conn: *const PGconn, - paramName: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn PQprotocolVersion(conn: *const PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQserverVersion(conn: *const PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQerrorMessage(conn: *const PGconn) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQsocket(conn: *const PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQbackendPID(conn: *const PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQpipelineStatus(conn: *const PGconn) -> PGpipelineStatus; -} -extern "C" { - pub fn PQconnectionNeedsPassword(conn: *const PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQconnectionUsedPassword(conn: *const PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQconnectionUsedGSSAPI(conn: *const PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQclientEncoding(conn: *const PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQsetClientEncoding( - conn: *mut PGconn, - encoding: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQsslInUse(conn: *mut PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQsslStruct( - conn: *mut PGconn, - struct_name: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn PQsslAttribute( - conn: *mut PGconn, - attribute_name: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn PQsslAttributeNames(conn: *mut PGconn) -> *const *const ::std::os::raw::c_char; -} -extern "C" { - pub fn PQgetssl(conn: *mut PGconn) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn PQinitSSL(do_init: ::std::os::raw::c_int); -} -extern "C" { - pub fn PQinitOpenSSL(do_ssl: ::std::os::raw::c_int, do_crypto: ::std::os::raw::c_int); -} -extern "C" { - pub fn PQgssEncInUse(conn: *mut PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQgetgssctx(conn: *mut PGconn) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn PQsetErrorVerbosity(conn: *mut PGconn, verbosity: PGVerbosity) -> PGVerbosity; -} -extern "C" { - pub fn PQsetErrorContextVisibility( - conn: *mut PGconn, - show_context: PGContextVisibility, - ) -> PGContextVisibility; -} -extern "C" { - pub fn PQsetNoticeReceiver( - conn: *mut PGconn, - proc_: PQnoticeReceiver, - arg: *mut ::std::os::raw::c_void, - ) -> PQnoticeReceiver; -} -extern "C" { - pub fn PQsetNoticeProcessor( - conn: *mut PGconn, - proc_: PQnoticeProcessor, - arg: *mut ::std::os::raw::c_void, - ) -> PQnoticeProcessor; -} -pub type pgthreadlock_t = - ::std::option::Option; -extern "C" { - pub fn PQregisterThreadLock(newhandler: pgthreadlock_t) -> pgthreadlock_t; -} -extern "C" { - pub fn PQtrace(conn: *mut PGconn, debug_port: *mut FILE); -} -extern "C" { - pub fn PQuntrace(conn: *mut PGconn); -} -extern "C" { - pub fn PQsetTraceFlags(conn: *mut PGconn, flags: ::std::os::raw::c_int); -} -extern "C" { - pub fn PQexec(conn: *mut PGconn, query: *const ::std::os::raw::c_char) -> *mut PGresult; -} -extern "C" { - pub fn PQexecParams( - conn: *mut PGconn, - command: *const ::std::os::raw::c_char, - nParams: ::std::os::raw::c_int, - paramTypes: *const Oid, - paramValues: *const *const ::std::os::raw::c_char, - paramLengths: *const ::std::os::raw::c_int, - paramFormats: *const ::std::os::raw::c_int, - resultFormat: ::std::os::raw::c_int, - ) -> *mut PGresult; -} -extern "C" { - pub fn PQprepare( - conn: *mut PGconn, - stmtName: *const ::std::os::raw::c_char, - query: *const ::std::os::raw::c_char, - nParams: ::std::os::raw::c_int, - paramTypes: *const Oid, - ) -> *mut PGresult; -} -extern "C" { - pub fn PQexecPrepared( - conn: *mut PGconn, - stmtName: *const ::std::os::raw::c_char, - nParams: ::std::os::raw::c_int, - paramValues: *const *const ::std::os::raw::c_char, - paramLengths: *const ::std::os::raw::c_int, - paramFormats: *const ::std::os::raw::c_int, - resultFormat: ::std::os::raw::c_int, - ) -> *mut PGresult; -} -extern "C" { - pub fn PQsendQuery( - conn: *mut PGconn, - query: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQsendQueryParams( - conn: *mut PGconn, - command: *const ::std::os::raw::c_char, - nParams: ::std::os::raw::c_int, - paramTypes: *const Oid, - paramValues: *const *const ::std::os::raw::c_char, - paramLengths: *const ::std::os::raw::c_int, - paramFormats: *const ::std::os::raw::c_int, - resultFormat: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQsendPrepare( - conn: *mut PGconn, - stmtName: *const ::std::os::raw::c_char, - query: *const ::std::os::raw::c_char, - nParams: ::std::os::raw::c_int, - paramTypes: *const Oid, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQsendQueryPrepared( - conn: *mut PGconn, - stmtName: *const ::std::os::raw::c_char, - nParams: ::std::os::raw::c_int, - paramValues: *const *const ::std::os::raw::c_char, - paramLengths: *const ::std::os::raw::c_int, - paramFormats: *const ::std::os::raw::c_int, - resultFormat: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQsetSingleRowMode(conn: *mut PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQgetResult(conn: *mut PGconn) -> *mut PGresult; -} -extern "C" { - pub fn PQisBusy(conn: *mut PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQconsumeInput(conn: *mut PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQenterPipelineMode(conn: *mut PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQexitPipelineMode(conn: *mut PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQpipelineSync(conn: *mut PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQsendFlushRequest(conn: *mut PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQnotifies(conn: *mut PGconn) -> *mut PGnotify; -} -extern "C" { - pub fn PQputCopyData( - conn: *mut PGconn, - buffer: *const ::std::os::raw::c_char, - nbytes: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQputCopyEnd( - conn: *mut PGconn, - errormsg: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQgetCopyData( - conn: *mut PGconn, - buffer: *mut *mut ::std::os::raw::c_char, - async_: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQgetline( - conn: *mut PGconn, - buffer: *mut ::std::os::raw::c_char, - length: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQputline( - conn: *mut PGconn, - string: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQgetlineAsync( - conn: *mut PGconn, - buffer: *mut ::std::os::raw::c_char, - bufsize: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQputnbytes( - conn: *mut PGconn, - buffer: *const ::std::os::raw::c_char, - nbytes: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQendcopy(conn: *mut PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQsetnonblocking(conn: *mut PGconn, arg: ::std::os::raw::c_int) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQisnonblocking(conn: *const PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQisthreadsafe() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQping(conninfo: *const ::std::os::raw::c_char) -> PGPing; -} -extern "C" { - pub fn PQpingParams( - keywords: *const *const ::std::os::raw::c_char, - values: *const *const ::std::os::raw::c_char, - expand_dbname: ::std::os::raw::c_int, - ) -> PGPing; -} -extern "C" { - pub fn PQflush(conn: *mut PGconn) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQfn( - conn: *mut PGconn, - fnid: ::std::os::raw::c_int, - result_buf: *mut ::std::os::raw::c_int, - result_len: *mut ::std::os::raw::c_int, - result_is_int: ::std::os::raw::c_int, - args: *const PQArgBlock, - nargs: ::std::os::raw::c_int, - ) -> *mut PGresult; -} -extern "C" { - pub fn PQresultStatus(res: *const PGresult) -> ExecStatusType; -} -extern "C" { - pub fn PQresStatus(status: ExecStatusType) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQresultErrorMessage(res: *const PGresult) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQresultVerboseErrorMessage( - res: *const PGresult, - verbosity: PGVerbosity, - show_context: PGContextVisibility, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQresultErrorField( - res: *const PGresult, - fieldcode: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQntuples(res: *const PGresult) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQnfields(res: *const PGresult) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQbinaryTuples(res: *const PGresult) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQfname( - res: *const PGresult, - field_num: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQfnumber( - res: *const PGresult, - field_name: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQftable(res: *const PGresult, field_num: ::std::os::raw::c_int) -> Oid; -} -extern "C" { - pub fn PQftablecol( - res: *const PGresult, - field_num: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQfformat( - res: *const PGresult, - field_num: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQftype(res: *const PGresult, field_num: ::std::os::raw::c_int) -> Oid; -} -extern "C" { - pub fn PQfsize(res: *const PGresult, field_num: ::std::os::raw::c_int) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQfmod(res: *const PGresult, field_num: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQcmdStatus(res: *mut PGresult) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQoidStatus(res: *const PGresult) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQoidValue(res: *const PGresult) -> Oid; -} -extern "C" { - pub fn PQcmdTuples(res: *mut PGresult) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQgetvalue( - res: *const PGresult, - tup_num: ::std::os::raw::c_int, - field_num: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQgetlength( - res: *const PGresult, - tup_num: ::std::os::raw::c_int, - field_num: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQgetisnull( - res: *const PGresult, - tup_num: ::std::os::raw::c_int, - field_num: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQnparams(res: *const PGresult) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQparamtype(res: *const PGresult, param_num: ::std::os::raw::c_int) -> Oid; -} -extern "C" { - pub fn PQdescribePrepared( - conn: *mut PGconn, - stmt: *const ::std::os::raw::c_char, - ) -> *mut PGresult; -} -extern "C" { - pub fn PQdescribePortal( - conn: *mut PGconn, - portal: *const ::std::os::raw::c_char, - ) -> *mut PGresult; -} -extern "C" { - pub fn PQsendDescribePrepared( - conn: *mut PGconn, - stmt: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQsendDescribePortal( - conn: *mut PGconn, - portal: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQclear(res: *mut PGresult); -} -extern "C" { - pub fn PQfreemem(ptr: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn PQmakeEmptyPGresult(conn: *mut PGconn, status: ExecStatusType) -> *mut PGresult; -} -extern "C" { - pub fn PQcopyResult(src: *const PGresult, flags: ::std::os::raw::c_int) -> *mut PGresult; -} -extern "C" { - pub fn PQsetResultAttrs( - res: *mut PGresult, - numAttributes: ::std::os::raw::c_int, - attDescs: *mut PGresAttDesc, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQresultAlloc(res: *mut PGresult, nBytes: usize) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn PQresultMemorySize(res: *const PGresult) -> usize; -} -extern "C" { - pub fn PQsetvalue( - res: *mut PGresult, - tup_num: ::std::os::raw::c_int, - field_num: ::std::os::raw::c_int, - value: *mut ::std::os::raw::c_char, - len: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQescapeStringConn( - conn: *mut PGconn, - to: *mut ::std::os::raw::c_char, - from: *const ::std::os::raw::c_char, - length: usize, - error: *mut ::std::os::raw::c_int, - ) -> usize; -} -extern "C" { - pub fn PQescapeLiteral( - conn: *mut PGconn, - str_: *const ::std::os::raw::c_char, - len: usize, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQescapeIdentifier( - conn: *mut PGconn, - str_: *const ::std::os::raw::c_char, - len: usize, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQescapeByteaConn( - conn: *mut PGconn, - from: *const ::std::os::raw::c_uchar, - from_length: usize, - to_length: *mut usize, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn PQunescapeBytea( - strtext: *const ::std::os::raw::c_uchar, - retbuflen: *mut usize, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn PQescapeString( - to: *mut ::std::os::raw::c_char, - from: *const ::std::os::raw::c_char, - length: usize, - ) -> usize; -} -extern "C" { - pub fn PQescapeBytea( - from: *const ::std::os::raw::c_uchar, - from_length: usize, - to_length: *mut usize, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn PQprint(fout: *mut FILE, res: *const PGresult, po: *const PQprintOpt); -} -extern "C" { - pub fn PQdisplayTuples( - res: *const PGresult, - fp: *mut FILE, - fillAlign: ::std::os::raw::c_int, - fieldSep: *const ::std::os::raw::c_char, - printHeader: ::std::os::raw::c_int, - quiet: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn PQprintTuples( - res: *const PGresult, - fout: *mut FILE, - PrintAttNames: ::std::os::raw::c_int, - TerseOutput: ::std::os::raw::c_int, - colWidth: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn lo_open( - conn: *mut PGconn, - lobjId: Oid, - mode: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lo_close(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lo_read( - conn: *mut PGconn, - fd: ::std::os::raw::c_int, - buf: *mut ::std::os::raw::c_char, - len: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lo_write( - conn: *mut PGconn, - fd: ::std::os::raw::c_int, - buf: *const ::std::os::raw::c_char, - len: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lo_lseek( - conn: *mut PGconn, - fd: ::std::os::raw::c_int, - offset: ::std::os::raw::c_int, - whence: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lo_lseek64( - conn: *mut PGconn, - fd: ::std::os::raw::c_int, - offset: pg_int64, - whence: ::std::os::raw::c_int, - ) -> pg_int64; -} -extern "C" { - pub fn lo_creat(conn: *mut PGconn, mode: ::std::os::raw::c_int) -> Oid; -} -extern "C" { - pub fn lo_create(conn: *mut PGconn, lobjId: Oid) -> Oid; -} -extern "C" { - pub fn lo_tell(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lo_tell64(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> pg_int64; -} -extern "C" { - pub fn lo_truncate( - conn: *mut PGconn, - fd: ::std::os::raw::c_int, - len: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lo_truncate64( - conn: *mut PGconn, - fd: ::std::os::raw::c_int, - len: pg_int64, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lo_unlink(conn: *mut PGconn, lobjId: Oid) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lo_import(conn: *mut PGconn, filename: *const ::std::os::raw::c_char) -> Oid; -} -extern "C" { - pub fn lo_import_with_oid( - conn: *mut PGconn, - filename: *const ::std::os::raw::c_char, - lobjId: Oid, - ) -> Oid; -} -extern "C" { - pub fn lo_export( - conn: *mut PGconn, - lobjId: Oid, - filename: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQlibVersion() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQmblen( - s: *const ::std::os::raw::c_char, - encoding: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQmblenBounded( - s: *const ::std::os::raw::c_char, - encoding: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQdsplen( - s: *const ::std::os::raw::c_char, - encoding: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQenv2encoding() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn PQencryptPassword( - passwd: *const ::std::os::raw::c_char, - user: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn PQencryptPasswordConn( - conn: *mut PGconn, - passwd: *const ::std::os::raw::c_char, - user: *const ::std::os::raw::c_char, - algorithm: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn pg_char_to_encoding(name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pg_encoding_to_char(encoding: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn pg_valid_server_encoding_id(encoding: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -pub type PQsslKeyPassHook_OpenSSL_type = ::std::option::Option< - unsafe extern "C" fn( - buf: *mut ::std::os::raw::c_char, - size: ::std::os::raw::c_int, - conn: *mut PGconn, - ) -> ::std::os::raw::c_int, ->; -extern "C" { - pub fn PQgetSSLKeyPassHook_OpenSSL() -> PQsslKeyPassHook_OpenSSL_type; -} -extern "C" { - pub fn PQsetSSLKeyPassHook_OpenSSL(hook: PQsslKeyPassHook_OpenSSL_type); -} -extern "C" { - pub fn PQdefaultSSLKeyPassHook_OpenSSL( - buf: *mut ::std::os::raw::c_char, - size: ::std::os::raw::c_int, - conn: *mut PGconn, - ) -> ::std::os::raw::c_int; -} -pub type __builtin_va_list = *mut ::std::os::raw::c_char; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct lconv { - pub _address: u8, -}