return h->scanner_config;
}
+int32_t _kds_s2000w_handler_opts_get_zero_option(void* value) {
+ int32_t* int_value = (int32_t*) value;
+ *int_value = kds_s2000w_option_descriptors_get_max_option_count();
+ return GOOD;
+}
+
void _kds_s2000w_handler_opts_set_options(handler_t* h)
{
const char* json_string = json_object_to_json_string_ext(h->scanner_config, JSON_C_TO_STRING_PLAIN);
json_object* config = _kds_s2000w_handler_opts_load_config(h);
option_descriptor_t* descriptor = kds_s2000w_option_descriptors_full_get_by_number(option);
- if (strcmp(descriptor->config_name, OPTION_COUNT) == 0) {
- int32_t* int_value = (int32_t*) value;
- *int_value = kds_s2000w_option_descriptors_get_max_option_count();
- return GOOD;
- }
+ if (strcmp(descriptor->config_name, OPTION_COUNT) == 0)
+ return _kds_s2000w_handler_opts_get_zero_option(value);
json_object* value_object = json_object_object_get(config, descriptor->config_name);