]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change sane method order
authorBastian Dehn <hhaalo@arcor.de>
Sat, 25 Jan 2025 17:42:39 +0000 (18:42 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 25 Jan 2025 17:42:39 +0000 (18:42 +0100)
src/kds_s2000w_net.c
src/kds_s2000w_net.h

index 1dd0c95e30f933d66cfa8be7fcaa18eaf05eee85..be26aa30403541f37965acaf2c9ec039924cc1b1 100644 (file)
@@ -109,38 +109,6 @@ SANE_Status sane_kds_s2000w_net_control_option(SANE_Handle handle,
        return SANE_STATUS_GOOD;
 }
 
-void sane_kds_s2000w_net_cancel(SANE_Handle handle)
-{
-       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_cancel");
-
-       handler* h = (handler*) handle;
-
-       if (h->read_info->cancel > 0) {
-               kds_s2000w_debug_printf(DEBUG, "scan completed canceled");
-               kds_s2000w_handler_reset(h);
-               kds_s2000w_handler_recreate_session(h);
-               return;
-       }
-
-       kds_s2000w_handler_get_current_scan_status(h);
-
-       if (h->current_scan_status->complete_scanned > 0) {
-               kds_s2000w_debug_printf(DEBUG, "scan completed");
-               kds_s2000w_handler_reset(h);
-               return;
-       }
-
-       if (h->current_scan_status->available_images <= 0) {
-               kds_s2000w_debug_printf(DEBUG, "scan completed no availible images");
-               kds_s2000w_handler_reset(h);
-               kds_s2000w_handler_recreate_session(h);
-               return;
-       }
-
-       kds_s2000w_debug_printf(DEBUG, "scan canceled");
-       h->read_info->cancel = 1;
-       kds_s2000w_handler_stop_scan(h);
-}
 
 SANE_Status sane_kds_s2000w_net_get_parameters(SANE_Handle handle,
        SANE_Parameters* params)
@@ -219,6 +187,39 @@ SANE_Status sane_kds_s2000w_net_read(SANE_Handle handle, SANE_Byte* data,
        return SANE_STATUS_GOOD;
 }
 
+void sane_kds_s2000w_net_cancel(SANE_Handle handle)
+{
+       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_cancel");
+
+       handler* h = (handler*) handle;
+
+       if (h->read_info->cancel > 0) {
+               kds_s2000w_debug_printf(DEBUG, "scan completed canceled");
+               kds_s2000w_handler_reset(h);
+               kds_s2000w_handler_recreate_session(h);
+               return;
+       }
+
+       kds_s2000w_handler_get_current_scan_status(h);
+
+       if (h->current_scan_status->complete_scanned > 0) {
+               kds_s2000w_debug_printf(DEBUG, "scan completed");
+               kds_s2000w_handler_reset(h);
+               return;
+       }
+
+       if (h->current_scan_status->available_images <= 0) {
+               kds_s2000w_debug_printf(DEBUG, "scan completed no availible images");
+               kds_s2000w_handler_reset(h);
+               kds_s2000w_handler_recreate_session(h);
+               return;
+       }
+
+       kds_s2000w_debug_printf(DEBUG, "scan canceled");
+       h->read_info->cancel = 1;
+       kds_s2000w_handler_stop_scan(h);
+}
+
 SANE_Status sane_kds_s2000w_net_set_io_mode(SANE_Handle handle,
        SANE_Bool non_blocking)
 {
index 7efb31cae59d673a565fe422a5ae1b4748b7c6b3..9314728554d46e91fc34aaf06b2f20558fed1902 100644 (file)
@@ -4,15 +4,21 @@
 
 SANE_Status sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback authorize);
 void sane_kds_s2000w_net_exit(void);
+
 SANE_Status sane_kds_s2000w_net_get_devices(SANE_Device*** device_list, SANE_Bool local_only);
+
 SANE_Status sane_kds_s2000w_net_open(SANE_String_Const devicename, SANE_Handle* handle);
 void sane_kds_s2000w_net_close(SANE_Handle handle);
-SANE_Status sane_kds_s2000w_net_control_option(SANE_Handle handle, SANE_Int option, SANE_Action action, void* value, SANE_Int* info);
+
 const SANE_Option_Descriptor* sane_kds_s2000w_net_get_option_descriptor(SANE_Handle handle, SANE_Int option);
-void sane_kds_s2000w_net_cancel(SANE_Handle handle);
+SANE_Status sane_kds_s2000w_net_control_option(SANE_Handle handle, SANE_Int option, SANE_Action action, void* value, SANE_Int* info);
+
 SANE_Status sane_kds_s2000w_net_get_parameters(SANE_Handle handle,     SANE_Parameters* params);
 SANE_Status sane_kds_s2000w_net_start(SANE_Handle handle);
 SANE_Status sane_kds_s2000w_net_read(SANE_Handle handle, SANE_Byte* data, SANE_Int max_length, SANE_Int* length);
+
+void sane_kds_s2000w_net_cancel(SANE_Handle handle);
+
 SANE_Status sane_kds_s2000w_net_set_io_mode(SANE_Handle handle, SANE_Bool non_blocking);
 SANE_Status sane_kds_s2000w_net_get_select_fd(SANE_Handle handle, SANE_Int* fd);