]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add descript fill with current state
authorBastian Dehn <hhaalo@arcor.de>
Wed, 24 Jan 2024 20:10:34 +0000 (21:10 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Wed, 24 Jan 2024 20:10:34 +0000 (21:10 +0100)
src/kds_s2000w_handler.c
src/kds_s2000w_handler.h
src/kds_s2000w_net.c

index 47a39ff5f44ec1d86b37ba5a0ae600893b79da0c..65eeac7dc02e959836101ae7c572e193d618bc40 100644 (file)
@@ -80,6 +80,11 @@ void kds_s2000w_handler_close()
        state = NULL;
 }
 
+current_state* kds_s2000w_handler_current_state()
+{
+       return state;
+}
+
 void kds_s2000w_handler_get_option(int option, void* value)
 {
        if (option != 0)
index a215492cfd7d6e3498eaf6c55fd1007b7d19ae71..3d36b16092888fd59430ea0a300d80b5df6bb55f 100644 (file)
@@ -24,6 +24,7 @@ typedef struct {
 
 current_state* kds_s2000w_handler_open();
 void kds_s2000w_handler_close();
+current_state* kds_s2000w_handler_current_state();
 void kds_s2000w_handler_get_option(int option, void* value);
 void kds_s2000w_handler_set_option(int option, void* value);
 void kds_s2000w_handler_set_option_auto(int option);
index c275de87a5f3007d57c496f49429ade067727740..49179b7f8909de2f59aab6903384bc4e8f5520b9 100644 (file)
@@ -72,13 +72,14 @@ 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)
 {
+       current_state* state = kds_s2000w_handler_current_state();
        if (option == 0) {
-               optionDescripor->name = "";
+               optionDescripor->name = "count of options";
                optionDescripor->title = "count of options";
                optionDescripor->desc = "count of options";
-               optionDescripor->type = SANE_TYPE_INT;
+               optionDescripor->type = state->type;
                optionDescripor->unit = SANE_UNIT_NONE;
-               optionDescripor->size = sizeof(SANE_Int);
+               optionDescripor->size = state->size;
                optionDescripor->cap = 0;
                optionDescripor->constraint_type = SANE_CONSTRAINT_NONE;
                optionDescripor->constraint.string_list = NULL;