Lines Matching defs:option
8 License, or (at your option) any later version.
41 - sane_get_option_descriptor() : get option information
42 - sane_control_option() : change option values
476 * This function is used to access option descriptors. The function
477 * returns the option descriptor for option number n of the device
479 * valid option. Its value is an integer that specifies the number of
481 * option 0). If n is not a valid option index, the function returns
482 * NULL. The returned option descriptor is guaranteed to remain valid
486 sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
492 if ((unsigned) option >= NUM_OPTIONS)
496 session->options[option].descriptor.name);
499 return &(session->options[option].descriptor);
503 * sets automatic value for an option , called by sane_control_option after
506 set_automatic_value (P5_Session * s, int option, SANE_Int * myinfo)
512 switch (option)
556 DBG (DBG_warn, "set_automatic_value: can't set unknown option %d\n",
557 option);
564 * sets an option , called by sane_control_option after all
567 set_option_value (P5_Session * s, int option, void *val, SANE_Int * myinfo)
572 switch (option)
578 s->options[option].value.w = *(SANE_Word *) val;
599 s->options[option].value.w = *(SANE_Word *) val;
604 if (s->options[option].value.s)
605 free (s->options[option].value.s);
606 s->options[option].value.s = strdup (val);
621 DBG (DBG_warn, "set_option_value: can't set unknown option %d\n",
622 option);
628 * gets an option , called by sane_control_option after all checks
631 get_option_value (P5_Session * s, int option, void *val)
635 switch (option)
645 *(SANE_Word *) val = s->options[option].value.w;
650 strcpy (val, s->options[option].value.s);
657 s->options[option].value.b = SANE_TRUE;
659 s->options[option].value.b = SANE_FALSE;
660 *(SANE_Bool *) val = s->options[option].value.b;
670 DBG (DBG_warn, "get_option_value: can't get unknown option %d\n",
671 option);
678 * Gets or sets an option value.
681 * This function is used to set or inquire the current value of option
683 * the option is controlled is specified by parameter action. The
685 * below. The value of the option is passed through argument val. It
686 * is a pointer to the memory that holds the option value. The memory
687 * area pointed to by v must be big enough to hold the entire option
688 * value (determined by member size in the corresponding option
692 * string option, the string pointed to by argument v may be shorter
693 * since the backend will stop reading the option value upon
700 sane_control_option (SANE_Handle handle, SANE_Int option,
709 "sane_control_option: start: action = %s, option = %s (%d)\n",
713 s->options[option].descriptor.name, option);
723 "scanning (option = %s (%d))\n",
724 s->options[option].descriptor.name, option);
728 /* option must be within existing range */
729 if (option >= NUM_OPTIONS || option < 0)
732 "sane_control_option: option %d >= NUM_OPTIONS || option < 0\n",
733 option);
737 /* don't access an inactive option */
738 cap = s->options[option].descriptor.cap;
741 DBG (DBG_warn, "sane_control_option: option %d is inactive\n", option);
749 status = get_option_value (s, option, val);
755 DBG (DBG_warn, "sane_control_option: option %d is not settable\n",
756 option);
761 sanei_constrain_value (&s->options[option].descriptor, val, &myinfo);
771 if (s->options[option].descriptor.type == SANE_TYPE_INT
772 && *(SANE_Word *) val == s->options[option].value.w)
778 status = set_option_value (s, option, val, &myinfo);
787 "sane_control_option: option %d is not autosettable\n",
788 option);
792 status = set_automatic_value (s, option, &myinfo);
1542 /**> placeholders pointers for option values */
1705 SANE_Int option, i, min, idx;
1713 for (option = 0; option < NUM_OPTIONS; option++)
1715 session->options[option].descriptor.size = sizeof (SANE_Word);
1716 session->options[option].descriptor.cap =
1722 /* last option / end of list marker */
1764 * We merge xdpi and ydpi list to provide only one resolution option control.