]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/testppd.c
2 * "$Id: testppd.c 7897 2008-09-02 19:33:19Z mike $"
4 * PPD test program for the Common UNIX Printing System (CUPS).
6 * Copyright 2007-2009 by Apple Inc.
7 * Copyright 1997-2006 by Easy Software Products.
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 * This file is subject to the Apple OS-Developed Software exception.
19 * main() - Main entry.
23 * Include necessary headers...
28 #include <cups/string.h>
45 static const char *default_code
=
47 "%%BeginFeature: *InstalledDuplexer False\n"
49 "} stopped cleartomark\n"
51 "%%BeginFeature: *PageRegion Letter\n"
54 "} stopped cleartomark\n"
56 "%%BeginFeature: *InputSlot Tray\n"
59 "} stopped cleartomark\n"
61 "%%BeginFeature: *IntOption None\n"
63 "} stopped cleartomark\n"
65 "%%BeginFeature: *StringOption None\n"
67 "} stopped cleartomark\n";
69 static const char *custom_code
=
71 "%%BeginFeature: *InstalledDuplexer False\n"
73 "} stopped cleartomark\n"
75 "%%BeginFeature: *InputSlot Tray\n"
78 "} stopped cleartomark\n"
80 "%%BeginFeature: *IntOption None\n"
82 "} stopped cleartomark\n"
84 "%%BeginFeature: *CustomStringOption True\n"
85 "(value\\0502\\051)\n"
87 "StringOption=Custom\n"
89 "} stopped cleartomark\n"
91 "%%BeginFeature: *CustomPageSize True\n"
99 "} stopped cleartomark\n";
103 * 'main()' - Main entry.
106 int /* O - Exit status */
107 main(int argc
, /* I - Number of command-line arguments */
108 char *argv
[]) /* I - Command-line arguments */
110 int i
; /* Looping var */
111 ppd_file_t
*ppd
; /* PPD file loaded from disk */
112 int status
; /* Status of tests (0 = success, 1 = fail) */
113 int conflicts
; /* Number of conflicts */
114 char *s
; /* String */
115 char buffer
[8192]; /* String buffer */
116 const char *text
; /* Localized text */
117 int num_options
; /* Number of options */
118 cups_option_t
*options
; /* Options */
119 ppd_size_t minsize
, /* Minimum size */
120 maxsize
, /* Maximum size */
121 *size
; /* Current size */
122 ppd_attr_t
*attr
; /* Current attribute */
123 _cups_pwg_media_t
*pwgmedia
; /* PWG media size */
131 * Setup directories for locale stuff...
134 if (access("locale", 0))
136 mkdir("locale", 0777);
137 mkdir("locale/fr", 0777);
138 symlink("../../../locale/cups_fr.po", "locale/fr/cups_fr.po");
139 mkdir("locale/zh_TW", 0777);
140 symlink("../../../locale/cups_zh_TW.po", "locale/zh_TW/cups_zh_TW.po");
143 putenv("LOCALEDIR=locale");
146 * Do tests with test.ppd...
149 fputs("ppdOpenFile(test.ppd): ", stdout
);
151 if ((ppd
= ppdOpenFile("test.ppd")) != NULL
)
155 ppd_status_t err
; /* Last error in file */
156 int line
; /* Line number in file */
160 err
= ppdLastError(&line
);
162 printf("FAIL (%s on line %d)\n", ppdErrorString(err
), line
);
165 fputs("ppdFindAttr(wildcard): ", stdout
);
166 if ((attr
= ppdFindAttr(ppd
, "cupsTest", NULL
)) == NULL
)
169 puts("FAIL (not found)");
171 else if (strcmp(attr
->name
, "cupsTest") || strcmp(attr
->spec
, "Foo"))
174 printf("FAIL (got \"%s %s\")\n", attr
->name
, attr
->spec
);
179 fputs("ppdFindNextAttr(wildcard): ", stdout
);
180 if ((attr
= ppdFindNextAttr(ppd
, "cupsTest", NULL
)) == NULL
)
183 puts("FAIL (not found)");
185 else if (strcmp(attr
->name
, "cupsTest") || strcmp(attr
->spec
, "Bar"))
188 printf("FAIL (got \"%s %s\")\n", attr
->name
, attr
->spec
);
193 fputs("ppdFindAttr(Foo): ", stdout
);
194 if ((attr
= ppdFindAttr(ppd
, "cupsTest", "Foo")) == NULL
)
197 puts("FAIL (not found)");
199 else if (strcmp(attr
->name
, "cupsTest") || strcmp(attr
->spec
, "Foo"))
202 printf("FAIL (got \"%s %s\")\n", attr
->name
, attr
->spec
);
207 fputs("ppdFindNextAttr(Foo): ", stdout
);
208 if ((attr
= ppdFindNextAttr(ppd
, "cupsTest", "Foo")) != NULL
)
211 printf("FAIL (got \"%s %s\")\n", attr
->name
, attr
->spec
);
216 fputs("ppdMarkDefaults: ", stdout
);
217 ppdMarkDefaults(ppd
);
219 if ((conflicts
= ppdConflicts(ppd
)) == 0)
224 printf("FAIL (%d conflicts)\n", conflicts
);
227 fputs("ppdEmitString (defaults): ", stdout
);
228 if ((s
= ppdEmitString(ppd
, PPD_ORDER_ANY
, 0.0)) != NULL
&&
229 !strcmp(s
, default_code
))
234 printf("FAIL (%d bytes instead of %d)\n", s
? (int)strlen(s
) : 0,
235 (int)strlen(default_code
));
244 fputs("ppdEmitString (custom size and string): ", stdout
);
245 ppdMarkOption(ppd
, "PageSize", "Custom.400x500");
246 ppdMarkOption(ppd
, "StringOption", "{String1=\"value 1\" String2=value(2)}");
248 if ((s
= ppdEmitString(ppd
, PPD_ORDER_ANY
, 0.0)) != NULL
&&
249 !strcmp(s
, custom_code
))
254 printf("FAIL (%d bytes instead of %d)\n", s
? (int)strlen(s
) : 0,
255 (int)strlen(custom_code
));
265 * Test constraints...
268 fputs("ppdConflicts(): ", stdout
);
269 ppdMarkOption(ppd
, "PageSize", "Letter");
270 ppdMarkOption(ppd
, "InputSlot", "Envelope");
272 if ((conflicts
= ppdConflicts(ppd
)) == 2)
276 printf("FAIL (%d)\n", conflicts
);
280 fputs("cupsResolveConflicts(InputSlot=Envelope): ", stdout
);
283 if (!cupsResolveConflicts(ppd
, "InputSlot", "Envelope", &num_options
,
286 puts("FAIL (Unable to resolve)");
289 else if (num_options
!= 2 ||
290 !cupsGetOption("PageSize", num_options
, options
))
292 printf("FAIL (%d options:", num_options
);
293 for (i
= 0; i
< num_options
; i
++)
294 printf(" %s=%s", options
[i
].name
, options
[i
].value
);
299 puts("PASS (Resolved by changing PageSize)");
301 cupsFreeOptions(num_options
, options
);
303 fputs("cupsResolveConflicts(No option/choice): ", stdout
);
306 if (cupsResolveConflicts(ppd
, NULL
, NULL
, &num_options
, &options
) &&
307 num_options
== 1 && !strcasecmp(options
[0].name
, "InputSlot") &&
308 !strcasecmp(options
[0].value
, "Tray"))
309 puts("PASS (Resolved by changing InputSlot)");
310 else if (num_options
> 0)
312 printf("FAIL (%d options:", num_options
);
313 for (i
= 0; i
< num_options
; i
++)
314 printf(" %s=%s", options
[i
].name
, options
[i
].value
);
320 puts("FAIL (Unable to resolve)");
323 cupsFreeOptions(num_options
, options
);
325 fputs("ppdInstallableConflict(): ", stdout
);
326 if (ppdInstallableConflict(ppd
, "Duplex", "DuplexNoTumble") &&
327 !ppdInstallableConflict(ppd
, "Duplex", "None"))
329 else if (!ppdInstallableConflict(ppd
, "Duplex", "DuplexNoTumble"))
331 puts("FAIL (Duplex=DuplexNoTumble did not conflict)");
336 puts("FAIL (Duplex=None conflicted)");
344 fputs("ppdPageSizeLimits: ", stdout
);
345 if (ppdPageSizeLimits(ppd
, &minsize
, &maxsize
))
347 if (minsize
.width
!= 36 || minsize
.length
!= 36 ||
348 maxsize
.width
!= 1080 || maxsize
.length
!= 86400)
350 printf("FAIL (got min=%.0fx%.0f, max=%.0fx%.0f, "
351 "expected min=36x36, max=1080x86400)\n", minsize
.width
,
352 minsize
.length
, maxsize
.width
, maxsize
.length
);
360 puts("FAIL (returned 0)");
365 * cupsMarkOptions with PWG and IPP size names.
368 fputs("cupsMarkOptions(media=iso-a4): ", stdout
);
369 num_options
= cupsAddOption("media", "iso-a4", 0, &options
);
370 cupsMarkOptions(ppd
, num_options
, options
);
371 cupsFreeOptions(num_options
, options
);
373 size
= ppdPageSize(ppd
, NULL
);
374 if (!size
|| strcmp(size
->name
, "A4"))
376 printf("FAIL (%s)\n", size
? size
->name
: "unknown");
382 fputs("cupsMarkOptions(media=na_letter_8.5x11in): ", stdout
);
383 num_options
= cupsAddOption("media", "na_letter_8.5x11in", 0, &options
);
384 cupsMarkOptions(ppd
, num_options
, options
);
385 cupsFreeOptions(num_options
, options
);
387 size
= ppdPageSize(ppd
, NULL
);
388 if (!size
|| strcmp(size
->name
, "Letter"))
390 printf("FAIL (%s)\n", size
? size
->name
: "unknown");
396 fputs("_cupsPWGMediaBySize(842, 1191): ", stdout
);
397 if ((pwgmedia
= _cupsPWGMediaBySize(842, 1191)) == NULL
)
399 puts("FAIL (not found)");
402 else if (strcmp(pwgmedia
->pwg
, "iso_a3_297x420mm"))
404 printf("FAIL (%s)\n", pwgmedia
->pwg
);
411 * Test localization...
414 fputs("ppdLocalizeIPPReason(text): ", stdout
);
415 if (ppdLocalizeIPPReason(ppd
, "foo", NULL
, buffer
, sizeof(buffer
)) &&
416 !strcmp(buffer
, "Foo Reason"))
421 printf("FAIL (\"%s\" instead of \"Foo Reason\")\n", buffer
);
424 fputs("ppdLocalizeIPPReason(http): ", stdout
);
425 if (ppdLocalizeIPPReason(ppd
, "foo", "http", buffer
, sizeof(buffer
)) &&
426 !strcmp(buffer
, "http://foo/bar.html"))
431 printf("FAIL (\"%s\" instead of \"http://foo/bar.html\")\n", buffer
);
434 fputs("ppdLocalizeIPPReason(help): ", stdout
);
435 if (ppdLocalizeIPPReason(ppd
, "foo", "help", buffer
, sizeof(buffer
)) &&
436 !strcmp(buffer
, "help:anchor='foo'%20bookID=Vendor%20Help"))
441 printf("FAIL (\"%s\" instead of \"help:anchor='foo'%%20bookID=Vendor%%20Help\")\n", buffer
);
444 fputs("ppdLocalizeIPPReason(file): ", stdout
);
445 if (ppdLocalizeIPPReason(ppd
, "foo", "file", buffer
, sizeof(buffer
)) &&
446 !strcmp(buffer
, "/help/foo/bar.html"))
451 printf("FAIL (\"%s\" instead of \"/help/foo/bar.html\")\n", buffer
);
456 putenv("LC_CTYPE=fr");
457 putenv("LC_MESSAGES=fr");
459 fputs("ppdLocalizeIPPReason(fr text): ", stdout
);
460 if (ppdLocalizeIPPReason(ppd
, "foo", NULL
, buffer
, sizeof(buffer
)) &&
461 !strcmp(buffer
, "La Long Foo Reason"))
466 printf("FAIL (\"%s\" instead of \"La Long Foo Reason\")\n", buffer
);
469 putenv("LANG=zh_TW");
470 putenv("LC_ALL=zh_TW");
471 putenv("LC_CTYPE=zh_TW");
472 putenv("LC_MESSAGES=zh_TW");
474 fputs("ppdLocalizeIPPReason(zh_TW text): ", stdout
);
475 if (ppdLocalizeIPPReason(ppd
, "foo", NULL
, buffer
, sizeof(buffer
)) &&
476 !strcmp(buffer
, "Number 1 Foo Reason"))
481 printf("FAIL (\"%s\" instead of \"Number 1 Foo Reason\")\n", buffer
);
485 * cupsMarkerName localization...
490 putenv("LC_CTYPE=en");
491 putenv("LC_MESSAGES=en");
493 fputs("ppdLocalizeMarkerName(bogus): ", stdout
);
495 if ((text
= ppdLocalizeMarkerName(ppd
, "bogus")) != NULL
)
498 printf("FAIL (\"%s\" instead of NULL)\n", text
);
503 fputs("ppdLocalizeMarkerName(cyan): ", stdout
);
505 if ((text
= ppdLocalizeMarkerName(ppd
, "cyan")) != NULL
&&
506 !strcmp(text
, "Cyan Toner"))
511 printf("FAIL (\"%s\" instead of \"Cyan Toner\")\n",
512 text
? text
: "(null)");
517 putenv("LC_CTYPE=fr");
518 putenv("LC_MESSAGES=fr");
520 fputs("ppdLocalizeMarkerName(fr cyan): ", stdout
);
521 if ((text
= ppdLocalizeMarkerName(ppd
, "cyan")) != NULL
&&
522 !strcmp(text
, "La Toner Cyan"))
527 printf("FAIL (\"%s\" instead of \"La Toner Cyan\")\n",
528 text
? text
: "(null)");
531 putenv("LANG=zh_TW");
532 putenv("LC_ALL=zh_TW");
533 putenv("LC_CTYPE=zh_TW");
534 putenv("LC_MESSAGES=zh_TW");
536 fputs("ppdLocalizeMarkerName(zh_TW cyan): ", stdout
);
537 if ((text
= ppdLocalizeMarkerName(ppd
, "cyan")) != NULL
&&
538 !strcmp(text
, "Number 1 Cyan Toner"))
543 printf("FAIL (\"%s\" instead of \"Number 1 Cyan Toner\")\n",
544 text
? text
: "(null)");
550 * Test new constraints...
553 fputs("ppdOpenFile(test2.ppd): ", stdout
);
555 if ((ppd
= ppdOpenFile("test2.ppd")) != NULL
)
559 ppd_status_t err
; /* Last error in file */
560 int line
; /* Line number in file */
564 err
= ppdLastError(&line
);
566 printf("FAIL (%s on line %d)\n", ppdErrorString(err
), line
);
569 fputs("ppdMarkDefaults: ", stdout
);
570 ppdMarkDefaults(ppd
);
572 if ((conflicts
= ppdConflicts(ppd
)) == 0)
577 printf("FAIL (%d conflicts)\n", conflicts
);
580 fputs("ppdConflicts(): ", stdout
);
581 ppdMarkOption(ppd
, "PageSize", "Env10");
582 ppdMarkOption(ppd
, "InputSlot", "Envelope");
583 ppdMarkOption(ppd
, "Quality", "Photo");
585 if ((conflicts
= ppdConflicts(ppd
)) == 2)
589 printf("FAIL (%d)\n", conflicts
);
593 fputs("cupsResolveConflicts(Quality=Photo): ", stdout
);
596 if (cupsResolveConflicts(ppd
, "Quality", "Photo", &num_options
,
599 printf("FAIL (%d options:", num_options
);
600 for (i
= 0; i
< num_options
; i
++)
601 printf(" %s=%s", options
[i
].name
, options
[i
].value
);
606 puts("PASS (Unable to resolve)");
607 cupsFreeOptions(num_options
, options
);
609 fputs("cupsResolveConflicts(No option/choice): ", stdout
);
612 if (cupsResolveConflicts(ppd
, NULL
, NULL
, &num_options
, &options
) &&
613 num_options
== 1 && !strcasecmp(options
->name
, "Quality") &&
614 !strcasecmp(options
->value
, "Normal"))
616 else if (num_options
> 0)
618 printf("FAIL (%d options:", num_options
);
619 for (i
= 0; i
< num_options
; i
++)
620 printf(" %s=%s", options
[i
].name
, options
[i
].value
);
626 puts("FAIL (Unable to resolve!)");
629 cupsFreeOptions(num_options
, options
);
631 fputs("cupsResolveConflicts(loop test): ", stdout
);
632 ppdMarkOption(ppd
, "PageSize", "A4");
633 ppdMarkOption(ppd
, "Quality", "Photo");
636 if (!cupsResolveConflicts(ppd
, NULL
, NULL
, &num_options
, &options
))
638 else if (num_options
> 0)
640 printf("FAIL (%d options:", num_options
);
641 for (i
= 0; i
< num_options
; i
++)
642 printf(" %s=%s", options
[i
].name
, options
[i
].value
);
646 puts("FAIL (No conflicts!)");
648 fputs("ppdInstallableConflict(): ", stdout
);
649 if (ppdInstallableConflict(ppd
, "Duplex", "DuplexNoTumble") &&
650 !ppdInstallableConflict(ppd
, "Duplex", "None"))
652 else if (!ppdInstallableConflict(ppd
, "Duplex", "DuplexNoTumble"))
654 puts("FAIL (Duplex=DuplexNoTumble did not conflict)");
659 puts("FAIL (Duplex=None conflicted)");
667 ppdMarkDefaults(ppd
);
669 fputs("ppdPageSizeLimits(default): ", stdout
);
670 if (ppdPageSizeLimits(ppd
, &minsize
, &maxsize
))
672 if (minsize
.width
!= 36 || minsize
.length
!= 36 ||
673 maxsize
.width
!= 1080 || maxsize
.length
!= 86400)
675 printf("FAIL (got min=%.0fx%.0f, max=%.0fx%.0f, "
676 "expected min=36x36, max=1080x86400)\n", minsize
.width
,
677 minsize
.length
, maxsize
.width
, maxsize
.length
);
685 puts("FAIL (returned 0)");
689 ppdMarkOption(ppd
, "InputSlot", "Manual");
691 fputs("ppdPageSizeLimits(InputSlot=Manual): ", stdout
);
692 if (ppdPageSizeLimits(ppd
, &minsize
, &maxsize
))
694 if (minsize
.width
!= 100 || minsize
.length
!= 100 ||
695 maxsize
.width
!= 1000 || maxsize
.length
!= 1000)
697 printf("FAIL (got min=%.0fx%.0f, max=%.0fx%.0f, "
698 "expected min=100x100, max=1000x1000)\n", minsize
.width
,
699 minsize
.length
, maxsize
.width
, maxsize
.length
);
707 puts("FAIL (returned 0)");
711 ppdMarkOption(ppd
, "Quality", "Photo");
713 fputs("ppdPageSizeLimits(Quality=Photo): ", stdout
);
714 if (ppdPageSizeLimits(ppd
, &minsize
, &maxsize
))
716 if (minsize
.width
!= 200 || minsize
.length
!= 200 ||
717 maxsize
.width
!= 1000 || maxsize
.length
!= 1000)
719 printf("FAIL (got min=%.0fx%.0f, max=%.0fx%.0f, "
720 "expected min=200x200, max=1000x1000)\n", minsize
.width
,
721 minsize
.length
, maxsize
.width
, maxsize
.length
);
729 puts("FAIL (returned 0)");
733 ppdMarkOption(ppd
, "InputSlot", "Tray");
735 fputs("ppdPageSizeLimits(Quality=Photo): ", stdout
);
736 if (ppdPageSizeLimits(ppd
, &minsize
, &maxsize
))
738 if (minsize
.width
!= 300 || minsize
.length
!= 300 ||
739 maxsize
.width
!= 1080 || maxsize
.length
!= 86400)
741 printf("FAIL (got min=%.0fx%.0f, max=%.0fx%.0f, "
742 "expected min=300x300, max=1080x86400)\n", minsize
.width
,
743 minsize
.length
, maxsize
.width
, maxsize
.length
);
751 puts("FAIL (returned 0)");
757 const char *filename
; /* PPD filename */
760 if (!strncmp(argv
[1], "-d", 2))
762 filename
= cupsGetPPD(argv
[1] + 2);
765 printf("%s: %s\n", argv
[1], cupsLastErrorString());
772 if ((ppd
= ppdOpenFile(filename
)) == NULL
)
774 ppd_status_t err
; /* Last error in file */
775 int line
; /* Line number in file */
779 err
= ppdLastError(&line
);
781 printf("%s: %s on line %d\n", argv
[1], ppdErrorString(err
), line
);
785 int j
, k
; /* Looping vars */
786 ppd_group_t
*group
; /* Option group */
787 ppd_option_t
*option
; /* Option */
788 ppd_coption_t
*coption
; /* Custom option */
789 ppd_cparam_t
*cparam
; /* Custom parameter */
790 ppd_const_t
*c
; /* UIConstraints */
791 char lang
[255], /* LANG environment variable */
792 lc_all
[255], /* LC_ALL environment variable */
793 lc_ctype
[255], /* LC_CTYPE environment variable */
794 lc_messages
[255];/* LC_MESSAGES environment variable */
799 snprintf(lang
, sizeof(lang
), "LANG=%s", argv
[2]);
801 snprintf(lc_all
, sizeof(lc_all
), "LC_ALL=%s", argv
[2]);
803 snprintf(lc_ctype
, sizeof(lc_ctype
), "LC_CTYPE=%s", argv
[2]);
805 snprintf(lc_messages
, sizeof(lc_messages
), "LC_MESSAGES=%s", argv
[2]);
813 text
= ppdLocalizeIPPReason(ppd
, argv
[3], NULL
, buffer
, sizeof(buffer
));
814 printf("ppdLocalizeIPPReason(%s)=%s\n", argv
[3],
815 text
? text
: "(null)");
816 return (text
== NULL
);
819 for (i
= ppd
->num_groups
, group
= ppd
->groups
;
823 printf("%s (%s):\n", group
->name
, group
->text
);
825 for (j
= group
->num_options
, option
= group
->options
;
829 printf(" %s (%s):\n", option
->keyword
, option
->text
);
831 for (k
= 0; k
< option
->num_choices
; k
++)
832 printf(" - %s (%s)\n", option
->choices
[k
].choice
,
833 option
->choices
[k
].text
);
835 if ((coption
= ppdFindCustomOption(ppd
, option
->keyword
)) != NULL
)
837 for (cparam
= (ppd_cparam_t
*)cupsArrayFirst(coption
->params
);
839 cparam
= (ppd_cparam_t
*)cupsArrayNext(coption
->params
))
841 switch (cparam
->type
)
843 case PPD_CUSTOM_CURVE
:
844 printf(" %s(%s): PPD_CUSTOM_CURVE (%g to %g)\n",
845 cparam
->name
, cparam
->text
,
846 cparam
->minimum
.custom_curve
,
847 cparam
->maximum
.custom_curve
);
850 case PPD_CUSTOM_INT
:
851 printf(" %s(%s): PPD_CUSTOM_INT (%d to %d)\n",
852 cparam
->name
, cparam
->text
,
853 cparam
->minimum
.custom_int
,
854 cparam
->maximum
.custom_int
);
857 case PPD_CUSTOM_INVCURVE
:
858 printf(" %s(%s): PPD_CUSTOM_INVCURVE (%g to %g)\n",
859 cparam
->name
, cparam
->text
,
860 cparam
->minimum
.custom_invcurve
,
861 cparam
->maximum
.custom_invcurve
);
864 case PPD_CUSTOM_PASSCODE
:
865 printf(" %s(%s): PPD_CUSTOM_PASSCODE (%d to %d)\n",
866 cparam
->name
, cparam
->text
,
867 cparam
->minimum
.custom_passcode
,
868 cparam
->maximum
.custom_passcode
);
871 case PPD_CUSTOM_PASSWORD
:
872 printf(" %s(%s): PPD_CUSTOM_PASSWORD (%d to %d)\n",
873 cparam
->name
, cparam
->text
,
874 cparam
->minimum
.custom_password
,
875 cparam
->maximum
.custom_password
);
878 case PPD_CUSTOM_POINTS
:
879 printf(" %s(%s): PPD_CUSTOM_POINTS (%g to %g)\n",
880 cparam
->name
, cparam
->text
,
881 cparam
->minimum
.custom_points
,
882 cparam
->maximum
.custom_points
);
885 case PPD_CUSTOM_REAL
:
886 printf(" %s(%s): PPD_CUSTOM_REAL (%g to %g)\n",
887 cparam
->name
, cparam
->text
,
888 cparam
->minimum
.custom_real
,
889 cparam
->maximum
.custom_real
);
892 case PPD_CUSTOM_STRING
:
893 printf(" %s(%s): PPD_CUSTOM_STRING (%d to %d)\n",
894 cparam
->name
, cparam
->text
,
895 cparam
->minimum
.custom_string
,
896 cparam
->maximum
.custom_string
);
904 puts("Constraints:");
906 for (i
= ppd
->num_consts
, c
= ppd
->consts
; i
> 0; i
--, c
++)
907 printf(" *UIConstraints: *%s %s *%s %s\n", c
->option1
, c
->choice1
,
908 c
->option2
, c
->choice2
);
912 for (attr
= (ppd_attr_t
*)cupsArrayFirst(ppd
->sorted_attrs
);
914 attr
= (ppd_attr_t
*)cupsArrayNext(ppd
->sorted_attrs
))
915 printf(" *%s %s/%s: \"%s\"\n", attr
->name
, attr
->spec
,
916 attr
->text
, attr
->value
? attr
->value
: "");
919 if (!strncmp(argv
[1], "-d", 2))
924 if (getenv("MallocStackLogging") && getenv("MallocStackLoggingNoCompact"))
926 char command
[1024]; /* malloc_history command */
928 snprintf(command
, sizeof(command
), "malloc_history %d -all_by_size",
933 #endif /* __APPLE__ */
942 * End of "$Id: testppd.c 7897 2008-09-02 19:33:19Z mike $".