]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add descriptor var and deprecated mark
authorBastian Dehn <hhaalo@arcor.de>
Mon, 22 Sep 2025 05:20:06 +0000 (07:20 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 22 Sep 2025 05:20:06 +0000 (07:20 +0200)
src/kds_s2000w_option_descriptors.c

index dfcfde1691f81dd18a3b6e932502780902b75d32..f8ae1d73d741849307bb58ab1a054a5355034dd5 100644 (file)
@@ -6,7 +6,8 @@
 
 #define MAX_OPTION_COUNT 47
 
-SANE_Option_Descriptor* descriptor_array = NULL;
+__attribute_deprecated__ SANE_Option_Descriptor* descriptor_array = NULL;
+option_descriptor** descriptors = NULL;
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_standard_group()
 {
@@ -1113,6 +1114,8 @@ void kds_s2000w_option_descriptors_init()
 {
        kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_init_option_descriptors");
 
+       descriptors = malloc(sizeof(option_descriptor*) * MAX_OPTION_COUNT);
+
        descriptor_array = malloc(sizeof(SANE_Option_Descriptor) * MAX_OPTION_COUNT);
        descriptor_array[0] = _kds_s2000w_option_descriptor_num_options();
        descriptor_array[1] = _kds_s2000w_option_descriptor_standard_group();
@@ -1190,6 +1193,8 @@ void kds_s2000w_option_descriptors_free()
 
        free(descriptor_array);
        descriptor_array = NULL;
+       free(descriptors);
+       descriptors = NULL;
 }
 
 SANE_Option_Descriptor* kds_s2000w_option_descriptors_get_by_number(uint32_t number)