Lines Matching defs:option

12    License, or (at your option) any later version.
497 * Get option descriptor. Return the option descriptor with the given index
500 * @param option Index of option descriptor to return
501 * @return The option descriptor
504 sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
508 DBG (DBG_info_proc, "sane_get_option_descriptor() option=%d\n", option);
510 if ((unsigned) option >= NUM_OPTIONS)
515 return scanner->opt + option;
519 * Set or inquire the current value of option number 'option' of the device
523 * @param option Index of option to set or get
524 * @param action Determines if the option value is read or set
530 sane_control_option (SANE_Handle handle, SANE_Int option, SANE_Action action,
545 DBG(DBG_error,"Device busy scanning, no option returned\n");
549 /* Check if option index is between bounds */
550 if ((unsigned) option >= NUM_OPTIONS) {
551 DBG(DBG_error,"Index too large, no option returned\n");
555 /* Check if option is switched on */
556 cap = scanner->opt[option].cap;
559 DBG(DBG_error,"Option inactive (%s)\n", scanner->opt[option].name);
563 /* Get name of option */
564 name = scanner->opt[option].name;
574 DBG (DBG_info_sane, "get %s [#%d]\n", name, option);
576 switch (option) {
614 *(SANE_Word *) val = scanner->val[option].w;
615 DBG (DBG_info_sane, "get %s [#%d] val=%d\n", name, option,scanner->val[option].w);
620 memcpy (val, scanner->val[option].wa, scanner->opt[option].size);
628 strcpy (val, scanner->val[option].s);
629 DBG (DBG_info_sane, "get %s [#%d] val=%s\n", name, option,scanner->val[option].s);
636 switch (scanner->opt[option].type) {
638 DBG (DBG_info_sane, "set %s [#%d] to %d, size=%d\n", name, option, *(SANE_Word *) val, scanner->opt[option].size);
641 DBG (DBG_info_sane, "set %s [#%d] to %f\n", name, option, SANE_UNFIX (*(SANE_Word *) val));
644 DBG (DBG_info_sane, "set %s [#%d] to %s\n", name, option, (char *) val);
647 DBG (DBG_info_sane, "set %s [#%d] to %d\n", name, option, *(SANE_Word *) val);
650 DBG (DBG_info_sane, "set %s [#%d]\n", name, option);
652 /* Check if option can be set */
657 status = sanei_constrain_value (scanner->opt + option, val, info);
661 /* Set option and handle info return */
662 switch (option)
704 scanner->val[option].w = *(SANE_Word *) val;
709 memcpy (scanner->val[option].wa, val, scanner->opt[option].size);
716 if (scanner->val[option].s) {
717 free (scanner->val[option].s);
720 scanner->val[option].s = (SANE_Char *) strdup (val);
733 if (scanner->val[option].s) {
734 free (scanner->val[option].s);
737 scanner->val[option].s = (SANE_Char *) strdup (val);
791 /* Calculate appropriate values from option settings */
792 DBG (DBG_info_sane, "sane_get_parameters from option values\n");