add get version of driver API

This commit is contained in:
gb 2023-08-23 10:22:31 +08:00
parent bdb975bdfb
commit 890d4a1c78
2 changed files with 18 additions and 0 deletions

View File

@ -25,6 +25,7 @@ extern SANE_Status inner_sane_init_ex(SANE_Int* version_code, sane_callback cb,
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);
extern SANE_Status inner_sane_ex_get_driver_version(SANE_Int* hh, SANE_Int* hl, SANE_Int* lh, SANE_Int* ll);
/// <summary>
/// 导出接口
@ -114,3 +115,7 @@ SANE_Status sane_read_ext_info(SANE_Img_Ext_Info* ext_info, SANE_Int* len)
{
return inner_sane_read_ext(ext_info, len);
}
SANE_Status sane_ex_get_driver_version(SANE_Int* hh, SANE_Int* hl, SANE_Int* lh, SANE_Int* ll)
{
return inner_sane_ex_get_driver_version(hh, hl, lh, ll);
}

View File

@ -2628,6 +2628,19 @@ extern "C" { // avoid compiler exporting name in C++ style !!!
{
return SANE_STATUS_UNSUPPORTED;
}
SANE_Status inner_sane_ex_get_driver_version(SANE_Int* hh, SANE_Int* hl, SANE_Int* lh, SANE_Int* ll)
{
if (hh)
*hh = VERSION_MAJOR;
if (hl)
*hl = VERSION_MINOR;
if (lh)
*lh = VERSION_YEAR;
if (ll)
*ll = GET_BUILD_VER;
return SANE_STATUS_GOOD;
}
void sanei_debug_msg(int level, int max_level, const char* be, const char* fmt, va_list ap)
{