sane-sys
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.