]>
git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/testtemplate.c
2 * "$Id: testtemplate.c 5111 2006-02-16 02:08:09Z mike $"
4 * CGI template test program for the Common UNIX Printing System (CUPS).
6 * Copyright 2006 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
26 * main() - Test the template code.
30 * Include necessary headers...
37 * 'main()' - Test the template code.
40 int /* O - Exit status */
41 main(int argc
, /* I - Number of command-line arguments */
42 char *argv
[]) /* I - Command-line arguments */
44 int i
; /* Looping var */
45 char *value
; /* Value in name=value */
46 FILE *out
; /* Where to send output */
50 * Don't buffer stdout or stderr so that the mixed output is sane...
57 * Loop through the command-line, assigning variables for any args with
63 for (i
= 1; i
< argc
; i
++)
65 if (!strcmp(argv
[i
], "-o"))
70 out
= fopen(argv
[i
], "w");
78 else if (!strcmp(argv
[i
], "-e"))
84 if (!freopen(argv
[i
], "w", stderr
))
91 else if (!strcmp(argv
[i
], "-q"))
92 freopen("/dev/null", "w", stderr
);
93 else if ((value
= strchr(argv
[i
], '=')) != NULL
)
96 cgiSetVariable(argv
[i
], value
);
99 cgiCopyTemplateFile(out
, argv
[i
]);
103 * Return with no errors...
111 * End of "$Id: testtemplate.c 5111 2006-02-16 02:08:09Z mike $".