SANE_Option_Descriptor* option_descriptors = NULL;
SANE_Device* device_info = NULL;
+int cancel = 0;
SANE_Status _sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback authorize)
{
SANE_Status _sane_kds_s2000w_net_start(SANE_Handle handle)
{
+ cancel = 0;
return SANE_STATUS_GOOD;
}
SANE_Int max_length, SANE_Int* length)
{
int length_count = 0;
- while(length_count < max_length) {
+ while(length_count < max_length) {
+ if (cancel) {
+ *length = 0;
+ return SANE_STATUS_CANCELLED;
+ }
data[length_count] = 0;
length_count++;
}
void _sane_kds_s2000w_net_cancel(SANE_Handle handle)
{
+ cancel = 1;
return;
}