]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
2 | * "$Id: testcgi.c 4869 2005-12-06 02:43:40Z mike $" | |
3 | * | |
4 | * CGI test program for the Common UNIX Printing System (CUPS). | |
5 | * | |
6 | * Copyright 1997-2005 by Easy Software Products. | |
7 | * | |
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 | |
13 | * at: | |
14 | * | |
15 | * Attn: CUPS Licensing Information | |
16 | * Easy Software Products | |
17 | * 44141 Airport View Drive, Suite 204 | |
18 | * Hollywood, Maryland 20636 USA | |
19 | * | |
20 | * Voice: (301) 373-9600 | |
21 | * EMail: cups-info@cups.org | |
22 | * WWW: http://www.cups.org | |
23 | * | |
24 | * Contents: | |
25 | * | |
26 | * main() - Test the help index code. | |
27 | * list_nodes() - List nodes in an array... | |
28 | */ | |
29 | ||
30 | /* | |
31 | * Include necessary headers... | |
32 | */ | |
33 | ||
34 | #include "cgi.h" | |
35 | ||
36 | ||
37 | /* | |
38 | * 'main()' - Test the CGI code. | |
39 | */ | |
40 | ||
41 | int /* O - Exit status */ | |
42 | main(int argc, /* I - Number of command-line arguments */ | |
43 | char *argv[]) /* I - Command-line arguments */ | |
44 | { | |
45 | /* | |
46 | * Test file upload/multi-part submissions... | |
47 | */ | |
48 | ||
49 | freopen("multipart.dat", "rb", stdin); | |
50 | ||
51 | putenv("CONTENT_TYPE=multipart/form-data; " | |
52 | "boundary=---------------------------1977426492562745908748943111"); | |
53 | putenv("REQUEST_METHOD=POST"); | |
54 | ||
55 | printf("cgiInitialize: "); | |
56 | if (cgiInitialize()) | |
57 | { | |
58 | const cgi_file_t *file; /* Upload file */ | |
59 | ||
60 | if ((file = cgiGetFile()) != NULL) | |
61 | { | |
62 | puts("PASS"); | |
63 | printf(" tempfile=\"%s\"\n", file->tempfile); | |
64 | printf(" name=\"%s\"\n", file->name); | |
65 | printf(" filename=\"%s\"\n", file->filename); | |
66 | printf(" mimetype=\"%s\"\n", file->mimetype); | |
67 | } | |
68 | else | |
69 | puts("FAIL (no file!)"); | |
70 | } | |
71 | else | |
72 | puts("FAIL (init)"); | |
73 | ||
74 | /* | |
75 | * Return with no errors... | |
76 | */ | |
77 | ||
78 | return (0); | |
79 | } | |
80 | ||
81 | ||
82 | /* | |
83 | * End of "$Id: testcgi.c 4869 2005-12-06 02:43:40Z mike $". | |
84 | */ |