]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
f2d18633 | 2 | * "$Id$" |
ef416fc2 | 3 | * |
321d8d57 | 4 | * CGI test program for CUPS. |
ef416fc2 | 5 | * |
321d8d57 | 6 | * Copyright 2007-2011 by Apple Inc. |
ef416fc2 | 7 | * Copyright 1997-2005 by Easy Software Products. |
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" | |
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/". | |
ef416fc2 | 14 | * |
15 | * Contents: | |
16 | * | |
17 | * main() - Test the help index code. | |
18 | * list_nodes() - List nodes in an array... | |
19 | */ | |
20 | ||
21 | /* | |
22 | * Include necessary headers... | |
23 | */ | |
24 | ||
25 | #include "cgi.h" | |
26 | ||
27 | ||
28 | /* | |
29 | * 'main()' - Test the CGI code. | |
30 | */ | |
31 | ||
32 | int /* O - Exit status */ | |
33 | main(int argc, /* I - Number of command-line arguments */ | |
34 | char *argv[]) /* I - Command-line arguments */ | |
35 | { | |
36 | /* | |
37 | * Test file upload/multi-part submissions... | |
38 | */ | |
39 | ||
40 | freopen("multipart.dat", "rb", stdin); | |
41 | ||
42 | putenv("CONTENT_TYPE=multipart/form-data; " | |
43 | "boundary=---------------------------1977426492562745908748943111"); | |
44 | putenv("REQUEST_METHOD=POST"); | |
45 | ||
46 | printf("cgiInitialize: "); | |
47 | if (cgiInitialize()) | |
48 | { | |
49 | const cgi_file_t *file; /* Upload file */ | |
50 | ||
51 | if ((file = cgiGetFile()) != NULL) | |
52 | { | |
53 | puts("PASS"); | |
54 | printf(" tempfile=\"%s\"\n", file->tempfile); | |
55 | printf(" name=\"%s\"\n", file->name); | |
56 | printf(" filename=\"%s\"\n", file->filename); | |
57 | printf(" mimetype=\"%s\"\n", file->mimetype); | |
58 | } | |
59 | else | |
60 | puts("FAIL (no file!)"); | |
61 | } | |
62 | else | |
63 | puts("FAIL (init)"); | |
321d8d57 | 64 | |
ef416fc2 | 65 | /* |
66 | * Return with no errors... | |
67 | */ | |
68 | ||
69 | return (0); | |
70 | } | |
71 | ||
72 | ||
73 | /* | |
f2d18633 | 74 | * End of "$Id$". |
ef416fc2 | 75 | */ |