2 * "$Id: testtemplate.c 9771 2011-05-12 05:21:56Z mike $"
4 * CGI template test program for CUPS.
6 * Copyright 2007-2011 by Apple Inc.
7 * Copyright 2006 by Easy Software Products.
9 * These coded instructions, statements, and computer programs are the
10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
17 * main() - Test the template code.
21 * Include necessary headers...
28 * 'main()' - Test the template code.
31 int /* O - Exit status */
32 main(int argc, /* I - Number of command-line arguments */
33 char *argv[]) /* I - Command-line arguments */
35 int i; /* Looping var */
36 char *value; /* Value in name=value */
37 FILE *out; /* Where to send output */
41 * Don't buffer stdout or stderr so that the mixed output is sane...
48 * Loop through the command-line, assigning variables for any args with
54 for (i = 1; i < argc; i ++)
56 if (!strcmp(argv[i], "-o"))
61 out = fopen(argv[i], "w");
69 else if (!strcmp(argv[i], "-e"))
75 if (!freopen(argv[i], "w", stderr))
82 else if (!strcmp(argv[i], "-q"))
83 freopen("/dev/null", "w", stderr);
84 else if ((value = strchr(argv[i], '=')) != NULL)
87 cgiSetVariable(argv[i], value);
90 cgiCopyTemplateFile(out, argv[i]);
94 * Return with no errors...
102 * End of "$Id: testtemplate.c 9771 2011-05-12 05:21:56Z mike $".