]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/testppd.c
Load cups into easysw/current.
[thirdparty/cups.git] / cups / testppd.c
CommitLineData
fa73b229 1/*
2 * "$Id: testppd.c 4939 2006-01-17 18:54:33Z mike $"
3 *
4 * PPD test program for the Common UNIX Printing System (CUPS).
5 *
6 * Copyright 1997-2006 by Easy Software Products.
7 *
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
13 * at:
14 *
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
19 *
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
23 *
24 * This file is subject to the Apple OS-Developed Software exception.
25 *
26 * Contents:
27 *
28 * main() - Main entry.
29 */
30
31/*
32 * Include necessary headers...
33 */
34
35#include <stdio.h>
36#include <stdlib.h>
37#include <cups/string.h>
38#include <errno.h>
39#include "ppd.h"
40#ifdef WIN32
41# include <io.h>
42#else
43# include <unistd.h>
44# include <fcntl.h>
45#endif /* WIN32 */
46
47
48/*
49 * 'main()' - Main entry.
50 */
51
52int /* O - Exit status */
53main(int argc, /* I - Number of command-line arguments */
54 char *argv[]) /* I - Command-line arguments */
55{
56 ppd_file_t *ppd; /* PPD file loaded from disk */
57 int status; /* Status of tests (0 = success, 1 = fail) */
58
59
60 status = 0;
61
62 fputs("ppdOpenFile: ", stdout);
63
64 if ((ppd = ppdOpenFile("test.ppd")) != NULL)
65 puts("PASS");
66 else
67 {
68 ppd_status_t err; /* Last error in file */
69 int line; /* Line number in file */
70
71
72 status ++;
73 err = ppdLastError(&line);
74
75 printf("FAIL (%s on line %d)\n", ppdErrorString(err), line);
76 }
77
78 ppdClose(ppd);
79
80 return (status);
81}
82
83
84/*
85 * End of "$Id: testppd.c 4939 2006-01-17 18:54:33Z mike $".
86 */