objc2_io_usb_host/
lib.rs

1//! # Bindings to the `IOUSBHost` framework
2//!
3//! See [Apple's docs][apple-doc] and [the general docs on framework crates][framework-crates] for more information.
4//!
5//! [apple-doc]: https://developer.apple.com/documentation/iousbhost/
6//! [framework-crates]: https://docs.rs/objc2/latest/objc2/topics/about_generated/index.html
7#![no_std]
8#![cfg_attr(feature = "unstable-darwin-objc", feature(darwin_objc))]
9#![cfg_attr(docsrs, feature(doc_cfg))]
10// Update in Cargo.toml as well.
11#![doc(html_root_url = "https://docs.rs/objc2-io-usb-host/0.3.2")]
12
13#[cfg(feature = "alloc")]
14extern crate alloc;
15
16#[cfg(feature = "std")]
17extern crate std;
18
19mod generated;
20#[allow(unused_imports, unreachable_pub)]
21pub use self::generated::*;
22
23// IOKit/IOReturn.h
24#[allow(dead_code)]
25pub(crate) type IOReturn = core::ffi::c_int; // kern_return_t
26
27#[allow(unused_macros)]
28macro_rules! IOUSBBit {
29    ($bit:expr) => {
30        1 << $bit
31    };
32}
33#[allow(unused_imports)]
34pub(crate) use IOUSBBit;
35
36#[allow(unused_macros)]
37macro_rules! IOUSBBitRange {
38    ($start:expr, $end:expr) => {
39        !((1 << $start) - 1) & ((1 << $end) | ((1 << $end) - 1))
40    };
41}
42#[allow(unused_imports)]
43pub(crate) use {IOUSBBitRange, IOUSBBitRange as IOUSBBitRange64};
44
45#[allow(unused_macros)]
46macro_rules! IOUSBBitRangePhase {
47    ($start:expr, $end:expr) => {
48        $start
49    };
50}
51#[allow(unused_imports)]
52pub(crate) use IOUSBBitRangePhase;
53
54#[cfg(feature = "IOUSBHostDefinitions")]
55extern "C" {
56    /// [Apple's documentation](https://developer.apple.com/documentation/iousbhost/iousbhostmatchingpropertykeyproductidmask?language=objc)
57    pub static IOUSBHostMatchingPropertyKeyProductIDMask: &'static IOUSBHostMatchingPropertyKey;
58}