]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/testcups.c
4 * CUPS API test program for the Common UNIX Printing System (CUPS).
6 * Copyright 2007 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...
41 * 'main()' - Main entry.
44 int /* O - Exit status */
45 main(int argc
, /* I - Number of command-line arguments */
46 char *argv
[]) /* I - Command-line arguments */
48 int status
= 0, /* Exit status */
49 num_dests
; /* Number of destinations */
50 cups_dest_t
*dests
, /* Destinations */
51 *dest
; /* Current destination */
52 const char *ppdfile
; /* PPD file */
53 ppd_file_t
*ppd
; /* PPD file data */
54 int num_jobs
; /* Number of jobs for queue */
55 cups_job_t
*jobs
; /* Jobs for queue */
62 fputs("cupsGetDests: ", stdout
);
65 num_dests
= cupsGetDests(&dests
);
76 * cupsGetDest(printer)
79 printf("cupsGetDest(\"%s\"): ", dests
[num_dests
/ 2].name
);
82 if ((dest
= cupsGetDest(dests
[num_dests
/ 2].name
, NULL
, num_dests
,
95 fputs("cupsGetDest(NULL): ", stdout
);
98 if ((dest
= cupsGetDest(NULL
, NULL
, num_dests
, dests
)) == NULL
)
110 fputs("cupsPrintFile: ", stdout
);
113 if (cupsPrintFile(dest
->name
, "../data/testprint.ps", "Test Page",
114 dest
->num_options
, dest
->options
) <= 0)
123 * cupsGetPPD(printer)
126 fputs("cupsGetPPD(): ", stdout
);
129 if ((ppdfile
= cupsGetPPD(dest
->name
)) == NULL
)
142 fputs("ppdOpenFile(): ", stdout
);
145 if ((ppd
= ppdOpenFile(ppdfile
)) == NULL
)
161 fputs("cupsGetJobs: ", stdout
);
164 num_jobs
= cupsGetJobs(&jobs
, NULL
, 0, -1);
174 cupsFreeJobs(num_jobs
, jobs
);
175 cupsFreeDests(num_dests
, dests
);
182 * End of "$Id: testfile.c 6192 2007-01-10 19:26:48Z mike $".