]> git.ipfire.org Git - thirdparty/cups.git/blob - backend/betest.c
Import cups.org releases
[thirdparty/cups.git] / backend / betest.c
1 /*
2 * "$Id$"
3 *
4 * Backend test program for the Common UNIX Printing System (CUPS).
5 *
6 * Copyright 1997-2001 by Easy Software Products, all rights reserved.
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" 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-3111 USA
19 *
20 * Voice: (301) 373-9603
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
23 *
24 * Contents:
25 *
26 * main() - Run the named backend.
27 */
28
29 /*
30 * Include necessary headers.
31 */
32
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include <cups/string.h>
36 #include <unistd.h>
37
38
39 /*
40 * 'main()' - Run the named backend.
41 *
42 * Usage:
43 *
44 * betest device-uri job-id user title copies options [file]
45 */
46
47 int /* O - Exit status */
48 main(int argc, /* I - Number of command-line arguments (7 or 8) */
49 char *argv[]) /* I - Command-line arguments */
50 {
51 char backend[255]; /* Method in URI */
52
53
54 if (argc < 7 || argc > 8)
55 {
56 fputs("Usage: betest device-uri job-id user title copies options [file]\n",
57 stderr);
58 return (1);
59 }
60
61 /*
62 * Extract the method from the device-uri - that's the program we want to
63 * execute.
64 */
65
66 if (sscanf(argv[1], "%254[^:]", backend) != 1)
67 {
68 fputs("betest: Bad device-uri - no colon!\n", stderr);
69 return (1);
70 }
71
72 /*
73 * Execute and return
74 */
75
76 execl(backend, argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7],
77 NULL);
78
79 return (1);
80 }
81
82
83 /*
84 * End of "$Id$".
85 */