sane-sys 0.1.0

Raw FFI bindings to libsane, the SANE (Scanner Access Now Easy) scanner API, generated with bindgen and linked through pkg-config
Documentation
  • Coverage
  • 8.73%
    11 out of 126 items documented0 out of 14 items with examples
  • Size
  • Source code size: 38.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 802.7 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 15s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • AlixANNERAUD/libsane_rust
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • AlixANNERAUD

sane-sys

crates.io docs.rs

Raw FFI bindings to libsane, the library of SANE (Scanner Access Now Easy).

The bindings are generated by bindgen from the system sane/sane.h at build time, and libsane is linked through pkg-config (sane-backends). C enums (SANE_Status, SANE_Frame...) are integer constants, so values a backend returns that the header does not list are not undefined behavior. The function-like macros of sane.h (SANE_FIX, SANE_VERSION_MAJOR...) are provided as functions.

For a safe API, use libsane.

System requirements

System Command
Debian, Ubuntu sudo apt install libsane-dev pkg-config libclang-dev
Fedora sudo dnf install sane-backends-devel pkgconf-pkg-config clang-devel
Arch Linux sudo pacman -S sane pkgconf clang
macOS (Homebrew) brew install sane-backends pkg-config llvm

The usual pkg-config variables apply (PKG_CONFIG_PATH, PKG_CONFIG_SYSROOT_DIR...), and linking can be overridden without pkg-config through Cargo's links override for sane.

On docs.rs, which has no libsane, the bindings are generated from the copy of the public-domain sane.h in include/, and nothing is linked.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.