]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/testppd.c
2 * "$Id: testppd.c 5261 2006-03-09 20:47:49Z mike $"
4 * PPD test program for the Common UNIX Printing System (CUPS).
6 * Copyright 1997-2006 by Easy Software Products.
8 * These coded instructions, statements, and computer programs are the
9 * property of Easy Software Products and are protected by Federal
10 * copyright law. Distribution and use rights are outlined in the file
11 * "LICENSE.txt" which should have been included with this file. If this
12 * file is missing or damaged please contact Easy Software Products
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
24 * This file is subject to the Apple OS-Developed Software exception.
28 * main() - Main entry.
32 * Include necessary headers...
37 #include <cups/string.h>
52 static const char *default_code
=
54 "%%BeginFeature: *PageRegion Letter\n"
57 "} stopped cleartomark\n"
59 "%%BeginFeature: *InputSlot Tray\n"
62 "} stopped cleartomark\n";
66 * 'main()' - Main entry.
69 int /* O - Exit status */
70 main(int argc
, /* I - Number of command-line arguments */
71 char *argv
[]) /* I - Command-line arguments */
73 ppd_file_t
*ppd
; /* PPD file loaded from disk */
74 int status
; /* Status of tests (0 = success, 1 = fail) */
75 int conflicts
; /* Number of conflicts */
81 fputs("ppdOpenFile: ", stdout
);
83 if ((ppd
= ppdOpenFile("test.ppd")) != NULL
)
87 ppd_status_t err
; /* Last error in file */
88 int line
; /* Line number in file */
92 err
= ppdLastError(&line
);
94 printf("FAIL (%s on line %d)\n", ppdErrorString(err
), line
);
97 fputs("ppdMarkDefaults: ", stdout
);
100 if ((conflicts
= ppdConflicts(ppd
)) == 0)
105 printf("FAIL (%d conflicts)\n", conflicts
);
108 fputs("ppdEmitString: ", stdout
);
109 if ((s
= ppdEmitString(ppd
, PPD_ORDER_ANY
, 0.0)) != NULL
&&
110 !strcmp(s
, default_code
))
114 printf("FAIL (%d bytes instead of %d)\n", s
? (int)strlen(s
) : 0,
115 (int)strlen(default_code
));
131 * End of "$Id: testppd.c 5261 2006-03-09 20:47:49Z mike $".