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

Function ppdConflicts

cups/ppd-conflicts.c:568–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

566 */
567
568int /* O - Number of conflicts found */
569ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
570{
571 int i, /* Looping variable */
572 conflicts; /* Number of conflicts */
573 cups_array_t *active; /* Active conflicts */
574 _ppd_cups_uiconsts_t *c; /* Current constraints */
575 _ppd_cups_uiconst_t *cptr; /* Current constraint */
576 ppd_option_t *o; /* Current option */
577
578
579 if (!ppd)
580 return (0);
581
582 /*
583 * Clear all conflicts...
584 */
585
586 cupsArraySave(ppd->options);
587
588 for (o = ppdFirstOption(ppd); o; o = ppdNextOption(ppd))
589 o->conflicted = 0;
590
591 cupsArrayRestore(ppd->options);
592
593 /*
594 * Test for conflicts...
595 */
596
597 active = ppd_test_constraints(ppd, NULL, NULL, 0, NULL,
598 _PPD_ALL_CONSTRAINTS);
599 conflicts = cupsArrayCount(active);
600
601 /*
602 * Loop through all of the UI constraints and flag any options
603 * that conflict...
604 */
605
606 for (c = (_ppd_cups_uiconsts_t *)cupsArrayFirst(active);
607 c;
608 c = (_ppd_cups_uiconsts_t *)cupsArrayNext(active))
609 {
610 for (i = c->num_constraints, cptr = c->constraints;
611 i > 0;
612 i --, cptr ++)
613 cptr->option->conflicted = 1;
614 }
615
616 cupsArrayDelete(active);
617
618 /*
619 * Return the number of conflicts found...
620 */
621
622 return (conflicts);
623}
624
625

Callers 6

do_set_optionsFunction · 0.85
check_defaultsFunction · 0.85
cupsMarkOptionsFunction · 0.85
ppdMarkDefaultsFunction · 0.85
ppdMarkOptionFunction · 0.85
mainFunction · 0.85

Calls 9

cupsArraySaveFunction · 0.85
ppdFirstOptionFunction · 0.85
ppdNextOptionFunction · 0.85
cupsArrayRestoreFunction · 0.85
ppd_test_constraintsFunction · 0.85
cupsArrayCountFunction · 0.85
cupsArrayFirstFunction · 0.85
cupsArrayNextFunction · 0.85
cupsArrayDeleteFunction · 0.85

Tested by 2

check_defaultsFunction · 0.68
mainFunction · 0.68