int value_length = 0;
const char* string_value = NULL;
char* char_value = NULL;
- int* int_value = NULL;
+ int int_value = 0;
+ int* int_value_ptr = NULL;
switch(option) {
case 0:
- int_value = (int*) value;
- *int_value = 4;
+ int_value_ptr = (int*) value;
+ *int_value_ptr = 5;
break;
case 1:
value_object = json_object_object_get(config, "DPI");
- int dpi_value = json_object_get_int(value_object);
- int* int_value = (int*) value;
- *int_value = dpi_value;
+ int_value = json_object_get_int(value_object);
+ int_value_ptr = (int*) value;
+ *int_value_ptr = int_value;
break;
case 2:
value_object = json_object_object_get(config, "ScanSide");
value_length = strlen(char_value);
memcpy(char_value, string_value, sizeof(char) * value_length);
break;
+ case 4:
+ value_object = json_object_object_get(config, "SkipBlankPages");
+ int_value = json_object_get_int(value_object);
+ int_value_ptr = (int*) value;
+ *int_value_ptr = int_value;
+ break;
default:
break;
}
option_descriptor_array.option_descriptors[option]->constraint_type = SANE_CONSTRAINT_NONE;
option_descriptor_array.option_descriptors[option]->constraint.string_list = NULL;
break;
+ case 4:
+ free(option_descriptor_array.option_descriptors[option]);
+ option_descriptor_array.option_descriptors[option] = NULL;
+ option_descriptor_array.option_descriptors[option] = malloc(sizeof(SANE_Option_Descriptor));
+ option_descriptor_array.option_descriptors[option]->name = "skipblankpages";
+ option_descriptor_array.option_descriptors[option]->title = "skipblankpages";
+ option_descriptor_array.option_descriptors[option]->desc = "skipblankpages";
+ option_descriptor_array.option_descriptors[option]->cap = SANE_CAP_SOFT_DETECT;
+ option_descriptor_array.option_descriptors[option]->constraint_type = SANE_CONSTRAINT_NONE;
+ option_descriptor_array.option_descriptors[option]->constraint.string_list = NULL;
+ break;
default:
return NULL;
break;
switch (option) {
case 0:
case 1:
+ case 4:
option_descriptor_array.option_descriptors[option]->type = SANE_TYPE_INT;
option_descriptor_array.option_descriptors[option]->size = sizeof(SANE_Int);
break;