# sane-sys
[](https://crates.io/crates/sane-sys)
[](https://docs.rs/sane-sys)
Raw FFI bindings to libsane, the library of
[SANE (Scanner Access Now Easy)](http://www.sane-project.org/).
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`](https://crates.io/crates/libsane).
## System requirements
| 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](https://doc.rust-lang.org/cargo/reference/build-scripts.html#overriding-build-scripts)
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.