]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change set info option to method
authorBastian Dehn <hhaalo@arcor.de>
Mon, 22 Sep 2025 11:05:42 +0000 (13:05 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 22 Sep 2025 11:05:42 +0000 (13:05 +0200)
src/kds_s2000w_handler_opts.c

index 0740b19514e9b1929a330bdd803ce49ae631c73a..f3a795b8769adb722dfb6102c2a3f2f7bf3343e0 100644 (file)
@@ -244,6 +244,28 @@ void _kds_s2000w_handler_opts_set_enable_color_drop_out_aggressiveness(json_obje
        color_drop_out_aggressiveness->cap &= ~SANE_CAP_SOFT_SELECT;
 }
 
+void _kds_s2000w_handler_opts_set_info_option(uint32_t option, int32_t* info) {
+       if (info == NULL)
+               return;
+
+       switch (option) {
+       case 3:
+       case 7:
+       case 8:
+       case 14:
+       case 16:
+       case 19:
+       case 21:
+       case 24:
+               *info = RELOAD_OPTIONS;
+               break;
+       case 31:
+               *info = RELOAD_OPTIONS | RELOAD_PARAMS;
+               break;
+       default:
+               break;
+       }
+}
 
 void kds_s2000w_handler_opts_get_option(handler* h, uint32_t option, void* value, int32_t* info)
 {
@@ -377,24 +399,6 @@ void kds_s2000w_handler_opts_set_option(handler* h, uint32_t option, void* value
                break;
        }
 
-       switch (option) {
-       case 3:
-       case 7:
-       case 8:
-       case 14:
-       case 16:
-       case 19:
-       case 21:
-       case 24:
-               if (info != NULL)
-                       *info = RELOAD_OPTIONS;
-               break;
-       case 31:
-               if (info != NULL)
-                       *info = RELOAD_OPTIONS | RELOAD_PARAMS;
-       default:
-               break;
-       }
-
+       _kds_s2000w_handler_opts_set_info_option(option, info);
        _kds_s2000w_handler_opts_set_options(h);
 }
\ No newline at end of file