![]() |
LibInsane
1.0.10
Cross-platform Cross-API Cross-driver Cross-image-scanner Image Scan Library
|
LibInsane C API. More...
#include <capi.h>
Data Fields | |
const char * | base_name |
void(* | cleanup )(struct lis_api *impl) |
cleanup the implementation. More... | |
enum lis_error(* | list_devices )(struct lis_api *impl, enum lis_device_locations locs, struct lis_device_descriptor ***dev_infos) |
Look for paper eaters. More... | |
enum lis_error(* | get_device )(struct lis_api *impl, const char *dev_id, struct lis_item **item) |
Open the access to a device. More... | |
void(* lis_api::cleanup) (struct lis_api *impl) |
cleanup the implementation.
Must be called once you're done with the implementation instance. Otherwise you will leak file descriptors and memory.
Exact meaning depends on the implementation (call to sane_cleanup()
, stopping a thread, etc).
enum lis_error(* lis_api::get_device) (struct lis_api *impl, const char *dev_id, struct lis_item **item) |
Open the access to a device.
Open the device.
[in] | dev_id | Device identifier. See list_devices(). |
[out] | item | Item representing the scanner. |
LIS_OK | item has been set to ta valid list of items. List is NULL terminated. You must use lis_item::close() on it later. See LIS_IS_OK. |
LIS_ERR_DEVICE_BUSY | Another process is already using this scanner. item may or may not be modified. See LIS_IS_ERROR. |
LIS_ERR_IO_ERROR | Didn't work but don't know why ... Item may or may not be modified. See LIS_IS_ERROR. |
LIS_ERR_ACCESS_DENIED | Permission denied. See LIS_IS_ERROR. |
enum lis_error(* lis_api::list_devices) (struct lis_api *impl, enum lis_device_locations locs, struct lis_device_descriptor ***dev_infos) |
Look for paper eaters.
If you already know the device identifier of the scanner you want to use, you do not need to call this function. You can call directly get_device.
[in] | local_only | 1 if only local devices must be reported, 0 if remote devices must also be reported |
[out] | dev_infos | will point to a list of device descriptions, NULL terminated. Will be invalidated/freed at the next call of list_devices() or cleanup. |
LIS_OK | dev_infos has been set to a list of devices. See LIS_IS_OK. |