]>
git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/testcgi.c
7abe92c9c973d1604db8fab8cef3347c3a289a0e
2 * "$Id: testcgi.c 177 2006-06-21 00:20:03Z jlovell $"
4 * CGI test program for the Common UNIX Printing System (CUPS).
6 * Copyright 1997-2005 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 help index code.
27 * list_nodes() - List nodes in an array...
31 * Include necessary headers...
38 * 'main()' - Test the CGI code.
41 int /* O - Exit status */
42 main(int argc
, /* I - Number of command-line arguments */
43 char *argv
[]) /* I - Command-line arguments */
46 * Test file upload/multi-part submissions...
49 freopen("multipart.dat", "rb", stdin
);
51 putenv("CONTENT_TYPE=multipart/form-data; "
52 "boundary=---------------------------1977426492562745908748943111");
53 putenv("REQUEST_METHOD=POST");
55 printf("cgiInitialize: ");
58 const cgi_file_t
*file
; /* Upload file */
60 if ((file
= cgiGetFile()) != NULL
)
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
);
69 puts("FAIL (no file!)");
75 * Return with no errors...
83 * End of "$Id: testcgi.c 177 2006-06-21 00:20:03Z jlovell $".