2022-05-03 03:56:07 +00:00
|
|
|
|
|
|
|
#include "sane/sanei_backend.h"
|
|
|
|
#include "sane/sane_ex.h"
|
|
|
|
//#include <stdlib.h>
|
|
|
|
//#include <string>
|
|
|
|
//#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);
|
2023-01-28 07:19:10 +00:00
|
|
|
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);
|
2022-05-03 03:56:07 +00:00
|
|
|
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);
|
2022-08-02 09:32:22 +00:00
|
|
|
extern const char* inner_sane_err_desc(SANE_Status err);
|
2023-01-28 07:19:10 +00:00
|
|
|
extern SANE_Status inner_sane_read_ext(SANE_Img_Ext_Info* ext_info, SANE_Int* len);
|
2022-05-03 03:56:07 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 导出接口
|
|
|
|
/// </summary>
|
|
|
|
SANE_Status sane_init(SANE_Int* version_code, SANE_Auth_Callback authorize)
|
|
|
|
{
|
|
|
|
return inner_sane_init(version_code, authorize);
|
|
|
|
}
|
|
|
|
void sane_exit(void)
|
|
|
|
{
|
2022-07-18 02:54:41 +00:00
|
|
|
inner_sane_exit();
|
2022-05-03 03:56:07 +00:00
|
|
|
}
|
|
|
|
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)
|
|
|
|
{
|
2023-01-28 07:19:10 +00:00
|
|
|
return inner_sane_get_option_descriptor(handle, (const void*)option);
|
2022-05-03 03:56:07 +00:00
|
|
|
}
|
|
|
|
SANE_Status sane_control_option(SANE_Handle handle, SANE_Int option, SANE_Action action, void* value, SANE_Int* info)
|
|
|
|
{
|
2023-01-28 07:19:10 +00:00
|
|
|
return inner_sane_control_option(handle, (const void*)option, action, value, info);
|
2022-05-03 03:56:07 +00:00
|
|
|
}
|
|
|
|
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);
|
|
|
|
}
|
2022-08-02 09:32:22 +00:00
|
|
|
const char* sane_err_desc(SANE_Status err)
|
|
|
|
{
|
|
|
|
return inner_sane_err_desc(err);
|
|
|
|
}
|
2023-01-28 07:19:10 +00:00
|
|
|
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);
|
|
|
|
}
|