pq-sys-0.4.8/.cargo_vcs_info.json0000644000000001360000000000100123010ustar { "git": { "sha1": "c683ce6511e2e89e0628ac29fc5ee7cc4333bd3e" }, "path_in_vcs": "" }pq-sys-0.4.8/.gitignore000064400000000000000000000000221046102023000130530ustar 00000000000000target Cargo.lock pq-sys-0.4.8/.travis.yml000064400000000000000000000002101046102023000131730ustar 00000000000000language: rust rust: - stable - beta - nightly sudo: false script: - rustc -V - cargo -V - cargo test os: - linux - osx pq-sys-0.4.8/CHANGELOG.md000064400000000000000000000054471046102023000127140ustar 00000000000000# Change Log All user visible changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/), as described for Rust libraries in [RFC #1105](https://github.com/rust-lang/rfcs/blob/master/text/1105-api-evolution.md) ## [0.4.8] 2023-04-18 ## Fixed - Added `wldap` as dependency for the vcpk installation on windows as that's now required there ## [0.4.5] 2018-05-09 ### Added - Linking can now be dynamically handled per-target by specifying the `TARGET` environment variable and `PQ_LIB_STATIC_$TARGET` environment variable. - The path to `pg_config` can now be dynamically handled per-target by specifying the `TARGET` environment variable and `PG_CONFIG_$TARGET` environment variable. ## [0.4.3] 2017-03-10 ### Fixed - Linking on the msvc toolchain will no longer attempt to statically link ## [0.4.2] 2017-02-19 ### Fixed - Improved linking on Windows, particularly with the msvc toolchain. ## [0.4.1] 2017-02-19 ### Fixed - Properly specified the build script ## [0.4.0] 2017-02-19 [YANKED] ### Changed - Bindings are no longer generated at compile time. Requiring clang 3.9 caused too many issues for too many users, and requiring `syntex_syntax` increased compile time too much. ## [0.3.2] 2017-02-16 ### Fixed - Fixed an issue when building on mac against postgres from homebrew ## [0.3.1] 2017-02-16 ### Fixed - Fixed an issue when building on mac against postgres from homebrew - Fixed an issue with locating header files on linux ## [0.3.0] 2017-02-16 ### Changed - Bindings are now generated when the library is built, rather than being vendored ahead of time. - `libc` is no longer used. Anywhere that `libc::some_type` was expected, `std::os::raw::some_type` is now used instead. - The build script will no longer attempt to canonicalize symlinks on MacOS. ## [0.2.7] 2016-12-10 ### Changed - `pkg-config` is disabled by default. It can be enabled by adding `features = ["pkg-config"]` to your `Cargo.toml`. ## [0.2.6] 2016-12-10 ### Added - We will attempt to use `pkg-config` to locate libpq before falling back to `pg_config`. ## [0.2.5] 2016-12-10 - No changes. Accidental release on the wrong commit. ## [0.2.4] 2016-11-22 ### Added - `pq` will be statically linked if the environment variable `PQ_LIB_STATIC` is set. ## [0.2.3] 2016-08-12 ### Changed - On Mac if `pg_config` points to a directory where `libpq.dylib` is a symlink, we will now attempt to find the canonical directory to link against. This means that for installations using homebrew, `/usr/local/Cellar/postgresql/version/lib` will be added to `DYLD_LIBRARY_PATH` instead of `/usr/local/lib` ## [0.2.2] 2016-07-30 ### Added - The directory containing libpq for linking can now be specified via the `PQ_LIB_DIR` environment variable. pq-sys-0.4.8/Cargo.toml0000644000000015440000000000100103030ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] name = "pq-sys" version = "0.4.8" build = "build.rs" links = "pq" description = "Auto-generated rust bindings for libpq" readme = "README.md" license = "MIT OR Apache-2.0" repository = "https://github.com/sgrif/pq-sys" [lib] name = "pq_sys" [build-dependencies.pkg-config] version = "0.3.0" optional = true [target."cfg(target_env = \"msvc\")".build-dependencies.vcpkg] version = "0.2.6" pq-sys-0.4.8/Cargo.toml.orig000064400000000000000000000005711046102023000137630ustar 00000000000000[package] name = "pq-sys" version = "0.4.8" description = "Auto-generated rust bindings for libpq" license = "MIT OR Apache-2.0" repository = "https://github.com/sgrif/pq-sys" links = "pq" build = "build.rs" [lib] name = "pq_sys" [build-dependencies] pkg-config = { version = "0.3.0", optional = true } [target.'cfg(target_env = "msvc")'.build-dependencies] vcpkg = "0.2.6" pq-sys-0.4.8/LICENSE-APACHE000064400000000000000000000250121046102023000130150ustar 00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS Copyright 2015-2017 Sean Griffin Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. pq-sys-0.4.8/LICENSE-MIT000064400000000000000000000020741046102023000125300ustar 00000000000000The MIT License (MIT) Copyright (c) 2015-2017 Sean Griffin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. pq-sys-0.4.8/README.md000064400000000000000000000057021046102023000123540ustar 00000000000000pq-sys ====== Autogenerated Rust bindings for libpq Building -------- This repository contains direct, one-to-one mappings to the C functions provided in `libpq-fe.h` and `postgres_ext.h`. This library expects that libpq be installed on the system. The build script of crate will attempt to find the lib path of libpq using the following methods: * First it will look for an environment variable in the format of `PQ_LIB_DIR_{TARGET}` where `{TARGET}` gets replaced by the Target environment variable set for cross-compilation * Second, if the environment variable `PQ_LIB_DIR` is set, it will use its value * If the environment variable isn't set, it tries to use pkg-config to locate it. All the config options, such as `PKG_CONFIG_ALLOW_CROSS`, `PKG_CONFIG_ALL_STATIC` etc., of the crate [pkg-config](https://docs.rs/pkg-config/) apply. * Then, for MSVC ABI builds the build script will attempt use the library from a [vcpkg](https://github.com/Microsoft/vcpkg) installation if there is one available. You may need to set VCPKG_ROOT (or run `vcpkg integrate install`), set VCPKGRS_DYNAMIC=1, and run `vcpkg install libpq:x64-windows`. See the documentation for the [vcpkg](https://docs.rs/vcpkg/) crate for more. * If it still can't locate the library, it will invoke the Postgres command `pg_config --libdir` The build script instructs Cargo to link the library statically if the environmental variable `PQ_LIB_STATIC` is set. This can be useful, if targeting for a musl target. If pkg-config is being used, it's configuration options will apply. ## FAQ ### I'm seeing `dyld: Symbol not found __cg_jpeg_resync_to_restart` on macOS This is caused when the output of `pg_config --libdir` is a directory that also contains `libjpeg.dylib` which differs from the system libjpeg. This is usually caused by install postgres via homebrew, or using postgresapp.com. If you've installed via homebrew, you should not see this issue unless you've provided `features = ["pkg-config"]`. You can work around the issue by exporting `PQ_LIB_DIR="$(brew --prefix postgres)/lib"`. If you've installed postgresql using postgresapp.com, you will not be able to run your binaries using `cargo run` or `cargo test`. You can compile the binary manually via `cargo build` and then run `/target/debug/yourapp`. You can also manually create a directory that contains only a symlink to `libpq.dylib` and nothing else, then export `PQ_LIB_DIR` to that directory. It is recommended that you do not use postgresapp.com. ## License Licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. pq-sys-0.4.8/appveyor.yml000064400000000000000000000017301046102023000134620ustar 00000000000000environment: matrix: - TARGET: x86_64-pc-windows-msvc VCPKG_DEFAULT_TRIPLET: x64-windows-static RUSTFLAGS: -Ctarget-feature=+crt-static - TARGET: x86_64-pc-windows-msvc VCPKGRS_DYNAMIC: 1 VCPKG_DEFAULT_TRIPLET: x64-windows install: - ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe" - rust-nightly-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust" - set PATH=%PATH%;C:\Program Files (x86)\Rust\bin - if defined MSYS_BITS set PATH=%PATH%;C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin - rustc -V - cargo -V - if defined VCPKG_DEFAULT_TRIPLET git clone https://github.com/Microsoft/vcpkg c:\projects\vcpkg - if defined VCPKG_DEFAULT_TRIPLET c:\projects\vcpkg\bootstrap-vcpkg.bat - if defined VCPKG_DEFAULT_TRIPLET set VCPKG_ROOT=c:\projects\vcpkg - if defined VCPKG_DEFAULT_TRIPLET %VCPKG_ROOT%\vcpkg.exe install libpq build: false test_script: - cargo test --target %TARGET% pq-sys-0.4.8/build.rs000064400000000000000000000136141046102023000125430ustar 00000000000000#[cfg(feature="pkg-config")] extern crate pkg_config; #[cfg(target_env = "msvc")] extern crate vcpkg; use std::process::Command; use std::env; use std::path::PathBuf; use std::fmt::{self, Display}; enum LinkType { Static, Dynamic } impl Display for LinkType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { LinkType::Static => write!(f, "static"), LinkType::Dynamic => write!(f, "dylib"), } } } struct LinkingOptions { linking_type: Option, lib_name: &'static str, } impl LinkingOptions { fn from_name_and_type(lib_name: &'static str, tpe: LinkType) -> Self { LinkingOptions { linking_type: Some(tpe), lib_name } } fn from_name(lib_name: &'static str) -> Self { LinkingOptions { linking_type: None, lib_name } } fn from_env() -> Self { // On Windows-MSVC, always link dynamically if cfg!(all(windows, target_env="msvc")) { return LinkingOptions::from_name_and_type("libpq", LinkType::Dynamic); } // Link unconditionally statically if env::var_os("PQ_LIB_STATIC").is_some() { return LinkingOptions::from_name_and_type("pq", LinkType::Static); } // Examine the per-target env vars if let Ok(target) = env::var("TARGET") { let pg_config_for_target = format!("PQ_LIB_STATIC_{}", target.to_ascii_uppercase().replace("-", "_")); println!("cargo:rerun-if-env-changed={}", pg_config_for_target); if env::var_os(&pg_config_for_target).is_some() { return LinkingOptions::from_name_and_type("pq", LinkType::Static); } } // Otherwise, don't specify LinkingOptions::from_name("pq") } } impl Display for LinkingOptions { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if let Some(ref t) = self.linking_type { write!(f, "{}=", t)?; } write!(f, "{}", self.lib_name) } } fn main() { println!("cargo:rerun-if-env-changed=PQ_LIB_STATIC"); println!("cargo:rerun-if-env-changed=TARGET"); // if target is specified the more concrete pq_lib_dir overwrites a more general one let lib_dir = if let Ok(target) = env::var("TARGET") { let pq_lib_dir_for_target = format!("PQ_LIB_DIR_{}", target.to_ascii_uppercase().replace("-", "_")); check_and_use_lib_dir(&pq_lib_dir_for_target).or_else(|_| check_and_use_lib_dir("PQ_LIB_DIR")) } else{ check_and_use_lib_dir("PQ_LIB_DIR") }; if let Ok(lib_dir) = lib_dir { println!("cargo:rustc-link-search=native={}", lib_dir); } else if configured_by_pkg_config() { return // pkg_config does everything for us, including output for cargo } else if configured_by_vcpkg() { return // vcpkg does everything for us, including output for cargo } else if let Some(path) = pg_config_output("--libdir") { let path = replace_homebrew_path_on_mac(path); println!("cargo:rustc-link-search=native={}", path); } println!("cargo:rustc-link-lib={}", LinkingOptions::from_env()); } #[cfg(feature = "pkg-config")] fn configured_by_pkg_config() -> bool { pkg_config::probe_library("libpq").is_ok() } #[cfg(not(feature = "pkg-config"))] fn configured_by_pkg_config() -> bool { false } #[cfg(target_env = "msvc")] fn configured_by_vcpkg() -> bool { vcpkg::find_package("libpq").map(|_| { println!("cargo:rustc-link-lib=crypt32"); println!("cargo:rustc-link-lib=gdi32"); println!("cargo:rustc-link-lib=user32"); println!("cargo:rustc-link-lib=secur32"); println!("cargo:rustc-link-lib=shell32"); println!("cargo:rustc-link-lib=wldap32"); }).is_ok() } #[cfg(not(target_env = "msvc"))] fn configured_by_vcpkg() -> bool { false } fn check_and_use_lib_dir(var_name: &str) -> Result{ println!("cargo:rerun-if-env-changed={:?}", var_name); println!("{:?} = {:?}", var_name , env::var(var_name)); let pq_lib_dir = env::var(var_name); if let Ok(pg_lib_path) = pq_lib_dir.clone() { let path = PathBuf::from(&pg_lib_path); if !path.exists() { panic!("Folder {:?} doesn't exist in the configured path: {:?}", var_name, path); } } pq_lib_dir } fn pg_config_path() -> PathBuf { if let Ok(target) = env::var("TARGET") { let pg_config_for_target = &format!("PG_CONFIG_{}", target.to_ascii_uppercase().replace("-", "_")); println!("cargo:rerun-if-env-changed={}", pg_config_for_target); if let Some(pg_config_path) = env::var_os(pg_config_for_target) { let path = PathBuf::from(&pg_config_path); if !path.exists() { panic!("pg_config doesn't exist in the configured path: {:?}", path); } return path; } } PathBuf::from("pg_config") } fn pg_config_output(command: &str) -> Option { Command::new(pg_config_path()) .arg(command) .output() .ok() .into_iter() .filter(|output| output.status.success()) .flat_map(|output| String::from_utf8(output.stdout).ok()) .map(|output| output.trim().to_string()) .next() } #[cfg(not(target_os = "macos"))] fn replace_homebrew_path_on_mac(path: String) -> String { path } #[cfg(target_os = "macos")] fn replace_homebrew_path_on_mac(path: String) -> String { if path == "/usr/local/lib" { Command::new("brew") .arg("--prefix") .arg("postgres") .output() .ok() .into_iter() .filter(|output| output.status.success()) .flat_map(|output| String::from_utf8(output.stdout).ok()) .map(|output| format!("{}/lib", output.trim())) .next() .unwrap_or(path) } else { path } } pq-sys-0.4.8/src/lib.rs000064400000000000000000000766271046102023000130160ustar 00000000000000#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)] /* automatically generated by rust-bindgen */ #[repr(C)] pub struct __BindgenUnionField(::std::marker::PhantomData); impl __BindgenUnionField { #[inline] pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) } #[inline] pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) } #[inline] pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) } } impl ::std::default::Default for __BindgenUnionField { #[inline] fn default() -> Self { Self::new() } } impl ::std::clone::Clone for __BindgenUnionField { #[inline] fn clone(&self) -> Self { Self::new() } } impl ::std::marker::Copy for __BindgenUnionField { } impl ::std::fmt::Debug for __BindgenUnionField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { fmt.write_str("__BindgenUnionField") } } pub type __int64_t = ::std::os::raw::c_longlong; pub type __darwin_size_t = ::std::os::raw::c_ulong; pub type __darwin_off_t = __int64_t; pub type fpos_t = __darwin_off_t; #[repr(C)] #[derive(Debug, Copy)] pub struct __sbuf { pub _base: *mut ::std::os::raw::c_uchar, pub _size: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout___sbuf() { assert_eq!(::std::mem::size_of::<__sbuf>() , 16usize); assert_eq!(::std::mem::align_of::<__sbuf>() , 8usize); } impl Clone for __sbuf { fn clone(&self) -> Self { *self } } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sFILEX([u8; 0]); #[repr(C)] #[derive(Debug, Copy)] pub struct __sFILE { pub _p: *mut ::std::os::raw::c_uchar, pub _r: ::std::os::raw::c_int, pub _w: ::std::os::raw::c_int, pub _flags: ::std::os::raw::c_short, pub _file: ::std::os::raw::c_short, pub _bf: __sbuf, pub _lbfsize: ::std::os::raw::c_int, pub _cookie: *mut ::std::os::raw::c_void, pub _close: ::std::option::Option ::std::os::raw::c_int>, pub _read: ::std::option::Option ::std::os::raw::c_int>, pub _seek: ::std::option::Option ::std::os::raw::c_longlong>, pub _write: ::std::option::Option ::std::os::raw::c_int>, pub _ub: __sbuf, pub _extra: *mut __sFILEX, pub _ur: ::std::os::raw::c_int, pub _ubuf: [::std::os::raw::c_uchar; 3usize], pub _nbuf: [::std::os::raw::c_uchar; 1usize], pub _lb: __sbuf, pub _blksize: ::std::os::raw::c_int, pub _offset: fpos_t, } #[test] fn bindgen_test_layout___sFILE() { assert_eq!(::std::mem::size_of::<__sFILE>() , 152usize); assert_eq!(::std::mem::align_of::<__sFILE>() , 8usize); } impl Clone for __sFILE { fn clone(&self) -> Self { *self } } pub type FILE = __sFILE; pub type Oid = ::std::os::raw::c_uint; pub const CONNECTION_OK: _bindgen_ty_2 = _bindgen_ty_2::CONNECTION_OK; pub const CONNECTION_BAD: _bindgen_ty_2 = _bindgen_ty_2::CONNECTION_BAD; pub const CONNECTION_STARTED: _bindgen_ty_2 = _bindgen_ty_2::CONNECTION_STARTED; pub const CONNECTION_MADE: _bindgen_ty_2 = _bindgen_ty_2::CONNECTION_MADE; pub const CONNECTION_AWAITING_RESPONSE: _bindgen_ty_2 = _bindgen_ty_2::CONNECTION_AWAITING_RESPONSE; pub const CONNECTION_AUTH_OK: _bindgen_ty_2 = _bindgen_ty_2::CONNECTION_AUTH_OK; pub const CONNECTION_SETENV: _bindgen_ty_2 = _bindgen_ty_2::CONNECTION_SETENV; pub const CONNECTION_SSL_STARTUP: _bindgen_ty_2 = _bindgen_ty_2::CONNECTION_SSL_STARTUP; pub const CONNECTION_NEEDED: _bindgen_ty_2 = _bindgen_ty_2::CONNECTION_NEEDED; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_2 { 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, } pub use self::_bindgen_ty_2 as ConnStatusType; pub const PGRES_POLLING_FAILED: _bindgen_ty_3 = _bindgen_ty_3::PGRES_POLLING_FAILED; pub const PGRES_POLLING_READING: _bindgen_ty_3 = _bindgen_ty_3::PGRES_POLLING_READING; pub const PGRES_POLLING_WRITING: _bindgen_ty_3 = _bindgen_ty_3::PGRES_POLLING_WRITING; pub const PGRES_POLLING_OK: _bindgen_ty_3 = _bindgen_ty_3::PGRES_POLLING_OK; pub const PGRES_POLLING_ACTIVE: _bindgen_ty_3 = _bindgen_ty_3::PGRES_POLLING_ACTIVE; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_3 { PGRES_POLLING_FAILED = 0, PGRES_POLLING_READING = 1, PGRES_POLLING_WRITING = 2, PGRES_POLLING_OK = 3, PGRES_POLLING_ACTIVE = 4, } pub use self::_bindgen_ty_3 as PostgresPollingStatusType; pub const PGRES_EMPTY_QUERY: _bindgen_ty_4 = _bindgen_ty_4::PGRES_EMPTY_QUERY; pub const PGRES_COMMAND_OK: _bindgen_ty_4 = _bindgen_ty_4::PGRES_COMMAND_OK; pub const PGRES_TUPLES_OK: _bindgen_ty_4 = _bindgen_ty_4::PGRES_TUPLES_OK; pub const PGRES_COPY_OUT: _bindgen_ty_4 = _bindgen_ty_4::PGRES_COPY_OUT; pub const PGRES_COPY_IN: _bindgen_ty_4 = _bindgen_ty_4::PGRES_COPY_IN; pub const PGRES_BAD_RESPONSE: _bindgen_ty_4 = _bindgen_ty_4::PGRES_BAD_RESPONSE; pub const PGRES_NONFATAL_ERROR: _bindgen_ty_4 = _bindgen_ty_4::PGRES_NONFATAL_ERROR; pub const PGRES_FATAL_ERROR: _bindgen_ty_4 = _bindgen_ty_4::PGRES_FATAL_ERROR; pub const PGRES_COPY_BOTH: _bindgen_ty_4 = _bindgen_ty_4::PGRES_COPY_BOTH; pub const PGRES_SINGLE_TUPLE: _bindgen_ty_4 = _bindgen_ty_4::PGRES_SINGLE_TUPLE; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_4 { 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, } pub use self::_bindgen_ty_4 as ExecStatusType; pub const PQTRANS_IDLE: _bindgen_ty_5 = _bindgen_ty_5::PQTRANS_IDLE; pub const PQTRANS_ACTIVE: _bindgen_ty_5 = _bindgen_ty_5::PQTRANS_ACTIVE; pub const PQTRANS_INTRANS: _bindgen_ty_5 = _bindgen_ty_5::PQTRANS_INTRANS; pub const PQTRANS_INERROR: _bindgen_ty_5 = _bindgen_ty_5::PQTRANS_INERROR; pub const PQTRANS_UNKNOWN: _bindgen_ty_5 = _bindgen_ty_5::PQTRANS_UNKNOWN; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_5 { PQTRANS_IDLE = 0, PQTRANS_ACTIVE = 1, PQTRANS_INTRANS = 2, PQTRANS_INERROR = 3, PQTRANS_UNKNOWN = 4, } pub use self::_bindgen_ty_5 as PGTransactionStatusType; pub const PQERRORS_TERSE: _bindgen_ty_6 = _bindgen_ty_6::PQERRORS_TERSE; pub const PQERRORS_DEFAULT: _bindgen_ty_6 = _bindgen_ty_6::PQERRORS_DEFAULT; pub const PQERRORS_VERBOSE: _bindgen_ty_6 = _bindgen_ty_6::PQERRORS_VERBOSE; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_6 { PQERRORS_TERSE = 0, PQERRORS_DEFAULT = 1, PQERRORS_VERBOSE = 2, } pub use self::_bindgen_ty_6 as PGVerbosity; pub const PQPING_OK: _bindgen_ty_7 = _bindgen_ty_7::PQPING_OK; pub const PQPING_REJECT: _bindgen_ty_7 = _bindgen_ty_7::PQPING_REJECT; pub const PQPING_NO_RESPONSE: _bindgen_ty_7 = _bindgen_ty_7::PQPING_NO_RESPONSE; pub const PQPING_NO_ATTEMPT: _bindgen_ty_7 = _bindgen_ty_7::PQPING_NO_ATTEMPT; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_7 { PQPING_OK = 0, PQPING_REJECT = 1, PQPING_NO_RESPONSE = 2, PQPING_NO_ATTEMPT = 3, } pub use self::_bindgen_ty_7 as PGPing; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct pg_conn([u8; 0]); pub type PGconn = pg_conn; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct pg_result([u8; 0]); pub type PGresult = pg_result; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct pg_cancel([u8; 0]); pub type PGcancel = pg_cancel; #[repr(C)] #[derive(Debug, Copy)] 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() { assert_eq!(::std::mem::size_of::() , 32usize); assert_eq!(::std::mem::align_of::() , 8usize); } impl Clone for pgNotify { fn clone(&self) -> Self { *self } } pub type PGnotify = pgNotify; pub type PQnoticeReceiver = ::std::option::Option; pub type PQnoticeProcessor = ::std::option::Option; pub type pqbool = ::std::os::raw::c_char; #[repr(C)] #[derive(Debug, Copy)] 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() { assert_eq!(::std::mem::size_of::<_PQprintOpt>() , 40usize); assert_eq!(::std::mem::align_of::<_PQprintOpt>() , 8usize); } impl Clone for _PQprintOpt { fn clone(&self) -> Self { *self } } pub type PQprintOpt = _PQprintOpt; #[repr(C)] #[derive(Debug, Copy)] 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() { assert_eq!(::std::mem::size_of::<_PQconninfoOption>() , 56usize); assert_eq!(::std::mem::align_of::<_PQconninfoOption>() , 8usize); } impl Clone for _PQconninfoOption { fn clone(&self) -> Self { *self } } pub type PQconninfoOption = _PQconninfoOption; #[repr(C)] #[derive(Debug, Copy)] pub struct _bindgen_ty_8 { pub len: ::std::os::raw::c_int, pub isint: ::std::os::raw::c_int, pub u: _bindgen_ty_8__bindgen_ty_1, } #[repr(C)] #[derive(Debug, Copy)] pub struct _bindgen_ty_8__bindgen_ty_1 { pub ptr: __BindgenUnionField<*mut ::std::os::raw::c_int>, pub integer: __BindgenUnionField<::std::os::raw::c_int>, pub bindgen_union_field: u64, } #[test] fn bindgen_test_layout__bindgen_ty_8__bindgen_ty_1() { assert_eq!(::std::mem::size_of::<_bindgen_ty_8__bindgen_ty_1>() , 8usize); assert_eq!(::std::mem::align_of::<_bindgen_ty_8__bindgen_ty_1>() , 8usize); } impl Clone for _bindgen_ty_8__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__bindgen_ty_8() { assert_eq!(::std::mem::size_of::<_bindgen_ty_8>() , 16usize); assert_eq!(::std::mem::align_of::<_bindgen_ty_8>() , 8usize); } impl Clone for _bindgen_ty_8 { fn clone(&self) -> Self { *self } } pub type PQArgBlock = _bindgen_ty_8; #[repr(C)] #[derive(Debug, Copy)] 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() { assert_eq!(::std::mem::size_of::() , 32usize); assert_eq!(::std::mem::align_of::() , 8usize); } impl Clone for pgresAttDesc { fn clone(&self) -> Self { *self } } 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 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 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 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 PQsetErrorVerbosity(conn: *mut PGconn, verbosity: PGVerbosity) -> PGVerbosity; } extern "C" { pub fn PQtrace(conn: *mut PGconn, debug_port: *mut FILE); } extern "C" { pub fn PQuntrace(conn: *mut PGconn); } 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 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 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, string: *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 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 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, ps: *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, printAttName: ::std::os::raw::c_int, terseOutput: ::std::os::raw::c_int, width: ::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 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; } pq-sys-0.4.8/tests/smoke.rs000064400000000000000000000001261046102023000137160ustar 00000000000000extern crate pq_sys; #[test] fn test_ssl_init() { unsafe{pq_sys::PQinitSSL(1);} }