glib-unix-0.22.0/.cargo_vcs_info.json0000644000000001471046102023000130370ustar { "git": { "sha1": "5b440606f190bb3013ec3adde4d90799d81151df" }, "path_in_vcs": "glib-unix" }glib-unix-0.22.0/COPYRIGHT000064400000000000000000000012131046102023000130730ustar 00000000000000The gtk-rs Project is licensed under the MIT license, see the LICENSE file or . Copyrights in the gtk-rs Project project are retained by their contributors. No copyright assignment is required to contribute to the gtk-rs Project project. For full authorship information, see the version control history. This project provides interoperability with various GNOME libraries but doesn't distribute any parts of them. Distributing compiled libraries and executables that link to those libraries may be subject to terms of the GNU LGPL or other licenses. For more information check the license of each GNOME library. glib-unix-0.22.0/Cargo.lock0000644000000421721046102023000110160ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 4 [[package]] name = "anyhow" version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" [[package]] name = "bitflags" version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" [[package]] name = "cfg-expr" version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78cef5b5a1a6827c7322ae2a636368a573006b27cfa76c7ebd53e834daeaab6a" dependencies = [ "smallvec", "target-lexicon", ] [[package]] name = "cfg-if" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "equivalent" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", "windows-sys", ] [[package]] name = "fastrand" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "foldhash" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "futures-channel" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" dependencies = [ "futures-core", ] [[package]] name = "futures-core" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" [[package]] name = "futures-executor" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" dependencies = [ "futures-core", "futures-task", "futures-util", ] [[package]] name = "futures-macro" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "futures-task" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" [[package]] name = "futures-util" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" dependencies = [ "futures-core", "futures-macro", "futures-task", "pin-project-lite", "slab", ] [[package]] name = "getrandom" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" dependencies = [ "cfg-if", "libc", "r-efi", "wasip2", "wasip3", ] [[package]] name = "gir-format-check" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a5da913a8586ce748f1164c890e1ebe75a7bbc472668f57b7f9fb893d7ac416" [[package]] name = "glib" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3b79a62980e85d61aae88988e5bcca6a35f05b0008e1333aa43bd61ef9bf35" dependencies = [ "bitflags", "futures-channel", "futures-core", "futures-executor", "futures-task", "futures-util", "glib-macros", "glib-sys", "gobject-sys", "libc", "memchr", "smallvec", ] [[package]] name = "glib-macros" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b48a968528354e04603ae96205f00cf7e77347ffde0fc943a2159948d7d6d80" dependencies = [ "heck", "proc-macro2", "quote", "syn", ] [[package]] name = "glib-sys" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48073e3b228419faa80b9b7f7122759d4ab2f44cd52a065fde7ca08f34c03147" dependencies = [ "libc", "system-deps", ] [[package]] name = "glib-unix" version = "0.22.0" dependencies = [ "futures-core", "gir-format-check", "glib", "glib-unix-sys", "libc", "tempfile", ] [[package]] name = "glib-unix-sys" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1f253bc9d43252b0e746e350c5993e0ca59d81595d81e7f9f1dff8ce6ff11c3" dependencies = [ "glib-sys", "libc", "system-deps", ] [[package]] name = "gobject-sys" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18eda93f09d3778f38255b231b17ef67195013a592c91624a4daf8bead875565" dependencies = [ "glib-sys", "libc", "system-deps", ] [[package]] name = "hashbrown" version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "foldhash", ] [[package]] name = "hashbrown" version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "id-arena" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" [[package]] name = "indexmap" version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", "hashbrown 0.16.1", "serde", "serde_core", ] [[package]] name = "itoa" version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "leb128fmt" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" [[package]] name = "libc" version = "0.2.182" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" [[package]] name = "linux-raw-sys" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "log" version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "memchr" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] name = "once_cell" version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "pin-project-lite" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pkg-config" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "prettyplease" version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", "syn", ] [[package]] name = "proc-macro2" version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" dependencies = [ "proc-macro2", ] [[package]] name = "r-efi" version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rustix" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", "windows-sys", ] [[package]] name = "semver" version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" [[package]] name = "serde" version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ "serde_core", ] [[package]] name = "serde_core" version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "serde_json" version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ "itoa", "memchr", "serde", "serde_core", "zmij", ] [[package]] name = "serde_spanned" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" dependencies = [ "serde_core", ] [[package]] name = "slab" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "smallvec" version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "syn" version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "system-deps" version = "7.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c8f33736f986f16d69b6cb8b03f55ddcad5c41acc4ccc39dd88e84aa805e7f" dependencies = [ "cfg-expr", "heck", "pkg-config", "toml", "version-compare", ] [[package]] name = "target-lexicon" version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c" [[package]] name = "tempfile" version = "3.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0136791f7c95b1f6dd99f9cc786b91bb81c3800b639b3478e561ddb7be95e5f1" dependencies = [ "fastrand", "getrandom", "once_cell", "rustix", "windows-sys", ] [[package]] name = "toml" version = "0.9.12+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" dependencies = [ "indexmap", "serde_core", "serde_spanned", "toml_datetime", "toml_parser", "toml_writer", "winnow", ] [[package]] name = "toml_datetime" version = "0.7.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" dependencies = [ "serde_core", ] [[package]] name = "toml_parser" version = "1.0.9+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "702d4415e08923e7e1ef96cd5727c0dfed80b4d2fa25db9647fe5eb6f7c5a4c4" dependencies = [ "winnow", ] [[package]] name = "toml_writer" version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" [[package]] name = "unicode-ident" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "unicode-xid" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "version-compare" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" [[package]] name = "wasip2" version = "1.0.2+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" dependencies = [ "wit-bindgen", ] [[package]] name = "wasip3" version = "0.4.0+wasi-0.3.0-rc-2026-01-06" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" dependencies = [ "wit-bindgen", ] [[package]] name = "wasm-encoder" version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" dependencies = [ "leb128fmt", "wasmparser", ] [[package]] name = "wasm-metadata" version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" dependencies = [ "anyhow", "indexmap", "wasm-encoder", "wasmparser", ] [[package]] name = "wasmparser" version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" dependencies = [ "bitflags", "hashbrown 0.15.5", "indexmap", "semver", ] [[package]] name = "windows-link" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-sys" version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ "windows-link", ] [[package]] name = "winnow" version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" [[package]] name = "wit-bindgen" version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" dependencies = [ "wit-bindgen-rust-macro", ] [[package]] name = "wit-bindgen-core" version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" dependencies = [ "anyhow", "heck", "wit-parser", ] [[package]] name = "wit-bindgen-rust" version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" dependencies = [ "anyhow", "heck", "indexmap", "prettyplease", "syn", "wasm-metadata", "wit-bindgen-core", "wit-component", ] [[package]] name = "wit-bindgen-rust-macro" version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" dependencies = [ "anyhow", "prettyplease", "proc-macro2", "quote", "syn", "wit-bindgen-core", "wit-bindgen-rust", ] [[package]] name = "wit-component" version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" dependencies = [ "anyhow", "bitflags", "indexmap", "log", "serde", "serde_derive", "serde_json", "wasm-encoder", "wasm-metadata", "wasmparser", "wit-parser", ] [[package]] name = "wit-parser" version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" dependencies = [ "anyhow", "id-arena", "indexmap", "log", "semver", "serde", "serde_derive", "serde_json", "unicode-xid", "wasmparser", ] [[package]] name = "zmij" version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" glib-unix-0.22.0/Cargo.toml0000644000000032161046102023000110350ustar # 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 = "2024" rust-version = "1.92" name = "glib-unix" version = "0.22.0" authors = ["The gtk-rs Project Developers"] build = false exclude = ["gir-files/*"] autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "Rust bindings for the GLibUnix library" homepage = "https://gtk-rs.org/" documentation = "https://gtk-rs.org/gtk-rs-core/stable/latest/docs/glib-unix/" readme = "README.md" keywords = [ "glib", "gtk-rs", "gnome", "GUI", ] license = "MIT" repository = "https://github.com/gtk-rs/gtk-rs-core" [package.metadata.docs.rs] all-features = true rustdoc-args = ["--generate-link-to-definition"] [features] default = ["futures"] futures = [ "glib/futures", "dep:futures-core", ] v2_80 = [ "glib-unix-sys/v2_80", "glib/v2_80", ] [lib] name = "glib_unix" path = "src/lib.rs" [dependencies.futures-core] version = "0.3" optional = true default-features = false [dependencies.glib] version = "0.22.0" default-features = false [dependencies.glib-unix-sys] version = "0.22.0" [dependencies.libc] version = "0.2" [dev-dependencies.gir-format-check] version = "^0.1" [dev-dependencies.tempfile] version = "3" glib-unix-0.22.0/Cargo.toml.orig000064400000000000000000000016041046102023000144730ustar 00000000000000[package] name = "glib-unix" documentation = "https://gtk-rs.org/gtk-rs-core/stable/latest/docs/glib-unix/" description = "Rust bindings for the GLibUnix library" readme = "README.md" keywords = ["glib", "gtk-rs", "gnome", "GUI"] authors.workspace = true edition.workspace = true exclude.workspace = true homepage.workspace = true license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true [dependencies] glib-unix-sys.workspace = true libc.workspace = true glib.workspace = true futures-core = { version = "0.3", default-features = false, optional = true} [dev-dependencies] tempfile = "3" gir-format-check.workspace = true [features] default = ["futures"] futures = ["glib/futures", "dep:futures-core"] v2_80 = ["glib-unix-sys/v2_80", "glib/v2_80"] [package.metadata.docs.rs] all-features = true rustdoc-args = ["--generate-link-to-definition"] glib-unix-0.22.0/Gir.toml000064400000000000000000000020631046102023000132220ustar 00000000000000[options] girs_directories = ["../gir-files"] library = "GLibUnix" version = "2.0" min_cfg_version = "2.56" use_gi_docgen = true target_path = "." work_mode = "normal" single_version_file = true deprecate_by_min_version = true trust_return_value_nullability = true generate = [ #"GLibUnix.Pipe", #"GLibUnix.PipeEnd" ] ignore = [ ] manual = [ "GLib.Error", "GLib.IOCondition", "GLib.Quark", "GLib.Source", ] [[object]] name = "GLibUnix.*" status = "generate" [[object.function]] name = "signal_add" ignore = true [[object.function]] name = "signal_add_full" ignore = true [[object.function]] name = "set_fd_nonblocking" # Need manual binding for RawFd ignore = true [[object.function]] pattern = "fd.*" # Need manual binding for RawFd ignore = true [[object.function]] name = "signal_source_new" # Need manual bindings to be useful ignore = true [[object.function]] name = "open_pipe" manual = true [[object.function]] name = "closefrom" unsafe = true glib-unix-0.22.0/LICENSE000064400000000000000000000020001046102023000126000ustar 00000000000000Permission 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. glib-unix-0.22.0/README.md000064400000000000000000000023321046102023000130620ustar 00000000000000# Rust GLib Unix bindings __Rust__ bindings and wrappers for [glib](https://docs.gtk.org/glib/), part of [gtk-rs-core](https://github.com/gtk-rs/gtk-rs-core). GLib __2.56__ is the lowest supported version for the underlying library. ## Minimum supported Rust version Currently, the minimum supported Rust version is `1.83.0`. ## Documentation * [Rust API - Stable](https://gtk-rs.org/gtk-rs-core/stable/latest/docs/glib_unix/) * [Rust API - Development](https://gtk-rs.org/gtk-rs-core/git/docs/glib_unix) * [GTK Installation instructions](https://www.gtk.org/docs/installations/) ## Using We recommend using [crates from crates.io](https://crates.io/keywords/gtk-rs), as [demonstrated here](https://gtk-rs.org/#using). If you want to track the bleeding edge, use the git dependency instead: ```toml [dependencies] glib = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "glib" } ``` Avoid mixing versioned and git crates like this: ```toml # This will not compile [dependencies] glib = "0.13" glib = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "glib" } ``` ### See Also * [gio](https://crates.io/crates/gio) ## License __glib-unix__ is available under the MIT License, please refer to it. glib-unix-0.22.0/src/auto/functions.rs000064400000000000000000000014741046102023000157260ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; #[cfg(feature = "v2_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] #[doc(alias = "g_closefrom")] pub unsafe fn closefrom(lowfd: i32) -> i32 { unsafe { ffi::g_closefrom(lowfd) } } #[doc(alias = "g_unix_error_quark")] pub fn error_quark() -> glib::Quark { unsafe { from_glib(ffi::g_unix_error_quark()) } } //#[cfg(feature = "v2_64")] //#[cfg_attr(docsrs, doc(cfg(feature = "v2_64")))] //#[doc(alias = "g_unix_get_passwd_entry")] //#[doc(alias = "get_passwd_entry")] //pub fn passwd_entry(user_name: &str) -> Result, glib::Error> { // unsafe { TODO: call ffi:g_unix_get_passwd_entry() } //} glib-unix-0.22.0/src/auto/mod.rs000064400000000000000000000002441046102023000144670ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT pub(crate) mod functions; glib-unix-0.22.0/src/auto/versions.txt000064400000000000000000000002041046102023000157470ustar 00000000000000Generated by gir (https://github.com/gtk-rs/gir @ 36917718ae60) from gir-files (https://github.com/gtk-rs/gir-files @ c01b7e1d9d02) glib-unix-0.22.0/src/functions.rs000064400000000000000000000421151046102023000147530ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use std::cell::RefCell; use std::future::Future; use std::mem::transmute; use std::os::fd::{FromRawFd, RawFd}; use std::pin::Pin; use glib::ffi::gpointer; use glib::thread_guard::ThreadGuard; use glib::translate::*; use glib::{ControlFlow, IOCondition, Priority, Source, SourceId}; use crate::ffi; #[cfg(feature = "futures")] use glib::{SourceFuture, SourceStream}; #[cfg(feature = "futures")] use futures_core::stream::Stream; fn into_raw ControlFlow + Send + 'static>(func: F) -> gpointer { let func: Box> = Box::new(RefCell::new(func)); Box::into_raw(func) as gpointer } fn into_raw_local ControlFlow + 'static>(func: F) -> gpointer { let func: Box>> = Box::new(ThreadGuard::new(RefCell::new(func))); Box::into_raw(func) as gpointer } unsafe extern "C" fn trampoline ControlFlow + Send + 'static>( func: gpointer, ) -> glib::ffi::gboolean { unsafe { let func: &RefCell = &*(func as *const RefCell); (*func.borrow_mut())().into_glib() } } unsafe extern "C" fn trampoline_local ControlFlow + 'static>( func: gpointer, ) -> glib::ffi::gboolean { unsafe { let func: &ThreadGuard> = &*(func as *const ThreadGuard>); (*func.get_ref().borrow_mut())().into_glib() } } unsafe extern "C" fn destroy_closure ControlFlow + Send + 'static>(ptr: gpointer) { unsafe { let _ = Box::>::from_raw(ptr as *mut _); } } unsafe extern "C" fn destroy_closure_local ControlFlow + 'static>(ptr: gpointer) { unsafe { let _ = Box::>>::from_raw(ptr as *mut _); } } unsafe extern "C" fn trampoline_unix_fd< F: FnMut(RawFd, IOCondition) -> ControlFlow + Send + 'static, >( fd: i32, condition: glib::ffi::GIOCondition, func: gpointer, ) -> glib::ffi::gboolean { unsafe { let func: &RefCell = &*(func as *const RefCell); (*func.borrow_mut())(fd, from_glib(condition)).into_glib() } } unsafe extern "C" fn trampoline_unix_fd_local< F: FnMut(RawFd, IOCondition) -> ControlFlow + 'static, >( fd: i32, condition: glib::ffi::GIOCondition, func: gpointer, ) -> glib::ffi::gboolean { unsafe { let func: &ThreadGuard> = &*(func as *const ThreadGuard>); (*func.get_ref().borrow_mut())(fd, from_glib(condition)).into_glib() } } unsafe extern "C" fn destroy_closure_unix_fd< F: FnMut(RawFd, IOCondition) -> ControlFlow + Send + 'static, >( ptr: gpointer, ) { unsafe { let _ = Box::>::from_raw(ptr as *mut _); } } unsafe extern "C" fn destroy_closure_unix_fd_local< F: FnMut(RawFd, IOCondition) -> ControlFlow + 'static, >( ptr: gpointer, ) { unsafe { let _ = Box::>>::from_raw(ptr as *mut _); } } fn into_raw_unix_fd ControlFlow + Send + 'static>( func: F, ) -> gpointer { let func: Box> = Box::new(RefCell::new(func)); Box::into_raw(func) as gpointer } fn into_raw_unix_fd_local ControlFlow + 'static>( func: F, ) -> gpointer { let func: Box>> = Box::new(ThreadGuard::new(RefCell::new(func))); Box::into_raw(func) as gpointer } #[inline(always)] fn fnmut_callback_wrapper( func: impl FnOnce() + Send + 'static, ) -> impl FnMut() -> ControlFlow + Send + 'static { let mut func = Some(func); move || { let func = func .take() .expect("GSource closure called after returning ControlFlow::Break"); func(); ControlFlow::Break } } #[inline(always)] fn fnmut_callback_wrapper_local( func: impl FnOnce() + 'static, ) -> impl FnMut() -> ControlFlow + 'static { let mut func = Some(func); move || { let func = func .take() .expect("GSource closure called after returning glib::ControlFlow::Break"); func(); ControlFlow::Break } } #[doc(alias = "g_unix_open_pipe")] pub fn unix_open_pipe(flags: i32) -> Result<(RawFd, RawFd), glib::Error> { unsafe { let mut fds = [0, 2]; let mut error = std::ptr::null_mut(); let _ = ffi::g_unix_open_pipe(&mut fds, flags, &mut error); if error.is_null() { Ok(( FromRawFd::from_raw_fd(fds[0]), FromRawFd::from_raw_fd(fds[1]), )) } else { Err(from_glib_full(error)) } } } // rustdoc-stripper-ignore-next /// Create a `Stream` that will provide a value whenever the given UNIX signal is raised /// /// The `Stream` must be spawned on an `Executor` backed by a `glib::MainContext`. #[cfg(feature = "futures")] pub fn signal_stream(signum: i32) -> Pin + Send + 'static>> { signal_stream_with_priority(Priority::default(), signum) } // rustdoc-stripper-ignore-next /// Create a `Stream` that will provide a value whenever the given UNIX signal is raised /// /// The `Stream` must be spawned on an `Executor` backed by a `glib::MainContext`. #[cfg(feature = "futures")] pub fn signal_stream_with_priority( priority: Priority, signum: i32, ) -> Pin + Send + 'static>> { Box::pin(SourceStream::new(move |send| { signal_source_new(signum, None, priority, move || { if send.unbounded_send(()).is_err() { ControlFlow::Break } else { ControlFlow::Continue } }) })) } // rustdoc-stripper-ignore-next /// Create a `Future` that will resolve once the given UNIX signal is raised /// /// The `Future` must be spawned on an `Executor` backed by a `glib::MainContext`. #[cfg(feature = "futures")] pub fn signal_future_with_priority( priority: Priority, signum: i32, ) -> Pin + Send + 'static>> { Box::pin(SourceFuture::new(move |send| { let mut send = Some(send); signal_source_new(signum, None, priority, move || { let _ = send.take().unwrap().send(()); ControlFlow::Break }) })) } // rustdoc-stripper-ignore-next /// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a /// UNIX signal is raised. /// /// `func` will be called repeatedly every time `signum` is raised until it /// returns `ControlFlow::Break`. #[doc(alias = "g_unix_signal_source_new")] pub fn signal_source_new( signum: i32, name: Option<&str>, priority: Priority, func: F, ) -> glib::Source where F: FnMut() -> glib::ControlFlow + Send + 'static, { unsafe { let source = ffi::g_unix_signal_source_new(signum); glib::ffi::g_source_set_callback( source, Some(trampoline::), into_raw(func), Some(destroy_closure::), ); glib::ffi::g_source_set_priority(source, priority.into_glib()); if let Some(name) = name { glib::ffi::g_source_set_name(source, name.to_glib_none().0); } from_glib_full(source) } } // rustdoc-stripper-ignore-next /// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a /// UNIX file descriptor reaches the given IO condition. /// /// `func` will be called repeatedly while the file descriptor matches the given IO condition /// until it returns `ControlFlow::Break`. #[doc(alias = "g_unix_fd_source_new")] pub fn fd_source_new( fd: RawFd, condition: IOCondition, name: Option<&str>, priority: Priority, func: F, ) -> Source where F: FnMut(RawFd, IOCondition) -> ControlFlow + Send + 'static, { unsafe { let source = ffi::g_unix_fd_source_new(fd, condition.into_glib()); glib::ffi::g_source_set_callback( source, Some(transmute::< *const (), unsafe extern "C" fn(glib::ffi::gpointer) -> glib::ffi::gboolean, >(trampoline_unix_fd:: as *const ())), into_raw_unix_fd(func), Some(destroy_closure_unix_fd::), ); glib::ffi::g_source_set_priority(source, priority.into_glib()); if let Some(name) = name { glib::ffi::g_source_set_name(source, name.to_glib_none().0); } from_glib_full(source) } } // rustdoc-stripper-ignore-next /// Create a `Future` that will resolve once the given UNIX signal is raised /// /// The `Future` must be spawned on an `Executor` backed by a `glib::MainContext`. pub fn signal_future(signum: i32) -> Pin + Send + 'static>> { signal_future_with_priority(Priority::default(), signum) } // rustdoc-stripper-ignore-next /// Adds a closure to be called by the default main loop whenever a UNIX signal is raised. /// /// `func` will be called repeatedly every time `signum` is raised until it /// returns `ControlFlow::Break`. /// /// The default main loop almost always is the main loop of the main thread. /// Thus, the closure is called on the main thread. #[doc(alias = "g_unix_signal_add_full")] pub fn unix_signal_add(signum: i32, func: F) -> SourceId where F: FnMut() -> ControlFlow + Send + 'static, { unsafe { from_glib(ffi::g_unix_signal_add_full( Priority::default().into_glib(), signum, Some(trampoline::), into_raw(func), Some(destroy_closure::), )) } } // rustdoc-stripper-ignore-next /// Adds a closure to be called by the default main loop whenever a UNIX signal is raised. /// /// `func` will be called repeatedly every time `signum` is raised until it /// returns `ControlFlow::Break`. /// /// The default main loop almost always is the main loop of the main thread. /// Thus, the closure is called on the main thread. /// /// In comparison to `unix_signal_add()`, this only requires `func` to be /// `FnOnce`, and will automatically return `ControlFlow::Break`. #[doc(alias = "g_unix_signal_add_full")] pub fn unix_signal_add_once(signum: i32, func: F) -> SourceId where F: FnOnce() + Send + 'static, { unix_signal_add(signum, fnmut_callback_wrapper(func)) } // rustdoc-stripper-ignore-next /// Adds a closure to be called by the default main loop whenever a UNIX signal is raised. /// /// `func` will be called repeatedly every time `signum` is raised until it /// returns `ControlFlow::Break`. /// /// The default main loop almost always is the main loop of the main thread. /// Thus, the closure is called on the main thread. /// /// Different to `unix_signal_add()`, this does not require `func` to be /// `Send` but can only be called from the thread that owns the main context. /// /// This function panics if called from a different thread than the one that /// owns the main context. #[doc(alias = "g_unix_signal_add_full")] pub fn unix_signal_add_local(signum: i32, func: F) -> SourceId where F: FnMut() -> ControlFlow + 'static, { unsafe { let context = glib::MainContext::default(); let _acquire = context .acquire() .expect("default main context already acquired by another thread"); from_glib(ffi::g_unix_signal_add_full( Priority::default().into_glib(), signum, Some(trampoline_local::), into_raw_local(func), Some(destroy_closure_local::), )) } } // rustdoc-stripper-ignore-next /// Adds a closure to be called by the default main loop whenever a UNIX signal is raised. /// /// `func` will be called repeatedly every time `signum` is raised until it /// returns `ControlFlow::Break`. /// /// The default main loop almost always is the main loop of the main thread. /// Thus, the closure is called on the main thread. /// /// Different to `unix_signal_add()`, this does not require `func` to be /// `Send` but can only be called from the thread that owns the main context. /// /// This function panics if called from a different thread than the one that /// owns the main context. /// /// In comparison to `unix_signal_add_local()`, this only requires `func` to be /// `FnOnce`, and will automatically return `ControlFlow::Break`. #[doc(alias = "g_unix_signal_add_full")] pub fn unix_signal_add_local_once(signum: i32, func: F) -> SourceId where F: FnOnce() + 'static, { unix_signal_add_local(signum, fnmut_callback_wrapper_local(func)) } // rustdoc-stripper-ignore-next /// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a /// UNIX file descriptor reaches the given IO condition. /// /// `func` will be called repeatedly while the file descriptor matches the given IO condition /// until it returns `ControlFlow::Break`. /// /// The default main loop almost always is the main loop of the main thread. /// Thus, the closure is called on the main thread. #[doc(alias = "g_unix_fd_add_full")] pub fn unix_fd_add(fd: RawFd, condition: IOCondition, func: F) -> SourceId where F: FnMut(RawFd, IOCondition) -> ControlFlow + Send + 'static, { unsafe { from_glib(ffi::g_unix_fd_add_full( Priority::default().into_glib(), fd, condition.into_glib(), Some(trampoline_unix_fd::), into_raw_unix_fd(func), Some(destroy_closure_unix_fd::), )) } } // rustdoc-stripper-ignore-next /// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a /// UNIX file descriptor reaches the given IO condition. /// /// `func` will be called repeatedly with `priority` while the file descriptor matches the given IO condition /// until it returns `ControlFlow::Break`. /// /// The default main loop almost always is the main loop of the main thread. /// Thus, the closure is called on the main thread. #[doc(alias = "g_unix_fd_add_full")] pub fn unix_fd_add_full( fd: RawFd, priority: Priority, condition: IOCondition, func: F, ) -> SourceId where F: FnMut(RawFd, IOCondition) -> ControlFlow + Send + 'static, { unsafe { from_glib(ffi::g_unix_fd_add_full( priority.into_glib(), fd, condition.into_glib(), Some(trampoline_unix_fd::), into_raw_unix_fd(func), Some(destroy_closure_unix_fd::), )) } } // rustdoc-stripper-ignore-next /// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a /// UNIX file descriptor reaches the given IO condition. /// /// `func` will be called repeatedly while the file descriptor matches the given IO condition /// until it returns `ControlFlow::Break`. /// /// The default main loop almost always is the main loop of the main thread. /// Thus, the closure is called on the main thread. /// /// Different to `unix_fd_add()`, this does not require `func` to be /// `Send` but can only be called from the thread that owns the main context. /// /// This function panics if called from a different thread than the one that /// owns the main context. #[doc(alias = "g_unix_fd_add_full")] pub fn unix_fd_add_local(fd: RawFd, condition: IOCondition, func: F) -> SourceId where F: FnMut(RawFd, IOCondition) -> ControlFlow + 'static, { unsafe { let context = glib::MainContext::default(); let _acquire = context .acquire() .expect("default main context already acquired by another thread"); from_glib(ffi::g_unix_fd_add_full( Priority::default().into_glib(), fd, condition.into_glib(), Some(trampoline_unix_fd_local::), into_raw_unix_fd_local(func), Some(destroy_closure_unix_fd_local::), )) } } // rustdoc-stripper-ignore-next /// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a /// UNIX file descriptor reaches the given IO condition. /// /// `func` will be called repeatedly with `priority` while the file descriptor matches the given IO condition /// until it returns `ControlFlow::Break`. /// /// The default main loop almost always is the main loop of the main thread. /// Thus, the closure is called on the main thread. /// /// Different to `unix_fd_add()`, this does not require `func` to be /// `Send` but can only be called from the thread that owns the main context. /// /// This function panics if called from a different thread than the one that /// owns the main context. #[doc(alias = "g_unix_fd_add_full")] pub fn unix_fd_add_local_full( fd: RawFd, priority: Priority, condition: IOCondition, func: F, ) -> SourceId where F: FnMut(RawFd, IOCondition) -> ControlFlow + 'static, { unsafe { let context = glib::MainContext::default(); let _acquire = context .acquire() .expect("default main context already acquired by another thread"); from_glib(ffi::g_unix_fd_add_full( priority.into_glib(), fd, condition.into_glib(), Some(trampoline_unix_fd_local::), into_raw_unix_fd_local(func), Some(destroy_closure_unix_fd_local::), )) } } glib-unix-0.22.0/src/lib.rs000064400000000000000000000004751046102023000135140ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. #![cfg_attr(docsrs, feature(doc_cfg))] #![doc = include_str!("../README.md")] pub use glib_unix_sys as ffi; mod auto; mod functions; pub use auto::functions::*; pub use functions::*; pub mod prelude { pub use glib::prelude::*; }