| 757 | */ |
| 758 | |
| 759 | static void |
| 760 | ppd_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 | */ |
no test coverage detected