]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change descriptor for option number zero
authorBastian Dehn <hhaalo@arcor.de>
Sun, 21 Jan 2024 17:27:20 +0000 (18:27 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 21 Jan 2024 17:27:26 +0000 (18:27 +0100)
src/kds_s2000w_net.c

index be49cccb35861ce48ae1ea4e3c60721a1130a3b2..972b0a584560f724511ccd3a0da9a91aea2ee809 100644 (file)
@@ -72,15 +72,17 @@ void _sane_kds_s2000w_net_close(SANE_Handle handle)
 const SANE_Option_Descriptor* _sane_kds_s2000w_net_get_option_descriptor(
        SANE_Handle handle, SANE_Int option)
 {
-       optionDescripor->name = "test";
-       optionDescripor->title = "test get option descriptor";
-       optionDescripor->desc = "function get option descriptor test";
-       optionDescripor->type = SANE_TYPE_BOOL;
-       optionDescripor->unit = SANE_UNIT_NONE;
-       optionDescripor->size = 0;
-       optionDescripor->cap = 0;
-       optionDescripor->constraint_type = SANE_CONSTRAINT_NONE;
-       optionDescripor->constraint.string_list = NULL;
+       if (option == 0) {
+               optionDescripor->name = "";
+               optionDescripor->title = "count of options";
+               optionDescripor->desc = "count of options";
+               optionDescripor->type = SANE_TYPE_INT;
+               optionDescripor->unit = SANE_UNIT_NONE;
+               optionDescripor->size = sizeof(SANE_Int);
+               optionDescripor->cap = 0;
+               optionDescripor->constraint_type = SANE_CONSTRAINT_NONE;
+               optionDescripor->constraint.string_list = NULL;
+       }
 
        return optionDescripor;
 }