]> git.ipfire.org Git - thirdparty/cups.git/blame - backend/betest.c
Load cups into easysw/current.
[thirdparty/cups.git] / backend / betest.c
CommitLineData
ef416fc2 1/*
bc44d920 2 * "$Id: betest.c 6649 2007-07-11 21:46:42Z mike $"
ef416fc2 3 *
4 * Backend test program for the Common UNIX Printing System (CUPS).
5 *
bc44d920 6 * Copyright 2007 by Apple Inc.
ef416fc2 7 * Copyright 1997-2005 by Easy Software Products, all rights reserved.
8 *
9 * These coded instructions, statements, and computer programs are the
bc44d920 10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
ef416fc2 12 * "LICENSE" which should have been included with this file. If this
bc44d920 13 * file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 14 *
15 * This file is subject to the Apple OS-Developed Software exception.
16 *
17 * Contents:
18 *
19 * main() - Run the named backend.
20 */
21
22/*
23 * Include necessary headers.
24 */
25
26#include <stdio.h>
27#include <stdlib.h>
28#include <cups/string.h>
29#include <unistd.h>
30
31
32/*
33 * 'main()' - Run the named backend.
34 *
35 * Usage:
36 *
37 * betest device-uri job-id user title copies options [file]
38 */
39
40int /* O - Exit status */
41main(int argc, /* I - Number of command-line arguments (7 or 8) */
42 char *argv[]) /* I - Command-line arguments */
43{
44 char backend[255]; /* Method in URI */
45
46
47 if (argc < 7 || argc > 8)
48 {
49 fputs("Usage: betest device-uri job-id user title copies options [file]\n",
50 stderr);
51 return (1);
52 }
53
54 /*
55 * Extract the method from the device-uri - that's the program we want to
56 * execute.
57 */
58
59 if (sscanf(argv[1], "%254[^:]", backend) != 1)
60 {
61 fputs("betest: Bad device-uri - no colon!\n", stderr);
62 return (1);
63 }
64
65 /*
66 * Execute and return
67 */
68
69 execl(backend, argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7],
70 NULL);
71
72 return (1);
73}
74
75
76/*
bc44d920 77 * End of "$Id: betest.c 6649 2007-07-11 21:46:42Z mike $".
ef416fc2 78 */