#include "sane/sanei_backend.h" #include "sane/sane_ex.h" //#include //#include //#include "sane_hg_mdw.h" extern SANE_Status inner_sane_init(SANE_Int* version_code, SANE_Auth_Callback authorize); extern void inner_sane_exit(void); extern SANE_Status inner_sane_get_devices(const SANE_Device*** device_list, SANE_Bool local_only); extern SANE_Status inner_sane_open(SANE_String_Const devicename, SANE_Handle* handle); extern void inner_sane_close(SANE_Handle handle); extern const SANE_Option_Descriptor* inner_sane_get_option_descriptor(SANE_Handle handle, const void* option); extern SANE_Status inner_sane_control_option(SANE_Handle handle, const void* option, SANE_Action action, void* value, SANE_Int* info); extern SANE_Status inner_sane_get_parameters(SANE_Handle handle, SANE_Parameters* params); extern SANE_Status inner_sane_start(SANE_Handle handle); extern SANE_Status inner_sane_read(SANE_Handle handle, SANE_Byte* data, SANE_Int max_length, SANE_Int* length); extern void inner_sane_cancel(SANE_Handle handle); extern SANE_Status inner_sane_set_io_mode(SANE_Handle handle, SANE_Bool non_blocking); extern SANE_Status inner_sane_get_select_fd(SANE_Handle handle, SANE_Int* fd); extern SANE_String_Const inner_sane_strstatus(SANE_Status status); extern SANE_Status inner_sane_init_ex(SANE_Int* version_code, sane_callback cb, void* param); extern SANE_Status inner_sane_io_control(SANE_Handle h, unsigned long code, void* data, unsigned* len); extern const char* inner_sane_err_desc(SANE_Status err); extern SANE_Status inner_sane_read_ext(SANE_Img_Ext_Info* ext_info, SANE_Int* len); /// /// 导出接口 /// SANE_Status sane_init(SANE_Int* version_code, SANE_Auth_Callback authorize) { return inner_sane_init(version_code, authorize); } void sane_exit(void) { inner_sane_exit(); } SANE_Status sane_get_devices(const SANE_Device*** device_list, SANE_Bool local_only) { return inner_sane_get_devices(device_list, local_only); } SANE_Status sane_open(SANE_String_Const devicename, SANE_Handle* handle) { return inner_sane_open(devicename, handle); } void sane_close(SANE_Handle handle) { inner_sane_close(handle); } const SANE_Option_Descriptor* sane_get_option_descriptor(SANE_Handle handle, SANE_Int option) { return inner_sane_get_option_descriptor(handle, (const void*)option); } SANE_Status sane_control_option(SANE_Handle handle, SANE_Int option, SANE_Action action, void* value, SANE_Int* info) { return inner_sane_control_option(handle, (const void*)option, action, value, info); } SANE_Status sane_get_parameters(SANE_Handle handle, SANE_Parameters* params) { return inner_sane_get_parameters(handle, params); } SANE_Status sane_start(SANE_Handle handle) { return inner_sane_start(handle); } SANE_Status sane_read(SANE_Handle handle, SANE_Byte* data, SANE_Int max_length, SANE_Int* length) { return inner_sane_read(handle, data, max_length, length); } void sane_cancel(SANE_Handle handle) { inner_sane_cancel(handle); } SANE_Status sane_set_io_mode(SANE_Handle handle, SANE_Bool non_blocking) { return inner_sane_set_io_mode(handle, non_blocking); } SANE_Status sane_get_select_fd(SANE_Handle handle, SANE_Int* fd) { return inner_sane_get_select_fd(handle, fd); } SANE_String_Const sane_strstatus(SANE_Status status) { return inner_sane_strstatus(status); } // extensions ... SANE_Status sane_init_ex(SANE_Int* version_code, sane_callback cb, void* param) { return inner_sane_init_ex(version_code, cb, param); } SANE_Status sane_io_control(SANE_Handle h, unsigned long code, void* data, unsigned* len) { return inner_sane_io_control(h, code, data, len); } const char* sane_err_desc(SANE_Status err) { return inner_sane_err_desc(err); } const SANE_Option_Descriptor* sane_get_option_descriptor_ex(SANE_Handle handle, const char* option) { return inner_sane_get_option_descriptor(handle, (const void*)option); } SANE_Status sane_control_option_ex(SANE_Handle handle, const char* option, SANE_Action action, void* value, SANE_Int* info) { return inner_sane_control_option(handle, (const void*)option, action, value, info); } SANE_Status sane_read_ext_info(SANE_Img_Ext_Info* ext_info, SANE_Int* len) { return inner_sane_read_ext(ext_info, len); }