Skip to main content

Crate sane_sys

Crate sane_sys 

Source
Expand description

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). For a safe API, use the libsane crate.

C enums (SANE_Status, SANE_Frame, …) are type aliases of integers with one constant per value, because backends may return values the header does not list. The function-like macros of sane.h are provided as functions: SANE_VERSION_CODE, SANE_VERSION_MAJOR, SANE_VERSION_MINOR, SANE_VERSION_BUILD, SANE_FIX, SANE_UNFIX, SANE_OPTION_IS_ACTIVE and SANE_OPTION_IS_SETTABLE.

§System requirements

The SANE development files (libsane-dev on Debian and Ubuntu, sane-backends-devel on Fedora, sane-backends on Homebrew), pkg-config, and libclang for bindgen.

Structs§

SANE_Auth_Data
SANE_Device
SANE_Option_Descriptor
SANE_Parameters
SANE_Range

Constants§

SANE_ACTION_GET_VALUE
SANE_ACTION_SET_AUTO
SANE_ACTION_SET_VALUE
SANE_CAP_ADVANCED
SANE_CAP_AUTOMATIC
SANE_CAP_EMULATED
SANE_CAP_HARD_SELECT
SANE_CAP_INACTIVE
SANE_CAP_SOFT_DETECT
SANE_CAP_SOFT_SELECT
SANE_CONSTRAINT_NONE
SANE_CONSTRAINT_RANGE
SANE_CONSTRAINT_STRING_LIST
SANE_CONSTRAINT_WORD_LIST
SANE_CURRENT_MAJOR
SANE_CURRENT_MINOR
SANE_FALSE
SANE_FIXED_SCALE_SHIFT
SANE_FRAME_BLUE
SANE_FRAME_GRAY
SANE_FRAME_GREEN
SANE_FRAME_RED
SANE_FRAME_RGB
SANE_INFO_INEXACT
SANE_INFO_RELOAD_OPTIONS
SANE_INFO_RELOAD_PARAMS
SANE_MAX_PASSWORD_LEN
SANE_MAX_USERNAME_LEN
SANE_STATUS_ACCESS_DENIED
SANE_STATUS_CANCELLED
SANE_STATUS_COVER_OPEN
SANE_STATUS_DEVICE_BUSY
SANE_STATUS_EOF
SANE_STATUS_GOOD
SANE_STATUS_HW_LOCKED
The scanner mechanism is locked for transport.
SANE_STATUS_INVAL
SANE_STATUS_IO_ERROR
SANE_STATUS_JAMMED
SANE_STATUS_NO_DOCS
SANE_STATUS_NO_MEM
SANE_STATUS_UNSUPPORTED
SANE_STATUS_WARMING_UP
The lamp is not ready, retry later.
SANE_TRUE
SANE_TYPE_BOOL
SANE_TYPE_BUTTON
SANE_TYPE_FIXED
SANE_TYPE_GROUP
SANE_TYPE_INT
SANE_TYPE_STRING
SANE_UNIT_BIT
SANE_UNIT_DPI
SANE_UNIT_MICROSECOND
SANE_UNIT_MM
SANE_UNIT_NONE
SANE_UNIT_PERCENT
SANE_UNIT_PIXEL

Functions§

SANE_FIX
Converts a floating point number to SANE_Fixed (SANE_FIX).
SANE_OPTION_IS_ACTIVE
Whether an option with these capabilities is active (SANE_OPTION_IS_ACTIVE).
SANE_OPTION_IS_SETTABLE
Whether an option with these capabilities can be set by software (SANE_OPTION_IS_SETTABLE).
SANE_UNFIX
Converts a SANE_Fixed to a floating point number (SANE_UNFIX).
SANE_VERSION_BUILD
The build number of a version code (SANE_VERSION_BUILD).
SANE_VERSION_CODE
Builds a version code from its parts (SANE_VERSION_CODE).
SANE_VERSION_MAJOR
The major version of a version code (SANE_VERSION_MAJOR).
SANE_VERSION_MINOR
The minor version of a version code (SANE_VERSION_MINOR).
sane_cancel⚠
sane_close⚠
sane_control_option⚠
sane_exit⚠
sane_get_devices⚠
sane_get_option_descriptor⚠
sane_get_parameters⚠
sane_get_select_fd⚠
sane_init⚠
sane_open⚠
sane_read⚠
sane_set_io_mode⚠
sane_start⚠
sane_strstatus⚠

Type Aliases§

SANE_Action
SANE_Auth_Callback
SANE_Bool
SANE_Byte
SANE_Char
SANE_Constraint_Type
SANE_Fixed
SANE_Frame
SANE_Handle
SANE_Int
SANE_Status
SANE_String
SANE_String_Const
SANE_Unit
SANE_Value_Type
SANE_Word

Unions§

SANE_Option_Descriptor__bindgen_ty_1