sys usb-compat-01-sys

Rust bindings for libusb-compat-0.1

7 releases

0.2.6 Oct 1, 2024
0.2.5 Oct 1, 2024
0.2.4 May 23, 2023
0.2.3 Dec 7, 2022
0.1.1 Apr 24, 2021
Download history 18/week @ 2024-06-24 42/week @ 2024-07-01 9/week @ 2024-07-08 21/week @ 2024-07-15 40/week @ 2024-07-29 16/week @ 2024-08-05 24/week @ 2024-08-12 3/week @ 2024-08-26 2/week @ 2024-09-02 23/week @ 2024-09-23 352/week @ 2024-09-30 21/week @ 2024-10-07

396 downloads per month
Used in 3 crates (via nfc1-sys)

MIT license

46KB
1K SLoC

C 1K SLoC // 0.1% comments Rust 113 SLoC // 0.0% comments M4 45 SLoC // 0.2% comments Automake 34 SLoC Shell 17 SLoC // 0.1% comments

Contains (obscure autoconf code, 3KB) vendor/usb-compat-0.1/configure.ac

usb-compat-01-sys

Crates.io

Warning: If you just need to use libusb, you might be better off with any other libusb crate.

This crate exists mainly to provide linkage to libusb-compat-0.1, which is useful for creating Rust bindings to projects which utilize libusb 0.1.

In summary, it provides:

  • Low-level bindings to libusb-compat-0.1, generated by bindgen
  • Metadata which allows dependent crates to find the libusb/usb.h header, compile native code that depends on libusb-compat-0.1 or link to it in Rust code.
  • Vendored submodule copy of libusb-compat-0.1 (with build tweaks for x86_64-pc-windows-msvc), which means you don't have to separately install libusb-compat-0.1 to use this crate.

Usage

Add usb-compat-01-sys as a dependency in your project's Cargo.toml file:

[dependencies]
usb-compat-01-sys = "0.2"

Import the usb_compat_01_sys crate in your project, then you can use all functions starting with usb_ from libusb-compat-0.1.

See the libusb-compat-0.1 wiki or libusb-compat-0.1 examples for information on how to use it. The API is the same, as this is just a binding.

Dependencies

~1–3MB
~62K SLoC