]> git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/testcgi.c
Remove all of the Subversion keywords from various source files.
[thirdparty/cups.git] / cgi-bin / testcgi.c
1 /*
2 * CGI test program for CUPS.
3 *
4 * Copyright 2007-2014 by Apple Inc.
5 * Copyright 1997-2005 by Easy Software Products.
6 *
7 * These coded instructions, statements, and computer programs are the
8 * property of Apple Inc. and are protected by Federal copyright
9 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 * which should have been included with this file. If this file is
11 * file is missing or damaged, see the license at "http://www.cups.org/".
12 */
13
14 /*
15 * Include necessary headers...
16 */
17
18 #include "cgi.h"
19
20
21 /*
22 * 'main()' - Test the CGI code.
23 */
24
25 int /* O - Exit status */
26 main(void)
27 {
28 /*
29 * Test file upload/multi-part submissions...
30 */
31
32 freopen("multipart.dat", "rb", stdin);
33
34 putenv("CONTENT_TYPE=multipart/form-data; "
35 "boundary=---------------------------1977426492562745908748943111");
36 putenv("REQUEST_METHOD=POST");
37
38 printf("cgiInitialize: ");
39 if (cgiInitialize())
40 {
41 const cgi_file_t *file; /* Upload file */
42
43 if ((file = cgiGetFile()) != NULL)
44 {
45 puts("PASS");
46 printf(" tempfile=\"%s\"\n", file->tempfile);
47 printf(" name=\"%s\"\n", file->name);
48 printf(" filename=\"%s\"\n", file->filename);
49 printf(" mimetype=\"%s\"\n", file->mimetype);
50 }
51 else
52 puts("FAIL (no file!)");
53 }
54 else
55 puts("FAIL (init)");
56
57 /*
58 * Return with no errors...
59 */
60
61 return (0);
62 }