pq-sys-0.7.5/.cargo_vcs_info.json0000644000000001360000000000100123010ustar { "git": { "sha1": "5a86afc74207e3397d2c9a67fd36464f58974f0c" }, "path_in_vcs": "" }pq-sys-0.7.5/Cargo.lock0000644000000257570000000000100102740ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 4 [[package]] name = "aho-corasick" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "bindgen" version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f72209734318d0b619a5e0f5129918b848c416e122a3c4ce054e03cb87b726f" dependencies = [ "bitflags", "cexpr", "clang-sys", "itertools", "log", "prettyplease", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", "syn", ] [[package]] name = "bitflags" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bstr" version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" dependencies = [ "memchr", "regex-automata", "serde", ] [[package]] name = "cc" version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" dependencies = [ "shlex", ] [[package]] name = "cexpr" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ "nom", ] [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clang-sys" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", "libloading", ] [[package]] name = "console" version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" dependencies = [ "encode_unicode", "libc", "once_cell", "windows-sys", ] [[package]] name = "either" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encode_unicode" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "glob" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "itertools" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "libc" version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libloading" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", "windows-targets", ] [[package]] name = "log" version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "minimal-lexical" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "nom" version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", ] [[package]] name = "once_cell" version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl-sys" version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", "pkg-config", "vcpkg", ] [[package]] name = "pkg-config" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "pq-src" version = "0.3.10+libpq-18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ef39ce621f4993d6084fdcd4cbf1e01c84bdba53109cfad095d2cf441b85b9" dependencies = [ "cc", "openssl-sys", ] [[package]] name = "pq-sys" version = "0.7.5" dependencies = [ "bindgen", "libc", "pkg-config", "pq-src", "similar-asserts", "vcpkg", ] [[package]] name = "prettyplease" version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "483f8c21f64f3ea09fe0f30f5d48c3e8eefe5dac9129f0075f76593b4c1da705" dependencies = [ "proc-macro2", "syn", ] [[package]] name = "proc-macro2" version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] [[package]] name = "regex" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", "regex-automata", "regex-syntax", ] [[package]] name = "regex-automata" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustc-hash" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "serde" version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "similar" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" dependencies = [ "bstr", "unicode-segmentation", ] [[package]] name = "similar-asserts" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe85670573cd6f0fa97940f26e7e6601213c3b0555246c24234131f88c5709e" dependencies = [ "console", "similar", ] [[package]] name = "syn" version = "2.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "unicode-ident" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-segmentation" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "vcpkg" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "windows-sys" version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", "windows_x86_64_msvc", ] [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" pq-sys-0.7.5/Cargo.toml0000644000000033170000000000100103030ustar # 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] edition = "2021" rust-version = "1.82.0" name = "pq-sys" version = "0.7.5" build = "build.rs" links = "pq" include = [ "README.md", "LICENSE-MIT", "LICENSE-APACHE", "src/**/*.rs", "build.rs", "bindings/**/*.rs", "wrapper.h", ] autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "Auto-generated rust bindings for libpq" readme = "README.md" license = "MIT OR Apache-2.0" repository = "https://github.com/sgrif/pq-sys" [features] buildtime_bindgen = ["dep:bindgen"] bundled = [ "bundled_without_openssl", "pq-src/with-openssl", ] bundled_without_openssl = ["dep:pq-src"] default = ["pkg-config"] [lib] name = "pq_sys" path = "src/lib.rs" [dependencies.libc] version = "0.2.100" [dependencies.pq-src] version = ">=0.2, <0.4" optional = true default-features = false [dev-dependencies.bindgen] version = "0.72.0" [dev-dependencies.similar-asserts] version = "1.6.0" [build-dependencies.bindgen] version = "0.72.0" optional = true [build-dependencies.pkg-config] version = "0.3.0" optional = true [target.'cfg(target_env = "msvc")'.build-dependencies.vcpkg] version = "0.2.6" [lints.rust.unexpected_cfgs] level = "warn" priority = 0 check-cfg = ["cfg(buildscript_run)"] pq-sys-0.7.5/Cargo.toml.orig000064400000000000000000000020671046102023000137650ustar 00000000000000[package] name = "pq-sys" version = "0.7.5" 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" edition = "2021" rust-version = "1.82.0" include = ["README.md", "LICENSE-MIT", "LICENSE-APACHE", "src/**/*.rs", "build.rs", "bindings/**/*.rs", "wrapper.h"] [workspace] members = ["pq-src"] [lib] 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.72.0", optional = true } [target.'cfg(target_env = "msvc")'.build-dependencies] vcpkg = "0.2.6" [dev-dependencies] similar-asserts = "1.6.0" bindgen = "0.72.0" [features] default = ["pkg-config"] bundled = ["bundled_without_openssl", "pq-src/with-openssl"] bundled_without_openssl = ["dep:pq-src"] buildtime_bindgen = ["dep:bindgen"] [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(buildscript_run)'] } pq-sys-0.7.5/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.7.5/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.7.5/README.md000064400000000000000000000073101046102023000123510ustar 00000000000000pq-sys ====== Autogenerated Rust bindings for libpq [https://docs.rs/pq-sys/latest/pq_sys/](https://docs.rs/pq-sys/latest/pq_sys/) 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. ### Features * `buildtime_bindgen`: Run `bindgen` at build-time to generate bindings using installed headers. Not compatible with the `bundled` feature. * `bundled`: Build the bundled version of `libpq` from source. It will look for `openssl` installed on your system. To use a bundled version of `openssl`, add the `openssl-sys` crate with the vendored feature to your crate dependencies: ```toml [dependencies] openssl-sys = { version = "0.9.93", features = ["vendored"] } ``` * `bundled_without_openssl`: Build the bundled version of `libpq` from source without `openssl`. This disables the TLS support in `libpq`, so that you cannot connect to a database requiring TLS anymore. ## 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.7.5/build.rs000064400000000000000000000203671046102023000125460ustar 00000000000000#[cfg(feature = "pkg-config")] extern crate pkg_config; #[cfg(target_env = "msvc")] extern crate vcpkg; use std::env; use std::fmt::{self, Display}; use std::path::PathBuf; use std::process::Command; 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::rustc-cfg=buildscript_run"); if (cfg!(feature = "bundled") || cfg!(feature = "bundled_without_openssl")) && cfg!(feature = "buildtime_bindgen") { panic!("Combining the `bundled` and `builtime_bindgen` feature is not supported"); } let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("bindings.rs"); #[cfg(feature = "buildtime_bindgen")] { let bindings = include!("src/make_bindings.rs") .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) .generate() .expect("Unable to generate bindings"); bindings .write_to_file(out_path) .expect("Couldn't write bindings!"); } #[cfg(not(feature = "buildtime_bindgen"))] { let target_env = std::env::var("CARGO_CFG_TARGET_ENV").expect("Set by cargo"); let target_ptr_size = std::env::var("CARGO_CFG_TARGET_POINTER_WIDTH").expect("Set by cargo"); let bindings_name = match (target_env.as_str(), target_ptr_size.as_str()) { ("msvc", "32") => "src/bindings_windows_32.rs", ("msvc", "64") => "src/bindings_windows.rs", (_, "32") => "src/bindings_linux_32.rs", (_, "64") => "src/bindings_linux.rs", (target_env, ptr_width) => { panic!("Unsupported target: TargetEnv: `{target_env}`, PtrWidth: `{ptr_width}`\n\ If you use this target open an issue at https://github.com/sgrif/pq-sys/issues/new\ outlining the details of this target"); } }; let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").expect("Set by cargo"); let source_path = PathBuf::from(manifest_dir).join(bindings_name); std::fs::copy(source_path, out_path).expect("Couldn't write bindings"); } if cfg!(feature = "bundled") || cfg!(feature = "bundled_without_openssl") { // everything else is handled // by pq-src return; } #[cfg(target_os = "windows")] println!("cargo:rustc-link-lib=libpq"); #[cfg(not(target_os = "windows"))] println!("cargo:rustc-link-lib=pq"); 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.7.5/src/bindings_linux.rs000064400000000000000000001206231046102023000152460ustar 00000000000000/* automatically generated by rust-bindgen 0.72.1 */ use libc::FILE; 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 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 LIBPQ_HAS_FULL_PROTOCOL_VERSION: u32 = 1; pub const LIBPQ_HAS_PROMPT_OAUTH_DEVICE: 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 Oid = ::std::os::raw::c_uint; pub type pg_int64 = i64; #[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, CONNECTION_ALLOCATED = 14, CONNECTION_AUTHENTICATING = 15, } #[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, PGRES_TUPLES_CHUNK = 12, } #[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(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum PGauthData { PQAUTHDATA_PROMPT_OAUTH_DEVICE = 0, PQAUTHDATA_OAUTH_BEARER_TOKEN = 1, } #[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_cancel_conn { _unused: [u8; 0], } pub type PGcancelConn = pg_cancel_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, } #[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 = i64; 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, } #[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)] 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, } #[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)] 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, } #[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 { 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, } #[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; unsafe extern "C" { pub fn PQconnectStart(conninfo: *const ::std::os::raw::c_char) -> *mut PGconn; } 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; } unsafe extern "C" { pub fn PQconnectPoll(conn: *mut PGconn) -> PostgresPollingStatusType; } unsafe extern "C" { pub fn PQconnectdb(conninfo: *const ::std::os::raw::c_char) -> *mut PGconn; } 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; } unsafe 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; } unsafe extern "C" { pub fn PQfinish(conn: *mut PGconn); } unsafe extern "C" { pub fn PQconndefaults() -> *mut PQconninfoOption; } unsafe extern "C" { pub fn PQconninfoParse( conninfo: *const ::std::os::raw::c_char, errmsg: *mut *mut ::std::os::raw::c_char, ) -> *mut PQconninfoOption; } unsafe extern "C" { pub fn PQconninfo(conn: *mut PGconn) -> *mut PQconninfoOption; } unsafe extern "C" { pub fn PQconninfoFree(connOptions: *mut PQconninfoOption); } unsafe extern "C" { pub fn PQresetStart(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQresetPoll(conn: *mut PGconn) -> PostgresPollingStatusType; } unsafe extern "C" { pub fn PQreset(conn: *mut PGconn); } 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; } unsafe extern "C" { pub fn PQfreeCancel(cancel: *mut PGcancel); } 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; } unsafe extern "C" { pub fn PQrequestCancel(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQdb(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQuser(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQpass(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQhost(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQhostaddr(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQport(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQtty(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQoptions(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQstatus(conn: *const PGconn) -> ConnStatusType; } unsafe extern "C" { pub fn PQtransactionStatus(conn: *const PGconn) -> PGTransactionStatusType; } unsafe extern "C" { pub fn PQparameterStatus( conn: *const PGconn, paramName: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQprotocolVersion(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfullProtocolVersion(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQserverVersion(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQerrorMessage(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQsocket(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQbackendPID(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQpipelineStatus(conn: *const PGconn) -> PGpipelineStatus; } unsafe extern "C" { pub fn PQconnectionNeedsPassword(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQconnectionUsedPassword(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQconnectionUsedGSSAPI(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQclientEncoding(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsetClientEncoding( conn: *mut PGconn, encoding: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsslInUse(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsslStruct( conn: *mut PGconn, struct_name: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQsslAttribute( conn: *mut PGconn, attribute_name: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQsslAttributeNames(conn: *mut PGconn) -> *const *const ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQgetssl(conn: *mut PGconn) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQinitSSL(do_init: ::std::os::raw::c_int); } unsafe extern "C" { pub fn PQinitOpenSSL(do_ssl: ::std::os::raw::c_int, do_crypto: ::std::os::raw::c_int); } unsafe extern "C" { pub fn PQgssEncInUse(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQgetgssctx(conn: *mut PGconn) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQsetErrorVerbosity(conn: *mut PGconn, verbosity: PGVerbosity) -> PGVerbosity; } unsafe extern "C" { pub fn PQsetErrorContextVisibility( conn: *mut PGconn, show_context: PGContextVisibility, ) -> PGContextVisibility; } unsafe extern "C" { pub fn PQsetNoticeReceiver( conn: *mut PGconn, proc_: PQnoticeReceiver, arg: *mut ::std::os::raw::c_void, ) -> PQnoticeReceiver; } unsafe 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; unsafe extern "C" { pub fn PQregisterThreadLock(newhandler: pgthreadlock_t) -> pgthreadlock_t; } unsafe extern "C" { pub fn PQtrace(conn: *mut PGconn, debug_port: *mut FILE); } unsafe extern "C" { pub fn PQuntrace(conn: *mut PGconn); } unsafe extern "C" { pub fn PQsetTraceFlags(conn: *mut PGconn, flags: ::std::os::raw::c_int); } unsafe extern "C" { pub fn PQexec(conn: *mut PGconn, query: *const ::std::os::raw::c_char) -> *mut PGresult; } unsafe 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; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn PQsendQuery( conn: *mut PGconn, query: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe 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; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn PQsetSingleRowMode(conn: *mut PGconn) -> ::std::os::raw::c_int; } 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; } unsafe extern "C" { pub fn PQisBusy(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQconsumeInput(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQenterPipelineMode(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQexitPipelineMode(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQpipelineSync(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsendFlushRequest(conn: *mut PGconn) -> ::std::os::raw::c_int; } 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; } 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; } unsafe extern "C" { pub fn PQputCopyEnd( conn: *mut PGconn, errormsg: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } 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; } 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; } unsafe extern "C" { pub fn PQputline( conn: *mut PGconn, string: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } 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; } 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; } unsafe extern "C" { pub fn PQendcopy(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsetnonblocking(conn: *mut PGconn, arg: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQisnonblocking(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQisthreadsafe() -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQping(conninfo: *const ::std::os::raw::c_char) -> PGPing; } 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; } unsafe extern "C" { pub fn PQflush(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe 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; } unsafe extern "C" { pub fn PQresultStatus(res: *const PGresult) -> ExecStatusType; } unsafe extern "C" { pub fn PQresStatus(status: ExecStatusType) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQresultErrorMessage(res: *const PGresult) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQresultVerboseErrorMessage( res: *const PGresult, verbosity: PGVerbosity, show_context: PGContextVisibility, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQresultErrorField( res: *const PGresult, fieldcode: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQntuples(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQnfields(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQbinaryTuples(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfname( res: *const PGresult, field_num: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQfnumber( res: *const PGresult, field_name: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQftable(res: *const PGresult, field_num: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn PQftablecol( res: *const PGresult, field_num: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfformat( res: *const PGresult, field_num: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQftype(res: *const PGresult, field_num: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn PQfsize(res: *const PGresult, field_num: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfmod(res: *const PGresult, field_num: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQcmdStatus(res: *mut PGresult) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQoidStatus(res: *const PGresult) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQoidValue(res: *const PGresult) -> Oid; } unsafe extern "C" { pub fn PQcmdTuples(res: *mut PGresult) -> *mut ::std::os::raw::c_char; } 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; } 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; } 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; } unsafe extern "C" { pub fn PQnparams(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQparamtype(res: *const PGresult, param_num: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn PQdescribePrepared( conn: *mut PGconn, stmt: *const ::std::os::raw::c_char, ) -> *mut PGresult; } unsafe extern "C" { pub fn PQdescribePortal( conn: *mut PGconn, portal: *const ::std::os::raw::c_char, ) -> *mut PGresult; } unsafe extern "C" { pub fn PQsendDescribePrepared( conn: *mut PGconn, stmt: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsendDescribePortal( conn: *mut PGconn, portal: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } 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); } unsafe extern "C" { pub fn PQfreemem(ptr: *mut ::std::os::raw::c_void); } unsafe extern "C" { pub fn PQmakeEmptyPGresult(conn: *mut PGconn, status: ExecStatusType) -> *mut PGresult; } unsafe extern "C" { pub fn PQcopyResult(src: *const PGresult, flags: ::std::os::raw::c_int) -> *mut PGresult; } unsafe extern "C" { pub fn PQsetResultAttrs( res: *mut PGresult, numAttributes: ::std::os::raw::c_int, attDescs: *mut PGresAttDesc, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQresultAlloc(res: *mut PGresult, nBytes: usize) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQresultMemorySize(res: *const PGresult) -> usize; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn PQescapeLiteral( conn: *mut PGconn, str_: *const ::std::os::raw::c_char, len: usize, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQescapeIdentifier( conn: *mut PGconn, str_: *const ::std::os::raw::c_char, len: usize, ) -> *mut ::std::os::raw::c_char; } unsafe 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; } unsafe extern "C" { pub fn PQunescapeBytea( strtext: *const ::std::os::raw::c_uchar, retbuflen: *mut usize, ) -> *mut ::std::os::raw::c_uchar; } unsafe extern "C" { pub fn PQescapeString( to: *mut ::std::os::raw::c_char, from: *const ::std::os::raw::c_char, length: usize, ) -> usize; } 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; } unsafe extern "C" { pub fn PQprint(fout: *mut FILE, res: *const PGresult, po: *const PQprintOpt); } unsafe 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, ); } unsafe 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, ); } unsafe extern "C" { pub fn lo_open( conn: *mut PGconn, lobjId: Oid, mode: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_close(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe 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; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn lo_lseek64( conn: *mut PGconn, fd: ::std::os::raw::c_int, offset: i64, whence: ::std::os::raw::c_int, ) -> i64; } unsafe extern "C" { pub fn lo_creat(conn: *mut PGconn, mode: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn lo_create(conn: *mut PGconn, lobjId: Oid) -> Oid; } unsafe extern "C" { pub fn lo_tell(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_tell64(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> i64; } unsafe extern "C" { pub fn lo_truncate( conn: *mut PGconn, fd: ::std::os::raw::c_int, len: usize, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_truncate64( conn: *mut PGconn, fd: ::std::os::raw::c_int, len: i64, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_unlink(conn: *mut PGconn, lobjId: Oid) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_import(conn: *mut PGconn, filename: *const ::std::os::raw::c_char) -> Oid; } unsafe extern "C" { pub fn lo_import_with_oid( conn: *mut PGconn, filename: *const ::std::os::raw::c_char, lobjId: Oid, ) -> Oid; } unsafe extern "C" { pub fn lo_export( conn: *mut PGconn, lobjId: Oid, filename: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQlibVersion() -> ::std::os::raw::c_int; } 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; } unsafe extern "C" { pub fn PQmblenBounded( s: *const ::std::os::raw::c_char, encoding: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQdsplen( s: *const ::std::os::raw::c_char, encoding: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQenv2encoding() -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _PGpromptOAuthDevice { pub verification_uri: *const ::std::os::raw::c_char, pub user_code: *const ::std::os::raw::c_char, pub verification_uri_complete: *const ::std::os::raw::c_char, pub expires_in: ::std::os::raw::c_int, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of _PGpromptOAuthDevice"][::std::mem::size_of::<_PGpromptOAuthDevice>() - 32usize]; ["Alignment of _PGpromptOAuthDevice"][::std::mem::align_of::<_PGpromptOAuthDevice>() - 8usize]; ["Offset of field: _PGpromptOAuthDevice::verification_uri"] [::std::mem::offset_of!(_PGpromptOAuthDevice, verification_uri) - 0usize]; ["Offset of field: _PGpromptOAuthDevice::user_code"] [::std::mem::offset_of!(_PGpromptOAuthDevice, user_code) - 8usize]; ["Offset of field: _PGpromptOAuthDevice::verification_uri_complete"] [::std::mem::offset_of!(_PGpromptOAuthDevice, verification_uri_complete) - 16usize]; ["Offset of field: _PGpromptOAuthDevice::expires_in"] [::std::mem::offset_of!(_PGpromptOAuthDevice, expires_in) - 24usize]; }; pub type PGpromptOAuthDevice = _PGpromptOAuthDevice; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PGoauthBearerRequest { pub openid_configuration: *const ::std::os::raw::c_char, pub scope: *const ::std::os::raw::c_char, pub async_: ::std::option::Option< unsafe extern "C" fn( conn: *mut PGconn, request: *mut PGoauthBearerRequest, altsock: *mut ::std::os::raw::c_int, ) -> PostgresPollingStatusType, >, pub cleanup: ::std::option::Option< unsafe extern "C" fn(conn: *mut PGconn, request: *mut PGoauthBearerRequest), >, pub token: *mut ::std::os::raw::c_char, pub user: *mut ::std::os::raw::c_void, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of PGoauthBearerRequest"][::std::mem::size_of::() - 48usize]; ["Alignment of PGoauthBearerRequest"][::std::mem::align_of::() - 8usize]; ["Offset of field: PGoauthBearerRequest::openid_configuration"] [::std::mem::offset_of!(PGoauthBearerRequest, openid_configuration) - 0usize]; ["Offset of field: PGoauthBearerRequest::scope"] [::std::mem::offset_of!(PGoauthBearerRequest, scope) - 8usize]; ["Offset of field: PGoauthBearerRequest::async_"] [::std::mem::offset_of!(PGoauthBearerRequest, async_) - 16usize]; ["Offset of field: PGoauthBearerRequest::cleanup"] [::std::mem::offset_of!(PGoauthBearerRequest, cleanup) - 24usize]; ["Offset of field: PGoauthBearerRequest::token"] [::std::mem::offset_of!(PGoauthBearerRequest, token) - 32usize]; ["Offset of field: PGoauthBearerRequest::user"] [::std::mem::offset_of!(PGoauthBearerRequest, user) - 40usize]; }; 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; } unsafe 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; } 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; } pub type PQauthDataHook_type = ::std::option::Option< unsafe extern "C" fn( type_: PGauthData, conn: *mut PGconn, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >; unsafe extern "C" { pub fn PQsetAuthDataHook(hook: PQauthDataHook_type); } unsafe extern "C" { pub fn PQgetAuthDataHook() -> PQauthDataHook_type; } unsafe extern "C" { pub fn PQdefaultAuthDataHook( type_: PGauthData, conn: *mut PGconn, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn pg_char_to_encoding(name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn pg_encoding_to_char(encoding: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; } 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< 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, >; unsafe extern "C" { pub fn PQgetSSLKeyPassHook_OpenSSL() -> PQsslKeyPassHook_OpenSSL_type; } unsafe extern "C" { pub fn PQsetSSLKeyPassHook_OpenSSL(hook: PQsslKeyPassHook_OpenSSL_type); } 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; } pq-sys-0.7.5/src/bindings_linux_32.rs000064400000000000000000001206161046102023000155540ustar 00000000000000/* automatically generated by rust-bindgen 0.72.1 */ use libc::FILE; 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 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 LIBPQ_HAS_FULL_PROTOCOL_VERSION: u32 = 1; pub const LIBPQ_HAS_PROMPT_OAUTH_DEVICE: 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 Oid = ::std::os::raw::c_uint; pub type pg_int64 = i64; #[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, CONNECTION_ALLOCATED = 14, CONNECTION_AUTHENTICATING = 15, } #[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, PGRES_TUPLES_CHUNK = 12, } #[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(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum PGauthData { PQAUTHDATA_PROMPT_OAUTH_DEVICE = 0, PQAUTHDATA_OAUTH_BEARER_TOKEN = 1, } #[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_cancel_conn { _unused: [u8; 0], } pub type PGcancelConn = pg_cancel_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, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of pgNotify"][::std::mem::size_of::() - 16usize]; ["Alignment of pgNotify"][::std::mem::align_of::() - 4usize]; ["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) - 4usize]; ["Offset of field: pgNotify::extra"][::std::mem::offset_of!(pgNotify, extra) - 8usize]; ["Offset of field: pgNotify::next"][::std::mem::offset_of!(pgNotify, next) - 12usize]; }; pub type PGnotify = pgNotify; pub type pg_usec_time_t = i64; 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, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of _PQprintOpt"][::std::mem::size_of::<_PQprintOpt>() - 24usize]; ["Alignment of _PQprintOpt"][::std::mem::align_of::<_PQprintOpt>() - 4usize]; ["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) - 12usize]; ["Offset of field: _PQprintOpt::caption"] [::std::mem::offset_of!(_PQprintOpt, caption) - 16usize]; ["Offset of field: _PQprintOpt::fieldName"] [::std::mem::offset_of!(_PQprintOpt, fieldName) - 20usize]; }; 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, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of _PQconninfoOption"][::std::mem::size_of::<_PQconninfoOption>() - 28usize]; ["Alignment of _PQconninfoOption"][::std::mem::align_of::<_PQconninfoOption>() - 4usize]; ["Offset of field: _PQconninfoOption::keyword"] [::std::mem::offset_of!(_PQconninfoOption, keyword) - 0usize]; ["Offset of field: _PQconninfoOption::envvar"] [::std::mem::offset_of!(_PQconninfoOption, envvar) - 4usize]; ["Offset of field: _PQconninfoOption::compiled"] [::std::mem::offset_of!(_PQconninfoOption, compiled) - 8usize]; ["Offset of field: _PQconninfoOption::val"] [::std::mem::offset_of!(_PQconninfoOption, val) - 12usize]; ["Offset of field: _PQconninfoOption::label"] [::std::mem::offset_of!(_PQconninfoOption, label) - 16usize]; ["Offset of field: _PQconninfoOption::dispchar"] [::std::mem::offset_of!(_PQconninfoOption, dispchar) - 20usize]; ["Offset of field: _PQconninfoOption::dispsize"] [::std::mem::offset_of!(_PQconninfoOption, dispsize) - 24usize]; }; 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, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of PQArgBlock__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of PQArgBlock__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["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::() - 12usize]; ["Alignment of PQArgBlock"][::std::mem::align_of::() - 4usize]; ["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 { 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, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of pgresAttDesc"][::std::mem::size_of::() - 28usize]; ["Alignment of pgresAttDesc"][::std::mem::align_of::() - 4usize]; ["Offset of field: pgresAttDesc::name"][::std::mem::offset_of!(pgresAttDesc, name) - 0usize]; ["Offset of field: pgresAttDesc::tableid"] [::std::mem::offset_of!(pgresAttDesc, tableid) - 4usize]; ["Offset of field: pgresAttDesc::columnid"] [::std::mem::offset_of!(pgresAttDesc, columnid) - 8usize]; ["Offset of field: pgresAttDesc::format"] [::std::mem::offset_of!(pgresAttDesc, format) - 12usize]; ["Offset of field: pgresAttDesc::typid"][::std::mem::offset_of!(pgresAttDesc, typid) - 16usize]; ["Offset of field: pgresAttDesc::typlen"] [::std::mem::offset_of!(pgresAttDesc, typlen) - 20usize]; ["Offset of field: pgresAttDesc::atttypmod"] [::std::mem::offset_of!(pgresAttDesc, atttypmod) - 24usize]; }; pub type PGresAttDesc = pgresAttDesc; unsafe extern "C" { pub fn PQconnectStart(conninfo: *const ::std::os::raw::c_char) -> *mut PGconn; } 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; } unsafe extern "C" { pub fn PQconnectPoll(conn: *mut PGconn) -> PostgresPollingStatusType; } unsafe extern "C" { pub fn PQconnectdb(conninfo: *const ::std::os::raw::c_char) -> *mut PGconn; } 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; } unsafe 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; } unsafe extern "C" { pub fn PQfinish(conn: *mut PGconn); } unsafe extern "C" { pub fn PQconndefaults() -> *mut PQconninfoOption; } unsafe extern "C" { pub fn PQconninfoParse( conninfo: *const ::std::os::raw::c_char, errmsg: *mut *mut ::std::os::raw::c_char, ) -> *mut PQconninfoOption; } unsafe extern "C" { pub fn PQconninfo(conn: *mut PGconn) -> *mut PQconninfoOption; } unsafe extern "C" { pub fn PQconninfoFree(connOptions: *mut PQconninfoOption); } unsafe extern "C" { pub fn PQresetStart(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQresetPoll(conn: *mut PGconn) -> PostgresPollingStatusType; } unsafe extern "C" { pub fn PQreset(conn: *mut PGconn); } 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; } unsafe extern "C" { pub fn PQfreeCancel(cancel: *mut PGcancel); } 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; } unsafe extern "C" { pub fn PQrequestCancel(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQdb(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQuser(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQpass(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQhost(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQhostaddr(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQport(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQtty(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQoptions(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQstatus(conn: *const PGconn) -> ConnStatusType; } unsafe extern "C" { pub fn PQtransactionStatus(conn: *const PGconn) -> PGTransactionStatusType; } unsafe extern "C" { pub fn PQparameterStatus( conn: *const PGconn, paramName: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQprotocolVersion(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfullProtocolVersion(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQserverVersion(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQerrorMessage(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQsocket(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQbackendPID(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQpipelineStatus(conn: *const PGconn) -> PGpipelineStatus; } unsafe extern "C" { pub fn PQconnectionNeedsPassword(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQconnectionUsedPassword(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQconnectionUsedGSSAPI(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQclientEncoding(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsetClientEncoding( conn: *mut PGconn, encoding: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsslInUse(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsslStruct( conn: *mut PGconn, struct_name: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQsslAttribute( conn: *mut PGconn, attribute_name: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQsslAttributeNames(conn: *mut PGconn) -> *const *const ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQgetssl(conn: *mut PGconn) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQinitSSL(do_init: ::std::os::raw::c_int); } unsafe extern "C" { pub fn PQinitOpenSSL(do_ssl: ::std::os::raw::c_int, do_crypto: ::std::os::raw::c_int); } unsafe extern "C" { pub fn PQgssEncInUse(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQgetgssctx(conn: *mut PGconn) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQsetErrorVerbosity(conn: *mut PGconn, verbosity: PGVerbosity) -> PGVerbosity; } unsafe extern "C" { pub fn PQsetErrorContextVisibility( conn: *mut PGconn, show_context: PGContextVisibility, ) -> PGContextVisibility; } unsafe extern "C" { pub fn PQsetNoticeReceiver( conn: *mut PGconn, proc_: PQnoticeReceiver, arg: *mut ::std::os::raw::c_void, ) -> PQnoticeReceiver; } unsafe 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; unsafe extern "C" { pub fn PQregisterThreadLock(newhandler: pgthreadlock_t) -> pgthreadlock_t; } unsafe extern "C" { pub fn PQtrace(conn: *mut PGconn, debug_port: *mut FILE); } unsafe extern "C" { pub fn PQuntrace(conn: *mut PGconn); } unsafe extern "C" { pub fn PQsetTraceFlags(conn: *mut PGconn, flags: ::std::os::raw::c_int); } unsafe extern "C" { pub fn PQexec(conn: *mut PGconn, query: *const ::std::os::raw::c_char) -> *mut PGresult; } unsafe 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; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn PQsendQuery( conn: *mut PGconn, query: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe 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; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn PQsetSingleRowMode(conn: *mut PGconn) -> ::std::os::raw::c_int; } 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; } unsafe extern "C" { pub fn PQisBusy(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQconsumeInput(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQenterPipelineMode(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQexitPipelineMode(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQpipelineSync(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsendFlushRequest(conn: *mut PGconn) -> ::std::os::raw::c_int; } 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; } 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; } unsafe extern "C" { pub fn PQputCopyEnd( conn: *mut PGconn, errormsg: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } 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; } 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; } unsafe extern "C" { pub fn PQputline( conn: *mut PGconn, string: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } 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; } 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; } unsafe extern "C" { pub fn PQendcopy(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsetnonblocking(conn: *mut PGconn, arg: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQisnonblocking(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQisthreadsafe() -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQping(conninfo: *const ::std::os::raw::c_char) -> PGPing; } 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; } unsafe extern "C" { pub fn PQflush(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe 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; } unsafe extern "C" { pub fn PQresultStatus(res: *const PGresult) -> ExecStatusType; } unsafe extern "C" { pub fn PQresStatus(status: ExecStatusType) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQresultErrorMessage(res: *const PGresult) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQresultVerboseErrorMessage( res: *const PGresult, verbosity: PGVerbosity, show_context: PGContextVisibility, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQresultErrorField( res: *const PGresult, fieldcode: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQntuples(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQnfields(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQbinaryTuples(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfname( res: *const PGresult, field_num: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQfnumber( res: *const PGresult, field_name: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQftable(res: *const PGresult, field_num: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn PQftablecol( res: *const PGresult, field_num: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfformat( res: *const PGresult, field_num: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQftype(res: *const PGresult, field_num: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn PQfsize(res: *const PGresult, field_num: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfmod(res: *const PGresult, field_num: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQcmdStatus(res: *mut PGresult) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQoidStatus(res: *const PGresult) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQoidValue(res: *const PGresult) -> Oid; } unsafe extern "C" { pub fn PQcmdTuples(res: *mut PGresult) -> *mut ::std::os::raw::c_char; } 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; } 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; } 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; } unsafe extern "C" { pub fn PQnparams(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQparamtype(res: *const PGresult, param_num: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn PQdescribePrepared( conn: *mut PGconn, stmt: *const ::std::os::raw::c_char, ) -> *mut PGresult; } unsafe extern "C" { pub fn PQdescribePortal( conn: *mut PGconn, portal: *const ::std::os::raw::c_char, ) -> *mut PGresult; } unsafe extern "C" { pub fn PQsendDescribePrepared( conn: *mut PGconn, stmt: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsendDescribePortal( conn: *mut PGconn, portal: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } 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); } unsafe extern "C" { pub fn PQfreemem(ptr: *mut ::std::os::raw::c_void); } unsafe extern "C" { pub fn PQmakeEmptyPGresult(conn: *mut PGconn, status: ExecStatusType) -> *mut PGresult; } unsafe extern "C" { pub fn PQcopyResult(src: *const PGresult, flags: ::std::os::raw::c_int) -> *mut PGresult; } unsafe extern "C" { pub fn PQsetResultAttrs( res: *mut PGresult, numAttributes: ::std::os::raw::c_int, attDescs: *mut PGresAttDesc, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQresultAlloc(res: *mut PGresult, nBytes: usize) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQresultMemorySize(res: *const PGresult) -> usize; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn PQescapeLiteral( conn: *mut PGconn, str_: *const ::std::os::raw::c_char, len: usize, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQescapeIdentifier( conn: *mut PGconn, str_: *const ::std::os::raw::c_char, len: usize, ) -> *mut ::std::os::raw::c_char; } unsafe 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; } unsafe extern "C" { pub fn PQunescapeBytea( strtext: *const ::std::os::raw::c_uchar, retbuflen: *mut usize, ) -> *mut ::std::os::raw::c_uchar; } unsafe extern "C" { pub fn PQescapeString( to: *mut ::std::os::raw::c_char, from: *const ::std::os::raw::c_char, length: usize, ) -> usize; } 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; } unsafe extern "C" { pub fn PQprint(fout: *mut FILE, res: *const PGresult, po: *const PQprintOpt); } unsafe 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, ); } unsafe 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, ); } unsafe extern "C" { pub fn lo_open( conn: *mut PGconn, lobjId: Oid, mode: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_close(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe 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; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn lo_lseek64( conn: *mut PGconn, fd: ::std::os::raw::c_int, offset: i64, whence: ::std::os::raw::c_int, ) -> i64; } unsafe extern "C" { pub fn lo_creat(conn: *mut PGconn, mode: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn lo_create(conn: *mut PGconn, lobjId: Oid) -> Oid; } unsafe extern "C" { pub fn lo_tell(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_tell64(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> i64; } unsafe extern "C" { pub fn lo_truncate( conn: *mut PGconn, fd: ::std::os::raw::c_int, len: usize, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_truncate64( conn: *mut PGconn, fd: ::std::os::raw::c_int, len: i64, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_unlink(conn: *mut PGconn, lobjId: Oid) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_import(conn: *mut PGconn, filename: *const ::std::os::raw::c_char) -> Oid; } unsafe extern "C" { pub fn lo_import_with_oid( conn: *mut PGconn, filename: *const ::std::os::raw::c_char, lobjId: Oid, ) -> Oid; } unsafe extern "C" { pub fn lo_export( conn: *mut PGconn, lobjId: Oid, filename: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQlibVersion() -> ::std::os::raw::c_int; } 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; } unsafe extern "C" { pub fn PQmblenBounded( s: *const ::std::os::raw::c_char, encoding: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQdsplen( s: *const ::std::os::raw::c_char, encoding: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQenv2encoding() -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _PGpromptOAuthDevice { pub verification_uri: *const ::std::os::raw::c_char, pub user_code: *const ::std::os::raw::c_char, pub verification_uri_complete: *const ::std::os::raw::c_char, pub expires_in: ::std::os::raw::c_int, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of _PGpromptOAuthDevice"][::std::mem::size_of::<_PGpromptOAuthDevice>() - 16usize]; ["Alignment of _PGpromptOAuthDevice"][::std::mem::align_of::<_PGpromptOAuthDevice>() - 4usize]; ["Offset of field: _PGpromptOAuthDevice::verification_uri"] [::std::mem::offset_of!(_PGpromptOAuthDevice, verification_uri) - 0usize]; ["Offset of field: _PGpromptOAuthDevice::user_code"] [::std::mem::offset_of!(_PGpromptOAuthDevice, user_code) - 4usize]; ["Offset of field: _PGpromptOAuthDevice::verification_uri_complete"] [::std::mem::offset_of!(_PGpromptOAuthDevice, verification_uri_complete) - 8usize]; ["Offset of field: _PGpromptOAuthDevice::expires_in"] [::std::mem::offset_of!(_PGpromptOAuthDevice, expires_in) - 12usize]; }; pub type PGpromptOAuthDevice = _PGpromptOAuthDevice; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PGoauthBearerRequest { pub openid_configuration: *const ::std::os::raw::c_char, pub scope: *const ::std::os::raw::c_char, pub async_: ::std::option::Option< unsafe extern "C" fn( conn: *mut PGconn, request: *mut PGoauthBearerRequest, altsock: *mut ::std::os::raw::c_int, ) -> PostgresPollingStatusType, >, pub cleanup: ::std::option::Option< unsafe extern "C" fn(conn: *mut PGconn, request: *mut PGoauthBearerRequest), >, pub token: *mut ::std::os::raw::c_char, pub user: *mut ::std::os::raw::c_void, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of PGoauthBearerRequest"][::std::mem::size_of::() - 24usize]; ["Alignment of PGoauthBearerRequest"][::std::mem::align_of::() - 4usize]; ["Offset of field: PGoauthBearerRequest::openid_configuration"] [::std::mem::offset_of!(PGoauthBearerRequest, openid_configuration) - 0usize]; ["Offset of field: PGoauthBearerRequest::scope"] [::std::mem::offset_of!(PGoauthBearerRequest, scope) - 4usize]; ["Offset of field: PGoauthBearerRequest::async_"] [::std::mem::offset_of!(PGoauthBearerRequest, async_) - 8usize]; ["Offset of field: PGoauthBearerRequest::cleanup"] [::std::mem::offset_of!(PGoauthBearerRequest, cleanup) - 12usize]; ["Offset of field: PGoauthBearerRequest::token"] [::std::mem::offset_of!(PGoauthBearerRequest, token) - 16usize]; ["Offset of field: PGoauthBearerRequest::user"] [::std::mem::offset_of!(PGoauthBearerRequest, user) - 20usize]; }; 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; } unsafe 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; } 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; } pub type PQauthDataHook_type = ::std::option::Option< unsafe extern "C" fn( type_: PGauthData, conn: *mut PGconn, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >; unsafe extern "C" { pub fn PQsetAuthDataHook(hook: PQauthDataHook_type); } unsafe extern "C" { pub fn PQgetAuthDataHook() -> PQauthDataHook_type; } unsafe extern "C" { pub fn PQdefaultAuthDataHook( type_: PGauthData, conn: *mut PGconn, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn pg_char_to_encoding(name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn pg_encoding_to_char(encoding: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; } 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< 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, >; unsafe extern "C" { pub fn PQgetSSLKeyPassHook_OpenSSL() -> PQsslKeyPassHook_OpenSSL_type; } unsafe extern "C" { pub fn PQsetSSLKeyPassHook_OpenSSL(hook: PQsslKeyPassHook_OpenSSL_type); } 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; } pq-sys-0.7.5/src/bindings_windows.rs000064400000000000000000001206031046102023000155770ustar 00000000000000/* automatically generated by rust-bindgen 0.72.1 */ use libc::FILE; 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 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 LIBPQ_HAS_FULL_PROTOCOL_VERSION: u32 = 1; pub const LIBPQ_HAS_PROMPT_OAUTH_DEVICE: 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 Oid = ::std::os::raw::c_uint; pub type pg_int64 = i64; #[repr(i32)] #[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, CONNECTION_ALLOCATED = 14, CONNECTION_AUTHENTICATING = 15, } #[repr(i32)] #[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(i32)] #[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, PGRES_TUPLES_CHUNK = 12, } #[repr(i32)] #[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(i32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum PGVerbosity { PQERRORS_TERSE = 0, PQERRORS_DEFAULT = 1, PQERRORS_VERBOSE = 2, PQERRORS_SQLSTATE = 3, } #[repr(i32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum PGContextVisibility { PQSHOW_CONTEXT_NEVER = 0, PQSHOW_CONTEXT_ERRORS = 1, PQSHOW_CONTEXT_ALWAYS = 2, } #[repr(i32)] #[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(i32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum PGpipelineStatus { PQ_PIPELINE_OFF = 0, PQ_PIPELINE_ON = 1, PQ_PIPELINE_ABORTED = 2, } #[repr(i32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum PGauthData { PQAUTHDATA_PROMPT_OAUTH_DEVICE = 0, PQAUTHDATA_OAUTH_BEARER_TOKEN = 1, } #[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_cancel_conn { _unused: [u8; 0], } pub type PGcancelConn = pg_cancel_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, } #[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 = i64; 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, } #[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)] 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, } #[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)] 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, } #[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 { 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, } #[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; unsafe extern "C" { pub fn PQconnectStart(conninfo: *const ::std::os::raw::c_char) -> *mut PGconn; } 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; } unsafe extern "C" { pub fn PQconnectPoll(conn: *mut PGconn) -> PostgresPollingStatusType; } unsafe extern "C" { pub fn PQconnectdb(conninfo: *const ::std::os::raw::c_char) -> *mut PGconn; } 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; } unsafe 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; } unsafe extern "C" { pub fn PQfinish(conn: *mut PGconn); } unsafe extern "C" { pub fn PQconndefaults() -> *mut PQconninfoOption; } unsafe extern "C" { pub fn PQconninfoParse( conninfo: *const ::std::os::raw::c_char, errmsg: *mut *mut ::std::os::raw::c_char, ) -> *mut PQconninfoOption; } unsafe extern "C" { pub fn PQconninfo(conn: *mut PGconn) -> *mut PQconninfoOption; } unsafe extern "C" { pub fn PQconninfoFree(connOptions: *mut PQconninfoOption); } unsafe extern "C" { pub fn PQresetStart(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQresetPoll(conn: *mut PGconn) -> PostgresPollingStatusType; } unsafe extern "C" { pub fn PQreset(conn: *mut PGconn); } 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; } unsafe extern "C" { pub fn PQfreeCancel(cancel: *mut PGcancel); } 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; } unsafe extern "C" { pub fn PQrequestCancel(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQdb(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQuser(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQpass(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQhost(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQhostaddr(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQport(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQtty(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQoptions(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQstatus(conn: *const PGconn) -> ConnStatusType; } unsafe extern "C" { pub fn PQtransactionStatus(conn: *const PGconn) -> PGTransactionStatusType; } unsafe extern "C" { pub fn PQparameterStatus( conn: *const PGconn, paramName: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQprotocolVersion(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfullProtocolVersion(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQserverVersion(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQerrorMessage(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQsocket(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQbackendPID(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQpipelineStatus(conn: *const PGconn) -> PGpipelineStatus; } unsafe extern "C" { pub fn PQconnectionNeedsPassword(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQconnectionUsedPassword(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQconnectionUsedGSSAPI(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQclientEncoding(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsetClientEncoding( conn: *mut PGconn, encoding: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsslInUse(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsslStruct( conn: *mut PGconn, struct_name: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQsslAttribute( conn: *mut PGconn, attribute_name: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQsslAttributeNames(conn: *mut PGconn) -> *const *const ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQgetssl(conn: *mut PGconn) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQinitSSL(do_init: ::std::os::raw::c_int); } unsafe extern "C" { pub fn PQinitOpenSSL(do_ssl: ::std::os::raw::c_int, do_crypto: ::std::os::raw::c_int); } unsafe extern "C" { pub fn PQgssEncInUse(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQgetgssctx(conn: *mut PGconn) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQsetErrorVerbosity(conn: *mut PGconn, verbosity: PGVerbosity) -> PGVerbosity; } unsafe extern "C" { pub fn PQsetErrorContextVisibility( conn: *mut PGconn, show_context: PGContextVisibility, ) -> PGContextVisibility; } unsafe extern "C" { pub fn PQsetNoticeReceiver( conn: *mut PGconn, proc_: PQnoticeReceiver, arg: *mut ::std::os::raw::c_void, ) -> PQnoticeReceiver; } unsafe 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; unsafe extern "C" { pub fn PQregisterThreadLock(newhandler: pgthreadlock_t) -> pgthreadlock_t; } unsafe extern "C" { pub fn PQtrace(conn: *mut PGconn, debug_port: *mut FILE); } unsafe extern "C" { pub fn PQuntrace(conn: *mut PGconn); } unsafe extern "C" { pub fn PQsetTraceFlags(conn: *mut PGconn, flags: ::std::os::raw::c_int); } unsafe extern "C" { pub fn PQexec(conn: *mut PGconn, query: *const ::std::os::raw::c_char) -> *mut PGresult; } unsafe 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; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn PQsendQuery( conn: *mut PGconn, query: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe 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; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn PQsetSingleRowMode(conn: *mut PGconn) -> ::std::os::raw::c_int; } 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; } unsafe extern "C" { pub fn PQisBusy(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQconsumeInput(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQenterPipelineMode(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQexitPipelineMode(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQpipelineSync(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsendFlushRequest(conn: *mut PGconn) -> ::std::os::raw::c_int; } 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; } 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; } unsafe extern "C" { pub fn PQputCopyEnd( conn: *mut PGconn, errormsg: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } 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; } 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; } unsafe extern "C" { pub fn PQputline( conn: *mut PGconn, string: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } 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; } 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; } unsafe extern "C" { pub fn PQendcopy(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsetnonblocking(conn: *mut PGconn, arg: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQisnonblocking(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQisthreadsafe() -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQping(conninfo: *const ::std::os::raw::c_char) -> PGPing; } 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; } unsafe extern "C" { pub fn PQflush(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe 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; } unsafe extern "C" { pub fn PQresultStatus(res: *const PGresult) -> ExecStatusType; } unsafe extern "C" { pub fn PQresStatus(status: ExecStatusType) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQresultErrorMessage(res: *const PGresult) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQresultVerboseErrorMessage( res: *const PGresult, verbosity: PGVerbosity, show_context: PGContextVisibility, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQresultErrorField( res: *const PGresult, fieldcode: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQntuples(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQnfields(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQbinaryTuples(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfname( res: *const PGresult, field_num: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQfnumber( res: *const PGresult, field_name: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQftable(res: *const PGresult, field_num: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn PQftablecol( res: *const PGresult, field_num: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfformat( res: *const PGresult, field_num: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQftype(res: *const PGresult, field_num: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn PQfsize(res: *const PGresult, field_num: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfmod(res: *const PGresult, field_num: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQcmdStatus(res: *mut PGresult) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQoidStatus(res: *const PGresult) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQoidValue(res: *const PGresult) -> Oid; } unsafe extern "C" { pub fn PQcmdTuples(res: *mut PGresult) -> *mut ::std::os::raw::c_char; } 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; } 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; } 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; } unsafe extern "C" { pub fn PQnparams(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQparamtype(res: *const PGresult, param_num: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn PQdescribePrepared( conn: *mut PGconn, stmt: *const ::std::os::raw::c_char, ) -> *mut PGresult; } unsafe extern "C" { pub fn PQdescribePortal( conn: *mut PGconn, portal: *const ::std::os::raw::c_char, ) -> *mut PGresult; } unsafe extern "C" { pub fn PQsendDescribePrepared( conn: *mut PGconn, stmt: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsendDescribePortal( conn: *mut PGconn, portal: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } 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); } unsafe extern "C" { pub fn PQfreemem(ptr: *mut ::std::os::raw::c_void); } unsafe extern "C" { pub fn PQmakeEmptyPGresult(conn: *mut PGconn, status: ExecStatusType) -> *mut PGresult; } unsafe extern "C" { pub fn PQcopyResult(src: *const PGresult, flags: ::std::os::raw::c_int) -> *mut PGresult; } unsafe extern "C" { pub fn PQsetResultAttrs( res: *mut PGresult, numAttributes: ::std::os::raw::c_int, attDescs: *mut PGresAttDesc, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQresultAlloc(res: *mut PGresult, nBytes: usize) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQresultMemorySize(res: *const PGresult) -> usize; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn PQescapeLiteral( conn: *mut PGconn, str_: *const ::std::os::raw::c_char, len: usize, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQescapeIdentifier( conn: *mut PGconn, str_: *const ::std::os::raw::c_char, len: usize, ) -> *mut ::std::os::raw::c_char; } unsafe 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; } unsafe extern "C" { pub fn PQunescapeBytea( strtext: *const ::std::os::raw::c_uchar, retbuflen: *mut usize, ) -> *mut ::std::os::raw::c_uchar; } unsafe extern "C" { pub fn PQescapeString( to: *mut ::std::os::raw::c_char, from: *const ::std::os::raw::c_char, length: usize, ) -> usize; } 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; } unsafe extern "C" { pub fn PQprint(fout: *mut FILE, res: *const PGresult, po: *const PQprintOpt); } unsafe 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, ); } unsafe 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, ); } unsafe extern "C" { pub fn lo_open( conn: *mut PGconn, lobjId: Oid, mode: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_close(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe 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; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn lo_lseek64( conn: *mut PGconn, fd: ::std::os::raw::c_int, offset: i64, whence: ::std::os::raw::c_int, ) -> i64; } unsafe extern "C" { pub fn lo_creat(conn: *mut PGconn, mode: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn lo_create(conn: *mut PGconn, lobjId: Oid) -> Oid; } unsafe extern "C" { pub fn lo_tell(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_tell64(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> i64; } unsafe extern "C" { pub fn lo_truncate( conn: *mut PGconn, fd: ::std::os::raw::c_int, len: usize, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_truncate64( conn: *mut PGconn, fd: ::std::os::raw::c_int, len: i64, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_unlink(conn: *mut PGconn, lobjId: Oid) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_import(conn: *mut PGconn, filename: *const ::std::os::raw::c_char) -> Oid; } unsafe extern "C" { pub fn lo_import_with_oid( conn: *mut PGconn, filename: *const ::std::os::raw::c_char, lobjId: Oid, ) -> Oid; } unsafe extern "C" { pub fn lo_export( conn: *mut PGconn, lobjId: Oid, filename: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQlibVersion() -> ::std::os::raw::c_int; } 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; } unsafe extern "C" { pub fn PQmblenBounded( s: *const ::std::os::raw::c_char, encoding: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQdsplen( s: *const ::std::os::raw::c_char, encoding: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQenv2encoding() -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _PGpromptOAuthDevice { pub verification_uri: *const ::std::os::raw::c_char, pub user_code: *const ::std::os::raw::c_char, pub verification_uri_complete: *const ::std::os::raw::c_char, pub expires_in: ::std::os::raw::c_int, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of _PGpromptOAuthDevice"][::std::mem::size_of::<_PGpromptOAuthDevice>() - 32usize]; ["Alignment of _PGpromptOAuthDevice"][::std::mem::align_of::<_PGpromptOAuthDevice>() - 8usize]; ["Offset of field: _PGpromptOAuthDevice::verification_uri"] [::std::mem::offset_of!(_PGpromptOAuthDevice, verification_uri) - 0usize]; ["Offset of field: _PGpromptOAuthDevice::user_code"] [::std::mem::offset_of!(_PGpromptOAuthDevice, user_code) - 8usize]; ["Offset of field: _PGpromptOAuthDevice::verification_uri_complete"] [::std::mem::offset_of!(_PGpromptOAuthDevice, verification_uri_complete) - 16usize]; ["Offset of field: _PGpromptOAuthDevice::expires_in"] [::std::mem::offset_of!(_PGpromptOAuthDevice, expires_in) - 24usize]; }; pub type PGpromptOAuthDevice = _PGpromptOAuthDevice; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PGoauthBearerRequest { pub openid_configuration: *const ::std::os::raw::c_char, pub scope: *const ::std::os::raw::c_char, pub async_: ::std::option::Option< unsafe extern "C" fn( conn: *mut PGconn, request: *mut PGoauthBearerRequest, altsock: *mut usize, ) -> PostgresPollingStatusType, >, pub cleanup: ::std::option::Option< unsafe extern "C" fn(conn: *mut PGconn, request: *mut PGoauthBearerRequest), >, pub token: *mut ::std::os::raw::c_char, pub user: *mut ::std::os::raw::c_void, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of PGoauthBearerRequest"][::std::mem::size_of::() - 48usize]; ["Alignment of PGoauthBearerRequest"][::std::mem::align_of::() - 8usize]; ["Offset of field: PGoauthBearerRequest::openid_configuration"] [::std::mem::offset_of!(PGoauthBearerRequest, openid_configuration) - 0usize]; ["Offset of field: PGoauthBearerRequest::scope"] [::std::mem::offset_of!(PGoauthBearerRequest, scope) - 8usize]; ["Offset of field: PGoauthBearerRequest::async_"] [::std::mem::offset_of!(PGoauthBearerRequest, async_) - 16usize]; ["Offset of field: PGoauthBearerRequest::cleanup"] [::std::mem::offset_of!(PGoauthBearerRequest, cleanup) - 24usize]; ["Offset of field: PGoauthBearerRequest::token"] [::std::mem::offset_of!(PGoauthBearerRequest, token) - 32usize]; ["Offset of field: PGoauthBearerRequest::user"] [::std::mem::offset_of!(PGoauthBearerRequest, user) - 40usize]; }; 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; } unsafe 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; } 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; } pub type PQauthDataHook_type = ::std::option::Option< unsafe extern "C" fn( type_: PGauthData, conn: *mut PGconn, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >; unsafe extern "C" { pub fn PQsetAuthDataHook(hook: PQauthDataHook_type); } unsafe extern "C" { pub fn PQgetAuthDataHook() -> PQauthDataHook_type; } unsafe extern "C" { pub fn PQdefaultAuthDataHook( type_: PGauthData, conn: *mut PGconn, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn pg_char_to_encoding(name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn pg_encoding_to_char(encoding: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; } 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< 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, >; unsafe extern "C" { pub fn PQgetSSLKeyPassHook_OpenSSL() -> PQsslKeyPassHook_OpenSSL_type; } unsafe extern "C" { pub fn PQsetSSLKeyPassHook_OpenSSL(hook: PQsslKeyPassHook_OpenSSL_type); } 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; } pq-sys-0.7.5/src/bindings_windows_32.rs000064400000000000000000001205761046102023000161140ustar 00000000000000/* automatically generated by rust-bindgen 0.72.1 */ use libc::FILE; 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 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 LIBPQ_HAS_FULL_PROTOCOL_VERSION: u32 = 1; pub const LIBPQ_HAS_PROMPT_OAUTH_DEVICE: 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 Oid = ::std::os::raw::c_uint; pub type pg_int64 = i64; #[repr(i32)] #[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, CONNECTION_ALLOCATED = 14, CONNECTION_AUTHENTICATING = 15, } #[repr(i32)] #[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(i32)] #[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, PGRES_TUPLES_CHUNK = 12, } #[repr(i32)] #[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(i32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum PGVerbosity { PQERRORS_TERSE = 0, PQERRORS_DEFAULT = 1, PQERRORS_VERBOSE = 2, PQERRORS_SQLSTATE = 3, } #[repr(i32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum PGContextVisibility { PQSHOW_CONTEXT_NEVER = 0, PQSHOW_CONTEXT_ERRORS = 1, PQSHOW_CONTEXT_ALWAYS = 2, } #[repr(i32)] #[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(i32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum PGpipelineStatus { PQ_PIPELINE_OFF = 0, PQ_PIPELINE_ON = 1, PQ_PIPELINE_ABORTED = 2, } #[repr(i32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum PGauthData { PQAUTHDATA_PROMPT_OAUTH_DEVICE = 0, PQAUTHDATA_OAUTH_BEARER_TOKEN = 1, } #[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_cancel_conn { _unused: [u8; 0], } pub type PGcancelConn = pg_cancel_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, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of pgNotify"][::std::mem::size_of::() - 16usize]; ["Alignment of pgNotify"][::std::mem::align_of::() - 4usize]; ["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) - 4usize]; ["Offset of field: pgNotify::extra"][::std::mem::offset_of!(pgNotify, extra) - 8usize]; ["Offset of field: pgNotify::next"][::std::mem::offset_of!(pgNotify, next) - 12usize]; }; pub type PGnotify = pgNotify; pub type pg_usec_time_t = i64; 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, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of _PQprintOpt"][::std::mem::size_of::<_PQprintOpt>() - 24usize]; ["Alignment of _PQprintOpt"][::std::mem::align_of::<_PQprintOpt>() - 4usize]; ["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) - 12usize]; ["Offset of field: _PQprintOpt::caption"] [::std::mem::offset_of!(_PQprintOpt, caption) - 16usize]; ["Offset of field: _PQprintOpt::fieldName"] [::std::mem::offset_of!(_PQprintOpt, fieldName) - 20usize]; }; 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, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of _PQconninfoOption"][::std::mem::size_of::<_PQconninfoOption>() - 28usize]; ["Alignment of _PQconninfoOption"][::std::mem::align_of::<_PQconninfoOption>() - 4usize]; ["Offset of field: _PQconninfoOption::keyword"] [::std::mem::offset_of!(_PQconninfoOption, keyword) - 0usize]; ["Offset of field: _PQconninfoOption::envvar"] [::std::mem::offset_of!(_PQconninfoOption, envvar) - 4usize]; ["Offset of field: _PQconninfoOption::compiled"] [::std::mem::offset_of!(_PQconninfoOption, compiled) - 8usize]; ["Offset of field: _PQconninfoOption::val"] [::std::mem::offset_of!(_PQconninfoOption, val) - 12usize]; ["Offset of field: _PQconninfoOption::label"] [::std::mem::offset_of!(_PQconninfoOption, label) - 16usize]; ["Offset of field: _PQconninfoOption::dispchar"] [::std::mem::offset_of!(_PQconninfoOption, dispchar) - 20usize]; ["Offset of field: _PQconninfoOption::dispsize"] [::std::mem::offset_of!(_PQconninfoOption, dispsize) - 24usize]; }; 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, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of PQArgBlock__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of PQArgBlock__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["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::() - 12usize]; ["Alignment of PQArgBlock"][::std::mem::align_of::() - 4usize]; ["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 { 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, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of pgresAttDesc"][::std::mem::size_of::() - 28usize]; ["Alignment of pgresAttDesc"][::std::mem::align_of::() - 4usize]; ["Offset of field: pgresAttDesc::name"][::std::mem::offset_of!(pgresAttDesc, name) - 0usize]; ["Offset of field: pgresAttDesc::tableid"] [::std::mem::offset_of!(pgresAttDesc, tableid) - 4usize]; ["Offset of field: pgresAttDesc::columnid"] [::std::mem::offset_of!(pgresAttDesc, columnid) - 8usize]; ["Offset of field: pgresAttDesc::format"] [::std::mem::offset_of!(pgresAttDesc, format) - 12usize]; ["Offset of field: pgresAttDesc::typid"][::std::mem::offset_of!(pgresAttDesc, typid) - 16usize]; ["Offset of field: pgresAttDesc::typlen"] [::std::mem::offset_of!(pgresAttDesc, typlen) - 20usize]; ["Offset of field: pgresAttDesc::atttypmod"] [::std::mem::offset_of!(pgresAttDesc, atttypmod) - 24usize]; }; pub type PGresAttDesc = pgresAttDesc; unsafe extern "C" { pub fn PQconnectStart(conninfo: *const ::std::os::raw::c_char) -> *mut PGconn; } 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; } unsafe extern "C" { pub fn PQconnectPoll(conn: *mut PGconn) -> PostgresPollingStatusType; } unsafe extern "C" { pub fn PQconnectdb(conninfo: *const ::std::os::raw::c_char) -> *mut PGconn; } 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; } unsafe 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; } unsafe extern "C" { pub fn PQfinish(conn: *mut PGconn); } unsafe extern "C" { pub fn PQconndefaults() -> *mut PQconninfoOption; } unsafe extern "C" { pub fn PQconninfoParse( conninfo: *const ::std::os::raw::c_char, errmsg: *mut *mut ::std::os::raw::c_char, ) -> *mut PQconninfoOption; } unsafe extern "C" { pub fn PQconninfo(conn: *mut PGconn) -> *mut PQconninfoOption; } unsafe extern "C" { pub fn PQconninfoFree(connOptions: *mut PQconninfoOption); } unsafe extern "C" { pub fn PQresetStart(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQresetPoll(conn: *mut PGconn) -> PostgresPollingStatusType; } unsafe extern "C" { pub fn PQreset(conn: *mut PGconn); } 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; } unsafe extern "C" { pub fn PQfreeCancel(cancel: *mut PGcancel); } 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; } unsafe extern "C" { pub fn PQrequestCancel(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQdb(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQuser(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQpass(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQhost(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQhostaddr(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQport(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQtty(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQoptions(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQstatus(conn: *const PGconn) -> ConnStatusType; } unsafe extern "C" { pub fn PQtransactionStatus(conn: *const PGconn) -> PGTransactionStatusType; } unsafe extern "C" { pub fn PQparameterStatus( conn: *const PGconn, paramName: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQprotocolVersion(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfullProtocolVersion(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQserverVersion(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQerrorMessage(conn: *const PGconn) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQsocket(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQbackendPID(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQpipelineStatus(conn: *const PGconn) -> PGpipelineStatus; } unsafe extern "C" { pub fn PQconnectionNeedsPassword(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQconnectionUsedPassword(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQconnectionUsedGSSAPI(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQclientEncoding(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsetClientEncoding( conn: *mut PGconn, encoding: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsslInUse(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsslStruct( conn: *mut PGconn, struct_name: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQsslAttribute( conn: *mut PGconn, attribute_name: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQsslAttributeNames(conn: *mut PGconn) -> *const *const ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQgetssl(conn: *mut PGconn) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQinitSSL(do_init: ::std::os::raw::c_int); } unsafe extern "C" { pub fn PQinitOpenSSL(do_ssl: ::std::os::raw::c_int, do_crypto: ::std::os::raw::c_int); } unsafe extern "C" { pub fn PQgssEncInUse(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQgetgssctx(conn: *mut PGconn) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQsetErrorVerbosity(conn: *mut PGconn, verbosity: PGVerbosity) -> PGVerbosity; } unsafe extern "C" { pub fn PQsetErrorContextVisibility( conn: *mut PGconn, show_context: PGContextVisibility, ) -> PGContextVisibility; } unsafe extern "C" { pub fn PQsetNoticeReceiver( conn: *mut PGconn, proc_: PQnoticeReceiver, arg: *mut ::std::os::raw::c_void, ) -> PQnoticeReceiver; } unsafe 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; unsafe extern "C" { pub fn PQregisterThreadLock(newhandler: pgthreadlock_t) -> pgthreadlock_t; } unsafe extern "C" { pub fn PQtrace(conn: *mut PGconn, debug_port: *mut FILE); } unsafe extern "C" { pub fn PQuntrace(conn: *mut PGconn); } unsafe extern "C" { pub fn PQsetTraceFlags(conn: *mut PGconn, flags: ::std::os::raw::c_int); } unsafe extern "C" { pub fn PQexec(conn: *mut PGconn, query: *const ::std::os::raw::c_char) -> *mut PGresult; } unsafe 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; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn PQsendQuery( conn: *mut PGconn, query: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe 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; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn PQsetSingleRowMode(conn: *mut PGconn) -> ::std::os::raw::c_int; } 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; } unsafe extern "C" { pub fn PQisBusy(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQconsumeInput(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQenterPipelineMode(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQexitPipelineMode(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQpipelineSync(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsendFlushRequest(conn: *mut PGconn) -> ::std::os::raw::c_int; } 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; } 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; } unsafe extern "C" { pub fn PQputCopyEnd( conn: *mut PGconn, errormsg: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } 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; } 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; } unsafe extern "C" { pub fn PQputline( conn: *mut PGconn, string: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } 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; } 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; } unsafe extern "C" { pub fn PQendcopy(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsetnonblocking(conn: *mut PGconn, arg: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQisnonblocking(conn: *const PGconn) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQisthreadsafe() -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQping(conninfo: *const ::std::os::raw::c_char) -> PGPing; } 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; } unsafe extern "C" { pub fn PQflush(conn: *mut PGconn) -> ::std::os::raw::c_int; } unsafe 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; } unsafe extern "C" { pub fn PQresultStatus(res: *const PGresult) -> ExecStatusType; } unsafe extern "C" { pub fn PQresStatus(status: ExecStatusType) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQresultErrorMessage(res: *const PGresult) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQresultVerboseErrorMessage( res: *const PGresult, verbosity: PGVerbosity, show_context: PGContextVisibility, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQresultErrorField( res: *const PGresult, fieldcode: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQntuples(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQnfields(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQbinaryTuples(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfname( res: *const PGresult, field_num: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQfnumber( res: *const PGresult, field_name: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQftable(res: *const PGresult, field_num: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn PQftablecol( res: *const PGresult, field_num: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfformat( res: *const PGresult, field_num: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQftype(res: *const PGresult, field_num: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn PQfsize(res: *const PGresult, field_num: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQfmod(res: *const PGresult, field_num: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQcmdStatus(res: *mut PGresult) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQoidStatus(res: *const PGresult) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQoidValue(res: *const PGresult) -> Oid; } unsafe extern "C" { pub fn PQcmdTuples(res: *mut PGresult) -> *mut ::std::os::raw::c_char; } 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; } 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; } 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; } unsafe extern "C" { pub fn PQnparams(res: *const PGresult) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQparamtype(res: *const PGresult, param_num: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn PQdescribePrepared( conn: *mut PGconn, stmt: *const ::std::os::raw::c_char, ) -> *mut PGresult; } unsafe extern "C" { pub fn PQdescribePortal( conn: *mut PGconn, portal: *const ::std::os::raw::c_char, ) -> *mut PGresult; } unsafe extern "C" { pub fn PQsendDescribePrepared( conn: *mut PGconn, stmt: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQsendDescribePortal( conn: *mut PGconn, portal: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } 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); } unsafe extern "C" { pub fn PQfreemem(ptr: *mut ::std::os::raw::c_void); } unsafe extern "C" { pub fn PQmakeEmptyPGresult(conn: *mut PGconn, status: ExecStatusType) -> *mut PGresult; } unsafe extern "C" { pub fn PQcopyResult(src: *const PGresult, flags: ::std::os::raw::c_int) -> *mut PGresult; } unsafe extern "C" { pub fn PQsetResultAttrs( res: *mut PGresult, numAttributes: ::std::os::raw::c_int, attDescs: *mut PGresAttDesc, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQresultAlloc(res: *mut PGresult, nBytes: usize) -> *mut ::std::os::raw::c_void; } unsafe extern "C" { pub fn PQresultMemorySize(res: *const PGresult) -> usize; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn PQescapeLiteral( conn: *mut PGconn, str_: *const ::std::os::raw::c_char, len: usize, ) -> *mut ::std::os::raw::c_char; } unsafe extern "C" { pub fn PQescapeIdentifier( conn: *mut PGconn, str_: *const ::std::os::raw::c_char, len: usize, ) -> *mut ::std::os::raw::c_char; } unsafe 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; } unsafe extern "C" { pub fn PQunescapeBytea( strtext: *const ::std::os::raw::c_uchar, retbuflen: *mut usize, ) -> *mut ::std::os::raw::c_uchar; } unsafe extern "C" { pub fn PQescapeString( to: *mut ::std::os::raw::c_char, from: *const ::std::os::raw::c_char, length: usize, ) -> usize; } 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; } unsafe extern "C" { pub fn PQprint(fout: *mut FILE, res: *const PGresult, po: *const PQprintOpt); } unsafe 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, ); } unsafe 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, ); } unsafe extern "C" { pub fn lo_open( conn: *mut PGconn, lobjId: Oid, mode: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_close(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe 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; } unsafe 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; } unsafe 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; } unsafe extern "C" { pub fn lo_lseek64( conn: *mut PGconn, fd: ::std::os::raw::c_int, offset: i64, whence: ::std::os::raw::c_int, ) -> i64; } unsafe extern "C" { pub fn lo_creat(conn: *mut PGconn, mode: ::std::os::raw::c_int) -> Oid; } unsafe extern "C" { pub fn lo_create(conn: *mut PGconn, lobjId: Oid) -> Oid; } unsafe extern "C" { pub fn lo_tell(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_tell64(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> i64; } unsafe extern "C" { pub fn lo_truncate( conn: *mut PGconn, fd: ::std::os::raw::c_int, len: usize, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_truncate64( conn: *mut PGconn, fd: ::std::os::raw::c_int, len: i64, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_unlink(conn: *mut PGconn, lobjId: Oid) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn lo_import(conn: *mut PGconn, filename: *const ::std::os::raw::c_char) -> Oid; } unsafe extern "C" { pub fn lo_import_with_oid( conn: *mut PGconn, filename: *const ::std::os::raw::c_char, lobjId: Oid, ) -> Oid; } unsafe extern "C" { pub fn lo_export( conn: *mut PGconn, lobjId: Oid, filename: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQlibVersion() -> ::std::os::raw::c_int; } 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; } unsafe extern "C" { pub fn PQmblenBounded( s: *const ::std::os::raw::c_char, encoding: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQdsplen( s: *const ::std::os::raw::c_char, encoding: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn PQenv2encoding() -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _PGpromptOAuthDevice { pub verification_uri: *const ::std::os::raw::c_char, pub user_code: *const ::std::os::raw::c_char, pub verification_uri_complete: *const ::std::os::raw::c_char, pub expires_in: ::std::os::raw::c_int, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of _PGpromptOAuthDevice"][::std::mem::size_of::<_PGpromptOAuthDevice>() - 16usize]; ["Alignment of _PGpromptOAuthDevice"][::std::mem::align_of::<_PGpromptOAuthDevice>() - 4usize]; ["Offset of field: _PGpromptOAuthDevice::verification_uri"] [::std::mem::offset_of!(_PGpromptOAuthDevice, verification_uri) - 0usize]; ["Offset of field: _PGpromptOAuthDevice::user_code"] [::std::mem::offset_of!(_PGpromptOAuthDevice, user_code) - 4usize]; ["Offset of field: _PGpromptOAuthDevice::verification_uri_complete"] [::std::mem::offset_of!(_PGpromptOAuthDevice, verification_uri_complete) - 8usize]; ["Offset of field: _PGpromptOAuthDevice::expires_in"] [::std::mem::offset_of!(_PGpromptOAuthDevice, expires_in) - 12usize]; }; pub type PGpromptOAuthDevice = _PGpromptOAuthDevice; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PGoauthBearerRequest { pub openid_configuration: *const ::std::os::raw::c_char, pub scope: *const ::std::os::raw::c_char, pub async_: ::std::option::Option< unsafe extern "C" fn( conn: *mut PGconn, request: *mut PGoauthBearerRequest, altsock: *mut usize, ) -> PostgresPollingStatusType, >, pub cleanup: ::std::option::Option< unsafe extern "C" fn(conn: *mut PGconn, request: *mut PGoauthBearerRequest), >, pub token: *mut ::std::os::raw::c_char, pub user: *mut ::std::os::raw::c_void, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of PGoauthBearerRequest"][::std::mem::size_of::() - 24usize]; ["Alignment of PGoauthBearerRequest"][::std::mem::align_of::() - 4usize]; ["Offset of field: PGoauthBearerRequest::openid_configuration"] [::std::mem::offset_of!(PGoauthBearerRequest, openid_configuration) - 0usize]; ["Offset of field: PGoauthBearerRequest::scope"] [::std::mem::offset_of!(PGoauthBearerRequest, scope) - 4usize]; ["Offset of field: PGoauthBearerRequest::async_"] [::std::mem::offset_of!(PGoauthBearerRequest, async_) - 8usize]; ["Offset of field: PGoauthBearerRequest::cleanup"] [::std::mem::offset_of!(PGoauthBearerRequest, cleanup) - 12usize]; ["Offset of field: PGoauthBearerRequest::token"] [::std::mem::offset_of!(PGoauthBearerRequest, token) - 16usize]; ["Offset of field: PGoauthBearerRequest::user"] [::std::mem::offset_of!(PGoauthBearerRequest, user) - 20usize]; }; 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; } unsafe 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; } 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; } pub type PQauthDataHook_type = ::std::option::Option< unsafe extern "C" fn( type_: PGauthData, conn: *mut PGconn, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >; unsafe extern "C" { pub fn PQsetAuthDataHook(hook: PQauthDataHook_type); } unsafe extern "C" { pub fn PQgetAuthDataHook() -> PQauthDataHook_type; } unsafe extern "C" { pub fn PQdefaultAuthDataHook( type_: PGauthData, conn: *mut PGconn, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn pg_char_to_encoding(name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } unsafe extern "C" { pub fn pg_encoding_to_char(encoding: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; } 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< 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, >; unsafe extern "C" { pub fn PQgetSSLKeyPassHook_OpenSSL() -> PQsslKeyPassHook_OpenSSL_type; } unsafe extern "C" { pub fn PQsetSSLKeyPassHook_OpenSSL(hook: PQsslKeyPassHook_OpenSSL_type); } 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; } pq-sys-0.7.5/src/lib.rs000064400000000000000000000031351046102023000127760ustar 00000000000000#[cfg(any(feature = "bundled", feature = "bundled_without_openssl"))] extern crate pq_src; #[allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] mod bindings { #[cfg(buildscript_run)] include!(concat!(env!("OUT_DIR"), "/bindings.rs")); } #[cfg(not(buildscript_run))] compile_error!( "pq-sys relies on build scripts beeing executed. \n \ Please double check that you don't have a `[target.*.pq]` entry \ in your `.cargo/config.toml`\n \ These entries prevent build scripts from beeing run" ); pub use bindings::*; #[cfg(not(feature = "buildtime_bindgen"))] #[test] fn check_generated_bindings_match() { let libpq_include_path = concat!( env!("CARGO_MANIFEST_DIR"), "/pq-src/source/src/interfaces/libpq/" ); let postgres_include_path = concat!(env!("CARGO_MANIFEST_DIR"), "/pq-src/source/src/include"); let additional_includes_path = concat!(env!("CARGO_MANIFEST_DIR"), "/pq-src/additional_include/"); let builder = include!("make_bindings.rs").clang_args([ "-I", libpq_include_path, "-I", postgres_include_path, "-I", additional_includes_path, ]); 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!("OUT_DIR")) + "/bindings.rs").unwrap(); similar_asserts::assert_eq!(generated_bindings, bundled_bindings,) } pq-sys-0.7.5/src/make_bindings.rs000064400000000000000000000011541046102023000150210ustar 00000000000000/* keep in sync with the command in generate_bindings.sh */ 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;") pq-sys-0.7.5/wrapper.h000064400000000000000000000000261046102023000127200ustar 00000000000000#include