]>
git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/testcgi.c
2 * "$Id: testcgi.c 6649 2007-07-11 21:46:42Z mike $"
4 * CGI test program for the Common UNIX Printing System (CUPS).
6 * Copyright 2007 by Apple Inc.
7 * Copyright 1997-2005 by Easy Software Products.
9 * These coded instructions, statements, and computer programs are the
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/".
17 * main() - Test the help index code.
18 * list_nodes() - List nodes in an array...
22 * Include necessary headers...
29 * 'main()' - Test the CGI code.
32 int /* O - Exit status */
33 main(int argc
, /* I - Number of command-line arguments */
34 char *argv
[]) /* I - Command-line arguments */
37 * Test file upload/multi-part submissions...
40 freopen("multipart.dat", "rb", stdin
);
42 putenv("CONTENT_TYPE=multipart/form-data; "
43 "boundary=---------------------------1977426492562745908748943111");
44 putenv("REQUEST_METHOD=POST");
46 printf("cgiInitialize: ");
49 const cgi_file_t
*file
; /* Upload file */
51 if ((file
= cgiGetFile()) != NULL
)
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
);
60 puts("FAIL (no file!)");
66 * Return with no errors...
74 * End of "$Id: testcgi.c 6649 2007-07-11 21:46:42Z mike $".