From 663cbdeb5cbd9a2d6e9e1c0f1e2501efb7fc3f38 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sat, 20 Jan 2024 08:54:15 +0100 Subject: [PATCH] add option descriptor --- src/kds_s2000w_net.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/kds_s2000w_net.c b/src/kds_s2000w_net.c index f733d74..6159b61 100644 --- a/src/kds_s2000w_net.c +++ b/src/kds_s2000w_net.c @@ -3,6 +3,7 @@ #include SANE_Device* device = NULL; +SANE_Option_Descriptor* optionDescripor = NULL; SANE_Status _sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback authorize) { @@ -32,6 +33,9 @@ SANE_Status _sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback void _sane_kds_s2000w_net_exit(void) { free(device); + device = NULL; + free(optionDescripor); + optionDescripor = NULL; printf("kds_s2000w_net exit\n"); } @@ -70,6 +74,19 @@ const SANE_Option_Descriptor* _sane_kds_s2000w_net_get_option_descriptor( SANE_Handle handle, SANE_Int option) { printf("kds_s2000w_net get option descriptor\n"); + + optionDescripor = malloc(sizeof(SANE_Option_Descriptor)); + 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; + + return optionDescripor; } SANE_Status _sane_kds_s2000w_net_control_option(SANE_Handle handle, -- 2.39.5