MCPcopy Create free account
hub / github.com/OpenPrinting/cups / ppd_mark_option

Function ppd_mark_option

cups/ppd-mark.c:759–1091  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

757 */
758
759static void
760ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
761 const char *option, /* I - Option name */
762 const char *choice) /* I - Choice name */
763{
764 int i, j; /* Looping vars */
765 ppd_option_t *o; /* Option pointer */
766 ppd_choice_t *c, /* Choice pointer */
767 *oldc, /* Old choice pointer */
768 key; /* Search key for choice */
769 struct lconv *loc; /* Locale data */
770
771
772 DEBUG_printf(("7ppd_mark_option(ppd=%p, option=\"%s\", choice=\"%s\")",
773 ppd, option, choice));
774
775 /*
776 * AP_D_InputSlot is the "default input slot" on macOS, and setting
777 * it clears the regular InputSlot choices...
778 */
779
780 if (!_cups_strcasecmp(option, "AP_D_InputSlot"))
781 {
782 cupsArraySave(ppd->options);
783
784 if ((o = ppdFindOption(ppd, "InputSlot")) != NULL)
785 {
786 key.option = o;
787 if ((oldc = (ppd_choice_t *)cupsArrayFind(ppd->marked, &key)) != NULL)
788 {
789 oldc->marked = 0;
790 cupsArrayRemove(ppd->marked, oldc);
791 }
792 }
793
794 cupsArrayRestore(ppd->options);
795 }
796
797 /*
798 * Check for custom options...
799 */
800
801 cupsArraySave(ppd->options);
802
803 o = ppdFindOption(ppd, option);
804
805 cupsArrayRestore(ppd->options);
806
807 if (!o)
808 return;
809
810 loc = localeconv();
811
812 if (!_cups_strncasecmp(choice, "Custom.", 7))
813 {
814 /*
815 * Handle a custom option...
816 */

Callers 4

cupsMarkOptionsFunction · 0.85
ppdMarkOptionFunction · 0.85
ppd_defaultsFunction · 0.85
ppd_mark_choicesFunction · 0.85

Calls 15

_cups_strcasecmpFunction · 0.85
cupsArraySaveFunction · 0.85
ppdFindOptionFunction · 0.85
cupsArrayFindFunction · 0.85
cupsArrayRemoveFunction · 0.85
cupsArrayRestoreFunction · 0.85
_cups_strncasecmpFunction · 0.85
ppdFindChoiceFunction · 0.85
ppdPageSizeFunction · 0.85
ppdFindCustomOptionFunction · 0.85
cupsArrayFirstFunction · 0.85
_cupsStrScandFunction · 0.85

Tested by

no test coverage detected