4 * Option marking routines for the Common UNIX Printing System (CUPS).
6 * Copyright 2007-2009 by Apple Inc.
7 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
9 * These coded instructions, statements, and computer programs are the
10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
15 * PostScript is a trademark of Adobe Systems, Inc.
17 * This file is subject to the Apple OS-Developed Software exception.
21 * cupsResolveConflicts() - Resolve conflicts in a marked PPD.
22 * ppdConflicts() - Check to see if there are any conflicts among
23 * the marked option choices.
24 * ppdInstallableConflict() - Test whether an option choice conflicts with an
26 * ppd_is_installable() - Determine whether an option is in the
27 * InstallableOptions group.
28 * ppd_load_constraints() - Load constraints from a PPD file.
29 * ppd_test_constraints() - See if any constraints are active.
33 * Include necessary headers...
36 #include "ppd-private.h"
47 _PPD_NORMAL_CONSTRAINTS
,
48 _PPD_INSTALLABLE_CONSTRAINTS
,
57 static int ppd_is_installable(ppd_group_t
*installable
,
59 static void ppd_load_constraints(ppd_file_t
*ppd
);
60 static cups_array_t
*ppd_test_constraints(ppd_file_t
*ppd
,
64 cups_option_t
*options
,
69 * 'cupsResolveConflicts()' - Resolve conflicts in a marked PPD.
71 * This function attempts to resolve any conflicts in a marked PPD, returning
72 * a list of option changes that are required to resolve them. On input,
73 * "num_options" and "options" contain any pending option changes that have
74 * not yet been marked, while "option" and "choice" contain the most recent
75 * selection which may or may not be in "num_options" or "options".
77 * On successful return, "num_options" and "options" are updated to contain
78 * "option" and "choice" along with any changes required to resolve conflicts
79 * specified in the PPD file and 1 is returned.
81 * If option conflicts cannot be resolved, "num_options" and "options" are not
82 * changed and 0 is returned.
84 * When resolving conflicts, @code cupsResolveConflicts@ does not consider
85 * changes to the current page size (@code media@, @code PageSize@, and
86 * @code PageRegion@) or to the most recent option specified in "option".
87 * Thus, if the only way to resolve a conflict is to change the page size
88 * or the option the user most recently changed, @code cupsResolveConflicts@
89 * will return 0 to indicate it was unable to resolve the conflicts.
91 * The @code cupsResolveConflicts@ function uses one of two sources of option
92 * constraint information. The preferred constraint information is defined by
93 * @code cupsUIConstraints@ and @code cupsUIResolver@ attributes - in this
94 * case, the PPD file provides constraint resolution actions.
96 * The backup constraint information is defined by the
97 * @code UIConstraints@ and @code NonUIConstraints@ attributes. These
98 * constraints are resolved algorithmically by first selecting the default
99 * choice for the conflicting option, then iterating over all possible choices
100 * until a non-conflicting option choice is found.
105 int /* O - 1 on success, 0 on failure */
106 cupsResolveConflicts(
107 ppd_file_t
*ppd
, /* I - PPD file */
108 const char *option
, /* I - Newly selected option or @code NULL@ for none */
109 const char *choice
, /* I - Newly selected choice or @code NULL@ for none */
110 int *num_options
, /* IO - Number of additional selected options */
111 cups_option_t
**options
) /* IO - Additional selected options */
113 int i
, /* Looping var */
114 num_newopts
, /* Number of new options */
115 num_resopts
; /* Number of resolver options */
116 cups_option_t
*newopts
, /* New options */
117 *resopts
; /* Resolver options */
118 cups_array_t
*active
, /* Active constraints */
119 *pass
, /* Resolvers for this pass */
120 *resolvers
; /* Resolvers we have used */
121 _ppd_cups_uiconsts_t
*consts
; /* Current constraints */
122 _ppd_cups_uiconst_t
*constptr
; /* Current constraint */
123 ppd_attr_t
*resolver
; /* Current resolver */
124 const char *value
; /* Selected option value */
125 int changed
; /* Did we change anything? */
126 ppd_choice_t
*marked
; /* Marked choice */
130 * Range check input...
133 if (!ppd
|| !num_options
|| !options
|| (option
== NULL
) != (choice
== NULL
))
137 * Build a shadow option array...
143 for (i
= 0; i
< *num_options
; i
++)
144 num_newopts
= cupsAddOption((*options
)[i
].name
, (*options
)[i
].value
,
145 num_newopts
, &newopts
);
146 if (option
&& strcasecmp(option
, "Collate"))
147 num_newopts
= cupsAddOption(option
, choice
, num_newopts
, &newopts
);
150 * Loop until we have no conflicts...
153 cupsArraySave(ppd
->sorted_attrs
);
156 pass
= cupsArrayNew((cups_array_func_t
)strcasecmp
, NULL
);
158 while ((active
= ppd_test_constraints(ppd
, NULL
, NULL
, num_newopts
, newopts
,
159 _PPD_ALL_CONSTRAINTS
)) != NULL
)
162 resolvers
= cupsArrayNew((cups_array_func_t
)strcasecmp
, NULL
);
164 for (consts
= (_ppd_cups_uiconsts_t
*)cupsArrayFirst(active
), changed
= 0;
166 consts
= (_ppd_cups_uiconsts_t
*)cupsArrayNext(active
))
168 if (consts
->resolver
[0])
171 * Look up the resolver...
174 if (cupsArrayFind(pass
, consts
->resolver
))
175 continue; /* Already applied this resolver... */
177 if (cupsArrayFind(resolvers
, consts
->resolver
))
183 DEBUG_printf(("ppdResolveConflicts: Resolver loop with %s!\n",
188 if ((resolver
= ppdFindAttr(ppd
, "cupsUIResolver",
189 consts
->resolver
)) == NULL
)
191 DEBUG_printf(("ppdResolveConflicts: Resolver %s not found!\n",
196 if (!resolver
->value
)
198 DEBUG_printf(("ppdResolveConflicts: Resolver %s has no value!\n",
204 * Add the options from the resolver...
207 cupsArrayAdd(pass
, consts
->resolver
);
208 cupsArrayAdd(resolvers
, consts
->resolver
);
210 if (option
&& choice
)
213 num_resopts
= _ppdParseOptions(resolver
->value
, 0, &resopts
);
215 if ((value
= cupsGetOption(option
, num_newopts
, newopts
)) != NULL
&&
216 !strcasecmp(value
, choice
))
218 DEBUG_printf(("cupsResolveConflicts: Resolver %s changes %s!\n",
219 consts
->resolver
, option
));
220 cupsFreeOptions(num_resopts
, resopts
);
224 cupsFreeOptions(num_resopts
, resopts
);
227 num_newopts
= _ppdParseOptions(resolver
->value
, num_newopts
, &newopts
);
233 * Try resolving by choosing the default values for non-installable
234 * options, then by iterating through the possible choices...
237 int j
; /* Looping var */
238 ppd_choice_t
*cptr
; /* Current choice */
239 cups_array_t
*test
; /* Test array for conflicts */
242 for (i
= consts
->num_constraints
, constptr
= consts
->constraints
;
247 * Can't resolve by changing an installable option...
250 if (constptr
->installable
)
254 * Is this the option we are changing?
257 if (option
&& !strcasecmp(constptr
->option
->keyword
, option
))
261 * Get the current option choice...
264 if ((value
= cupsGetOption(constptr
->option
->keyword
, num_newopts
,
267 marked
= ppdFindMarkedChoice(ppd
, constptr
->option
->keyword
);
268 value
= marked
? marked
->choice
: "";
272 * Try the default choice...
277 if (strcasecmp(value
, constptr
->option
->defchoice
) &&
278 (test
= ppd_test_constraints(ppd
, constptr
->option
->keyword
,
279 constptr
->option
->defchoice
,
280 num_newopts
, newopts
,
281 _PPD_ALL_CONSTRAINTS
)) == NULL
)
287 num_newopts
= cupsAddOption(constptr
->option
->keyword
,
288 constptr
->option
->defchoice
,
289 num_newopts
, &newopts
);
295 * Try each choice instead...
298 for (j
= constptr
->option
->num_choices
,
299 cptr
= constptr
->option
->choices
;
303 cupsArrayDelete(test
);
306 if (strcasecmp(value
, cptr
->choice
) &&
307 strcasecmp(constptr
->option
->defchoice
, cptr
->choice
) &&
308 (test
= ppd_test_constraints(ppd
, constptr
->option
->keyword
,
309 cptr
->choice
, num_newopts
,
311 _PPD_ALL_CONSTRAINTS
)) == NULL
)
314 * This choice works...
317 num_newopts
= cupsAddOption(constptr
->option
->keyword
,
318 cptr
->choice
, num_newopts
,
325 cupsArrayDelete(test
);
332 DEBUG_puts("ppdResolveConflicts: Unable to automatically resolve "
338 cupsArrayClear(pass
);
339 cupsArrayDelete(active
);
343 * Free the caller's option array...
346 cupsFreeOptions(*num_options
, *options
);
349 * If Collate is the option we are testing, add it here. Otherwise, remove
350 * any Collate option from the resolve list since the filters automatically
351 * handle manual collation...
354 if (option
&& !strcasecmp(option
, "Collate"))
355 num_newopts
= cupsAddOption(option
, choice
, num_newopts
, &newopts
);
357 num_newopts
= cupsRemoveOption("Collate", num_newopts
, &newopts
);
360 * Return the new list of options to the caller...
363 *num_options
= num_newopts
;
366 cupsArrayDelete(pass
);
367 cupsArrayDelete(resolvers
);
369 cupsArrayRestore(ppd
->sorted_attrs
);
374 * If we get here, we failed to resolve...
379 cupsFreeOptions(num_newopts
, newopts
);
381 cupsArrayDelete(pass
);
382 cupsArrayDelete(resolvers
);
384 cupsArrayRestore(ppd
->sorted_attrs
);
391 * 'ppdConflicts()' - Check to see if there are any conflicts among the
392 * marked option choices.
394 * The returned value is the same as returned by @link ppdMarkOption@.
397 int /* O - Number of conflicts found */
398 ppdConflicts(ppd_file_t
*ppd
) /* I - PPD to check */
400 int i
, /* Looping variable */
401 conflicts
; /* Number of conflicts */
402 cups_array_t
*active
; /* Active conflicts */
403 _ppd_cups_uiconsts_t
*c
; /* Current constraints */
404 _ppd_cups_uiconst_t
*cptr
; /* Current constraint */
405 ppd_option_t
*o
; /* Current option */
412 * Clear all conflicts...
415 for (o
= ppdFirstOption(ppd
); o
; o
= ppdNextOption(ppd
))
419 * Test for conflicts...
422 active
= ppd_test_constraints(ppd
, NULL
, NULL
, 0, NULL
,
423 _PPD_ALL_CONSTRAINTS
);
424 conflicts
= cupsArrayCount(active
);
427 * Loop through all of the UI constraints and flag any options
431 for (c
= (_ppd_cups_uiconsts_t
*)cupsArrayFirst(active
);
433 c
= (_ppd_cups_uiconsts_t
*)cupsArrayNext(active
))
435 for (i
= c
->num_constraints
, cptr
= c
->constraints
;
438 cptr
->option
->conflicted
= 1;
441 cupsArrayDelete(active
);
444 * Return the number of conflicts found...
452 * 'ppdInstallableConflict()' - Test whether an option choice conflicts with
453 * an installable option.
455 * This function tests whether a particular option choice is available based
456 * on constraints against options in the "InstallableOptions" group.
461 int /* O - 1 if conflicting, 0 if not conflicting */
462 ppdInstallableConflict(
463 ppd_file_t
*ppd
, /* I - PPD file */
464 const char *option
, /* I - Option */
465 const char *choice
) /* I - Choice */
467 cups_array_t
*active
; /* Active conflicts */
471 * Range check input...
474 if (!ppd
|| !option
|| !choice
)
478 * Test constraints using the new option...
481 active
= ppd_test_constraints(ppd
, option
, choice
, 0, NULL
,
482 _PPD_INSTALLABLE_CONSTRAINTS
);
484 cupsArrayDelete(active
);
486 return (active
!= NULL
);
491 * 'ppd_is_installable()' - Determine whether an option is in the
492 * InstallableOptions group.
495 static int /* O - 1 if installable, 0 if normal */
497 ppd_group_t
*installable
, /* I - InstallableOptions group */
498 const char *name
) /* I - Option name */
502 int i
; /* Looping var */
503 ppd_option_t
*option
; /* Current option */
506 for (i
= installable
->num_options
, option
= installable
->options
;
509 if (!strcasecmp(option
->keyword
, name
))
518 * 'ppd_load_constraints()' - Load constraints from a PPD file.
522 ppd_load_constraints(ppd_file_t
*ppd
) /* I - PPD file */
524 int i
; /* Looping var */
525 ppd_const_t
*oldconst
; /* Current UIConstraints data */
526 ppd_attr_t
*constattr
; /* Current cupsUIConstraints attribute */
527 _ppd_cups_uiconsts_t
*consts
; /* Current cupsUIConstraints data */
528 _ppd_cups_uiconst_t
*constptr
; /* Current constraint */
529 ppd_group_t
*installable
; /* Installable options group */
530 const char *vptr
; /* Pointer into constraint value */
531 char option
[PPD_MAX_NAME
], /* Option name/MainKeyword */
532 choice
[PPD_MAX_NAME
], /* Choice/OptionKeyword */
533 *ptr
; /* Pointer into option or choice */
537 * Create an array to hold the constraint data...
540 ppd
->cups_uiconstraints
= cupsArrayNew(NULL
, NULL
);
543 * Find the installable options group if it exists...
546 for (i
= ppd
->num_groups
, installable
= ppd
->groups
;
548 i
--, installable
++)
549 if (!strcasecmp(installable
->name
, "InstallableOptions"))
556 * Load old-style [Non]UIConstraints data...
559 for (i
= ppd
->num_consts
, oldconst
= ppd
->consts
; i
> 0; i
--, oldconst
++)
562 * Weed out nearby duplicates, since the PPD spec requires that you
563 * define both "*Foo foo *Bar bar" and "*Bar bar *Foo foo"...
567 !strcasecmp(oldconst
[0].option1
, oldconst
[1].option2
) &&
568 !strcasecmp(oldconst
[0].choice1
, oldconst
[1].choice2
) &&
569 !strcasecmp(oldconst
[0].option2
, oldconst
[1].option1
) &&
570 !strcasecmp(oldconst
[0].choice2
, oldconst
[1].choice1
))
577 if ((consts
= calloc(1, sizeof(_ppd_cups_uiconsts_t
))) == NULL
)
579 DEBUG_puts("ppd_load_constraints: Unable to allocate memory for "
584 if ((constptr
= calloc(2, sizeof(_ppd_cups_uiconst_t
))) == NULL
)
587 DEBUG_puts("ppd_load_constraints: Unable to allocate memory for "
593 * Fill in the information...
596 consts
->num_constraints
= 2;
597 consts
->constraints
= constptr
;
599 if (!strncasecmp(oldconst
->option1
, "Custom", 6) &&
600 !strcasecmp(oldconst
->choice1
, "True"))
602 constptr
[0].option
= ppdFindOption(ppd
, oldconst
->option1
+ 6);
603 constptr
[0].choice
= ppdFindChoice(constptr
[0].option
, "Custom");
604 constptr
[0].installable
= 0;
608 constptr
[0].option
= ppdFindOption(ppd
, oldconst
->option1
);
609 constptr
[0].choice
= ppdFindChoice(constptr
[0].option
,
611 constptr
[0].installable
= ppd_is_installable(installable
,
615 if (!constptr
[0].option
|| (!constptr
[0].choice
&& oldconst
->choice1
[0]))
617 DEBUG_printf(("ppd_load_constraints: Unknown option *%s %s!\n",
618 oldconst
->option1
, oldconst
->choice1
));
619 free(consts
->constraints
);
624 if (!strncasecmp(oldconst
->option2
, "Custom", 6) &&
625 !strcasecmp(oldconst
->choice2
, "True"))
627 constptr
[1].option
= ppdFindOption(ppd
, oldconst
->option2
+ 6);
628 constptr
[1].choice
= ppdFindChoice(constptr
[1].option
, "Custom");
629 constptr
[1].installable
= 0;
633 constptr
[1].option
= ppdFindOption(ppd
, oldconst
->option2
);
634 constptr
[1].choice
= ppdFindChoice(constptr
[1].option
,
636 constptr
[1].installable
= ppd_is_installable(installable
,
640 if (!constptr
[1].option
|| (!constptr
[1].choice
&& oldconst
->choice2
[0]))
642 DEBUG_printf(("ppd_load_constraints: Unknown option *%s %s!\n",
643 oldconst
->option2
, oldconst
->choice2
));
644 free(consts
->constraints
);
649 consts
->installable
= constptr
[0].installable
|| constptr
[1].installable
;
652 * Add it to the constraints array...
655 cupsArrayAdd(ppd
->cups_uiconstraints
, consts
);
659 * Then load new-style constraints...
662 for (constattr
= ppdFindAttr(ppd
, "cupsUIConstraints", NULL
);
664 constattr
= ppdFindNextAttr(ppd
, "cupsUIConstraints", NULL
))
666 if (!constattr
->value
)
668 DEBUG_puts("ppd_load_constraints: Bad cupsUIConstraints value!");
672 for (i
= 0, vptr
= strchr(constattr
->value
, '*');
674 i
++, vptr
= strchr(vptr
+ 1, '*'));
678 DEBUG_puts("ppd_load_constraints: Bad cupsUIConstraints value!");
682 if ((consts
= calloc(1, sizeof(_ppd_cups_uiconsts_t
))) == NULL
)
684 DEBUG_puts("ppd_load_constraints: Unable to allocate memory for "
685 "cupsUIConstraints!");
689 if ((constptr
= calloc(i
, sizeof(_ppd_cups_uiconst_t
))) == NULL
)
692 DEBUG_puts("ppd_load_constraints: Unable to allocate memory for "
693 "cupsUIConstraints!");
697 consts
->num_constraints
= i
;
698 consts
->constraints
= constptr
;
700 strlcpy(consts
->resolver
, constattr
->spec
, sizeof(consts
->resolver
));
702 for (i
= 0, vptr
= strchr(constattr
->value
, '*');
704 i
++, vptr
= strchr(vptr
, '*'), constptr
++)
707 * Extract "*Option Choice" or just "*Option"...
710 for (vptr
++, ptr
= option
; *vptr
&& !isspace(*vptr
& 255); vptr
++)
711 if (ptr
< (option
+ sizeof(option
) - 1))
716 while (isspace(*vptr
& 255))
723 for (ptr
= choice
; *vptr
&& !isspace(*vptr
& 255); vptr
++)
724 if (ptr
< (choice
+ sizeof(choice
) - 1))
730 if (!strncasecmp(option
, "Custom", 6) && !strcasecmp(choice
, "True"))
732 _cups_strcpy(option
, option
+ 6);
733 strcpy(choice
, "Custom");
736 constptr
->option
= ppdFindOption(ppd
, option
);
737 constptr
->choice
= ppdFindChoice(constptr
->option
, choice
);
738 constptr
->installable
= ppd_is_installable(installable
, option
);
739 consts
->installable
|= constptr
->installable
;
741 if (!constptr
->option
|| (!constptr
->choice
&& choice
[0]))
743 DEBUG_printf(("ppd_load_constraints: Unknown option *%s %s!\n",
750 cupsArrayAdd(ppd
->cups_uiconstraints
, consts
);
753 free(consts
->constraints
);
761 * 'ppd_test_constraints()' - See if any constraints are active.
764 static cups_array_t
* /* O - Array of active constraints */
765 ppd_test_constraints(
766 ppd_file_t
*ppd
, /* I - PPD file */
767 const char *option
, /* I - Current option */
768 const char *choice
, /* I - Current choice */
769 int num_options
, /* I - Number of additional options */
770 cups_option_t
*options
, /* I - Additional options */
771 int which
) /* I - Which constraints to test */
773 int i
; /* Looping var */
774 _ppd_cups_uiconsts_t
*consts
; /* Current constraints */
775 _ppd_cups_uiconst_t
*constptr
; /* Current constraint */
776 ppd_choice_t key
, /* Search key */
777 *marked
; /* Marked choice */
778 cups_array_t
*active
= NULL
; /* Active constraints */
779 const char *value
; /* Current value */
780 int option_conflict
;/* Conflict with current option? */
783 DEBUG_printf(("ppd_test_constraints(ppd=%p, num_options=%d, options=%p, "
784 "which=%d)\n", ppd
, num_options
, options
, which
));
786 if (!ppd
->cups_uiconstraints
)
787 ppd_load_constraints(ppd
);
789 DEBUG_printf(("ppd_test_constraints: %d constraints!\n",
790 cupsArrayCount(ppd
->cups_uiconstraints
)));
792 cupsArraySave(ppd
->marked
);
794 for (consts
= (_ppd_cups_uiconsts_t
*)cupsArrayFirst(ppd
->cups_uiconstraints
);
796 consts
= (_ppd_cups_uiconsts_t
*)cupsArrayNext(ppd
->cups_uiconstraints
))
798 DEBUG_printf(("ppd_test_constraints: installable=%d, resolver=\"%s\", "
799 "num_constraints=%d option1=\"%s\", choice1=\"%s\", "
800 "option2=\"%s\", choice2=\"%s\", ...\n",
801 consts
->installable
, consts
->resolver
, consts
->num_constraints
,
802 consts
->constraints
[0].option
->keyword
,
803 consts
->constraints
[0].choice
?
804 consts
->constraints
[0].choice
->choice
: "",
805 consts
->constraints
[1].option
->keyword
,
806 consts
->constraints
[1].choice
?
807 consts
->constraints
[1].choice
->choice
: ""));
809 if (which
!= _PPD_ALL_CONSTRAINTS
&& which
!= consts
->installable
)
812 DEBUG_puts("ppd_test_constraints: Testing...");
814 for (i
= consts
->num_constraints
, constptr
= consts
->constraints
,
819 DEBUG_printf(("ppd_test_constraints: %s=%s?\n", constptr
->option
->keyword
,
820 constptr
->choice
? constptr
->choice
->choice
: ""));
822 if (constptr
->choice
&&
823 (!strcasecmp(constptr
->option
->keyword
, "PageSize") ||
824 !strcasecmp(constptr
->option
->keyword
, "PageRegion")))
827 * PageSize and PageRegion are used depending on the selected input slot
828 * and manual feed mode. Validate against the selected page size instead
829 * of an individual option...
832 if (option
&& choice
&&
833 (!strcasecmp(option
, "PageSize") ||
834 !strcasecmp(option
, "PageRegion")))
838 if (!strcasecmp(value
, constptr
->choice
->choice
))
841 else if ((value
= cupsGetOption("PageSize", num_options
,
843 if ((value
= cupsGetOption("PageRegion", num_options
,
845 if ((value
= cupsGetOption("media", num_options
, options
)) == NULL
)
847 ppd_size_t
*size
= ppdPageSize(ppd
, NULL
);
853 if (!value
|| strcasecmp(value
, constptr
->choice
->choice
))
855 DEBUG_puts("ppd_test_constraints: NO");
859 else if (constptr
->choice
)
861 if (option
&& choice
&& !strcasecmp(option
, constptr
->option
->keyword
))
863 if (strcasecmp(choice
, constptr
->choice
->choice
))
868 else if ((value
= cupsGetOption(constptr
->option
->keyword
, num_options
,
871 if (strcasecmp(value
, constptr
->choice
->choice
))
873 DEBUG_puts("ppd_test_constraints: NO");
877 else if (!constptr
->choice
->marked
)
879 DEBUG_puts("ppd_test_constraints: NO");
883 else if (option
&& choice
&&
884 !strcasecmp(option
, constptr
->option
->keyword
))
886 if (!strcasecmp(choice
, "None") || !strcasecmp(choice
, "Off") ||
887 !strcasecmp(choice
, "False"))
892 else if ((value
= cupsGetOption(constptr
->option
->keyword
, num_options
,
895 if (!strcasecmp(value
, "None") || !strcasecmp(value
, "Off") ||
896 !strcasecmp(value
, "False"))
898 DEBUG_puts("ppd_test_constraints: NO");
904 key
.option
= constptr
->option
;
906 if ((marked
= (ppd_choice_t
*)cupsArrayFind(ppd
->marked
, &key
))
908 (!strcasecmp(marked
->choice
, "None") ||
909 !strcasecmp(marked
->choice
, "Off") ||
910 !strcasecmp(marked
->choice
, "False")))
912 DEBUG_puts("ppd_test_constraints: NO");
918 if (i
<= 0 && (!option
|| option_conflict
))
921 active
= cupsArrayNew(NULL
, NULL
);
923 cupsArrayAdd(active
, consts
);
924 DEBUG_puts("ppd_test_constraints: Added...");
928 cupsArrayRestore(ppd
->marked
);
930 DEBUG_printf(("ppd_test_constraints: Found %d active constraints!\n",
931 cupsArrayCount(active
)));