From: Bastian Dehn Date: Wed, 24 Jan 2024 20:10:34 +0000 (+0100) Subject: add descript fill with current state X-Git-Tag: v1.0.0^2~465 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=661f2a2f5e60f78ac9b26c217b4326d326a1425d;p=sane-kds-s2000w-net.git add descript fill with current state --- diff --git a/src/kds_s2000w_handler.c b/src/kds_s2000w_handler.c index 47a39ff..65eeac7 100644 --- a/src/kds_s2000w_handler.c +++ b/src/kds_s2000w_handler.c @@ -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) diff --git a/src/kds_s2000w_handler.h b/src/kds_s2000w_handler.h index a215492..3d36b16 100644 --- a/src/kds_s2000w_handler.h +++ b/src/kds_s2000w_handler.h @@ -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); diff --git a/src/kds_s2000w_net.c b/src/kds_s2000w_net.c index c275de8..49179b7 100644 --- a/src/kds_s2000w_net.c +++ b/src/kds_s2000w_net.c @@ -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;