• Home
  • Raw
  • Download

Lines Matching +full:config +full:- +full:array

1 #include "../../include/sane/config.h"
40 /* range for int value in [0-15] */
66 check_config_attach (SANEI_Config * config, const char *devname, in check_config_attach() argument
70 if (config == NULL) in check_config_attach()
89 * non-existent config file
95 SANEI_Config config; in inexistent_config() local
97 config.count = 0; in inexistent_config()
98 config.descriptors = NULL; in inexistent_config()
99 config.values = NULL; in inexistent_config()
101 "/data/inexistent.conf", &config, in inexistent_config()
110 * no config struct
143 * empty config : backend has no configuration option
149 SANEI_Config config; in empty_config() local
151 config.count = 0; in empty_config()
152 config.descriptors = NULL; in empty_config()
153 config.values = NULL; in empty_config()
156 &config, check_config_attach, NULL); in empty_config()
170 SANEI_Config config; in string_option() local
180 options[i]->name = "modelname"; in string_option()
181 options[i]->title = "model name"; in string_option()
182 options[i]->desc = "user provided scanner's model name"; in string_option()
183 options[i]->type = SANE_TYPE_STRING; in string_option()
184 options[i]->unit = SANE_UNIT_NONE; in string_option()
185 options[i]->size = 128; in string_option()
186 options[i]->cap = SANE_CAP_SOFT_SELECT; in string_option()
187 options[i]->constraint_type = SANE_CONSTRAINT_NONE; in string_option()
193 options[i]->name = "vendor"; in string_option()
194 options[i]->title = "vendor name"; in string_option()
195 options[i]->desc = "user provided scanner's vendor name"; in string_option()
196 options[i]->type = SANE_TYPE_STRING; in string_option()
197 options[i]->unit = SANE_UNIT_NONE; in string_option()
198 options[i]->size = 128; in string_option()
199 options[i]->cap = SANE_CAP_SOFT_SELECT; in string_option()
200 options[i]->constraint_type = SANE_CONSTRAINT_NONE; in string_option()
204 config.count = i; in string_option()
205 config.descriptors = options; in string_option()
206 config.values = values; in string_option()
211 &config, check_config_attach, NULL); in string_option()
227 SANEI_Config config; in int_option() local
236 options[i]->name = "modelnumber"; in int_option()
237 options[i]->title = "model number"; in int_option()
238 options[i]->desc = "user provided scanner's model number"; in int_option()
239 options[i]->type = SANE_TYPE_INT; in int_option()
240 options[i]->unit = SANE_UNIT_NONE; in int_option()
241 options[i]->size = sizeof (SANE_Word); in int_option()
242 options[i]->cap = SANE_CAP_SOFT_SELECT; in int_option()
243 options[i]->constraint_type = SANE_CONSTRAINT_RANGE; in int_option()
244 options[i]->constraint.range = &model_range; in int_option()
248 config.descriptors = options; in int_option()
249 config.values = values; in int_option()
250 config.count = i; in int_option()
254 sanei_configure_attach (CONFIG_PATH "/data/int.conf", &config, in int_option()
270 SANEI_Config config; in wrong_range_int_option() local
271 SANE_Word modelnumber = -1; in wrong_range_int_option()
279 options[i]->name = "modelnumber"; in wrong_range_int_option()
280 options[i]->title = "model number"; in wrong_range_int_option()
281 options[i]->desc = "user provided scanner's model number"; in wrong_range_int_option()
282 options[i]->type = SANE_TYPE_INT; in wrong_range_int_option()
283 options[i]->unit = SANE_UNIT_NONE; in wrong_range_int_option()
284 options[i]->size = sizeof (SANE_Word); in wrong_range_int_option()
285 options[i]->cap = SANE_CAP_SOFT_SELECT; in wrong_range_int_option()
286 options[i]->constraint_type = SANE_CONSTRAINT_RANGE; in wrong_range_int_option()
287 options[i]->constraint.range = &model_range; in wrong_range_int_option()
291 config.descriptors = options; in wrong_range_int_option()
292 config.values = values; in wrong_range_int_option()
293 config.count = i; in wrong_range_int_option()
297 sanei_configure_attach (CONFIG_PATH "/data/wrong-range.conf", in wrong_range_int_option()
298 &config, check_config_attach, NULL); in wrong_range_int_option()
302 assert (modelnumber == -1); in wrong_range_int_option()
307 * word array
313 SANEI_Config config; in word_array_option() local
322 options[i]->name = "numbers"; in word_array_option()
323 options[i]->title = "some numbers"; in word_array_option()
324 options[i]->desc = "an array of numbers"; in word_array_option()
325 options[i]->type = SANE_TYPE_INT; in word_array_option()
326 options[i]->unit = SANE_UNIT_NONE; in word_array_option()
327 options[i]->size = sizeof (SANE_Word) * 7; in word_array_option()
328 options[i]->cap = SANE_CAP_SOFT_SELECT; in word_array_option()
329 options[i]->constraint_type = SANE_CONSTRAINT_RANGE; in word_array_option()
330 options[i]->constraint.range = &model_range; in word_array_option()
334 config.descriptors = options; in word_array_option()
335 config.values = values; in word_array_option()
336 config.count = i; in word_array_option()
340 sanei_configure_attach (CONFIG_PATH "/data/word-array.conf", in word_array_option()
341 &config, check_config_attach, NULL); in word_array_option()
359 SANEI_Config config; in string_list_option() local
368 options[i]->name = "string-choice"; in string_list_option()
369 options[i]->title = "string choice"; in string_list_option()
370 options[i]->desc = "one string among a fixed list"; in string_list_option()
371 options[i]->type = SANE_TYPE_STRING; in string_list_option()
372 options[i]->unit = SANE_UNIT_NONE; in string_list_option()
373 options[i]->size = 128; in string_list_option()
374 options[i]->cap = SANE_CAP_SOFT_SELECT; in string_list_option()
375 options[i]->constraint_type = SANE_CONSTRAINT_STRING_LIST; in string_list_option()
376 options[i]->constraint.string_list = string_list; in string_list_option()
380 config.descriptors = options; in string_list_option()
381 config.values = values; in string_list_option()
382 config.count = i; in string_list_option()
386 sanei_configure_attach (CONFIG_PATH "/data/string-list.conf", in string_list_option()
387 &config, check_config_attach, NULL); in string_list_option()
402 SANEI_Config config; in wrong_string_list_option() local
411 options[i]->name = "string-choice"; in wrong_string_list_option()
412 options[i]->title = "string choice"; in wrong_string_list_option()
413 options[i]->desc = "one string among a fixed list"; in wrong_string_list_option()
414 options[i]->type = SANE_TYPE_STRING; in wrong_string_list_option()
415 options[i]->unit = SANE_UNIT_NONE; in wrong_string_list_option()
416 options[i]->size = 128; in wrong_string_list_option()
417 options[i]->cap = SANE_CAP_SOFT_SELECT; in wrong_string_list_option()
418 options[i]->constraint_type = SANE_CONSTRAINT_STRING_LIST; in wrong_string_list_option()
419 options[i]->constraint.string_list = string_list; in wrong_string_list_option()
423 config.descriptors = options; in wrong_string_list_option()
424 config.values = values; in wrong_string_list_option()
425 config.count = i; in wrong_string_list_option()
432 "/data/wrong-string-list.conf", &config, in wrong_string_list_option()
448 SANEI_Config config; in umax_pp() local
453 SANE_Word buffersize = -1; in umax_pp()
454 SANE_Word redgain = -1; in umax_pp()
455 SANE_Word greengain = -1; in umax_pp()
456 SANE_Word bluegain = -1; in umax_pp()
457 SANE_Word redoffset = -1; in umax_pp()
458 SANE_Word greenoffset = -1; in umax_pp()
459 SANE_Word blueoffset = -1; in umax_pp()
465 options[i]->name = "buffer"; in umax_pp()
466 options[i]->type = SANE_TYPE_INT; in umax_pp()
467 options[i]->unit = SANE_UNIT_NONE; in umax_pp()
468 options[i]->size = sizeof (SANE_Word); in umax_pp()
469 options[i]->cap = SANE_CAP_SOFT_SELECT; in umax_pp()
470 options[i]->constraint_type = SANE_CONSTRAINT_RANGE; in umax_pp()
471 options[i]->constraint.range = &buffer_range; in umax_pp()
477 options[i]->name = "red-gain"; in umax_pp()
478 options[i]->type = SANE_TYPE_INT; in umax_pp()
479 options[i]->unit = SANE_UNIT_NONE; in umax_pp()
480 options[i]->size = sizeof (SANE_Word); in umax_pp()
481 options[i]->cap = SANE_CAP_SOFT_SELECT; in umax_pp()
482 options[i]->constraint_type = SANE_CONSTRAINT_RANGE; in umax_pp()
483 options[i]->constraint.range = &value16_range; in umax_pp()
489 options[i]->name = "green-gain"; in umax_pp()
490 options[i]->type = SANE_TYPE_INT; in umax_pp()
491 options[i]->unit = SANE_UNIT_NONE; in umax_pp()
492 options[i]->size = sizeof (SANE_Word); in umax_pp()
493 options[i]->cap = SANE_CAP_SOFT_SELECT; in umax_pp()
494 options[i]->constraint_type = SANE_CONSTRAINT_RANGE; in umax_pp()
495 options[i]->constraint.range = &value16_range; in umax_pp()
501 options[i]->name = "blue-gain"; in umax_pp()
502 options[i]->type = SANE_TYPE_INT; in umax_pp()
503 options[i]->unit = SANE_UNIT_NONE; in umax_pp()
504 options[i]->size = sizeof (SANE_Word); in umax_pp()
505 options[i]->cap = SANE_CAP_SOFT_SELECT; in umax_pp()
506 options[i]->constraint_type = SANE_CONSTRAINT_RANGE; in umax_pp()
507 options[i]->constraint.range = &value16_range; in umax_pp()
513 options[i]->name = "red-offset"; in umax_pp()
514 options[i]->type = SANE_TYPE_INT; in umax_pp()
515 options[i]->unit = SANE_UNIT_NONE; in umax_pp()
516 options[i]->size = sizeof (SANE_Word); in umax_pp()
517 options[i]->cap = SANE_CAP_SOFT_SELECT; in umax_pp()
518 options[i]->constraint_type = SANE_CONSTRAINT_RANGE; in umax_pp()
519 options[i]->constraint.range = &value16_range; in umax_pp()
525 options[i]->name = "green-offset"; in umax_pp()
526 options[i]->type = SANE_TYPE_INT; in umax_pp()
527 options[i]->unit = SANE_UNIT_NONE; in umax_pp()
528 options[i]->size = sizeof (SANE_Word); in umax_pp()
529 options[i]->cap = SANE_CAP_SOFT_SELECT; in umax_pp()
530 options[i]->constraint_type = SANE_CONSTRAINT_RANGE; in umax_pp()
531 options[i]->constraint.range = &value16_range; in umax_pp()
537 options[i]->name = "blue-offset"; in umax_pp()
538 options[i]->type = SANE_TYPE_INT; in umax_pp()
539 options[i]->unit = SANE_UNIT_NONE; in umax_pp()
540 options[i]->size = sizeof (SANE_Word); in umax_pp()
541 options[i]->cap = SANE_CAP_SOFT_SELECT; in umax_pp()
542 options[i]->constraint_type = SANE_CONSTRAINT_RANGE; in umax_pp()
543 options[i]->constraint.range = &value16_range; in umax_pp()
549 options[i]->name = "astra"; in umax_pp()
550 options[i]->type = SANE_TYPE_STRING; in umax_pp()
551 options[i]->unit = SANE_UNIT_NONE; in umax_pp()
552 options[i]->size = 128; in umax_pp()
553 options[i]->cap = SANE_CAP_SOFT_SELECT; in umax_pp()
554 options[i]->constraint_type = SANE_CONSTRAINT_STRING_LIST; in umax_pp()
555 options[i]->constraint.string_list = astra_models; in umax_pp()
559 config.descriptors = options; in umax_pp()
560 config.values = values; in umax_pp()
561 config.count = i; in umax_pp()
568 &config, check_config_attach, NULL); in umax_pp()
580 assert (strcmp (lastdevname, "port safe-auto") == 0); in umax_pp()
585 i--; in umax_pp()
598 SANEI_Config config; in wrong_bool_option() local
607 options[i]->name = "booltrue"; in wrong_bool_option()
608 options[i]->title = "boolean true"; in wrong_bool_option()
609 options[i]->type = SANE_TYPE_BOOL; in wrong_bool_option()
610 options[i]->unit = SANE_UNIT_NONE; in wrong_bool_option()
611 options[i]->size = sizeof (SANE_Bool); in wrong_bool_option()
612 options[i]->cap = SANE_CAP_SOFT_SELECT; in wrong_bool_option()
613 options[i]->constraint_type = SANE_CONSTRAINT_NONE; in wrong_bool_option()
619 options[i]->name = "boolfalse"; in wrong_bool_option()
620 options[i]->title = "boolean false"; in wrong_bool_option()
621 options[i]->type = SANE_TYPE_BOOL; in wrong_bool_option()
622 options[i]->unit = SANE_UNIT_NONE; in wrong_bool_option()
623 options[i]->size = sizeof (SANE_Bool); in wrong_bool_option()
624 options[i]->cap = SANE_CAP_SOFT_SELECT; in wrong_bool_option()
625 options[i]->constraint_type = SANE_CONSTRAINT_NONE; in wrong_bool_option()
629 config.descriptors = options; in wrong_bool_option()
630 config.values = values; in wrong_bool_option()
631 config.count = i; in wrong_bool_option()
635 sanei_configure_attach (CONFIG_PATH "/data/wrong-boolean.conf", in wrong_bool_option()
636 &config, check_config_attach, NULL); in wrong_bool_option()
651 SANEI_Config config; in bool_option() local
660 options[i]->name = "booltrue"; in bool_option()
661 options[i]->title = "boolean true"; in bool_option()
662 options[i]->type = SANE_TYPE_BOOL; in bool_option()
663 options[i]->unit = SANE_UNIT_NONE; in bool_option()
664 options[i]->size = sizeof (SANE_Bool); in bool_option()
665 options[i]->cap = SANE_CAP_SOFT_SELECT; in bool_option()
666 options[i]->constraint_type = SANE_CONSTRAINT_NONE; in bool_option()
672 options[i]->name = "boolfalse"; in bool_option()
673 options[i]->title = "boolean false"; in bool_option()
674 options[i]->type = SANE_TYPE_BOOL; in bool_option()
675 options[i]->unit = SANE_UNIT_NONE; in bool_option()
676 options[i]->size = sizeof (SANE_Bool); in bool_option()
677 options[i]->cap = SANE_CAP_SOFT_SELECT; in bool_option()
678 options[i]->constraint_type = SANE_CONSTRAINT_NONE; in bool_option()
684 options[i]->name = "boolarray"; in bool_option()
685 options[i]->title = "boolean array"; in bool_option()
686 options[i]->type = SANE_TYPE_BOOL; in bool_option()
687 options[i]->unit = SANE_UNIT_NONE; in bool_option()
688 options[i]->size = sizeof (boolarray); in bool_option()
689 options[i]->cap = SANE_CAP_SOFT_SELECT; in bool_option()
690 options[i]->constraint_type = SANE_CONSTRAINT_NONE; in bool_option()
694 config.descriptors = options; in bool_option()
695 config.values = values; in bool_option()
696 config.count = i; in bool_option()
701 &config, check_config_attach, NULL); in bool_option()
721 SANEI_Config config; in fixed_option() local
730 options[i]->name = "width"; in fixed_option()
731 options[i]->title = "width"; in fixed_option()
732 options[i]->type = SANE_TYPE_FIXED; in fixed_option()
733 options[i]->unit = SANE_UNIT_NONE; in fixed_option()
734 options[i]->size = sizeof (SANE_Word); in fixed_option()
735 options[i]->cap = SANE_CAP_SOFT_SELECT; in fixed_option()
736 options[i]->constraint_type = SANE_CONSTRAINT_NONE; in fixed_option()
742 options[i]->name = "height"; in fixed_option()
743 options[i]->title = "height"; in fixed_option()
744 options[i]->type = SANE_TYPE_FIXED; in fixed_option()
745 options[i]->unit = SANE_UNIT_NONE; in fixed_option()
746 options[i]->size = sizeof (SANE_Word); in fixed_option()
747 options[i]->cap = SANE_CAP_SOFT_SELECT; in fixed_option()
748 options[i]->constraint_type = SANE_CONSTRAINT_NONE; in fixed_option()
754 options[i]->name = "array-of-fixed"; in fixed_option()
755 options[i]->title = "array of fixed"; in fixed_option()
756 options[i]->type = SANE_TYPE_FIXED; in fixed_option()
757 options[i]->unit = SANE_UNIT_NONE; in fixed_option()
758 options[i]->size = sizeof (fixedarray); in fixed_option()
759 options[i]->cap = SANE_CAP_SOFT_SELECT; in fixed_option()
760 options[i]->constraint_type = SANE_CONSTRAINT_RANGE; in fixed_option()
761 options[i]->constraint.range = &height_range; in fixed_option()
765 config.descriptors = options; in fixed_option()
766 config.values = values; in fixed_option()
767 config.count = i; in fixed_option()
772 &config, check_config_attach, NULL); in fixed_option()
792 SANEI_Config config; in wrong_fixed_option() local
801 options[i]->name = "height"; in wrong_fixed_option()
802 options[i]->title = "height"; in wrong_fixed_option()
803 options[i]->type = SANE_TYPE_FIXED; in wrong_fixed_option()
804 options[i]->unit = SANE_UNIT_NONE; in wrong_fixed_option()
805 options[i]->size = sizeof (SANE_Word); in wrong_fixed_option()
806 options[i]->cap = SANE_CAP_SOFT_SELECT; in wrong_fixed_option()
807 options[i]->constraint_type = SANE_CONSTRAINT_RANGE; in wrong_fixed_option()
808 options[i]->constraint.range = &height_range; in wrong_fixed_option()
812 config.descriptors = options; in wrong_fixed_option()
813 config.values = values; in wrong_fixed_option()
814 config.count = i; in wrong_fixed_option()
818 sanei_configure_attach (CONFIG_PATH "/data/wrong-fixed.conf", in wrong_fixed_option()
819 &config, check_config_attach, NULL); in wrong_fixed_option()
830 SANEI_Config config; in snapscan() local
839 options[i]->name = "firmware"; in snapscan()
840 options[i]->title = "scanner's firmware path"; in snapscan()
841 options[i]->desc = "user provided scanner's full path"; in snapscan()
842 options[i]->type = SANE_TYPE_STRING; in snapscan()
843 options[i]->unit = SANE_UNIT_NONE; in snapscan()
844 options[i]->size = sizeof (firmware); in snapscan()
845 options[i]->cap = SANE_CAP_SOFT_SELECT; in snapscan()
846 options[i]->constraint_type = SANE_CONSTRAINT_NONE; in snapscan()
850 config.descriptors = options; in snapscan()
851 config.values = values; in snapscan()
852 config.count = i; in snapscan()
857 &config, check_config_attach, NULL); in snapscan()
861 assert (strcmp (firmware, "/usr/share/sane/snapscan/your-firmwarefile.bin") in snapscan()
868 * create the test suite for sanei config related tests
900 /* set up config dir for local conf files */ in main()
909 /* vim: set sw=2 cino=>2se-1sn-1s{s^-1st0(0u0 smarttab expandtab: */